diff options
author | Mike Buland <mike@xagasoft.com> | 2013-04-22 13:05:22 -0600 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2013-04-22 13:05:22 -0600 |
commit | 2909f50d008920568f0e50da760b266388ccc124 (patch) | |
tree | 6789c162a2b950c2006c944e9d21e6ed9bda7069 /src/parser.h | |
parent | d7ccd9c4d8e5a5bb4f12b36b3e4ad3105c5a9317 (diff) | |
download | clic-2909f50d008920568f0e50da760b266388ccc124.tar.gz clic-2909f50d008920568f0e50da760b266388ccc124.tar.bz2 clic-2909f50d008920568f0e50da760b266388ccc124.tar.xz clic-2909f50d008920568f0e50da760b266388ccc124.zip |
There is now a parser & calculator interface.
Diffstat (limited to 'src/parser.h')
-rw-r--r-- | src/parser.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/parser.h b/src/parser.h new file mode 100644 index 0000000..5563613 --- /dev/null +++ b/src/parser.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef PARSER_H | ||
2 | #define PARSER_H | ||
3 | |||
4 | #include <bu/list.h> | ||
5 | #include "token.h" | ||
6 | |||
7 | namespace Bu | ||
8 | { | ||
9 | class Stream; | ||
10 | }; | ||
11 | |||
12 | class Lexer; | ||
13 | |||
14 | class Parser | ||
15 | { | ||
16 | public: | ||
17 | Parser( Lexer &lex, Bu::Stream &rOut ); | ||
18 | virtual ~Parser(); | ||
19 | |||
20 | void parse(); | ||
21 | |||
22 | private: | ||
23 | void unwind(); | ||
24 | int reqTokens( Token::Type eType ); | ||
25 | int getPriority( Token::Type eType ); | ||
26 | |||
27 | private: | ||
28 | Lexer &lex; | ||
29 | Bu::Stream &rOut; | ||
30 | typedef Bu::List<Token> TokenStack; | ||
31 | TokenStack tsTerminal; | ||
32 | TokenStack tsNonTerminal; | ||
33 | }; | ||
34 | |||
35 | #endif | ||