summaryrefslogtreecommitdiff
path: root/test/translate1.lm
blob: 4403ca62eb4ae53aa978345d06c9808cce033445 (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