SmaCC__SmaCCGrammarScanner.st
author vranyj1
Mon, 10 Sep 2012 09:07:46 +0000
changeset 23 11ad79f459e6
parent 16 55254a6f8404
permissions -rw-r--r--
- stx_goodies_smaCC added: #svnRepositoryUrlString changed: #classNamesAndAttributes #extensionMethodNames #preRequisites - SmaCC::SmaCCRHS changed: #parseTreeRewriter
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
     1
"{ Package: 'stx:goodies/smaCC' }"
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
     2
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
     3
"{ NameSpace: SmaCC }"
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
     4
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
     5
SmaCCScanner subclass:#SmaCCGrammarScanner
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
     6
	instanceVariableNames:''
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
     7
	classVariableNames:''
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
     8
	poolDictionaries:''
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
     9
	category:'SmaCC-Parser Generator'
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    10
!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    11
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    12
SmaCCGrammarScanner comment:'SmaCCGrammarScanner is the scanner for the grammar parser'
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    13
!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    14
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    15
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    16
!SmaCCGrammarScanner class methodsFor:'generated-comments'!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    17
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    18
scannerDefinitionComment
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    19
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    20
	"<name> : [a-zA-Z_] \w* ;
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    21
<whitespace>    :       \s+ ;
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    22
<tokenname>     :       \< <name> \> ;
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    23
<symbolname>    :       <name>   ;
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    24
<keyword>       :       (\"" [^\""]* \"") + ;
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    25
<comment>       :       \# [^\r\n]* ;
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    26
<code>: \{ [^\}]+ \} ;
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    27
<variablename> :        \' <name> \' ;
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    28
<production> : \: (\: \=)? ;
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    29
"
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    30
! !
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    31
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    32
!SmaCCGrammarScanner class methodsFor:'generated-initialization'!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    33
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    34
initializeKeywordMap
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    35
    keywordMap := Dictionary new.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    36
    #( #(20 'error' 16) ) do:[:each | 
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    37
        (keywordMap at:each first ifAbsentPut:[ Dictionary new ]) at:(each at:2)
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    38
            put:each last
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    39
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    40
    ^ keywordMap
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    41
! !
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    42
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    43
!SmaCCGrammarScanner class methodsFor:'public'!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    44
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    45
needsLineNumbers
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    46
	^true
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    47
! !
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    48
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    49
!SmaCCGrammarScanner methodsFor:'generated-scanner'!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    50
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    51
keywordFor: aString 
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    52
	^aString asUppercase
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    53
!
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    54
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    55
scan1
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    56
    [
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    57
        [
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    58
            self step.
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    59
            currentCharacter ~~ $"
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    60
        ] whileTrue.
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    61
        self recordMatch:#( 21 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    62
        self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    63
        (currentCharacter == $")
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    64
    ] whileTrue:[].
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    65
    ^ self reportLastMatch
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    66
!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    67
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
    68
scan2
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    69
    self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    70
    (currentCharacter == $>) ifTrue:[
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    71
        ^ self recordAndReportMatch:#( 10 ).
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    72
    ].
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    73
    (currentCharacter == $i) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    74
        self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    75
        (currentCharacter == $d) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    76
            ^ self recordAndReportMatch:#( 4 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    77
        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    78
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    79
    ].
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    80
    (currentCharacter == $l) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    81
        self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    82
        (currentCharacter == $e) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    83
            self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    84
            (currentCharacter == $f) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    85
                self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    86
                (currentCharacter == $t) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    87
                    ^ self recordAndReportMatch:#( 6 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    88
                ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    89
                ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    90
            ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    91
            ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    92
        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    93
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    94
    ].
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    95
    (currentCharacter == $n) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    96
        self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    97
        (currentCharacter == $o) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
    98
            self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
    99
            (currentCharacter == $n) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   100
                self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   101
                (currentCharacter == $a) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   102
                    self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   103
                    (currentCharacter == $s) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   104
                        self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   105
                        (currentCharacter == $s) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   106
                            self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   107
                            (currentCharacter == $o) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   108
                                self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   109
                                (currentCharacter == $c) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   110
                                    ^ self recordAndReportMatch:#( 3 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   111
                                ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   112
                                ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   113
                            ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   114
                            ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   115
                        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   116
                        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   117
                    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   118
                    ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   119
                ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   120
                ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   121
            ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   122
            ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   123
        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   124
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   125
    ].
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   126
    (currentCharacter == $r) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   127
        self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   128
        (currentCharacter == $i) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   129
            self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   130
            (currentCharacter == $g) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   131
                self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   132
                (currentCharacter == $h) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   133
                    self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   134
                    (currentCharacter == $t) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   135
                        ^ self recordAndReportMatch:#( 8 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   136
                    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   137
                    ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   138
                ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   139
                ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   140
            ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   141
            ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   142
        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   143
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   144
    ].
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   145
    (currentCharacter == $s) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   146
        self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   147
        (currentCharacter == $t) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   148
            self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   149
            (currentCharacter == $a) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   150
                self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   151
                (currentCharacter == $r) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   152
                    self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   153
                    (currentCharacter == $t) ifTrue:[
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   154
                        ^ self recordAndReportMatch:#( 1 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   155
                    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   156
                    ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   157
                ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   158
                ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   159
            ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   160
            ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   161
        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   162
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   163
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   164
    ^ self reportLastMatch
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   165
!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   166
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   167
scanForToken
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   168
    self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   169
    (currentCharacter isLetter or:[ currentCharacter == $_ ]) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   170
        [
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   171
            self recordMatch:#( 20 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   172
            self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   173
            (currentCharacter isLetterOrDigit or:[ currentCharacter == $_ ])
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   174
        ] whileTrue.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   175
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   176
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   177
    (currentCharacter isSeparator 
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   178
        or:[ currentCharacter == (Character codePoint:16rB) ]) 
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   179
            ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   180
                [
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   181
                    self recordMatch:#whitespace.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   182
                    self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   183
                    (currentCharacter isSeparator 
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   184
                        or:[ currentCharacter == (Character codePoint:16rB) ])
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   185
                ] whileTrue.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   186
                ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   187
            ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   188
    (currentCharacter == $") ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   189
        ^ self scan1
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   190
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   191
    (currentCharacter == $#) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   192
        [
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   193
            self recordMatch:#comment.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   194
            self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   195
            (currentCharacter <= (Character tab) 
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   196
                or:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   197
                    (currentCharacter between:(Character codePoint:16rB)
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   198
                        and:(Character codePoint:16rC)) 
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   199
                            or:[ currentCharacter >= (Character codePoint:16rE) ]
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   200
                ])
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   201
        ] whileTrue.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   202
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   203
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   204
    (currentCharacter == $%) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   205
        ^ self scan2
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   206
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   207
    (currentCharacter == $') ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   208
        self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   209
        (currentCharacter isLetter or:[ currentCharacter == $_ ]) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   210
            [
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   211
                self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   212
                (currentCharacter isLetterOrDigit or:[ currentCharacter == $_ ])
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   213
            ] whileTrue.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   214
            (currentCharacter == $') ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   215
                ^ self recordAndReportMatch:#( 24 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   216
            ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   217
            ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   218
        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   219
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   220
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   221
    (currentCharacter == $() ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   222
        ^ self recordAndReportMatch:#( 17 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   223
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   224
    (currentCharacter == $)) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   225
        ^ self recordAndReportMatch:#( 12 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   226
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   227
    (currentCharacter == $*) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   228
        ^ self recordAndReportMatch:#( 9 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   229
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   230
    (currentCharacter == $+) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   231
        ^ self recordAndReportMatch:#( 15 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   232
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   233
    (currentCharacter == $:) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   234
        self recordMatch:#( 25 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   235
        self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   236
        (currentCharacter == $:) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   237
            self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   238
            (currentCharacter == $=) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   239
                ^ self recordAndReportMatch:#( 25 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   240
            ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   241
            ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   242
        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   243
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   244
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   245
    (currentCharacter == $;) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   246
        ^ self recordAndReportMatch:#( 7 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   247
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   248
    (currentCharacter == $<) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   249
        self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   250
        (currentCharacter isLetter or:[ currentCharacter == $_ ]) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   251
            [
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   252
                self step.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   253
                (currentCharacter isLetterOrDigit or:[ currentCharacter == $_ ])
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   254
            ] whileTrue.
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   255
            (currentCharacter == $>) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   256
                ^ self recordAndReportMatch:#( 19 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   257
            ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   258
            ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   259
        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   260
        (currentCharacter == $%) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   261
            ^ self recordAndReportMatch:#( 13 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   262
        ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   263
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   264
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   265
    (currentCharacter == $?) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   266
        ^ self recordAndReportMatch:#( 5 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   267
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   268
    (currentCharacter == $[) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   269
        ^ self recordAndReportMatch:#( 11 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   270
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   271
    (currentCharacter == $]) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   272
        ^ self recordAndReportMatch:#( 14 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   273
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   274
    (currentCharacter == ${) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   275
        self step.
16
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   276
        (currentCharacter ~~ $}) ifTrue:[
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   277
            [
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   278
                self step.
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   279
                currentCharacter ~~ $}
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   280
            ] whileTrue.
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   281
            ^ self recordAndReportMatch:#( 23 )
55254a6f8404 Generated scanners how uses Character>>is* methods on iff they
vranyj1
parents: 14
diff changeset
   282
        ].
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   283
        ^ self reportLastMatch
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   284
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   285
    (currentCharacter == $|) ifTrue:[
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   286
        ^ self recordAndReportMatch:#( 2 ).
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   287
    ].
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   288
    ^ self reportLastMatch
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   289
! !
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   290
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   291
!SmaCCGrammarScanner methodsFor:'generated-tokens'!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   292
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   293
emptySymbolTokenId
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   294
	^43
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   295
!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   296
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   297
errorTokenId
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   298
	^44
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   299
! !
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   300
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   301
!SmaCCGrammarScanner class methodsFor:'documentation'!
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   302
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   303
version
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   304
    ^ '$Header: /opt/data/cvs/stx/goodies/smaCC/SmaCC__SmaCCGrammarScanner.st,v 1.1 2006-02-09 21:15:17 vranyj1 Exp $'
14
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   305
!
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   306
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   307
version_SVN
76468a870e05 Grammar parser recompiled to support comments
vranyj1
parents: 1
diff changeset
   308
    ^ '$Id$'
1
b8cca2663544 Initial import
vranyj1
parents:
diff changeset
   309
! !