109 "enum", |
109 "enum", |
110 "func", |
110 "func", |
111 "return", |
111 "return", |
112 }; |
112 }; |
113 |
113 |
114 static_assert (countof (gTokenStrings) == (int)gLastNamedToken + 1, |
114 static_assert (countof (gTokenStrings) == (int) Token::LastNamedToken + 1, |
115 "Count of gTokenStrings is not the same as the amount of named token identifiers."); |
115 "Count of gTokenStrings is not the same as the amount of named token identifiers."); |
116 |
116 |
117 // ============================================================================= |
117 // ============================================================================= |
118 // |
118 // |
119 LexerScanner::LexerScanner (FILE* fp) : |
119 LexerScanner::LexerScanner (FILE* fp) : |
288 |
288 |
289 // ============================================================================= |
289 // ============================================================================= |
290 // |
290 // |
291 String LexerScanner::GetTokenString (Token a) |
291 String LexerScanner::GetTokenString (Token a) |
292 { |
292 { |
293 ASSERT_LT_EQ (a, gLastNamedToken); |
293 ASSERT_LT_EQ (a, Token::LastNamedToken); |
294 return gTokenStrings[a]; |
294 return gTokenStrings[int (a)]; |
295 } |
295 } |
296 |
296 |
297 // ============================================================================= |
297 // ============================================================================= |
298 // |
298 // |
299 String LexerScanner::readLine() |
299 String LexerScanner::readLine() |