From d7c0a793787eaf52c4302d6d1ea6cc43f7ff9ca7 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 23 Dec 2011 01:02:51 -0700 Subject: global section is optional now. --- src/parser.y | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/parser.y') diff --git a/src/parser.y b/src/parser.y index 8e198c8..0b1d41b 100644 --- a/src/parser.y +++ b/src/parser.y @@ -90,8 +90,9 @@ gameDecls: | gameDecls tokGame '.' tokIdent '=' literal ';' { bld.setGameParam( *($4) ); } ; -globalDecl: tokGlobal '{' globalExprList '}' - ; +globalDecl: + | tokGlobal '{' globalExprList '}' + ; globalExprList: | globalExprList cmpltGlobalExpr @@ -109,7 +110,7 @@ bodyDecl: | bodyDecl function ; -situation: tokSituation tokSituationName { printf("Read situtaion: %s\n", (*$2).getStr() ); } '{' situationMembers '}' +situation: tokSituation tokSituationName { bld.beginSituation( *($2) ); } '{' situationMembers '}' { bld.endSituation(); } ; situationMembers: @@ -124,7 +125,7 @@ situationMode: tokSetup | tokEnter ; -function: tokFunction tokIdent '(' ')' '{' '}' +function: tokFunction tokIdent { bld.beginFunction( *($2) ); } '(' ')' '{' '}' { bld.endFunction(); } ; cmpltExprList: -- cgit v1.2.3