compiler/PPCAbstractCharacterNode.st
changeset 438 20598d7ce9fa
parent 429 23de165842c3
child 452 9f4558b3be66
equal deleted inserted replaced
437:54b3bc9e3987 438:20598d7ce9fa
    10 !
    10 !
    11 
    11 
    12 
    12 
    13 !PPCAbstractCharacterNode methodsFor:'accessing'!
    13 !PPCAbstractCharacterNode methodsFor:'accessing'!
    14 
    14 
    15 acceptsEpsilon
       
    16 	^ false
       
    17 !
       
    18 
       
    19 character
    15 character
    20 	^ character
    16 	^ character
    21 !
    17 !
    22 
    18 
    23 character: char
    19 character: char
    27 prefix
    23 prefix
    28 	^ #char
    24 	^ #char
    29 ! !
    25 ! !
    30 
    26 
    31 !PPCAbstractCharacterNode methodsFor:'analysis'!
    27 !PPCAbstractCharacterNode methodsFor:'analysis'!
       
    28 
       
    29 acceptsEpsilon
       
    30 	^ false
       
    31 !
    32 
    32 
    33 firstCharSet
    33 firstCharSet
    34 	^ PPCharSetPredicate on: [:e | e = character ]
    34 	^ PPCharSetPredicate on: [:e | e = character ]
    35 ! !
    35 ! !
    36 
    36 
    60 	compiler add: '(context peek == ', id, ')'.
    60 	compiler add: '(context peek == ', id, ')'.
    61 	compiler indent.
    61 	compiler indent.
    62 	compiler add: 'ifFalse: [ self error: ''', character asInteger asString, ' expected'' at: context position ] '.
    62 	compiler add: 'ifFalse: [ self error: ''', character asInteger asString, ' expected'' at: context position ] '.
    63 	compiler add: 'ifTrue: [ context next ].'.
    63 	compiler add: 'ifTrue: [ context next ].'.
    64 	compiler dedent.
    64 	compiler dedent.
    65 !
       
    66 
       
    67 compileWith: compiler effect: effect id: id
       
    68 	self start: compiler id: id.
       
    69 	self body: compiler.
       
    70  ^ self stop: compiler.
       
    71 !
       
    72 
       
    73 compileWith: compiler id: id
       
    74 	self start: compiler.
       
    75 	self body: compiler.
       
    76  ^ compiler stopMethod.
       
    77 ! !
    65 ! !
    78 
    66 
    79 !PPCAbstractCharacterNode class methodsFor:'documentation'!
    67 !PPCAbstractCharacterNode class methodsFor:'documentation'!
    80 
    68 
    81 version_HG
    69 version_HG