blob: e062b53098fa6f9038bee41bfb8a65bf49acc3c5 (
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
|
##### LM #####
lex
ignore /space+/
literal '*', '(', ')'
token id /[a-zA-Z_]+/
{
t: str = input.pull( match_length )
input.push( make_token( typeid<id> t ) )
}
end
def foo [id]
def item
[id]
| [foo]
| ['(' item* ')']
def start
[item*]
parse Input: start[ stdin ]
print( Input )
##### IN #####
a b ( c d ) e f
##### EXP #####
a b ( c d ) e f
|