--- a/SmaCC__CScanner.st Tue Sep 23 09:33:07 2008 +0000
+++ b/SmaCC__CScanner.st Tue Nov 18 19:09:05 2008 +0000
@@ -14,41 +14,78 @@
scannerDefinitionComment
- "<H>: [a-fA-F0-9] ;
-<IS>: [uUlL] ;
-<D>: [0-9] ;
-<E>: [Ee][\+\-]?<D>+ ;
-<FS>: [fFlL] ;
+ "<H>: [a-fA-F0-9] ;
+<IS>: [uUlL] ;
+<D>: [0-9] ;
+<E>: [Ee][\+\-]?<D>+ ;
+<FS>: [fFlL] ;
<ELLIPSIS> : \.\.\. ;
-<comment>: \/ \* ;
+<comment>: \/ \* ;
<LETTER> : [a-zA-Z_] ;
<DIGIT> : [0-9] ;
-<IDENTIFIER>: <LETTER> (<LETTER>|<DIGIT>)* ;
+<IDENTIFIER>: <LETTER> (<LETTER>|<DIGIT>)* ;
<CONSTANT>: (0[xX]<H>+<IS>?) |
- (<D>+<IS>?) |
- (<D>+<E><FS>?) |
- <D>*\.<D>+<E>?<FS>? |
- (L? \' ( (\\ .) | ([^\\\""]) )+ \') ;
+ (<D>+<IS>?) |
+ (<D>+<E><FS>?) |
+ <D>*\.<D>+<E>?<FS>? |
+ (L? \' ( (\\ .) | ([^\\\""]) )+ \') ;
+
+<STRING_LITERAL>: L? \"" ( (\\ .) | ([^\\\""]) )* \"" ;
-<STRING_LITERAL>: L? \"" ( (\\ .) | ([^\\\""]) )* \"" ;
+<LEFT_BLOCK>: \[ | (\< \:) ;
+<RIGHT_BLOCK>: \] | (\: \>) ;
+<LEFT_BRACE>: \{ | (\< \%) ;
+<RIGHT_BRACE>: \} | (\% \>) ;
-<LEFT_BLOCK>: \[ | (\< \:) ;
-<RIGHT_BLOCK>: \] | (\: \>) ;
-<LEFT_BRACE>: \{ | (\< \%) ;
-<RIGHT_BRACE>: \} | (\% \>) ;
+<whitespace>: \s+ ;
+"
-<whitespace>: \s+ ;"
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
!CScanner class methodsFor:'generated-initialization'!
initializeKeywordMap
- keywordMap := Dictionary new.
- #(#(#IDENTIFIER 'auto' 62) #(#IDENTIFIER 'break' 37) #(#IDENTIFIER 'case' 45) #(#IDENTIFIER 'char' 67) #(#IDENTIFIER 'const' 38) #(#IDENTIFIER 'continue' 49) #(#IDENTIFIER 'default' 41) #(#IDENTIFIER 'do' 48) #(#IDENTIFIER 'double' 52) #(#IDENTIFIER 'else' 43) #(#IDENTIFIER 'enum' 42) #(#IDENTIFIER 'extern' 60) #(#IDENTIFIER 'float' 71) #(#IDENTIFIER 'for' 47) #(#IDENTIFIER 'goto' 50) #(#IDENTIFIER 'if' 51) #(#IDENTIFIER 'int' 69) #(#IDENTIFIER 'long' 68) #(#IDENTIFIER 'register' 73) #(#IDENTIFIER 'return' 65) #(#IDENTIFIER 'short' 66) #(#IDENTIFIER 'signed' 46) #(#IDENTIFIER 'sizeof' 32) #(#IDENTIFIER 'static' 70) #(#IDENTIFIER 'struct' 44) #(#IDENTIFIER 'switch' 54) #(#IDENTIFIER 'typedef' 64) #(#IDENTIFIER 'union' 39) #(#IDENTIFIER 'unsigned' 55) #(#IDENTIFIER 'void' 72) #(#IDENTIFIER 'volatile' 40) #(#IDENTIFIER 'while' 53))
- do:
- [:each |
- (keywordMap at: each first ifAbsentPut: [Dictionary new]) at: (each at: 2) put: each last].
- ^keywordMap
+ keywordMap := Dictionary new.
+ #( #(IDENTIFIER 'auto' 65)
+ #(IDENTIFIER 'break' 48)
+ #(IDENTIFIER 'case' 38)
+ #(IDENTIFIER 'char' 73)
+ #(IDENTIFIER 'const' 40)
+ #(IDENTIFIER 'continue' 47)
+ #(IDENTIFIER 'default' 39)
+ #(IDENTIFIER 'do' 54)
+ #(IDENTIFIER 'double' 70)
+ #(IDENTIFIER 'else' 46)
+ #(IDENTIFIER 'enum' 45)
+ #(IDENTIFIER 'extern' 58)
+ #(IDENTIFIER 'float' 67)
+ #(IDENTIFIER 'for' 49)
+ #(IDENTIFIER 'goto' 50)
+ #(IDENTIFIER 'if' 42)
+ #(IDENTIFIER 'int' 69)
+ #(IDENTIFIER 'long' 66)
+ #(IDENTIFIER 'register' 71)
+ #(IDENTIFIER 'return' 56)
+ #(IDENTIFIER 'short' 68)
+ #(IDENTIFIER 'signed' 51)
+ #(IDENTIFIER 'sizeof' 24)
+ #(IDENTIFIER 'static' 61)
+ #(IDENTIFIER 'struct' 43)
+ #(IDENTIFIER 'switch' 52)
+ #(IDENTIFIER 'typedef' 57)
+ #(IDENTIFIER 'union' 44)
+ #(IDENTIFIER 'unsigned' 55)
+ #(IDENTIFIER 'void' 72)
+ #(IDENTIFIER 'volatile' 41)
+ #(IDENTIFIER 'while' 53) )
+ do:[:each |
+ (keywordMap at:each first ifAbsentPut:[ Dictionary new ]) at:(each at:2)
+ put:each last
+ ].
+ ^ keywordMap
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
!CScanner class methodsFor:'public'!
@@ -72,324 +109,498 @@
!CScanner methodsFor:'generated-scanner'!
scan1
- self step.
- currentCharacter isDigit ifTrue: [^self scan2].
- ^self reportLastMatch
+ [
+ self recordMatch:#( 77 ).
+ self step.
+ (currentCharacter isXMLDigit)
+ ] whileTrue.
+ (currentCharacter == $F
+ or:[
+ currentCharacter == $L
+ or:[ currentCharacter == $f or:[ currentCharacter == $l ] ]
+ ])
+ ifTrue:[ ^ self recordAndReportMatch:#( 77 ). ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
scan2
-
- [self recordMatch: #(77).
- self step.
- currentCharacter isDigit] whileTrue.
- (currentCharacter == $F
- or: [currentCharacter == $L or: [currentCharacter == $f or: [currentCharacter == $l]]])
- ifTrue: [^self recordAndReportMatch: #(77)].
- (currentCharacter == $E or: [currentCharacter == $e]) ifTrue: [^self scan3].
- ^self reportLastMatch
+ self step.
+ (currentCharacter isXMLDigit) ifTrue:[
+ ^ self scan3
+ ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
scan3
- self step.
- currentCharacter isDigit ifTrue: [^self scan4].
- (currentCharacter == $+ or: [currentCharacter == $-])
- ifTrue:
- [self step.
- currentCharacter isDigit ifTrue: [^self scan4].
- ^self reportLastMatch].
- ^self reportLastMatch
+ [
+ self recordMatch:#( 77 ).
+ self step.
+ (currentCharacter isXMLDigit)
+ ] whileTrue.
+ (currentCharacter == $F
+ or:[
+ currentCharacter == $L
+ or:[ currentCharacter == $f or:[ currentCharacter == $l ] ]
+ ])
+ ifTrue:[ ^ self recordAndReportMatch:#( 77 ). ].
+ (currentCharacter == $E or:[ currentCharacter == $e ]) ifTrue:[
+ ^ self scan4
+ ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
scan4
-
- [self recordMatch: #(77).
- self step.
- currentCharacter isDigit] whileTrue.
- (currentCharacter == $F
- or: [currentCharacter == $L or: [currentCharacter == $f or: [currentCharacter == $l]]])
- ifTrue: [^self recordAndReportMatch: #(77)].
- ^self reportLastMatch
+ self step.
+ (currentCharacter isXMLDigit) ifTrue:[
+ ^ self scan1
+ ].
+ (currentCharacter == $+ or:[ currentCharacter == $- ]) ifTrue:[
+ self step.
+ (currentCharacter isXMLDigit) ifTrue:[
+ ^ self scan1
+ ].
+ ^ self reportLastMatch
+ ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
scan5
- self step.
- (currentCharacter <= $!!
- or: [(currentCharacter between: $# and: $[) or: [currentCharacter >= $]]])
- ifTrue: [^self scan7].
- currentCharacter == $\ ifTrue: [^self scan6].
- ^self reportLastMatch
+ self step.
+ (currentCharacter <= $!!
+ or:[ (currentCharacter between:$# and:$[) or:[ currentCharacter >= $] ] ])
+ ifTrue:[ ^ self scan6 ].
+ (currentCharacter == $\) ifTrue:[
+ ^ self scan7
+ ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
scan6
- self step.
- ^self scan7
+ [
+ self step.
+ (currentCharacter <= $!!
+ or:[
+ (currentCharacter between:$# and:$&)
+ or:[ (currentCharacter between:$( and:$[) or:[ currentCharacter >= $] ] ]
+ ])
+ ] whileTrue.
+ (currentCharacter == $') ifTrue:[
+ [
+ self recordMatch:#( 77 ).
+ self step.
+ (currentCharacter <= $!!
+ or:[
+ (currentCharacter between:$# and:$&)
+ or:[ (currentCharacter between:$( and:$[) or:[ currentCharacter >= $] ] ]
+ ])
+ ifTrue:[ ^ self scan6 ].
+ (currentCharacter == $')
+ ] whileTrue.
+ (currentCharacter == $\) ifTrue:[
+ ^ self scan7
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $\) ifTrue:[
+ ^ self scan7
+ ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
scan7
-
- [self step.
- currentCharacter <= $!! or:
- [(currentCharacter between: $# and: $&)
- or: [(currentCharacter between: $( and: $[) or: [currentCharacter >= $]]]]]
- whileTrue.
- currentCharacter == $'
- ifTrue:
- [
- [self recordMatch: #(77).
- self step.
- (currentCharacter <= $!! or:
- [(currentCharacter between: $# and: $&)
- or: [(currentCharacter between: $( and: $[) or: [currentCharacter >= $]]]])
- ifTrue: [^self scan7].
- currentCharacter == $']
- whileTrue.
- currentCharacter == $\ ifTrue: [^self scan6].
- ^self reportLastMatch].
- currentCharacter == $\ ifTrue: [^self scan6].
- ^self reportLastMatch
+ self step.
+ (currentCharacter isImmediate) ifTrue:[
+ ^ self scan6
+ ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
scan8
-
- [
- [self step.
- currentCharacter <= $!!
- or: [(currentCharacter between: $# and: $[) or: [currentCharacter >= $]]]]
- whileTrue.
- currentCharacter == $" ifTrue: [^self recordAndReportMatch: #(78)].
- currentCharacter == $\]
- whileTrue: [self step].
- ^self reportLastMatch
+ [
+ self step.
+ (currentCharacter <= $!!
+ or:[ (currentCharacter between:$# and:$[) or:[ currentCharacter >= $] ] ])
+ ] whileTrue.
+ (currentCharacter == $") ifTrue:[
+ ^ self recordAndReportMatch:#( 78 ).
+ ].
+ (currentCharacter == $\) ifTrue:[
+ self step.
+ (currentCharacter isImmediate) ifTrue:[
+ ^ self scan8
+ ].
+ ^ self reportLastMatch
+ ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
scan9
-
- [self recordMatch: #(77).
- self step.
- currentCharacter isDigit] whileTrue.
- (currentCharacter == $L
- or: [currentCharacter == $U or: [currentCharacter == $l or: [currentCharacter == $u]]])
- ifTrue: [^self recordAndReportMatch: #(77)].
- (currentCharacter == $E or: [currentCharacter == $e]) ifTrue: [^self scan3].
- currentCharacter == $. ifTrue: [^self scan1].
- ^self reportLastMatch
+ [
+ self recordMatch:#( 77 ).
+ self step.
+ (currentCharacter isXMLDigit)
+ ] whileTrue.
+ (currentCharacter == $L
+ or:[
+ currentCharacter == $U
+ or:[ currentCharacter == $l or:[ currentCharacter == $u ] ]
+ ])
+ ifTrue:[ ^ self recordAndReportMatch:#( 77 ). ].
+ (currentCharacter == $E or:[ currentCharacter == $e ]) ifTrue:[
+ ^ self scan4
+ ].
+ (currentCharacter == $.) ifTrue:[
+ ^ self scan2
+ ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
scanForToken
- self step.
- ((currentCharacter between: $A and: $K) or:
- [(currentCharacter between: $M and: $Z)
- or: [currentCharacter == $_ or: [currentCharacter between: $a and: $z]]])
- ifTrue:
- [
- [self recordMatch: #IDENTIFIER.
- self step.
- currentCharacter isHexDigit or:
- [(currentCharacter between: $G and: $Z)
- or: [currentCharacter == $_ or: [currentCharacter between: $a and: $z]]]]
- whileTrue.
- ^self reportLastMatch].
- (currentCharacter between: $1 and: $9) ifTrue: [^self scan9].
- ((currentCharacter between: $ and: $
-) or: [currentCharacter == $ ])
- ifTrue:
- [
- [self recordMatch: #whitespace.
- self step.
- (currentCharacter between: $ and: $
-) or: [currentCharacter == $ ]]
- whileTrue.
- ^self reportLastMatch].
- currentCharacter == $!!
- ifTrue:
- [self recordMatch: #(31).
- self step.
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(3)].
- ^self reportLastMatch].
- currentCharacter == $" ifTrue: [^self scan8].
- currentCharacter == $%
- ifTrue:
- [self recordMatch: #(13).
- self step.
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(36)].
- currentCharacter == $> ifTrue: [^self recordAndReportMatch: #(82)].
- ^self reportLastMatch].
- currentCharacter == $&
- ifTrue:
- [self recordMatch: #(24).
- self step.
- currentCharacter == $& ifTrue: [^self recordAndReportMatch: #(6)].
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(58)].
- ^self reportLastMatch].
- currentCharacter == $' ifTrue: [^self scan5].
- currentCharacter == $( ifTrue: [^self recordAndReportMatch: #(25)].
- currentCharacter == $) ifTrue: [^self recordAndReportMatch: #(20)].
- currentCharacter == $*
- ifTrue:
- [self recordMatch: #(35).
- self step.
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(10)].
- ^self reportLastMatch].
- currentCharacter == $+
- ifTrue:
- [self recordMatch: #(34).
- self step.
- currentCharacter == $+ ifTrue: [^self recordAndReportMatch: #(21)].
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(18)].
- ^self reportLastMatch].
- currentCharacter == $, ifTrue: [^self recordAndReportMatch: #(22)].
- currentCharacter == $-
- ifTrue:
- [self recordMatch: #(29).
- self step.
- currentCharacter == $- ifTrue: [^self recordAndReportMatch: #(26)].
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(56)].
- currentCharacter == $> ifTrue: [^self recordAndReportMatch: #(19)].
- ^self reportLastMatch].
- currentCharacter == $.
- ifTrue:
- [self recordMatch: #(23).
- self step.
- currentCharacter isDigit ifTrue: [^self scan2].
- currentCharacter == $.
- ifTrue:
- [self step.
- currentCharacter == $. ifTrue: [^self recordAndReportMatch: #(74)].
- ^self reportLastMatch].
- ^self reportLastMatch].
- currentCharacter == $/
- ifTrue:
- [self recordMatch: #(30).
- self step.
- currentCharacter == $* ifTrue: [^self recordAndReportMatch: #comment].
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(12)].
- ^self reportLastMatch].
- currentCharacter == $0
- ifTrue:
- [self recordMatch: #(77).
- self step.
- currentCharacter isDigit ifTrue: [^self scan9].
- (currentCharacter == $L
- or: [currentCharacter == $U or: [currentCharacter == $l or: [currentCharacter == $u]]])
- ifTrue: [^self recordAndReportMatch: #(77)].
- (currentCharacter == $E or: [currentCharacter == $e]) ifTrue: [^self scan3].
- (currentCharacter == $X or: [currentCharacter == $x])
- ifTrue:
- [self step.
- (currentCharacter isHexDigit or: [currentCharacter between: $a and: $f])
- ifTrue:
- [
- [self recordMatch: #(77).
- self step.
- currentCharacter isHexDigit or: [currentCharacter between: $a and: $f]]
- whileTrue.
- (currentCharacter == $L
- or: [currentCharacter == $U or: [currentCharacter == $l or: [currentCharacter == $u]]])
- ifTrue: [^self recordAndReportMatch: #(77)].
- ^self reportLastMatch].
- ^self reportLastMatch].
- currentCharacter == $. ifTrue: [^self scan1].
- ^self reportLastMatch].
- currentCharacter == $:
- ifTrue:
- [self recordMatch: #(11).
- self step.
- currentCharacter == $> ifTrue: [^self recordAndReportMatch: #(80)].
- ^self reportLastMatch].
- currentCharacter == $; ifTrue: [^self recordAndReportMatch: #(59)].
- currentCharacter == $<
- ifTrue:
- [self recordMatch: #(17).
- self step.
- currentCharacter == $% ifTrue: [^self recordAndReportMatch: #(81)].
- currentCharacter == $: ifTrue: [^self recordAndReportMatch: #(79)].
- currentCharacter == $<
- ifTrue:
- [self recordMatch: #(27).
- self step.
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(33)].
- ^self reportLastMatch].
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(2)].
- ^self reportLastMatch].
- currentCharacter == $=
- ifTrue:
- [self recordMatch: #(14).
- self step.
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(1)].
- ^self reportLastMatch].
- currentCharacter == $>
- ifTrue:
- [self recordMatch: #(7).
- self step.
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(5)].
- currentCharacter == $>
- ifTrue:
- [self recordMatch: #(9).
- self step.
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(63)].
- ^self reportLastMatch].
- ^self reportLastMatch].
- currentCharacter == $? ifTrue: [^self recordAndReportMatch: #(16)].
- currentCharacter == $L
- ifTrue:
- [self recordMatch: #IDENTIFIER.
- self step.
- (currentCharacter isHexDigit or:
- [(currentCharacter between: $G and: $Z)
- or: [currentCharacter == $_ or: [currentCharacter between: $a and: $z]]])
- ifTrue:
- [
- [self recordMatch: #IDENTIFIER.
- self step.
- currentCharacter isHexDigit or:
- [(currentCharacter between: $G and: $Z)
- or: [currentCharacter == $_ or: [currentCharacter between: $a and: $z]]]]
- whileTrue.
- ^self reportLastMatch].
- currentCharacter == $" ifTrue: [^self scan8].
- currentCharacter == $' ifTrue: [^self scan5].
- ^self reportLastMatch].
- currentCharacter == $[ ifTrue: [^self recordAndReportMatch: #(79)].
- currentCharacter == $] ifTrue: [^self recordAndReportMatch: #(80)].
- currentCharacter == $^
- ifTrue:
- [self recordMatch: #(8).
- self step.
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(61)].
- ^self reportLastMatch].
- currentCharacter == ${ ifTrue: [^self recordAndReportMatch: #(81)].
- currentCharacter == $|
- ifTrue:
- [self recordMatch: #(4).
- self step.
- currentCharacter == $= ifTrue: [^self recordAndReportMatch: #(57)].
- currentCharacter == $| ifTrue: [^self recordAndReportMatch: #(15)].
- ^self reportLastMatch].
- currentCharacter == $} ifTrue: [^self recordAndReportMatch: #(82)].
- currentCharacter == $~ ifTrue: [^self recordAndReportMatch: #(28)].
- ^self reportLastMatch
+ self step.
+ ((currentCharacter between:$A and:$K)
+ or:[
+ (currentCharacter between:$M and:$Z)
+ or:[ currentCharacter == $_ or:[ (currentCharacter between:$a and:$z) ] ]
+ ])
+ ifTrue:[
+ [
+ self recordMatch:#IDENTIFIER.
+ self step.
+ (currentCharacter isLetterOrDigit or:[ currentCharacter == $_ ])
+ ] whileTrue.
+ ^ self reportLastMatch
+ ].
+ (currentCharacter between:$1 and:$9) ifTrue:[
+ ^ self scan9
+ ].
+ (currentCharacter isSeparator
+ or:[ currentCharacter == (Character codePoint:16rB) ])
+ ifTrue:[
+ [
+ self recordMatch:#whitespace.
+ self step.
+ (currentCharacter isSeparator
+ or:[ currentCharacter == (Character codePoint:16rB) ])
+ ] whileTrue.
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $!!) ifTrue:[
+ self recordMatch:#( 32 ).
+ self step.
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 4 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $") ifTrue:[
+ ^ self scan8
+ ].
+ (currentCharacter == $%) ifTrue:[
+ self recordMatch:#( 30 ).
+ self step.
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 10 ).
+ ].
+ (currentCharacter == $>) ifTrue:[
+ ^ self recordAndReportMatch:#( 82 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $&) ifTrue:[
+ self recordMatch:#( 28 ).
+ self step.
+ (currentCharacter == $&) ifTrue:[
+ ^ self recordAndReportMatch:#( 5 ).
+ ].
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 63 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $') ifTrue:[
+ ^ self scan5
+ ].
+ (currentCharacter == $() ifTrue:[
+ ^ self recordAndReportMatch:#( 25 ).
+ ].
+ (currentCharacter == $)) ifTrue:[
+ ^ self recordAndReportMatch:#( 26 ).
+ ].
+ (currentCharacter == $*) ifTrue:[
+ self recordMatch:#( 34 ).
+ self step.
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 12 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $+) ifTrue:[
+ self recordMatch:#( 35 ).
+ self step.
+ (currentCharacter == $+) ifTrue:[
+ ^ self recordAndReportMatch:#( 23 ).
+ ].
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 11 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $,) ifTrue:[
+ ^ self recordAndReportMatch:#( 21 ).
+ ].
+ (currentCharacter == $-) ifTrue:[
+ self recordMatch:#( 36 ).
+ self step.
+ (currentCharacter == $-) ifTrue:[
+ ^ self recordAndReportMatch:#( 20 ).
+ ].
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 19 ).
+ ].
+ (currentCharacter == $>) ifTrue:[
+ ^ self recordAndReportMatch:#( 22 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $.) ifTrue:[
+ self recordMatch:#( 27 ).
+ self step.
+ (currentCharacter isXMLDigit) ifTrue:[
+ ^ self scan3
+ ].
+ (currentCharacter == $.) ifTrue:[
+ self step.
+ (currentCharacter == $.) ifTrue:[
+ ^ self recordAndReportMatch:#( 74 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $/) ifTrue:[
+ self recordMatch:#( 29 ).
+ self step.
+ (currentCharacter == $*) ifTrue:[
+ ^ self recordAndReportMatch:#comment.
+ ].
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 13 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $0) ifTrue:[
+ self recordMatch:#( 77 ).
+ self step.
+ (currentCharacter isXMLDigit) ifTrue:[
+ ^ self scan9
+ ].
+ (currentCharacter == $L
+ or:[
+ currentCharacter == $U
+ or:[ currentCharacter == $l or:[ currentCharacter == $u ] ]
+ ])
+ ifTrue:[ ^ self recordAndReportMatch:#( 77 ). ].
+ (currentCharacter == $E or:[ currentCharacter == $e ]) ifTrue:[
+ ^ self scan4
+ ].
+ (currentCharacter == $X or:[ currentCharacter == $x ]) ifTrue:[
+ self step.
+ (currentCharacter isXMLDigit
+ or:[
+ (currentCharacter between:$A and:$F)
+ or:[ (currentCharacter between:$a and:$f) ]
+ ])
+ ifTrue:[
+ [
+ self recordMatch:#( 77 ).
+ self step.
+ (currentCharacter isXMLDigit
+ or:[
+ (currentCharacter between:$A and:$F)
+ or:[ (currentCharacter between:$a and:$f) ]
+ ])
+ ] whileTrue.
+ (currentCharacter == $L
+ or:[
+ currentCharacter == $U
+ or:[ currentCharacter == $l or:[ currentCharacter == $u ] ]
+ ])
+ ifTrue:[ ^ self recordAndReportMatch:#( 77 ). ].
+ ^ self reportLastMatch
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $.) ifTrue:[
+ ^ self scan2
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $:) ifTrue:[
+ self recordMatch:#( 16 ).
+ self step.
+ (currentCharacter == $>) ifTrue:[
+ ^ self recordAndReportMatch:#( 80 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $;) ifTrue:[
+ ^ self recordAndReportMatch:#( 60 ).
+ ].
+ (currentCharacter == $<) ifTrue:[
+ self recordMatch:#( 18 ).
+ self step.
+ (currentCharacter == $%) ifTrue:[
+ ^ self recordAndReportMatch:#( 81 ).
+ ].
+ (currentCharacter == $:) ifTrue:[
+ ^ self recordAndReportMatch:#( 79 ).
+ ].
+ (currentCharacter == $<) ifTrue:[
+ self recordMatch:#( 33 ).
+ self step.
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 37 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 7 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $=) ifTrue:[
+ self recordMatch:#( 17 ).
+ self step.
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 3 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $>) ifTrue:[
+ self recordMatch:#( 6 ).
+ self step.
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 8 ).
+ ].
+ (currentCharacter == $>) ifTrue:[
+ self recordMatch:#( 14 ).
+ self step.
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 62 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $?) ifTrue:[
+ ^ self recordAndReportMatch:#( 15 ).
+ ].
+ (currentCharacter == $L) ifTrue:[
+ self recordMatch:#IDENTIFIER.
+ self step.
+ (currentCharacter isLetterOrDigit or:[ currentCharacter == $_ ]) ifTrue:[
+ [
+ self recordMatch:#IDENTIFIER.
+ self step.
+ (currentCharacter isLetterOrDigit or:[ currentCharacter == $_ ])
+ ] whileTrue.
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $") ifTrue:[
+ ^ self scan8
+ ].
+ (currentCharacter == $') ifTrue:[
+ ^ self scan5
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $[) ifTrue:[
+ ^ self recordAndReportMatch:#( 79 ).
+ ].
+ (currentCharacter == $]) ifTrue:[
+ ^ self recordAndReportMatch:#( 80 ).
+ ].
+ (currentCharacter == $^) ifTrue:[
+ self recordMatch:#( 1 ).
+ self step.
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 64 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == ${) ifTrue:[
+ ^ self recordAndReportMatch:#( 81 ).
+ ].
+ (currentCharacter == $|) ifTrue:[
+ self recordMatch:#( 2 ).
+ self step.
+ (currentCharacter == $=) ifTrue:[
+ ^ self recordAndReportMatch:#( 59 ).
+ ].
+ (currentCharacter == $|) ifTrue:[
+ ^ self recordAndReportMatch:#( 9 ).
+ ].
+ ^ self reportLastMatch
+ ].
+ (currentCharacter == $}) ifTrue:[
+ ^ self recordAndReportMatch:#( 82 ).
+ ].
+ (currentCharacter == $~) ifTrue:[
+ ^ self recordAndReportMatch:#( 31 ).
+ ].
+ ^ self reportLastMatch
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
!CScanner methodsFor:'generated-tokens'!
CONSTANTId
^77
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
IDENTIFIERId
^76
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
TYPE_NAMEId
- ^131
+ ^132
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
emptySymbolTokenId
- ^146
+ ^147
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
!
errorTokenId
- ^147
+ ^148
+
+ "Modified: / 18-11-2008 / 13:47:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !
!CScanner methodsFor:'initialize-release'!