compiler/PPCCompilerTokenizingErrorStrategy.st
changeset 525 751532c8f3db
parent 523 09afcf28ed60
parent 524 f6f68d32de73
child 526 cc0ce8edda63
equal deleted inserted replaced
523:09afcf28ed60 525:751532c8f3db
     1 "{ Package: 'stx:goodies/petitparser/compiler' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
       
     4 
       
     5 Object subclass:#PPCCompilerTokenizingErrorStrategy
       
     6 	instanceVariableNames:'compiler'
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'PetitCompiler-Compiler-Codegen-Straregies'
       
    10 !
       
    11 
       
    12 !PPCCompilerTokenizingErrorStrategy class methodsFor:'as yet unclassified'!
       
    13 
       
    14 on: aPPCCompiler
       
    15     ^ self new
       
    16         compiler: aPPCCompiler;
       
    17         yourself
       
    18 ! !
       
    19 
       
    20 !PPCCompilerTokenizingErrorStrategy methodsFor:'as yet unclassified'!
       
    21 
       
    22 codeClearError
       
    23     compiler add: 'error := false.'.
       
    24 !
       
    25 
       
    26 codeError
       
    27     compiler add: 'self error: ''error message not specified'' at: context position.'.
       
    28 !
       
    29 
       
    30 codeError: message
       
    31     compiler add: 'self error: ''', message, ''' at: context position.'.
       
    32 !
       
    33 
       
    34 compiler: aPPCCompiler
       
    35     compiler := aPPCCompiler 
       
    36 ! !
       
    37