From ac58dc8822b154a2ce51cc1b1317bc5e57ebf655 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 11 Dec 2011 23:00:45 -0700 Subject: 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. --- src/parser.y | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/parser.y') 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 ); } %token tokIf %token tokThen %token tokElse +%token tokNot %token tokCommand %token tokSituationName %token tokIdent @@ -54,6 +55,7 @@ gameExprList: ; cmpltGameExpr: gameExpr ';' + | commandDecl ; gameExpr: tokIdent '=' expr @@ -103,6 +105,14 @@ listValues: expr dictValues: expr ':' expr | dictValues ',' expr ':' expr ; + +commandDecl: tokCommand ':' tokString commandParamList '{' '}' + ; + +commandParamList: + | commandParamList tokString + | commandParamList tokIdent + ; %% int main() -- cgit v1.2.3