compiler/PPCAbstractCharacterNode.st
changeset 464 f6d77fee9811
parent 459 4751c407bb40
child 465 f729f6cd3c76
child 502 1e45d3c96ec5
--- a/compiler/PPCAbstractCharacterNode.st	Tue May 12 01:24:03 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-"{ Package: 'stx:goodies/petitparser/compiler' }"
-
-"{ NameSpace: Smalltalk }"
-
-PPCNode subclass:#PPCAbstractCharacterNode
-	instanceVariableNames:'character'
-	classVariableNames:''
-	poolDictionaries:''
-	category:'PetitCompiler-Nodes'
-!
-
-
-!PPCAbstractCharacterNode methodsFor:'accessing'!
-
-character
-    ^ character
-!
-
-character: char
-    character := char
-!
-
-prefix
-    ^ #char
-! !
-
-!PPCAbstractCharacterNode methodsFor:'analysis'!
-
-acceptsEpsilon
-    ^ false
-!
-
-firstCharSet
-    ^ PPCharSetPredicate on: [:e | e = character ]
-!
-
-recognizedSentencesPrim
-    ^ Array with: character asString
-! !
-
-!PPCAbstractCharacterNode methodsFor:'comparison'!
-
-= anotherNode
-    super = anotherNode ifFalse: [ ^ false ].
-    ^ character = anotherNode character.
-!
-
-hash
-    ^ super hash bitXor: character hash
-! !
-
-!PPCAbstractCharacterNode methodsFor:'compiling'!
-
-body: compiler
-    | id |
-    
-    character ppcPrintable ifTrue: [ 
-        id := character storeString 
-    ] ifFalse: [ 
-        id := compiler idFor: character prefixed: #char.
-        compiler addConstant: (Character value: character asInteger) as: id .
-    ].
-    
-    compiler add: '(context peek == ', id, ')'.
-    compiler indent.
-    compiler add: 'ifFalse: [ self error: ''', character asInteger asString, ' expected'' at: context position ] '.
-    compiler add: 'ifTrue: [ context next ].'.
-    compiler dedent.
-! !
-
-!PPCAbstractCharacterNode methodsFor:'printing'!
-
-printNameOn: aStream
-    super printNameOn: aStream.
-
-    character = $" ifTrue: [ 
-        "this is hack to allow for printing '' in comments..."
-        aStream nextPutAll: ', '; nextPutAll: '$'''''.
-        ^ self
-    ].
-
-    aStream nextPutAll: ', '; print: character
-! !
-
-!PPCAbstractCharacterNode class methodsFor:'documentation'!
-
-version_HG
-
-    ^ '$Changeset: <not expanded> $'
-! !
-