equal
deleted
inserted
replaced
6 instanceVariableNames:'currentTokenValue currentTokenType scanner' |
6 instanceVariableNames:'currentTokenValue currentTokenType scanner' |
7 classVariableNames:'' |
7 classVariableNames:'' |
8 poolDictionaries:'' |
8 poolDictionaries:'' |
9 category:'PetitCompiler-Parsers' |
9 category:'PetitCompiler-Parsers' |
10 ! |
10 ! |
|
11 |
|
12 !PPTokenizingCompiledParser class methodsFor:'as yet unclassified'! |
|
13 |
|
14 acceptsLoggingOfCompilation |
|
15 ^ self == PPTokenizingCompiledParser |
|
16 ! ! |
|
17 |
|
18 !PPTokenizingCompiledParser methodsFor:'initialization'! |
|
19 |
|
20 initialize |
|
21 super initialize. |
|
22 |
|
23 ! ! |
11 |
24 |
12 !PPTokenizingCompiledParser methodsFor:'tokenizing'! |
25 !PPTokenizingCompiledParser methodsFor:'tokenizing'! |
13 |
26 |
14 consume: tokenType |
27 consume: tokenType |
15 self halt: 'deprecated'. |
28 self halt: 'deprecated'. |
20 "self error: 'expected: ', tokenType storeString, ' got ', currentTokenType storeString." |
33 "self error: 'expected: ', tokenType storeString, ' got ', currentTokenType storeString." |
21 self error. |
34 self error. |
22 ! |
35 ! |
23 |
36 |
24 consumeWhitespace |
37 consumeWhitespace |
25 self shouldBeImplemented |
38 "self shouldBeImplemented " |
26 ! |
39 ! |
27 |
40 |
28 currentTokenType |
41 currentTokenType |
29 currentTokenType isNil ifTrue: [ self nextToken ]. |
42 currentTokenType isNil ifTrue: [ self nextToken ]. |
30 ^ currentTokenType |
43 ^ currentTokenType |
55 context compiledParser: self. |
68 context compiledParser: self. |
56 failure := PPFailure new message: nil; context: context; position: -1. |
69 failure := PPFailure new message: nil; context: context; position: -1. |
57 context noteFailure: failure. |
70 context noteFailure: failure. |
58 error := false. |
71 error := false. |
59 currentTokenType := nil. |
72 currentTokenType := nil. |
60 scanner := PPCScanner new. |
73 scanner := (self class classVarNamed: #scannerClass) new. |
|
74 scanner stream: aPPContext. |
|
75 |
61 |
76 |
62 self consumeWhitespace. |
77 self consumeWhitespace. |
63 retval := self perform: startSymbol. |
78 retval := self perform: startSymbol. |
64 " self consumeWhitespace." |
79 " self consumeWhitespace." |
65 |
80 |