200
|
1 |
"{ Package: 'stx:goodies/petitparser/analyzer' }"
|
|
2 |
|
|
3 |
Object subclass:#PPProcessor
|
|
4 |
instanceVariableNames:'searches context'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'PetitAnalyzer-Core'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!PPProcessor class methodsFor:'instance creation'!
|
|
12 |
|
|
13 |
new
|
|
14 |
^ self basicNew initialize
|
|
15 |
! !
|
|
16 |
|
|
17 |
!PPProcessor methodsFor:'initialization'!
|
|
18 |
|
|
19 |
initialize
|
|
20 |
super initialize.
|
|
21 |
searches := OrderedCollection new.
|
|
22 |
context := Dictionary new
|
|
23 |
! !
|
|
24 |
|
|
25 |
!PPProcessor methodsFor:'private'!
|
|
26 |
|
|
27 |
context
|
|
28 |
^ context
|
|
29 |
!
|
|
30 |
|
|
31 |
performRule: aRule on: aParser
|
|
32 |
context := Dictionary new.
|
|
33 |
^ aRule performOn: aParser
|
|
34 |
!
|
|
35 |
|
|
36 |
performRulesOn: aParser
|
|
37 |
| result |
|
|
38 |
searches do: [ :rule |
|
|
39 |
result := self performRule: rule on: aParser.
|
|
40 |
result notNil ifTrue: [ ^ result ] ].
|
|
41 |
^ nil
|
|
42 |
! !
|
|
43 |
|
|
44 |
!PPProcessor methodsFor:'rules'!
|
|
45 |
|
|
46 |
addRule: aGrammarRule
|
|
47 |
searches add: (aGrammarRule setOwner: self)
|
|
48 |
! !
|
|
49 |
|
|
50 |
!PPProcessor class methodsFor:'documentation'!
|
|
51 |
|
|
52 |
version
|
285
|
53 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/analyzer/PPProcessor.st,v 1.2 2014-03-04 20:27:44 cg Exp $'
|
200
|
54 |
!
|
|
55 |
|
|
56 |
version_CVS
|
285
|
57 |
^ '$Header: /cvs/stx/stx/goodies/petitparser/analyzer/PPProcessor.st,v 1.2 2014-03-04 20:27:44 cg Exp $'
|
200
|
58 |
! !
|
|
59 |
|