author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Tue, 02 Jun 2015 00:16:55 +0100 | |
changeset 479 | 6316a98b7150 |
parent 459 | 4751c407bb40 |
permissions | -rw-r--r-- |
200 | 1 |
"{ Package: 'stx:goodies/petitparser/analyzer' }" |
2 |
||
459
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
285
diff
changeset
|
3 |
"{ NameSpace: Smalltalk }" |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
285
diff
changeset
|
4 |
|
200 | 5 |
Object subclass:#PPProcessor |
6 |
instanceVariableNames:'searches context' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'PetitAnalyzer-Core' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!PPProcessor class methodsFor:'instance creation'! |
|
14 |
||
15 |
new |
|
16 |
^ self basicNew initialize |
|
17 |
! ! |
|
18 |
||
19 |
!PPProcessor methodsFor:'initialization'! |
|
20 |
||
21 |
initialize |
|
22 |
super initialize. |
|
23 |
searches := OrderedCollection new. |
|
24 |
context := Dictionary new |
|
25 |
! ! |
|
26 |
||
27 |
!PPProcessor methodsFor:'private'! |
|
28 |
||
29 |
context |
|
30 |
^ context |
|
31 |
! |
|
32 |
||
33 |
performRule: aRule on: aParser |
|
34 |
context := Dictionary new. |
|
35 |
^ aRule performOn: aParser |
|
36 |
! |
|
37 |
||
38 |
performRulesOn: aParser |
|
39 |
| result | |
|
40 |
searches do: [ :rule | |
|
41 |
result := self performRule: rule on: aParser. |
|
42 |
result notNil ifTrue: [ ^ result ] ]. |
|
43 |
^ nil |
|
44 |
! ! |
|
45 |
||
46 |
!PPProcessor methodsFor:'rules'! |
|
47 |
||
48 |
addRule: aGrammarRule |
|
49 |
searches add: (aGrammarRule setOwner: self) |
|
50 |
! ! |
|
51 |
||
52 |
!PPProcessor class methodsFor:'documentation'! |
|
53 |
||
54 |
version |
|
285 | 55 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/analyzer/PPProcessor.st,v 1.2 2014-03-04 20:27:44 cg Exp $' |
200 | 56 |
! |
57 |
||
58 |
version_CVS |
|
285 | 59 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/analyzer/PPProcessor.st,v 1.2 2014-03-04 20:27:44 cg Exp $' |
459
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
285
diff
changeset
|
60 |
! |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
285
diff
changeset
|
61 |
|
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
285
diff
changeset
|
62 |
version_HG |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
285
diff
changeset
|
63 |
|
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
285
diff
changeset
|
64 |
^ '$Changeset: <not expanded> $' |
200 | 65 |
! ! |
66 |