46 { |
46 { |
47 FCheckWord = (1 << 0), // must be followed by whitespace |
47 FCheckWord = (1 << 0), // must be followed by whitespace |
48 FCheckPeek = (1 << 1), // don't advance cursor |
48 FCheckPeek = (1 << 1), // don't advance cursor |
49 }; |
49 }; |
50 |
50 |
51 static inline bool isSymbolChar (char c, bool allownumbers) |
51 static inline bool IsSymbolCharacter (char c, bool allownumbers) |
52 { |
52 { |
53 if (allownumbers && (c >= '0' && c <= '9')) |
53 if (allownumbers and (c >= '0' and c <= '9')) |
54 return true; |
54 return true; |
55 |
55 |
56 return (c >= 'a' && c <= 'z') || |
56 return (c >= 'a' and c <= 'z') or |
57 (c >= 'A' && c <= 'Z') || |
57 (c >= 'A' and c <= 'Z') or |
58 (c == '_'); |
58 (c == '_'); |
59 } |
59 } |
60 |
60 |
61 LexerScanner (FILE* fp); |
61 LexerScanner (FILE* fp); |
62 ~LexerScanner(); |
62 ~LexerScanner(); |
76 inline int getColumn() const |
76 inline int getColumn() const |
77 { |
77 { |
78 return m_position - m_lineBreakPosition; |
78 return m_position - m_lineBreakPosition; |
79 } |
79 } |
80 |
80 |
81 inline ETokenType getTokenType() const |
81 inline Token getTokenType() const |
82 { |
82 { |
83 return m_tokenType; |
83 return m_tokenType; |
84 } |
84 } |
85 |
85 |
86 static String getTokenString (ETokenType a); |
86 static String GetTokenString (Token a); |
87 |
87 |
88 private: |
88 private: |
89 char* m_data; |
89 char* m_data; |
90 char* m_position; |
90 char* m_position; |
91 char* m_lineBreakPosition; |
91 char* m_lineBreakPosition; |
92 String m_tokenText, |
92 String m_tokenText, |
93 m_lastToken; |
93 m_lastToken; |
94 ETokenType m_tokenType; |
94 Token m_tokenType; |
95 int m_line; |
95 int m_line; |
96 |
96 |
97 bool checkString (const char* c, int flags = 0); |
97 bool checkString (const char* c, int flags = 0); |
98 |
98 |
99 // Yields a copy of the current position information. |
99 // Yields a copy of the current position information. |