diff options
author | Mike Buland <eichlan@xagasoft.com> | 2011-12-11 23:00:45 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2011-12-11 23:00:45 -0700 |
commit | ac58dc8822b154a2ce51cc1b1317bc5e57ebf655 (patch) | |
tree | d9f7c95785720d1c1a3fce92c080e3021328c3ef /src/parser.y | |
parent | 7c90fe68b557d32b65955ffd18e2e79585a7282b (diff) | |
download | stage-ac58dc8822b154a2ce51cc1b1317bc5e57ebf655.tar.gz stage-ac58dc8822b154a2ce51cc1b1317bc5e57ebf655.tar.bz2 stage-ac58dc8822b154a2ce51cc1b1317bc5e57ebf655.tar.xz stage-ac58dc8822b154a2ce51cc1b1317bc5e57ebf655.zip |
I think I've narrowed down how commands will work
It's kinda' cool for the most part, there will have to be some ways of
referencing them later. Basically, there are global commands and
situation commands. With any luck, it'll just work.
Diffstat (limited to 'src/parser.y')
-rw-r--r-- | src/parser.y | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/parser.y b/src/parser.y index 9fb2be9..7242df0 100644 --- a/src/parser.y +++ b/src/parser.y | |||
@@ -24,6 +24,7 @@ void yyerror( const char *error ) { printf("%s\n", error ); } | |||
24 | %token tokIf | 24 | %token tokIf |
25 | %token tokThen | 25 | %token tokThen |
26 | %token tokElse | 26 | %token tokElse |
27 | %token tokNot | ||
27 | %token tokCommand | 28 | %token tokCommand |
28 | %token <sValue> tokSituationName | 29 | %token <sValue> tokSituationName |
29 | %token <sValue> tokIdent | 30 | %token <sValue> tokIdent |
@@ -54,6 +55,7 @@ gameExprList: | |||
54 | ; | 55 | ; |
55 | 56 | ||
56 | cmpltGameExpr: gameExpr ';' | 57 | cmpltGameExpr: gameExpr ';' |
58 | | commandDecl | ||
57 | ; | 59 | ; |
58 | 60 | ||
59 | gameExpr: tokIdent '=' expr | 61 | gameExpr: tokIdent '=' expr |
@@ -103,6 +105,14 @@ listValues: expr | |||
103 | dictValues: expr ':' expr | 105 | dictValues: expr ':' expr |
104 | | dictValues ',' expr ':' expr | 106 | | dictValues ',' expr ':' expr |
105 | ; | 107 | ; |
108 | |||
109 | commandDecl: tokCommand ':' tokString commandParamList '{' '}' | ||
110 | ; | ||
111 | |||
112 | commandParamList: | ||
113 | | commandParamList tokString | ||
114 | | commandParamList tokIdent | ||
115 | ; | ||
106 | %% | 116 | %% |
107 | 117 | ||
108 | int main() | 118 | int main() |