--- a/compiler/PPCFSAVisitor.st Wed Aug 26 23:34:48 2015 +0100
+++ b/compiler/PPCFSAVisitor.st Sat Aug 29 07:56:14 2015 +0100
@@ -2,19 +2,13 @@
"{ NameSpace: Smalltalk }"
-PPCPass subclass:#PPCFSAVisitor
+PPCPassVisitor subclass:#PPCFSAVisitor
instanceVariableNames:'fsaCache idGen'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Visitors'
!
-!PPCFSAVisitor methodsFor:'accessing'!
-
-idGen: anObject
- idGen := anObject
-! !
-
!PPCFSAVisitor methodsFor:'as yet unclassified'!
unorderedChoiceFromFollowSet: followSet
@@ -23,13 +17,14 @@
^ fsaCache at: followSet ifAbsentPut: [
followFsas := followSet collect: [ :followNode |
followNode asFsa
- name: (idGen idFor: followNode);
- retval: (idGen idFor: followNode);
+ name: (context idGenerator idFor: followNode);
+ retval: (context idGenerator idFor: followNode);
yourself
].
self unorderedChoiceFromFsas: followFsas.
]
-
+
+ "Modified: / 03-09-2015 / 21:28:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
unorderedChoiceFromFsas: fsas
@@ -53,11 +48,13 @@
| anFsa |
anFsa := tokenNode asFsa determinize.
- anFsa name: (idGen idFor: tokenNode).
- anFsa retval: (idGen idFor: tokenNode).
+ anFsa name: (context idGenerator idFor: tokenNode).
+ anFsa retval: (context idGenerator idFor: tokenNode).
tokenNode fsa: anFsa.
^ tokenNode
+
+ "Modified: / 03-09-2015 / 21:27:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
visitTokenConsumeNode: node
@@ -69,9 +66,11 @@
epsilon ifTrue: [ followSet add: PPCEndOfFileNode instance ].
anFsa := self unorderedChoiceFromFollowSet: followSet.
- anFsa name: 'nextToken_', (idGen idFor: node).
+ anFsa name: 'nextToken_', (context idGenerator idFor: node).
node nextFsa: anFsa.
+
+ "Modified: / 03-09-2015 / 21:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
visitTokenNode: node