summaryrefslogtreecommitdiff
path: root/test/btscan.lm
blob: ac7914c250190792d29f147c353e8a426ab0ef79 (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*]

btscan P = parse btscan( stdin )

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