parsers/java/PPJavaLexicon.st
changeset 436 e1c44b571db9
parent 435 3bc08fb90133
child 437 54b3bc9e3987
equal deleted inserted replaced
435:3bc08fb90133 436:e1c44b571db9
    30 Grammar rules follow as closely as possible the specification found in "The Java Language Specification Third Edition"
    30 Grammar rules follow as closely as possible the specification found in "The Java Language Specification Third Edition"
    31 
    31 
    32 URL = '
    32 URL = '
    33 !
    33 !
    34 
    34 
       
    35 
    35 !PPJavaLexicon class methodsFor:'accessing'!
    36 !PPJavaLexicon class methodsFor:'accessing'!
    36 
    37 
    37 ignoredNames
    38 ignoredNames
    38 	"Answer a collection of instance-variables that should not be automatically initialized with productions, but that are used internal to the composite parser."
    39 	"Answer a collection of instance-variables that should not be automatically initialized with productions, but that are used internal to the composite parser."
    39 
    40 
   161 
   162 
   162 !PPJavaLexicon methodsFor:'grammar-keywords'!
   163 !PPJavaLexicon methodsFor:'grammar-keywords'!
   163 
   164 
   164 keyword
   165 keyword
   165 
   166 
   166 	| keywordParsers |
   167         | keywordParsers |
   167 	
   168         
   168 	keywordParsers := keywords keysSortedSafely 
   169         keywordParsers := keywords keys asSortedCollection collect: [:eachKey | keywords at: eachKey ].
   169 								collect: [:eachKey | keywords at: eachKey ].
   170         ^ self asToken: ( (keywordParsers reduce: [ :a :b | a / b ]) )
   170 	^ self asToken: ( (keywordParsers reduce: [ :a :b | a / b ]) )
   171 
       
   172     "Modified (format): / 21-04-2015 / 15:27:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   171 ! !
   173 ! !
   172 
   174 
   173 !PPJavaLexicon methodsFor:'grammar-lineTerminators'!
   175 !PPJavaLexicon methodsFor:'grammar-lineTerminators'!
   174 
   176 
   175 inputCharacter 
   177 inputCharacter 
   177 	^(lineTerminator not) , unicodeInputCharacter ==> #second
   179 	^(lineTerminator not) , unicodeInputCharacter ==> #second
   178 !
   180 !
   179 
   181 
   180 lineTerminator
   182 lineTerminator
   181 
   183 
   182 	^ (Character lf asParser) / (Character cr asParser , (Character lf asParser ) optional )
   184         ^ ((Character codePoint: 10)   asParser) / ((Character codePoint: 13) asParser , ((Character codePoint: 10) asParser ) optional )
       
   185 
       
   186     "Modified: / 21-04-2015 / 16:55:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   183 ! !
   187 ! !
   184 
   188 
   185 !PPJavaLexicon methodsFor:'grammar-literals'!
   189 !PPJavaLexicon methodsFor:'grammar-literals'!
   186 
   190 
   187 literal
   191 literal
   403 ! !
   407 ! !
   404 
   408 
   405 !PPJavaLexicon methodsFor:'grammar-operators'!
   409 !PPJavaLexicon methodsFor:'grammar-operators'!
   406 
   410 
   407 operator
   411 operator
   408 	| operatorParsers |
   412         | operatorParsers |
   409 	
   413         
   410 	operatorParsers := operators keysSortedSafely 
   414         operatorParsers := operators keys asSortedCollection collect: [:eachKey | operators at: eachKey ].                                                
   411 								collect: [:eachKey | operators at: eachKey ].
   415         ^self asToken:  (operatorParsers reduce: [ :a :b | a / b ])
   412 						
   416 
   413 	^self asToken:  (operatorParsers reduce: [ :a :b | a / b ]) 
   417     "Modified: / 21-04-2015 / 15:26:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   414 ! !
   418 ! !
   415 
   419 
   416 !PPJavaLexicon methodsFor:'grammar-separators'!
   420 !PPJavaLexicon methodsFor:'grammar-separators'!
   417 
   421 
   418 separator	
   422 separator	
   533 	^self asToken: (keywords at: aString 
   537 	^self asToken: (keywords at: aString 
   534 						ifAbsent: [separators at: aString 
   538 						ifAbsent: [separators at: aString 
   535 							ifAbsent: [operators at: aString] ])
   539 							ifAbsent: [operators at: aString] ])
   536 ! !
   540 ! !
   537 
   541 
       
   542 !PPJavaLexicon class methodsFor:'documentation'!
       
   543 
       
   544 version_HG
       
   545 
       
   546     ^ '$Changeset: <not expanded> $'
       
   547 ! !
       
   548