104 |
104 |
105 ActionArray := Array new:256. |
105 ActionArray := Array new:256. |
106 TypeArray := Array new:256. |
106 TypeArray := Array new:256. |
107 |
107 |
108 block := [:s :char | s nextNumber]. |
108 block := [:s :char | s nextNumber]. |
109 ($0 asciiValue) to:($9 asciiValue) do:[:index | |
109 ($0 codePoint) to:($9 codePoint) do:[:index | |
110 ActionArray at:index put:block |
110 ActionArray at:index put:block |
111 ]. |
111 ]. |
112 |
112 |
113 block := [:s :char | s nextSingleCharacterToken:char]. |
113 block := [:s :char | s nextSingleCharacterToken:char]. |
114 #( $: $; $, ${ $} $( $) $[ $] $_ $? $@) do:[:ch | |
114 #( $: $; $, ${ $} $( $) $[ $] $_ $? $@) do:[:ch | |
115 ActionArray at:(ch asciiValue) put:block |
115 ActionArray at:(ch asciiValue) put:block |
116 ]. |
116 ]. |
117 |
117 |
118 block := [:s :char | s nextIdentifier]. |
118 block := [:s :char | s nextIdentifier]. |
119 ($a asciiValue) to:($z asciiValue) do:[:index | |
119 ($a codePoint) to:($z codePoint) do:[:index | |
120 ActionArray at:index put:block |
120 ActionArray at:index put:block |
121 ]. |
121 ]. |
122 ($A asciiValue) to:($Z asciiValue) do:[:index | |
122 ($A codePoint) to:($Z codePoint) do:[:index | |
123 ActionArray at:index put:block |
123 ActionArray at:index put:block |
124 ]. |
124 ]. |
125 ActionArray at:$_ asciiValue put:block. |
125 ActionArray at:$_ codePoint put:block. |
126 |
126 |
127 ActionArray at:$$ asciiValue put:block. |
127 ActionArray at:$$ codePoint put:block. |
128 |
128 |
129 ActionArray at:($. asciiValue) put:[:s :char | s nextDotOrFloatOrEllipsis]. |
129 ActionArray at:($. codePoint) put:[:s :char | s nextDotOrFloatOrEllipsis]. |
130 |
130 |
131 ActionArray at:($' asciiValue) put:[:s :char | s nextString:$' character:true]. |
131 ActionArray at:($' codePoint) put:[:s :char | s nextString:$' character:false]. |
132 ActionArray at:($" asciiValue) put:[:s :char | s nextString:$" character:false]. |
132 ActionArray at:($" codePoint) put:[:s :char | s nextString:$" character:false]. |
133 ActionArray at:($!! asciiValue) put:[:s :char | s nextMulti:#(($= #'!!=')) after:char]. |
133 ActionArray at:($!! codePoint) put:[:s :char | s nextMulti:#(($= #'!!=')) after:char]. |
134 ActionArray at:($= asciiValue) put:[:s :char | s nextMulti:#(($= #'==')) after:char]. |
134 ActionArray at:($= codePoint) put:[:s :char | s nextMulti:#(($= #'==')) after:char]. |
135 ActionArray at:($< asciiValue) put:[:s :char | s nextMulti:#(($= #'<=') ($< #'<<')) after:char]. |
135 ActionArray at:($< codePoint) put:[:s :char | s nextMulti:#(($= #'<=') ($< #'<<')) after:char]. |
136 ActionArray at:($> asciiValue) put:[:s :char | s nextMulti:#(($= #'>=') ($> #'>>' $> #'>>>' $= #'>>>=')) after:char]. |
136 ActionArray at:($> codePoint) put:[:s :char | s nextMulti:#(($= #'>=') ($> #'>>' $> #'>>>' $= #'>>>=')) after:char]. |
137 |
137 |
138 ActionArray at:($- asciiValue) put:[:s :char | s nextMulti:#(($- #'--') ($= #'-=')) after:char]. |
138 ActionArray at:($- codePoint) put:[:s :char | s nextMulti:#(($- #'--') ($= #'-=')) after:char]. |
139 ActionArray at:($+ asciiValue) put:[:s :char | s nextMulti:#(($+ #'++') ($= #'+=')) after:char]. |
139 ActionArray at:($+ codePoint) put:[:s :char | s nextMulti:#(($+ #'++') ($= #'+=')) after:char]. |
140 ActionArray at:($* asciiValue) put:[:s :char | s nextMulti:#(($= #'*=')) after:char]. |
140 ActionArray at:($* codePoint) put:[:s :char | s nextMulti:#(($= #'*=')) after:char]. |
141 ActionArray at:($/ asciiValue) put:[:s :char | s nextMulti:#(($= #'/=') ($/ nil #skipEOLComment) ($* nil #skipComment)) after:char]. |
141 ActionArray at:($/ codePoint) put:[:s :char | s nextMulti:#(($= #'/=') ($/ nil #skipEOLComment) ($* nil #skipComment)) after:char]. |
142 ActionArray at:($% asciiValue) put:[:s :char | s nextMulti:#(($= #'%=')) after:char]. |
142 ActionArray at:($% codePoint) put:[:s :char | s nextMulti:#(($= #'%=')) after:char]. |
143 ActionArray at:($& asciiValue) put:[:s :char | s nextMulti:#(($= #'&=') ($& #'&&')) after:char]. |
143 ActionArray at:($& codePoint) put:[:s :char | s nextMulti:#(($= #'&=') ($& #'&&')) after:char]. |
144 ActionArray at:($^ asciiValue) put:[:s :char | s nextMulti:#(($= #'^=')) after:char]. |
144 ActionArray at:($^ codePoint) put:[:s :char | s nextMulti:#(($= #'^=')) after:char]. |
145 ActionArray at:($~ asciiValue) put:[:s :char | s nextMulti:#(($= #'~=')) after:char]. |
145 ActionArray at:($~ codePoint) put:[:s :char | s nextMulti:#(($= #'~=')) after:char]. |
146 ActionArray at:($| asciiValue) put:[:s :char | s nextMulti:#(($= #'|=') ($| #'||')) after:char]. |
146 ActionArray at:($| codePoint) put:[:s :char | s nextMulti:#(($= #'|=') ($| #'||')) after:char]. |
147 |
147 |
148 " |
148 " |
149 self setupActions |
149 self setupActions |
150 " |
150 " |
151 |
151 |
152 "Created: / 14-05-1998 / 15:48:03 / cg" |
152 "Created: / 14-05-1998 / 15:48:03 / cg" |
153 "Modified: / 17-05-1998 / 21:03:37 / cg" |
153 "Modified: / 17-05-1998 / 21:03:37 / cg" |
154 "Modified: / 16-03-2012 / 23:49:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
154 "Modified: / 11-01-2013 / 13:04:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
155 ! |
155 ! |
156 |
156 |
157 setupKeywordTable |
157 setupKeywordTable |
158 "initialize the scanners actionTables - these are used to dispatch |
158 "initialize the scanners actionTables - these are used to dispatch |
159 into scanner methods as characters are read" |
159 into scanner methods as characters are read" |