summaryrefslogtreecommitdiff
path: root/src/parser.h
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2013-04-22 13:05:22 -0600
committerMike Buland <mike@xagasoft.com>2013-04-22 13:05:22 -0600
commit2909f50d008920568f0e50da760b266388ccc124 (patch)
tree6789c162a2b950c2006c944e9d21e6ed9bda7069 /src/parser.h
parentd7ccd9c4d8e5a5bb4f12b36b3e4ad3105c5a9317 (diff)
downloadclic-2909f50d008920568f0e50da760b266388ccc124.tar.gz
clic-2909f50d008920568f0e50da760b266388ccc124.tar.bz2
clic-2909f50d008920568f0e50da760b266388ccc124.tar.xz
clic-2909f50d008920568f0e50da760b266388ccc124.zip
There is now a parser & calculator interface.
Diffstat (limited to '')
-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