compiler/PPCTokenizingConfiguration.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sat, 29 Aug 2015 07:56:14 +0100
changeset 534 a949c4fe44df
parent 532 132d7898a2a1
permissions -rw-r--r--
PPCConfiguration refactoring: [6/10]: use #runPass: instead of self-sends. ...in PPCConfiguration>>invokePhases. This is a preparation for removing #invokePhases completely and configuring the compilation via list of phases.

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

"{ NameSpace: Smalltalk }"

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

!PPCTokenizingConfiguration methodsFor:'accessing - defaults'!

defaultParserSuperclass
    ^ PPTokenizingCompiledParser

    "Modified (comment): / 01-09-2015 / 08:48:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!PPCTokenizingConfiguration methodsFor:'compiling'!

invokePhases

    self runPass: PPCTokenDetector.

    context options cacheFirstFollow ifTrue:[
        self runPass: PPCCacheFirstFollowPass  
    ].  
    self runPass: PPCLL1Visitor.
    context options tokenize ifTrue:[
        self runPass: PPCTokenizingVisitor    
    ].

    self runPass: PPCMergingVisitor .

    context options specialize ifTrue:[
        self runPass: PPCSpecializingVisitor
    ].

    self runPass: PPCRecognizerComponentDetector .

    context options specialize ifTrue:[
        self runPass: PPCSpecializingVisitor
    ].
    context options inline ifTrue:[
        self runPass: PPCInliningVisitor     
    ]. 

    self runPass: PPCMergingVisitor .

    self runPass: PPCCheckingVisitor.
    context options cacheFirstFollow ifTrue:[
        self runPass: PPCCacheFirstFollowPass  
    ].  
    self runPass: PPCTokenizingCodeGenerator.
    self runPass: PPCFSAVisitor.
    self runPass: PPCTokenCodeGenerator.
    self runPass: PPCScannerCodeGenerator.  

    self generateScanner.
    self generateParser.

    "Modified: / 04-09-2015 / 10:25:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !