summaryrefslogtreecommitdiff
path: root/test/backtrack2.lm
blob: 9b166fbe5140f2739f6349ce840d53eff0925ead (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

# Token names.
lex start
{
	token id /[a-z]+/
	ignore ws /[ \t\n]+/
}

token bang1 /'!'/
token bang2 /'!'/

def one [bang1 id id id]

def two [bang2 id id id id]

def prods 
	[one]
|	[two]

def start
	[prods]

parse S: start( stdin )
print_xml( match S "!aa bb cc dd" )