summaryrefslogtreecommitdiff
path: root/src/parser.y
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-12-23 01:02:51 -0700
committerMike Buland <eichlan@xagasoft.com>2011-12-23 01:02:51 -0700
commitd7c0a793787eaf52c4302d6d1ea6cc43f7ff9ca7 (patch)
treeff702f7ef133e80eedb6943b1c0f07f5e7fce1c7 /src/parser.y
parent7a53f0e95a5ffe13a21fc8d2076e34ee96693ac0 (diff)
downloadstage-d7c0a793787eaf52c4302d6d1ea6cc43f7ff9ca7.tar.gz
stage-d7c0a793787eaf52c4302d6d1ea6cc43f7ff9ca7.tar.bz2
stage-d7c0a793787eaf52c4302d6d1ea6cc43f7ff9ca7.tar.xz
stage-d7c0a793787eaf52c4302d6d1ea6cc43f7ff9ca7.zip
global section is optional now.
Diffstat (limited to 'src/parser.y')
-rw-r--r--src/parser.y9
1 files changed, 5 insertions, 4 deletions
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:
90 | gameDecls tokGame '.' tokIdent '=' literal ';' { bld.setGameParam( *($4) ); } 90 | gameDecls tokGame '.' tokIdent '=' literal ';' { bld.setGameParam( *($4) ); }
91 ; 91 ;
92 92
93globalDecl: tokGlobal '{' globalExprList '}' 93globalDecl:
94 ; 94 | tokGlobal '{' globalExprList '}'
95 ;
95 96
96globalExprList: 97globalExprList:
97 | globalExprList cmpltGlobalExpr 98 | globalExprList cmpltGlobalExpr
@@ -109,7 +110,7 @@ bodyDecl:
109 | bodyDecl function 110 | bodyDecl function
110 ; 111 ;
111 112
112situation: tokSituation tokSituationName { printf("Read situtaion: %s\n", (*$2).getStr() ); } '{' situationMembers '}' 113situation: tokSituation tokSituationName { bld.beginSituation( *($2) ); } '{' situationMembers '}' { bld.endSituation(); }
113 ; 114 ;
114 115
115situationMembers: 116situationMembers:
@@ -124,7 +125,7 @@ situationMode: tokSetup
124 | tokEnter 125 | tokEnter
125 ; 126 ;
126 127
127function: tokFunction tokIdent '(' ')' '{' '}' 128function: tokFunction tokIdent { bld.beginFunction( *($2) ); } '(' ')' '{' '}' { bld.endFunction(); }
128 ; 129 ;
129 130
130cmpltExprList: 131cmpltExprList: