use of org.antlr.v4.tool.LexerGrammar in project antlr4 by tunnelvisionlabs.
the class TestATNConstruction method testCharSetUnicodePropertyInvertEscape.
@Test
public void testCharSetUnicodePropertyInvertEscape() throws Exception {
LexerGrammar g = new LexerGrammar("lexer grammar P;\n" + "A : [\\P{Gothic}] ;");
String expecting = "s0->RuleStart_A_1\n" + "RuleStart_A_1->s3\n" + "s3-{0..66351, 66379..1114111}->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 TestATNConstruction method testCharSetUnicodePropertyOverlap.
@Test
public void testCharSetUnicodePropertyOverlap() throws Exception {
LexerGrammar g = new LexerGrammar("lexer grammar P;\n" + "A : [\\p{ASCII_Hex_Digit}\\p{Hex_Digit}] ;");
String expecting = "s0->RuleStart_A_1\n" + "RuleStart_A_1->s3\n" + "s3-{48..57, 65..70, 97..102, 65296..65305, 65313..65318, 65345..65350}->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 TestATNConstruction method testCharSetUnicodeSMPEscape.
@Test
public void testCharSetUnicodeSMPEscape() throws Exception {
LexerGrammar g = new LexerGrammar("lexer grammar P;\n" + "A : [\\u{10ABCD}] ;");
String expecting = "s0->RuleStart_A_1\n" + "RuleStart_A_1->s3\n" + "s3-1092557->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 TestATNConstruction method testCharSetUnicodeMultiplePropertyEscape.
@Test
public void testCharSetUnicodeMultiplePropertyEscape() throws Exception {
// Ditto the Mahajani script. Not going to change soon. I hope.
LexerGrammar g = new LexerGrammar("lexer grammar P;\n" + "A : [\\p{Gothic}\\p{Mahajani}] ;");
String expecting = "s0->RuleStart_A_1\n" + "RuleStart_A_1->s3\n" + "s3-{66352..66378, 69968..70006}->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 TestATNConstruction method testCharSet.
@Test
public void testCharSet() throws Exception {
LexerGrammar g = new LexerGrammar("lexer grammar P;\n" + "A : [abc] ;");
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);
}
Aggregations