compiler/PPCTokenizingConfiguration.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 03 Jun 2015 06:23:49 +0100
changeset 481 34ee0d3c72e7
parent 477 b18b6cc7aabc
child 516 3b81c9e53352
permissions -rw-r--r--
Introduced PPCMappedActionNode for PPMappedActionParser. It's compilation is not yet ideal, bot works for now.

"{ Package: 'stx:goodies/petitparser/compiler' }"

"{ NameSpace: Smalltalk }"

PPCConfiguration subclass:#PPCTokenizingConfiguration
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitCompiler-Core'
!


!PPCTokenizingConfiguration methodsFor:'compiling'!

invokePhases
    self toPPCIr.
    self createTokens.
    self cacheFirstFollow.
    self createLL1Choices.
    self tokenize.
    self merge.
    self specialize.
    self createRecognizingComponents.
    self specialize.
    self inline.
    self merge.
    self check.	
    self cacheFirstFollow.
    self generate.
! !

!PPCTokenizingConfiguration methodsFor:'hooks'!

codeCompilerOn: args
    ^ PPCTokenizingCompiler on: args
!

codeGeneratorVisitorOn: compiler
    ^ PPCTokenizingCodeGenerator on: compiler
! !

!PPCTokenizingConfiguration methodsFor:'phases'!

createLL1Choices
    ir :=  PPCLL1Visitor new
        arguments: arguments;
        visit: ir.
    self remember: #LL1
!

tokenize
    "
        This will try transform the parser into the tokenizing parser
    "
    arguments tokenize ifFalse: [ ^ self ] .
    
    ir :=  PPCTokenizingVisitor new
        arguments: arguments;
        visit: ir.
    self remember: #tokenize
! !

!PPCTokenizingConfiguration class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !