Last change
on this file since 433e2c3 was
6b0b624,
checked in by Peter A. Buhr <pabuhr@…>, 7 years ago
|
change #ifndef to #pragma once
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
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 | // token.h -- |
---|
8 | // |
---|
9 | // Author : Peter A. Buhr |
---|
10 | // Created On : Wed Jun 28 22:47:58 2017 |
---|
11 | // Last Modified By : Peter A. Buhr |
---|
12 | // Last Modified On : Sat Jul 22 10:12:42 2017 |
---|
13 | // Update Count : 6 |
---|
14 | // |
---|
15 | |
---|
16 | #pragma once |
---|
17 | |
---|
18 | struct Token { |
---|
19 | std::string text; // text of terminal or non-terminal token |
---|
20 | int kind; // kind of terminal or non-terminal token |
---|
21 | std::list<std::string> ws_list; // list of whitespace and comments before terminal token |
---|
22 | Token *left, *down; // binary parse tree links |
---|
23 | |
---|
24 | Token( const std::string &, int ); |
---|
25 | Token( const std::string &, std::list<std::string> &, int ); |
---|
26 | void addLeftTail( Token * ); |
---|
27 | void addDownLeftTail( Token * ); |
---|
28 | bool isTerminal(); |
---|
29 | int getKind() const; |
---|
30 | std::string getText() const; |
---|
31 | std::string getWS(); |
---|
32 | bool isComment(); |
---|
33 | std::string getComment(); |
---|
34 | }; |
---|
35 | |
---|
36 | // Local Variables: // |
---|
37 | // tab-width: 4 // |
---|
38 | // mode: c++ // |
---|
39 | // compile-command: "make install" // |
---|
40 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.