source:
src/Parser/lex.h
@
905cf4b
Last change on this file since 905cf4b was 984dce6, checked in by , 9 years ago | |
---|---|
|
|
File size: 1.1 KB |
Rev | Line | |
---|---|---|
[b87a5ed] | 1 | // |
2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo | |
3 | // | |
4 | // The contents of this file are covered under the licence agreement in the | |
5 | // file "LICENCE" distributed with Cforall. | |
6 | // | |
7 | // lex.h -- | |
8 | // | |
9 | // Author : Peter A. Buhr | |
10 | // Created On : Sat Sep 22 08:58:10 2001 | |
11 | // Last Modified By : Peter A. Buhr | |
[984dce6] | 12 | // Last Modified On : Mon Mar 21 18:18:06 2016 |
13 | // Update Count : 346 | |
[b87a5ed] | 14 | // |
[51b7345] | 15 | |
16 | #ifndef PARSER_LEX_H | |
17 | #define PARSER_LEX_H | |
18 | ||
19 | int yylex(); | |
[5f2f2d7] | 20 | void yyerror( const char * ); |
[51b7345] | 21 | |
[984dce6] | 22 | #include <string> |
23 | #include "ParseNode.h" | |
[b87a5ed] | 24 | // External declarations for information sharing between lexer and scanner |
[984dce6] | 25 | class TypedefTable; |
[51b7345] | 26 | extern TypedefTable typedefTable; |
27 | ||
[b87a5ed] | 28 | // current location in the input |
[51b7345] | 29 | extern int yylineno; |
30 | extern char *yyfilename; | |
31 | ||
[b87a5ed] | 32 | struct Location { |
33 | char *file; | |
34 | int line; | |
[51b7345] | 35 | }; |
36 | ||
[b87a5ed] | 37 | class Token { |
38 | public: | |
[5f2f2d7] | 39 | std::string *str; // must be pointer as used in union |
[b87a5ed] | 40 | Location loc; |
[51b7345] | 41 | |
[b87a5ed] | 42 | operator std::string *() { return str; } |
[51b7345] | 43 | }; |
44 | ||
[b87a5ed] | 45 | #endif // PARSER_LEX_H |
46 | ||
47 | // Local Variables: // | |
48 | // tab-width: 4 // | |
49 | // mode: c++ // | |
50 | // compile-command: "make install" // | |
51 | // End: // |
Note: See TracBrowser
for help on using the repository browser.