aboutsummaryrefslogtreecommitdiff
path: root/runtime/CSharp3/Sources/Antlr3.Runtime.Test/StringTemplateOutput.g3
blob: 886e48a199d774dcf11cfa6ca0cb60c8c039ebed (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
35
36
grammar StringTemplateOutput;

options {
    language=CSharp3;
    TokenLabelType=CommonToken;
    output=template;
}

@lexer::namespace{Antlr3.Runtime.Test}
@parser::namespace{Antlr3.Runtime.Test}

/*
 * Parser Rules
 */

public
compileUnit
    :   ID integer EOF
		-> new(id={$ID.text}, value={$integer.st})
    ;

integer
	:	i='int' -> {%{$i.text}}
	;

/*
 * Lexer Rules
 */

ID
	:	'a'..'z'*
	;

WS
    :   ' '
    ;