PetitCommonMark/software/petitcompiler/PPCTokenizingCodeGen.class.st

44 lines
1.0 KiB
Smalltalk

"
I am CodeGen suited for the needs of tokenizing code generator.
"
Class {
#name : 'PPCTokenizingCodeGen',
#superclass : 'PPCCodeGen',
#category : 'PetitCompiler-Compiler-Codegen'
}
{ #category : 'code generation' }
PPCTokenizingCodeGen >> codeScannerRememberTo: variableName [
self codeAssign: 'scanner remember' to: variableName.
self codeDot.
]
{ #category : 'code generation' }
PPCTokenizingCodeGen >> codeScannerRestoreFrom: variableName [
self code: 'scanner restore: ', variableName.
self codeDot.
]
{ #category : 'initialization' }
PPCTokenizingCodeGen >> initialize [
super initialize.
]
{ #category : 'code generation' }
PPCTokenizingCodeGen >> remember: node to: variableName [
^ self codeScannerRememberTo: variableName
]
{ #category : 'code generation' }
PPCTokenizingCodeGen >> restore: node from: mementoName [
^ self codeScannerRestoreFrom: mementoName
]
{ #category : 'code generation' }
PPCTokenizingCodeGen >> restoreSequence: node child: child from: mementoName [
^ self restore: node from: mementoName
]