compiler/PPCTokenizingCodeGenerator.st
changeset 508 c74a0dbfa161
parent 503 ff58cd9f1f3c
child 516 3b81c9e53352
equal deleted inserted replaced
507:c5773c25eedc 508:c74a0dbfa161
     7 	classVariableNames:''
     7 	classVariableNames:''
     8 	poolDictionaries:''
     8 	poolDictionaries:''
     9 	category:'PetitCompiler-Visitors'
     9 	category:'PetitCompiler-Visitors'
    10 !
    10 !
    11 
    11 
       
    12 
    12 !PPCTokenizingCodeGenerator methodsFor:'accessing'!
    13 !PPCTokenizingCodeGenerator methodsFor:'accessing'!
    13 
    14 
    14 guards
    15 guards
    15     "When tokenizing, do not use guards"
    16     "When tokenizing, do not use guards"
    16     ^ false
    17     ^ false
    89     | possibleError |
    90     | possibleError |
    90     possibleError := true.
    91     possibleError := true.
    91 
    92 
    92     node children do: [ :child |
    93     node children do: [ :child |
    93         | tokenMethodName |
    94         | tokenMethodName |
    94         
    95 
    95         child acceptsEpsilon ifTrue: [  
    96         "TODO: JK: fix this in a proper way. Commented for now to make LRPParser cimpilable 
       
    97          with tokenizing"
       
    98         "child acceptsEpsilon"false ifTrue: [  
    96             possibleError := false.
    99             possibleError := false.
    97             compiler codeAssignParsedValueOf:[ self visit:child ] to:self retvalVar.
   100             compiler codeAssignParsedValueOf:[ self visit:child ] to:self retvalVar.
    98             compiler codeReturn
   101             compiler codeReturn
    99         ] ifFalse: [
   102         ] ifFalse: [
   100             child firstSetWithTokens do: [ :first |
   103             child firstSetWithTokens do: [ :first |
   123     ].
   126     ].
   124     possibleError ifTrue: [
   127     possibleError ifTrue: [
   125         compiler codeError: 'no choice found'.
   128         compiler codeError: 'no choice found'.
   126     ]
   129     ]
   127 
   130 
   128     "Modified: / 10-05-2015 / 07:37:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   131     "Modified: / 31-07-2015 / 08:07:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   129 !
   132 !
   130 
   133 
   131 visitDeterministicChoiceNode: node
   134 visitDeterministicChoiceNode: node
   132     | dictionary isInlined |
   135     | dictionary isInlined |
   133     dictionary := IdentityDictionary new.
   136     dictionary := IdentityDictionary new.
   218 
   221 
   219 visitTrimmingTokenNode: node
   222 visitTrimmingTokenNode: node
   220     self error: 'shoudl not happend!!'
   223     self error: 'shoudl not happend!!'
   221 ! !
   224 ! !
   222 
   225 
       
   226 !PPCTokenizingCodeGenerator class methodsFor:'documentation'!
       
   227 
       
   228 version_HG
       
   229 
       
   230     ^ '$Changeset: <not expanded> $'
       
   231 ! !
       
   232