Token result = engine.scan("A");
assertEquals(Atype, result.getType());
}
@Test public void testTokensRules() throws Exception {
Grammar pg = new Grammar(
"parser grammar p;\n"+
"a : (INT|FLOAT|WS)+;\n");
Grammar g = new Grammar();
g.importTokenVocabulary(pg);
g.setFileName("<string>");
g.setGrammarContent(
"lexer grammar t;\n"+
"INT : (DIGIT)+ ;\n"+
"FLOAT : (DIGIT)+ '.' (DIGIT)* ;\n"+
"fragment DIGIT : '0'..'9';\n" +
"WS : (' ')+ {channel=99;};\n");