summaryrefslogtreecommitdiff
path: root/src/parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.h')
-rw-r--r--src/parser.h35
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
7namespace Bu
8{
9 class Stream;
10};
11
12class Lexer;
13
14class Parser
15{
16public:
17 Parser( Lexer &lex, Bu::Stream &rOut );
18 virtual ~Parser();
19
20 void parse();
21
22private:
23 void unwind();
24 int reqTokens( Token::Type eType );
25 int getPriority( Token::Type eType );
26
27private:
28 Lexer &lex;
29 Bu::Stream &rOut;
30 typedef Bu::List<Token> TokenStack;
31 TokenStack tsTerminal;
32 TokenStack tsNonTerminal;
33};
34
35#endif