diff options
author | Mike Buland <eichlan@xagasoft.com> | 2016-12-01 10:40:43 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2016-12-01 10:40:43 -0700 |
commit | b96daa4e9849ac9caf5c0dfcea8daac28267ea19 (patch) | |
tree | 9be42c8cfe8b875f396b5887742bb936bd081c65 /src/parser.h | |
parent | 4efeaef41e57b25d6004e7f91828f7d5b5cd0b20 (diff) | |
download | clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.tar.gz clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.tar.bz2 clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.tar.xz clic-b96daa4e9849ac9caf5c0dfcea8daac28267ea19.zip |
Scripts are executable now!
The main interactive interface doesn't work, and there's a lot left to do with
the unit tests, other command line options, etc. but it's pretty exciting.
I also still have to figure out how commands will work. I'm thinking they'll
be stored in an Expression and executed by the engine as normal.
Diffstat (limited to 'src/parser.h')
-rw-r--r-- | src/parser.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/parser.h b/src/parser.h index b0a1231..1e0d1c4 100644 --- a/src/parser.h +++ b/src/parser.h | |||
@@ -12,6 +12,7 @@ namespace Bu | |||
12 | }; | 12 | }; |
13 | 13 | ||
14 | class Lexer; | 14 | class Lexer; |
15 | class Expression; | ||
15 | 16 | ||
16 | /** | 17 | /** |
17 | * | 18 | * |
@@ -45,10 +46,10 @@ class Lexer; | |||
45 | class Parser | 46 | class Parser |
46 | { | 47 | { |
47 | public: | 48 | public: |
48 | Parser( Lexer &lex, Bu::Stream &rOut ); | 49 | Parser( Lexer &lex ); |
49 | virtual ~Parser(); | 50 | virtual ~Parser(); |
50 | 51 | ||
51 | void parse(); | 52 | Expression *parse(); |
52 | 53 | ||
53 | private: | 54 | private: |
54 | void expr(); | 55 | void expr(); |
@@ -58,6 +59,7 @@ private: | |||
58 | private: | 59 | private: |
59 | void shift( const Token &t ); | 60 | void shift( const Token &t ); |
60 | void reduce(); | 61 | void reduce(); |
62 | void output( const Token &t ); | ||
61 | int reqTokens( Token::Type eType ); | 63 | int reqTokens( Token::Type eType ); |
62 | int getPriority( Token::Type eType ); | 64 | int getPriority( Token::Type eType ); |
63 | 65 | ||
@@ -65,10 +67,9 @@ private: | |||
65 | 67 | ||
66 | private: | 68 | private: |
67 | Lexer &lex; | 69 | Lexer &lex; |
68 | Bu::Stream &rOut; | ||
69 | typedef Bu::List<Token> TokenStack; | 70 | typedef Bu::List<Token> TokenStack; |
70 | TokenStack tsParse; | 71 | TokenStack tsParse; |
71 | TokenStack tsScript; | 72 | Expression *pCurExp; |
72 | }; | 73 | }; |
73 | 74 | ||
74 | #endif | 75 | #endif |