compiler/PPCAnyNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 03 Nov 2014 09:10:56 +0000
changeset 405 0470a5e6e712
parent 392 9b297f0d949c
child 414 0eaf09920532
permissions -rw-r--r--
Merged PetitParser and PetitTests Name: PetitParser-JanKurs.253 Author: JanKurs Time: 30-10-2014, 03:55:46 AM UUID: c7100f9c-e875-4453-8f26-e0c91dd49b91 Name: PetitTests-JanKurs.63 Author: JanKurs Time: 30-10-2014, 12:54:37 PM UUID: 7afbeef7-eadf-4d65-bce5-7204e2727edb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
391
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/petitparser/compiler' }"
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
PPCNode subclass:#PPCAnyNode
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
	instanceVariableNames:''
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
	classVariableNames:''
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	poolDictionaries:''
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	category:'PetitCompiler-Nodes'
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
!
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
405
0470a5e6e712 Merged PetitParser and PetitTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    10
391
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
!PPCAnyNode methodsFor:'as yet unclassified'!
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
acceptsEpsilon
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
	^ false
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
!
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
asInlined
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
	^ PPCInlineAnyNode new
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
		name: name;
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
		yourself
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
!
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
compileWith: compiler effect: effect id: id
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
	compiler startMethod: id.
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	compiler add: '^ context next ifNil: [ error := true. ].'.
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
 ^ compiler stopMethod.	
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
!
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
firstCharParser
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
	^ #any asParser
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
	
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
!
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
prefix
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
	^ #any
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
! !
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
405
0470a5e6e712 Merged PetitParser and PetitTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    38
!PPCAnyNode class methodsFor:'documentation'!
0470a5e6e712 Merged PetitParser and PetitTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    39
0470a5e6e712 Merged PetitParser and PetitTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    40
version_HG
0470a5e6e712 Merged PetitParser and PetitTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    41
0470a5e6e712 Merged PetitParser and PetitTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    42
    ^ '$Changeset: <not expanded> $'
0470a5e6e712 Merged PetitParser and PetitTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    43
! !
0470a5e6e712 Merged PetitParser and PetitTests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    44