blob: 466cad49102050d55dfeb96a6850b4a4aeb07710 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
Id: 50
Subject: sending back artificicial tokens with ignore
Tracker: Bug
Status: Closed
Fixed-Version:
Created-On: Sat Mar 20 18:31:54 -0700 2010
Updated-On: Sat Mar 20 21:57:25 -0700 2010
Where does the ignore come from? The artificial token or from the the stream? Need to record this info and use it during backtracking
<pre>
lex start
{
ignore /[ \t]+/
literal '*', '(', ')', '^', ';', '\n', '.'
token id /[a-zA-Z_]+/
}
parser out_parser [out]
global out_parser Out = construct out_parser []
def out_item
[id]
| ['(' item* ')']
def out
[out_item*]
def item
[id]
{
Out << r1
}
| ['(' item* ')']
{
# Out << '('
# Out << r2
# Out << ')'
}
def A1 []
def A2 []
def F
[]
{
#Out.finish()
}
def start
[A1 item* F '.' '^']
| [A2 item* F '.' ';' '\n']
start Input = parse start( stdin )
print( Input )
</pre>
|