KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EdgeLexer.h
Go to the documentation of this file.
1 #ifndef EDGELEXER_H_
2 #define EDGELEXER_H_
3 
11 #include <iostream>
12 #include <string>
13 
14 #include "spear/Wide.h"
15 
16 
17 namespace spear {
18 
19 class EdgeLexer
20 {
21 public:
22 
23  static const int TOKEN_EOF = 0;
24  static const int TOKEN_STRING = 1;
25  static const int TOKEN_LP = 2;
26  static const int TOKEN_RP = 3;
27 
28  EdgeLexer(IStream &);
29 
30  int lexem(String &);
31 
32  int getLineCount() const { return _lineCount; };
33 
34  void print_stream(std::ostream& os) const {os << _stream.rdbuf();}
35 
36 private:
37 
39  IStream & _stream;
40 
42  int _lineCount;
43 
45  void skipWhiteSpaces();
46 
47  bool isSpace(Char c) const;
48 };
49 
50 } // end namespace spear
51 
52 #endif
EdgeLexer(IStream &)
Definition: EdgeLexer.cc:15
static const int TOKEN_STRING
Definition: EdgeLexer.h:24
int getLineCount() const
Definition: EdgeLexer.h:32
static const int TOKEN_RP
Definition: EdgeLexer.h:26
char Char
Definition: Wide.h:34
Definition: EdgeLexer.h:19
#define String
Definition: Wide.h:36
int lexem(String &)
Definition: EdgeLexer.cc:49
static const int TOKEN_EOF
Definition: EdgeLexer.h:23
static const int TOKEN_LP
Definition: EdgeLexer.h:25
#define IStream
Definition: Wide.h:39
void print_stream(std::ostream &os) const
Definition: EdgeLexer.h:34