org.antlr.v4.test.runtime.templates.LexerExec.HexVsID.stg Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of runtime-testsuite Show documentation
Show all versions of runtime-testsuite Show documentation
A collection of tests for ANTLR 4 Runtime libraries.
TestType() ::= "Lexer"
Grammar ::= [
"L": {}
]
Input() ::= <%
x 0 1 a.b a.l
%>
Output() ::= <<
[@0,0:0='x',\<5>,1:0]
[@1,1:1=' ',\<6>,1:1]
[@2,2:2='0',\<2>,1:2]
[@3,3:3=' ',\<6>,1:3]
[@4,4:4='1',\<2>,1:4]
[@5,5:5=' ',\<6>,1:5]
[@6,6:6='a',\<5>,1:6]
[@7,7:7='.',\<4>,1:7]
[@8,8:8='b',\<5>,1:8]
[@9,9:9=' ',\<6>,1:9]
[@10,10:10='a',\<5>,1:10]
[@11,11:11='.',\<4>,1:11]
[@12,12:12='l',\<5>,1:12]
[@13,13:12='\',\<-1>,1:13]<\n>
>>
Errors() ::= ""
grammar(grammarName) ::= <<
lexer grammar ;
HexLiteral : '0' ('x'|'X') HexDigit+ ;
DecimalLiteral : ('0' | '1'..'9' '0'..'9'*) ;
FloatingPointLiteral : ('0x' | '0X') HexDigit* ('.' HexDigit*)? ;
DOT : '.' ;
ID : 'a'..'z'+ ;
fragment HexDigit : ('0'..'9'|'a'..'f'|'A'..'F') ;
WS : (' '|'\n')+;
>>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy