Initial grammar definition based on http://slps.github.com/zoo/index.html#Google_Dart.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 11 Jan 2013 10:12:41 +0000
changeset 28fedb5e096fc
parent 1 46dd2b3b6974
child 3 46c322c66a29
Initial grammar definition based on http://slps.github.com/zoo/index.html#Google_Dart.
compiler/Dart__Parser.st
compiler/compiler.rc
     1.1 --- a/compiler/Dart__Parser.st	Thu Jan 10 13:21:04 2013 +0000
     1.2 +++ b/compiler/Dart__Parser.st	Fri Jan 11 10:12:41 2013 +0000
     1.3 @@ -3,7 +3,44 @@
     1.4  "{ NameSpace: Dart }"
     1.5  
     1.6  PPCompositeParser subclass:#Parser
     1.7 -	instanceVariableNames:''
     1.8 +	instanceVariableNames:'additiveExpression additiveOperator argumentList arguments
     1.9 +		assignableExpression assignableSelector assignmentOperator
    1.10 +		bitwiseAndExpression bitwiseOperator bitwiseOrExpression
    1.11 +		bitwiseXorExpression block catchPart classDefinition
    1.12 +		classMemberDefinition compilationUnit compoundLiteral
    1.13 +		conditionalExpression constInitializedIdentifier
    1.14 +		constInitializedVariableDeclaration
    1.15 +		constantConstructorDeclaration constantExpression
    1.16 +		constructorDeclaration declaration declaredIdentifier defaultCase
    1.17 +		defaultFormalParameter directive equalityExpression
    1.18 +		equalityOperator expression expressionInParentheses
    1.19 +		expressionList factoryConstructorDeclaration factorySpecification
    1.20 +		fieldFormalParameter fieldInitializer finalVarOrType finallyPart
    1.21 +		forInitializerStatement forLoopParts formalParameterList
    1.22 +		functionBody functionBodyOrNative functionDeclaration
    1.23 +		functionExpression functionExpressionBody functionNative
    1.24 +		functionPrefix functionTypeAlias getOrSet identifier
    1.25 +		importReference importReferences incrementOperator
    1.26 +		initializedIdentifier initializedIdentifierList
    1.27 +		initializedVariableDeclaration initializers interfaceDefinition
    1.28 +		interfaceMemberDefinition interfaces isOperator
    1.29 +		iterationStatement label libraryBody libraryDefinition
    1.30 +		libraryImport librarySource libraryUnit listLiteral literal
    1.31 +		logicalAndExpression logicalOrExpression mapLiteral
    1.32 +		mapLiteralEntry methodDeclaration multiplicativeExpression
    1.33 +		multiplicativeOperator namedArgument namedConstructorDeclaration
    1.34 +		namedFormalParameters negateOperator nonLabelledStatement
    1.35 +		normalFormalParameter normalFormalParameterTail postfixExpression
    1.36 +		postfixOperator prefixOperator primary primaryFE primaryNoFE
    1.37 +		qualified redirection relationalExpression relationalOperator
    1.38 +		returnType selectionStatement selector shiftExpression
    1.39 +		shiftOperator simpleFormalParameter sourceUrls
    1.40 +		specialSignatureDefinition statement statements
    1.41 +		staticFinalDeclaration staticFinalDeclarationList
    1.42 +		superCallOrFieldInitializer superclass superinterfaces switchCase
    1.43 +		topLevelDefinition tryStatement type typeArguments typeList
    1.44 +		typeParameter typeParameters unaryExpression
    1.45 +		userDefinableOperator variableDeclaration'
    1.46  	classVariableNames:''
    1.47  	poolDictionaries:''
    1.48  	category:'Languages-Dart-Parser'
    1.49 @@ -17,6 +54,837 @@
    1.50  !
    1.51  
    1.52  
    1.53 +!Parser methodsFor:'grammar'!
    1.54 +
    1.55 +additiveExpression
    1.56 +
    1.57 +        ^ (multiplicativeExpression , ((additiveOperator , multiplicativeExpression) star))
    1.58 +        / ((TokenParser for: #super) , ((additiveOperator , multiplicativeExpression) plus))
    1.59 +
    1.60 +    "Modified: / 11-01-2013 / 09:59:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.61 +!
    1.62 +
    1.63 +additiveOperator
    1.64 +
    1.65 +	^ ('+' asParser)
    1.66 +	/ ('-' asParser)
    1.67 +	
    1.68 +!
    1.69 +
    1.70 +argumentList
    1.71 +
    1.72 +	^ (namedArgument , (((',' asParser) , namedArgument) star))
    1.73 +	/ (expressionList , (((',' asParser) , namedArgument) star))
    1.74 +	
    1.75 +!
    1.76 +
    1.77 +arguments
    1.78 +
    1.79 +	^('(' asParser) , (argumentList optional) , (')' asParser)
    1.80 +!
    1.81 +
    1.82 +assignableExpression
    1.83 +
    1.84 +        ^ (primary , (((arguments star) , assignableSelector) plus))
    1.85 +        / ((TokenParser for: #super) , assignableSelector)
    1.86 +        / identifier
    1.87 +
    1.88 +    "Modified: / 11-01-2013 / 10:00:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.89 +!
    1.90 +
    1.91 +assignableSelector
    1.92 +
    1.93 +	^ (('[' asParser) , constantExpression , (']' asParser))
    1.94 +	/ (('.' asParser) , identifier)
    1.95 +	
    1.96 +!
    1.97 +
    1.98 +assignmentOperator
    1.99 +
   1.100 +	^ ('=' asParser)
   1.101 +	/ ('*=' asParser)
   1.102 +	/ ('/=' asParser)
   1.103 +	/ ('~/=' asParser)
   1.104 +	/ ('%=' asParser)
   1.105 +	/ ('+=' asParser)
   1.106 +	/ ('-=' asParser)
   1.107 +	/ ('<<=' asParser)
   1.108 +	/ (('>' asParser) , ('>' asParser) , ('>' asParser) , ('=' asParser))
   1.109 +	/ (('>' asParser) , ('>' asParser) , ('=' asParser))
   1.110 +	/ ('&=' asParser)
   1.111 +	/ ('^=' asParser)
   1.112 +	/ ('|=' asParser)
   1.113 +	
   1.114 +!
   1.115 +
   1.116 +bitwiseAndExpression
   1.117 +
   1.118 +        ^ (equalityExpression , ((('&' asParser) , equalityExpression) star))
   1.119 +        / ((TokenParser for: #super) , ((('&' asParser) , equalityExpression) plus))
   1.120 +
   1.121 +    "Modified: / 11-01-2013 / 10:00:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.122 +!
   1.123 +
   1.124 +bitwiseOperator
   1.125 +
   1.126 +	^ ('&' asParser)
   1.127 +	/ ('^' asParser)
   1.128 +	/ ('|' asParser)
   1.129 +	
   1.130 +!
   1.131 +
   1.132 +bitwiseOrExpression
   1.133 +
   1.134 +	^ (bitwiseXorExpression , ((('|' asParser) , bitwiseXorExpression) star))
   1.135 +	/ ((TokenParser for:#super) , ((('|' asParser) , bitwiseXorExpression) plus))
   1.136 +	
   1.137 +!
   1.138 +
   1.139 +bitwiseXorExpression
   1.140 +
   1.141 +	^ (bitwiseAndExpression , ((('^' asParser) , bitwiseAndExpression) star))
   1.142 +	/ ((TokenParser for:#super) , ((('^' asParser) , bitwiseAndExpression) plus))
   1.143 +	
   1.144 +!
   1.145 +
   1.146 +block
   1.147 +
   1.148 +	^('{' asParser) , statements , ('}' asParser)
   1.149 +!
   1.150 +
   1.151 +catchPart
   1.152 +
   1.153 +	^(TokenParser for:#catch) , ('(' asParser) , declaredIdentifier , (((',' asParser) , declaredIdentifier) optional) , (')' asParser) , block
   1.154 +!
   1.155 +
   1.156 +classDefinition
   1.157 +
   1.158 +	^ ((TokenParser for:#class) , identifier , (typeParameters optional) , (superclass optional) , (interfaces optional) , ('{' asParser) , (classMemberDefinition star) , ('}' asParser))
   1.159 +	/ ((TokenParser for:#class) , identifier , (typeParameters optional) , (interfaces optional) , (TokenParser for:#native) , (TokenParser for:#string) , ('{' asParser) , (classMemberDefinition star) , ('}' asParser))
   1.160 +	
   1.161 +!
   1.162 +
   1.163 +classMemberDefinition
   1.164 +
   1.165 +	^ (declaration , (';' asParser))
   1.166 +	/ (constructorDeclaration , (';' asParser))
   1.167 +	/ (methodDeclaration , functionBodyOrNative)
   1.168 +	/ ((TokenParser for:#const) , factoryConstructorDeclaration , functionNative)
   1.169 +	
   1.170 +!
   1.171 +
   1.172 +compilationUnit
   1.173 +
   1.174 +        ^( ((TokenParser for: #'#!!') optional) , (directive star) , (topLevelDefinition star) ) end
   1.175 +
   1.176 +    "Modified: / 11-01-2013 / 10:02:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.177 +!
   1.178 +
   1.179 +compoundLiteral
   1.180 +
   1.181 +	^ listLiteral
   1.182 +	/ mapLiteral
   1.183 +	
   1.184 +!
   1.185 +
   1.186 +conditionalExpression
   1.187 +
   1.188 +	^logicalOrExpression , ((('?' asParser) , constantExpression , (':' asParser) , constantExpression) optional)
   1.189 +!
   1.190 +
   1.191 +constInitializedIdentifier
   1.192 +
   1.193 +	^identifier , ((('=' asParser) , constantExpression) optional)
   1.194 +!
   1.195 +
   1.196 +constInitializedVariableDeclaration
   1.197 +
   1.198 +	^declaredIdentifier , ((('=' asParser) , constantExpression) optional) , (((',' asParser) , constInitializedIdentifier) star)
   1.199 +!
   1.200 +
   1.201 +constantConstructorDeclaration
   1.202 +
   1.203 +	^(TokenParser for:#const) , qualified , formalParameterList
   1.204 +!
   1.205 +
   1.206 +constantExpression
   1.207 +
   1.208 +	^ (assignableExpression , assignmentOperator , constantExpression)
   1.209 +	/ conditionalExpression
   1.210 +	
   1.211 +!
   1.212 +
   1.213 +constructorDeclaration
   1.214 +
   1.215 +	^ (identifier , formalParameterList , ((redirection / initializers ) optional))
   1.216 +	/ (namedConstructorDeclaration , ((redirection / initializers ) optional))
   1.217 +	
   1.218 +!
   1.219 +
   1.220 +declaration
   1.221 +
   1.222 +	^ (constantConstructorDeclaration , ((redirection / initializers ) optional))
   1.223 +	/ (functionDeclaration , redirection)
   1.224 +	/ (namedConstructorDeclaration , redirection)
   1.225 +	/ ((TokenParser for:#abstract) , specialSignatureDefinition)
   1.226 +	/ ((TokenParser for:#abstract) , functionDeclaration)
   1.227 +	/ ((TokenParser for:#static) , (TokenParser for:#final) , (type optional) , staticFinalDeclarationList)
   1.228 +	/ (((TokenParser for:#static) optional) , constInitializedVariableDeclaration)
   1.229 +	
   1.230 +!
   1.231 +
   1.232 +declaredIdentifier
   1.233 +
   1.234 +	^ ((TokenParser for:#final) , (type optional) , identifier)
   1.235 +	/ ((TokenParser for:#var) , identifier)
   1.236 +	/ (type , identifier)
   1.237 +	
   1.238 +!
   1.239 +
   1.240 +defaultCase
   1.241 +
   1.242 +	^(label optional) , (((TokenParser for:#case) , constantExpression , (':' asParser)) star) , (TokenParser for:#default) , (':' asParser) , statements
   1.243 +!
   1.244 +
   1.245 +defaultFormalParameter
   1.246 +
   1.247 +	^normalFormalParameter , ((('=' asParser) , constantExpression) optional)
   1.248 +!
   1.249 +
   1.250 +directive
   1.251 +
   1.252 +	^('#' asParser) , identifier , arguments , (';' asParser)
   1.253 +!
   1.254 +
   1.255 +equalityExpression
   1.256 +
   1.257 +	^ (relationalExpression , ((equalityOperator , relationalExpression) optional))
   1.258 +	/ ((TokenParser for:#super) , equalityOperator , relationalExpression)
   1.259 +	
   1.260 +!
   1.261 +
   1.262 +equalityOperator
   1.263 +
   1.264 +	^ ('==' asParser)
   1.265 +	/ ('!!=' asParser)
   1.266 +	/ ('===' asParser)
   1.267 +	/ ('!!==' asParser)
   1.268 +	
   1.269 +!
   1.270 +
   1.271 +expressionInParentheses
   1.272 +
   1.273 +	^('(' asParser) , constantExpression , (')' asParser)
   1.274 +!
   1.275 +
   1.276 +expressionList
   1.277 +
   1.278 +	^constantExpression , (((',' asParser) , constantExpression) star)
   1.279 +!
   1.280 +
   1.281 +factoryConstructorDeclaration
   1.282 +
   1.283 +	^(TokenParser for:#factory) , qualified , (typeParameters optional) , ((('.' asParser) , identifier) optional) , formalParameterList
   1.284 +!
   1.285 +
   1.286 +factorySpecification
   1.287 +
   1.288 +	^(TokenParser for:#factory) , type
   1.289 +!
   1.290 +
   1.291 +fieldFormalParameter
   1.292 +
   1.293 +	^(finalVarOrType optional) , (TokenParser for:#this) , ('.' asParser) , identifier
   1.294 +!
   1.295 +
   1.296 +fieldInitializer
   1.297 +
   1.298 +	^(((TokenParser for:#this) , ('.' asParser)) optional) , identifier , ('=' asParser) , conditionalExpression
   1.299 +!
   1.300 +
   1.301 +finalVarOrType
   1.302 +
   1.303 +	^ ((TokenParser for:#final) , (type optional))
   1.304 +	/ (TokenParser for:#var)
   1.305 +	/ type
   1.306 +	
   1.307 +!
   1.308 +
   1.309 +finallyPart
   1.310 +
   1.311 +	^(TokenParser for:#finally) , block
   1.312 +!
   1.313 +
   1.314 +forInitializerStatement
   1.315 +
   1.316 +	^ (initializedVariableDeclaration , (';' asParser))
   1.317 +	/ ((constantExpression optional) , (';' asParser))
   1.318 +	
   1.319 +!
   1.320 +
   1.321 +forLoopParts
   1.322 +
   1.323 +	^ (forInitializerStatement , (constantExpression optional) , (';' asParser) , (expressionList optional))
   1.324 +	/ (declaredIdentifier , (TokenParser for:#in) , constantExpression)
   1.325 +	/ (identifier , (TokenParser for:#in) , constantExpression)
   1.326 +	
   1.327 +!
   1.328 +
   1.329 +formalParameterList
   1.330 +
   1.331 +	^ (('(' asParser) , (namedFormalParameters optional) , (')' asParser))
   1.332 +	/ (('(' asParser) , normalFormalParameter , (normalFormalParameterTail optional) , (')' asParser))
   1.333 +	
   1.334 +!
   1.335 +
   1.336 +functionBody
   1.337 +
   1.338 +	^ (('=>' asParser) , constantExpression , (';' asParser))
   1.339 +	/ block
   1.340 +	
   1.341 +!
   1.342 +
   1.343 +functionBodyOrNative
   1.344 +
   1.345 +	^ ((TokenParser for:#native) , functionBody)
   1.346 +	/ functionNative
   1.347 +	/ functionBody
   1.348 +	
   1.349 +!
   1.350 +
   1.351 +functionDeclaration
   1.352 +
   1.353 +	^(returnType optional) , identifier , formalParameterList
   1.354 +!
   1.355 +
   1.356 +functionExpression
   1.357 +
   1.358 +	^(((returnType optional) , identifier) optional) , formalParameterList , functionExpressionBody
   1.359 +!
   1.360 +
   1.361 +functionExpressionBody
   1.362 +
   1.363 +	^ (('=>' asParser) , constantExpression)
   1.364 +	/ block
   1.365 +	
   1.366 +!
   1.367 +
   1.368 +functionNative
   1.369 +
   1.370 +	^(TokenParser for:#native) , ((TokenParser for:#string) optional) , (';' asParser)
   1.371 +!
   1.372 +
   1.373 +functionPrefix
   1.374 +
   1.375 +	^(returnType optional) , identifier
   1.376 +!
   1.377 +
   1.378 +functionTypeAlias
   1.379 +
   1.380 +	^(TokenParser for:#typedef) , functionPrefix , (typeParameters optional) , formalParameterList , (';' asParser)
   1.381 +!
   1.382 +
   1.383 +getOrSet
   1.384 +
   1.385 +	^ (TokenParser for:#get)
   1.386 +	/ (TokenParser for:#set)
   1.387 +	
   1.388 +!
   1.389 +
   1.390 +identifier
   1.391 +
   1.392 +	^ IDENTIFIER_NO_DOLLAR
   1.393 +	/ (TokenParser for:#identifier)
   1.394 +	/ (TokenParser for:#abstract)
   1.395 +	/ ASSERT
   1.396 +	/ (TokenParser for:#class)
   1.397 +	/ EXTENDS
   1.398 +	/ (TokenParser for:#factory)
   1.399 +	/ (TokenParser for:#get)
   1.400 +	/ (TokenParser for:#implements)
   1.401 +	/ (TokenParser for:#import)
   1.402 +	/ (TokenParser for:#interface)
   1.403 +	/ (TokenParser for:#is)
   1.404 +	/ (TokenParser for:#library)
   1.405 +	/ (TokenParser for:#native)
   1.406 +	/ NEGATE
   1.407 +	/ OPERATOR
   1.408 +	/ (TokenParser for:#set)
   1.409 +	/ (TokenParser for:#source)
   1.410 +	/ (TokenParser for:#static)
   1.411 +	/ (TokenParser for:#typedef)
   1.412 +	
   1.413 +!
   1.414 +
   1.415 +importReference
   1.416 +
   1.417 +	^(((TokenParser for:#identifier) , (':' asParser)) optional) , (TokenParser for:#string)
   1.418 +!
   1.419 +
   1.420 +importReferences
   1.421 +
   1.422 +	^importReference , (((',' asParser) , importReference) star) , ((',' asParser) optional)
   1.423 +!
   1.424 +
   1.425 +initializedIdentifier
   1.426 +
   1.427 +	^identifier , ((('=' asParser) , constantExpression) optional)
   1.428 +!
   1.429 +
   1.430 +initializedIdentifierList
   1.431 +
   1.432 +	^initializedIdentifier , (((',' asParser) , initializedIdentifier) star)
   1.433 +!
   1.434 +
   1.435 +initializedVariableDeclaration
   1.436 +
   1.437 +	^declaredIdentifier , ((('=' asParser) , constantExpression) optional) , (((',' asParser) , initializedIdentifier) star)
   1.438 +!
   1.439 +
   1.440 +initializers
   1.441 +
   1.442 +	^(':' asParser) , superCallOrFieldInitializer , (((',' asParser) , superCallOrFieldInitializer) star)
   1.443 +!
   1.444 +
   1.445 +interfaceDefinition
   1.446 +
   1.447 +	^(TokenParser for:#interface) , identifier , (typeParameters optional) , (superinterfaces optional) , (factorySpecification optional) , ('{' asParser) , (interfaceMemberDefinition star) , ('}' asParser)
   1.448 +!
   1.449 +
   1.450 +interfaceMemberDefinition
   1.451 +
   1.452 +	^ ((TokenParser for:#static) , (TokenParser for:#final) , (type optional) , initializedIdentifierList , (';' asParser))
   1.453 +	/ (functionDeclaration , (';' asParser))
   1.454 +	/ (constantConstructorDeclaration , (';' asParser))
   1.455 +	/ (namedConstructorDeclaration , (';' asParser))
   1.456 +	/ (specialSignatureDefinition , (';' asParser))
   1.457 +	/ (variableDeclaration , (';' asParser))
   1.458 +	
   1.459 +!
   1.460 +
   1.461 +interfaces
   1.462 +
   1.463 +	^(TokenParser for:#implements) , typeList
   1.464 +!
   1.465 +
   1.466 +isOperator
   1.467 +
   1.468 +	^(TokenParser for:#is) , (('!!' asParser) optional)
   1.469 +!
   1.470 +
   1.471 +iterationStatement
   1.472 +
   1.473 +	^ ((TokenParser for:#while) , ('(' asParser) , constantExpression , (')' asParser) , statement)
   1.474 +	/ ((TokenParser for:#do) , statement , (TokenParser for:#while) , ('(' asParser) , constantExpression , (')' asParser) , (';' asParser))
   1.475 +	/ ((TokenParser for:#for) , ('(' asParser) , forLoopParts , (')' asParser) , statement)
   1.476 +	
   1.477 +!
   1.478 +
   1.479 +label
   1.480 +
   1.481 +	^identifier , (':' asParser)
   1.482 +!
   1.483 +
   1.484 +libraryBody
   1.485 +
   1.486 +	^(libraryImport optional) , (librarySource optional)
   1.487 +!
   1.488 +
   1.489 +libraryDefinition
   1.490 +
   1.491 +	^(TokenParser for:#library) , ('{' asParser) , libraryBody , ('}' asParser)
   1.492 +!
   1.493 +
   1.494 +libraryImport
   1.495 +
   1.496 +	^(TokenParser for:#import) , ('=' asParser) , ('[' asParser) , (importReferences optional) , (']' asParser)
   1.497 +!
   1.498 +
   1.499 +librarySource
   1.500 +
   1.501 +	^(TokenParser for:#source) , ('=' asParser) , ('[' asParser) , (sourceUrls optional) , (']' asParser)
   1.502 +!
   1.503 +
   1.504 +libraryUnit
   1.505 +
   1.506 +        ^libraryDefinition end
   1.507 +
   1.508 +    "Modified: / 11-01-2013 / 10:07:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.509 +!
   1.510 +
   1.511 +listLiteral
   1.512 +
   1.513 +	^('[' asParser) , ((expressionList , ((',' asParser) optional)) optional) , (']' asParser)
   1.514 +!
   1.515 +
   1.516 +literal
   1.517 +
   1.518 +        ^ (TokenParser for: #null)
   1.519 +        / (TokenParser for: #true)
   1.520 +        / (TokenParser for: #false)
   1.521 +        / (TokenParser for: #number)
   1.522 +        / (TokenParser for:#string)
   1.523 +
   1.524 +    "Modified: / 11-01-2013 / 10:08:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.525 +!
   1.526 +
   1.527 +logicalAndExpression
   1.528 +
   1.529 +	^bitwiseOrExpression , ((('&&' asParser) , bitwiseOrExpression) star)
   1.530 +!
   1.531 +
   1.532 +logicalOrExpression
   1.533 +
   1.534 +	^logicalAndExpression , ((('||' asParser) , logicalAndExpression) star)
   1.535 +!
   1.536 +
   1.537 +mapLiteral
   1.538 +
   1.539 +	^('{' asParser) , ((mapLiteralEntry , (((',' asParser) , mapLiteralEntry) star) , ((',' asParser) optional)) optional) , ('}' asParser)
   1.540 +!
   1.541 +
   1.542 +mapLiteralEntry
   1.543 +
   1.544 +	^(TokenParser for:#string) , (':' asParser) , constantExpression
   1.545 +!
   1.546 +
   1.547 +methodDeclaration
   1.548 +
   1.549 +	^ factoryConstructorDeclaration
   1.550 +	/ ((TokenParser for:#static) , functionDeclaration)
   1.551 +	/ specialSignatureDefinition
   1.552 +	/ (functionDeclaration , (initializers optional))
   1.553 +	/ (namedConstructorDeclaration , (initializers optional))
   1.554 +	
   1.555 +!
   1.556 +
   1.557 +multiplicativeExpression
   1.558 +
   1.559 +	^ (unaryExpression , ((multiplicativeOperator , unaryExpression) star))
   1.560 +	/ ((TokenParser for:#super) , ((multiplicativeOperator , unaryExpression) plus))
   1.561 +	
   1.562 +!
   1.563 +
   1.564 +multiplicativeOperator
   1.565 +
   1.566 +	^ ('*' asParser)
   1.567 +	/ ('/' asParser)
   1.568 +	/ ('%' asParser)
   1.569 +	/ ('~/' asParser)
   1.570 +	
   1.571 +!
   1.572 +
   1.573 +namedArgument
   1.574 +
   1.575 +	^label , constantExpression
   1.576 +!
   1.577 +
   1.578 +namedConstructorDeclaration
   1.579 +
   1.580 +	^identifier , ('.' asParser) , identifier , formalParameterList
   1.581 +!
   1.582 +
   1.583 +namedFormalParameters
   1.584 +
   1.585 +	^('[' asParser) , defaultFormalParameter , (((',' asParser) , defaultFormalParameter) star) , (']' asParser)
   1.586 +!
   1.587 +
   1.588 +negateOperator
   1.589 +
   1.590 +	^ ('!!' asParser)
   1.591 +	/ ('~' asParser)
   1.592 +	
   1.593 +!
   1.594 +
   1.595 +nonLabelledStatement
   1.596 +
   1.597 +        ^ block
   1.598 +        / (initializedVariableDeclaration , (';' asParser))
   1.599 +        / iterationStatement
   1.600 +        / selectionStatement
   1.601 +        / tryStatement
   1.602 +        / ((TokenParser for: #break) , (identifier optional) , (';' asParser))
   1.603 +        / ((TokenParser for: #continue) , (identifier optional) , (';' asParser))
   1.604 +        / ((TokenParser for: #return) , (constantExpression optional) , (';' asParser))
   1.605 +        / ((TokenParser for: #throw) , (constantExpression optional) , (';' asParser))
   1.606 +        / ((constantExpression optional) , (';' asParser))
   1.607 +        / ((TokenParser for: #assert) , ('(' asParser) , conditionalExpression , (')' asParser) , (';' asParser))
   1.608 +        / (functionDeclaration , functionBody)
   1.609 +
   1.610 +    "Modified: / 11-01-2013 / 10:09:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.611 +!
   1.612 +
   1.613 +normalFormalParameter
   1.614 +
   1.615 +	^ functionDeclaration
   1.616 +	/ fieldFormalParameter
   1.617 +	/ simpleFormalParameter
   1.618 +	
   1.619 +!
   1.620 +
   1.621 +normalFormalParameterTail
   1.622 +
   1.623 +	^ ((',' asParser) , namedFormalParameters)
   1.624 +	/ ((',' asParser) , normalFormalParameter , (normalFormalParameterTail optional))
   1.625 +	
   1.626 +!
   1.627 +
   1.628 +postfixExpression
   1.629 +
   1.630 +	^ (assignableExpression , postfixOperator)
   1.631 +	/ (primary , (selector star))
   1.632 +	
   1.633 +!
   1.634 +
   1.635 +postfixOperator
   1.636 +
   1.637 +	^ ('++' asParser)
   1.638 +	/ ('--' asParser)
   1.639 +	
   1.640 +!
   1.641 +
   1.642 +prefixOperator
   1.643 +
   1.644 +	^ additiveOperator
   1.645 +	/ negateOperator
   1.646 +	
   1.647 +!
   1.648 +
   1.649 +primary
   1.650 +
   1.651 +	^ primaryNoFE
   1.652 +	/ primaryFE
   1.653 +	
   1.654 +!
   1.655 +
   1.656 +primaryFE
   1.657 +
   1.658 +	^ functionExpression
   1.659 +	/ primaryNoFE
   1.660 +	
   1.661 +!
   1.662 +
   1.663 +primaryNoFE
   1.664 +
   1.665 +        ^ (TokenParser for:#this)
   1.666 +        / ((TokenParser for:#super) , assignableSelector)
   1.667 +        / literal
   1.668 +        / identifier
   1.669 +        / (((TokenParser for:#const) optional) , (typeArguments optional) , compoundLiteral)
   1.670 +        / (((TokenParser for: #new) / (TokenParser for:#const) ) , type , ((('.' asParser) , identifier) optional) , arguments)
   1.671 +        / expressionInParentheses
   1.672 +
   1.673 +    "Modified: / 11-01-2013 / 10:09:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.674 +!
   1.675 +
   1.676 +qualified
   1.677 +
   1.678 +	^identifier , ((('.' asParser) , identifier) optional)
   1.679 +!
   1.680 +
   1.681 +redirection
   1.682 +
   1.683 +	^(':' asParser) , (TokenParser for:#this) , ((('.' asParser) , identifier) optional) , arguments
   1.684 +!
   1.685 +
   1.686 +relationalExpression
   1.687 +
   1.688 +	^ (shiftExpression , (((isOperator , type) / (relationalOperator , shiftExpression) ) optional))
   1.689 +	/ ((TokenParser for:#super) , relationalOperator , shiftExpression)
   1.690 +	
   1.691 +!
   1.692 +
   1.693 +relationalOperator
   1.694 +
   1.695 +	^ (('>' asParser) , ('=' asParser))
   1.696 +	/ ('>' asParser)
   1.697 +	/ ('<=' asParser)
   1.698 +	/ ('<' asParser)
   1.699 +	
   1.700 +!
   1.701 +
   1.702 +returnType
   1.703 +
   1.704 +        ^ (TokenParser for: #void)
   1.705 +        / type
   1.706 +
   1.707 +    "Modified: / 11-01-2013 / 10:09:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.708 +!
   1.709 +
   1.710 +selectionStatement
   1.711 +
   1.712 +        ^ ((TokenParser for: #if) , ('(' asParser) , constantExpression , (')' asParser) , statement , (((TokenParser for: #else) , statement) optional))
   1.713 +        / ((TokenParser for: #switch) , ('(' asParser) , constantExpression , (')' asParser) , ('{' asParser) , (switchCase star) , (defaultCase optional) , ('}' asParser))
   1.714 +
   1.715 +    "Modified: / 11-01-2013 / 10:10:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.716 +!
   1.717 +
   1.718 +selector
   1.719 +
   1.720 +	^ assignableSelector
   1.721 +	/ arguments
   1.722 +	
   1.723 +!
   1.724 +
   1.725 +shiftExpression
   1.726 +
   1.727 +	^ (additiveExpression , ((shiftOperator , additiveExpression) star))
   1.728 +	/ ((TokenParser for:#super) , ((shiftOperator , additiveExpression) plus))
   1.729 +	
   1.730 +!
   1.731 +
   1.732 +shiftOperator
   1.733 +
   1.734 +	^ ('<<' asParser)
   1.735 +	/ (('>' asParser) , ('>' asParser) , ('>' asParser))
   1.736 +	/ (('>' asParser) , ('>' asParser))
   1.737 +	
   1.738 +!
   1.739 +
   1.740 +simpleFormalParameter
   1.741 +
   1.742 +	^ declaredIdentifier
   1.743 +	/ identifier
   1.744 +	
   1.745 +!
   1.746 +
   1.747 +sourceUrls
   1.748 +
   1.749 +	^(TokenParser for:#string) , (((',' asParser) , (TokenParser for:#string)) star) , ((',' asParser) optional)
   1.750 +!
   1.751 +
   1.752 +specialSignatureDefinition
   1.753 +
   1.754 +        ^ (((TokenParser for:#static) optional) , (returnType optional) , getOrSet , identifier , formalParameterList)
   1.755 +        / ((returnType optional) , (TokenParser for: #operator) , userDefinableOperator , formalParameterList)
   1.756 +
   1.757 +    "Modified: / 11-01-2013 / 10:10:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.758 +!
   1.759 +
   1.760 +statement
   1.761 +
   1.762 +	^(label star) , nonLabelledStatement
   1.763 +!
   1.764 +
   1.765 +statements
   1.766 +
   1.767 +	^statement star
   1.768 +!
   1.769 +
   1.770 +staticFinalDeclaration
   1.771 +
   1.772 +	^identifier , ('=' asParser) , constantExpression
   1.773 +!
   1.774 +
   1.775 +staticFinalDeclarationList
   1.776 +
   1.777 +	^staticFinalDeclaration , (((',' asParser) , staticFinalDeclaration) star)
   1.778 +!
   1.779 +
   1.780 +superCallOrFieldInitializer
   1.781 +
   1.782 +	^ ((TokenParser for:#super) , arguments)
   1.783 +	/ ((TokenParser for:#super) , ('.' asParser) , identifier , arguments)
   1.784 +	/ fieldInitializer
   1.785 +	
   1.786 +!
   1.787 +
   1.788 +superclass
   1.789 +
   1.790 +        ^(TokenParser for: #extends) , type
   1.791 +
   1.792 +    "Modified: / 11-01-2013 / 10:10:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.793 +!
   1.794 +
   1.795 +superinterfaces
   1.796 +
   1.797 +        ^(TokenParser for: #extends) , typeList
   1.798 +
   1.799 +    "Modified: / 11-01-2013 / 10:10:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.800 +!
   1.801 +
   1.802 +switchCase
   1.803 +
   1.804 +	^(label optional) , (((TokenParser for:#case) , constantExpression , (':' asParser)) plus) , statements
   1.805 +!
   1.806 +
   1.807 +topLevelDefinition
   1.808 +
   1.809 +	^ classDefinition
   1.810 +	/ interfaceDefinition
   1.811 +	/ functionTypeAlias
   1.812 +	/ (functionDeclaration , functionBodyOrNative)
   1.813 +	/ ((returnType optional) , getOrSet , identifier , formalParameterList , functionBodyOrNative)
   1.814 +	/ ((TokenParser for:#final) , (type optional) , staticFinalDeclarationList , (';' asParser))
   1.815 +	/ (constInitializedVariableDeclaration , (';' asParser))
   1.816 +	
   1.817 +!
   1.818 +
   1.819 +tryStatement
   1.820 +
   1.821 +        ^(TokenParser for: #try) , block , (((catchPart plus) , (finallyPart optional)) / finallyPart )
   1.822 +
   1.823 +    "Modified: / 11-01-2013 / 10:10:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.824 +!
   1.825 +
   1.826 +type
   1.827 +
   1.828 +	^qualified , (typeArguments optional)
   1.829 +!
   1.830 +
   1.831 +typeArguments
   1.832 +
   1.833 +	^('<' asParser) , typeList , ('>' asParser)
   1.834 +!
   1.835 +
   1.836 +typeList
   1.837 +
   1.838 +	^type , (((',' asParser) , type) star)
   1.839 +!
   1.840 +
   1.841 +typeParameter
   1.842 +
   1.843 +        ^identifier , (((TokenParser for: #extends) , type) optional)
   1.844 +
   1.845 +    "Modified: / 11-01-2013 / 10:11:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.846 +!
   1.847 +
   1.848 +typeParameters
   1.849 +
   1.850 +	^('<' asParser) , typeParameter , (((',' asParser) , typeParameter) star) , ('>' asParser)
   1.851 +!
   1.852 +
   1.853 +unaryExpression
   1.854 +
   1.855 +	^ postfixExpression
   1.856 +	/ (prefixOperator , unaryExpression)
   1.857 +	/ (negateOperator , (TokenParser for:#super))
   1.858 +	/ (('-' asParser) , (TokenParser for:#super))
   1.859 +	/ (postfixOperator , assignableExpression)
   1.860 +	
   1.861 +!
   1.862 +
   1.863 +userDefinableOperator
   1.864 +
   1.865 +        ^ multiplicativeOperator
   1.866 +        / additiveOperator
   1.867 +        / shiftOperator
   1.868 +        / relationalOperator
   1.869 +        / bitwiseOperator
   1.870 +        / ('==' asParser)
   1.871 +        / ('~' asParser)
   1.872 +        / (TokenParser for: #negate)
   1.873 +        / (('[' asParser) , (']' asParser))
   1.874 +        / (('[' asParser) , (']' asParser) , ('=' asParser))
   1.875 +
   1.876 +    "Modified: / 11-01-2013 / 10:11:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.877 +!
   1.878 +
   1.879 +variableDeclaration
   1.880 +
   1.881 +	^declaredIdentifier , (((',' asParser) , identifier) star)
   1.882 +! !
   1.883 +
   1.884  !Parser::TokenParser class methodsFor:'instance creation'!
   1.885  
   1.886  for: tokenType
     2.1 --- a/compiler/compiler.rc	Thu Jan 10 13:21:04 2013 +0000
     2.2 +++ b/compiler/compiler.rc	Fri Jan 11 10:12:41 2013 +0000
     2.3 @@ -25,7 +25,7 @@
     2.4        VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
     2.5        VALUE "ProductName", "ProductName\0"
     2.6        VALUE "ProductVersion", "6.2.3.0\0"
     2.7 -      VALUE "ProductDate", "Thu, 10 Jan 2013 13:20:39 GMT\0"
     2.8 +      VALUE "ProductDate", "Fri, 11 Jan 2013 10:12:00 GMT\0"
     2.9      END
    2.10  
    2.11    END