summaryrefslogtreecommitdiff
path: root/test/btscan1.lm
blob: 0aae89e354710603556e87ea76dff21cf4f5f4db (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
namespace r1
{
	lex r1
	{
		literal '!', 'a', 'b'
		ignore /[ \n\t]+/
	}

	def line [ '!' 'a' 'b' 'b' 'a']
}

namespace r2
{
	lex r2
	{
		literal '!'
		token id /[a-zA-Z_]+/
		ignore /[ \n\t]+/
	}

	def line [ '!' id ]
}

def item 
	[r1::line]
|	[r2::line]

def btscan 
	[item*]

P: btscan P = parse btscan( stdin )

match P ~!abb !abba !aab
print_xml(P)