From 2909f50d008920568f0e50da760b266388ccc124 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 22 Apr 2013 13:05:22 -0600 Subject: There is now a parser & calculator interface. --- src/parser.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/parser.h (limited to 'src/parser.h') 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 @@ +#ifndef PARSER_H +#define PARSER_H + +#include +#include "token.h" + +namespace Bu +{ + class Stream; +}; + +class Lexer; + +class Parser +{ +public: + Parser( Lexer &lex, Bu::Stream &rOut ); + virtual ~Parser(); + + void parse(); + +private: + void unwind(); + int reqTokens( Token::Type eType ); + int getPriority( Token::Type eType ); + +private: + Lexer &lex; + Bu::Stream &rOut; + typedef Bu::List TokenStack; + TokenStack tsTerminal; + TokenStack tsNonTerminal; +}; + +#endif -- cgit v1.2.3