File: vm_emit.parsley

package info (click to toggle)
python-parsley 1.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,048 kB
  • sloc: python: 9,897; makefile: 127
file content (29 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (2)
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
#TreeTransformer
Grammar(str:name str:tree @rules) {{{
class $name:
    tree = $tree
    $rules
}}}
Rule(str:name @rules) {{{
$name = [
    $rules
]
}}}

Ascend() --> t.Ascend(),
Bind(str:x) --> t.Bind($x),
Call(str:x) --> t.Call($x),
Choice(str:x) --> t.Choice($x),
Commit(str:x) --> t.Commit($x),
Descend() --> t.Descend(),
EndSlice() --> t.EndSlice(),
Fail() --> t.Fail(),
ForeignCall(str:x str:y) --> t.ForeignCall($x, $y),
Match(str:x) --> t.Match($x),
Predicate() --> t.Predicate(),
Push() --> t.Push(),
Python(str:x) --> t.Python($x),
StartSlice() --> t.StartSlice(),
SuperCall(str:x) --> t.SuperCall($x),

str = anything:s -> str(s.data)