use of org.antlr.v4.tool.LexerGrammar in project antlr4 by tunnelvisionlabs.
the class TestATNConstruction method testCharSetRange.
@Test
public void testCharSetRange() throws Exception {
LexerGrammar g = new LexerGrammar("lexer grammar P;\n" + "A : [a-c] ;");
String expecting = "s0->RuleStart_A_1\n" + "RuleStart_A_1->s3\n" + "s3-{97..99}->s4\n" + "s4->RuleStop_A_2\n";
checkTokensRule(g, null, expecting);
}
use of org.antlr.v4.tool.LexerGrammar in project antlr4 by tunnelvisionlabs.
the class TestATNDeserialization method testLexerNotSet.
@Test
public void testLexerNotSet() throws Exception {
LexerGrammar lg = new LexerGrammar("lexer grammar L;\n" + "ID : ~('a'|'b')\n ;");
checkDeserializationIsStable(lg);
}
use of org.antlr.v4.tool.LexerGrammar in project antlr4 by tunnelvisionlabs.
the class TestATNDeserialization method testLexerTwoRules.
@Test
public void testLexerTwoRules() throws Exception {
LexerGrammar lg = new LexerGrammar("lexer grammar L;\n" + "A : 'a' ;\n" + "B : 'b' ;\n");
checkDeserializationIsStable(lg);
}
use of org.antlr.v4.tool.LexerGrammar in project antlr4 by tunnelvisionlabs.
the class TestATNDeserialization method testLexerNotSetWithRange.
@Test
public void testLexerNotSetWithRange() throws Exception {
LexerGrammar lg = new LexerGrammar("lexer grammar L;\n" + "ID : ~('a'|'b'|'e'|'p'..'t')\n ;");
checkDeserializationIsStable(lg);
}
use of org.antlr.v4.tool.LexerGrammar in project antlr4 by tunnelvisionlabs.
the class TestATNDeserialization method testLexerNotSetWithRange2.
@Test
public void testLexerNotSetWithRange2() throws Exception {
LexerGrammar lg = new LexerGrammar("lexer grammar L;\n" + "ID : ~('a'|'b') ~('e'|'p'..'t')\n ;");
checkDeserializationIsStable(lg);
}
Aggregations