PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
"{ Package: 'stx:goodies/petitparser/compiler' }"
"{ NameSpace: Smalltalk }"
Object subclass:#PPCCompilationContext
instanceVariableNames:'options compiler parserClass scannerClass'
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Core'
!
!PPCCompilationContext class methodsFor:'instance creation'!
new
"return an initialized instance"
^ self basicNew initialize.
! !
!PPCCompilationContext methodsFor:'accessing'!
idGenerator
^ self parserClass idGen
"Created: / 03-09-2015 / 21:27:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
options
^ options
!
options:aPPCCompilationOptions
options := aPPCCompilationOptions.
!
parserClass
"Return parser class as PPCClass"
parserClass isNil ifTrue:[
parserClass := PPCClass new.
].
^ parserClass
"Created: / 24-08-2015 / 23:58:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
scannerClass
"Return scanner class as PPCClass"
scannerClass isNil ifTrue:[
scannerClass := PPCClass new.
"Both parser class and scanner class must share the
same ID generator in order to to use same names
for tokens."
scannerClass idGen: self parserClass idGen
].
^ scannerClass
"Created: / 24-08-2015 / 23:59:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPCCompilationContext methodsFor:'initialization'!
initialize
"Invoked when a new instance is created."
options := PPCCompilationOptions default.
"Modified: / 26-08-2015 / 19:49:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !