equal
deleted
inserted
replaced
1 "{ Package: 'stx:goodies/petitparser/compiler' }" |
1 "{ Package: 'stx:goodies/petitparser/compiler' }" |
2 |
2 |
3 "{ NameSpace: Smalltalk }" |
3 "{ NameSpace: Smalltalk }" |
4 |
4 |
5 PPCPass subclass:#PPCCodeGenerator |
5 PPCPassVisitor subclass:#PPCCodeGenerator |
6 instanceVariableNames:'codeGen' |
6 instanceVariableNames:'codeGen' |
7 classVariableNames:'' |
7 classVariableNames:'' |
8 poolDictionaries:'' |
8 poolDictionaries:'' |
9 category:'PetitCompiler-Visitors-CodeGenerators' |
9 category:'PetitCompiler-Visitors-CodeGenerators' |
10 ! |
10 ! |
208 | entry | |
208 | entry | |
209 |
209 |
210 context isNil ifTrue:[ |
210 context isNil ifTrue:[ |
211 PPCCompilationError new signal: 'oops, no context set, use #context: before running a pass!!'. |
211 PPCCompilationError new signal: 'oops, no context set, use #context: before running a pass!!'. |
212 ]. |
212 ]. |
213 codeGen options: context options. |
213 context options generate ifTrue:[ |
214 codeGen clazz: context parserClass. |
214 codeGen options: context options. |
215 entry := self visit: ir. |
215 codeGen clazz: context parserClass. |
216 context parserClass propertyAt:#rootMethod put:entry. |
216 entry := self visit: ir. |
|
217 context parserClass propertyAt:#rootMethod put:entry. |
|
218 ]. |
217 ^ ir |
219 ^ ir |
218 |
220 |
219 "Created: / 26-08-2015 / 22:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
221 "Created: / 26-08-2015 / 22:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
222 "Modified: / 04-09-2015 / 10:18:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
220 ! ! |
223 ! ! |
221 |
224 |
222 !PPCCodeGenerator methodsFor:'support'! |
225 !PPCCodeGenerator methodsFor:'support'! |
223 |
226 |
224 compileTokenWhitespace: node |
227 compileTokenWhitespace: node |