ack. more cleanup work will be required for change of token types from 3..n to 1..n

This commit is contained in:
Terence Parr 2012-06-01 18:08:00 -07:00
parent 8481979f69
commit 5a2fe297e3
2 changed files with 6 additions and 6 deletions

View File

@ -123,8 +123,8 @@ public <if(parser.abstractRecognizer)>abstract <endif>class <parser.name> extend
<parser.tokens:{k | <k>=<parser.tokens.(k)>}; separator=", ", wrap, anchor>; <parser.tokens:{k | <k>=<parser.tokens.(k)>}; separator=", ", wrap, anchor>;
<endif> <endif>
public static final String[] tokenNames = { public static final String[] tokenNames = {
"\<INVALID>", "\<INVALID>", "\<INVALID>", "\<INVALID>",
<parser.tokenNames:{t | <t>}; separator=", ", wrap, anchor> <parser.tokenNames:{t | <t>}; separator=", ", wrap, anchor>
}; };
public static final int public static final int
<parser.rules:{r | RULE_<r.name> = <r.index>}; separator=", ", wrap, anchor>; <parser.rules:{r | RULE_<r.name> = <r.index>}; separator=", ", wrap, anchor>;
@ -723,7 +723,7 @@ public <if(lexer.abstractRecognizer)>abstract <endif>class <lexer.name> extends
}; };
public static final String[] tokenNames = { public static final String[] tokenNames = {
"\<INVALID>", "\<INVALID>", "\<INVALID>", "\<INVALID>",
<lexer.tokenNames:{t | <t>}; separator=", ", wrap, anchor> <lexer.tokenNames:{t | <t>}; separator=", ", wrap, anchor>
}; };
public static final String[] ruleNames = { public static final String[] ruleNames = {

View File

@ -80,7 +80,7 @@ public class TestATNInterpreter extends BaseTest {
errorTokenType = re.getOffendingToken().getType(); errorTokenType = re.getOffendingToken().getType();
} }
assertEquals(1, errorIndex); assertEquals(1, errorIndex);
assertEquals(errorTokenType, 5); assertEquals(3, errorTokenType);
} }
@Test public void testMustTrackPreviousGoodAlt2() throws Exception { @Test public void testMustTrackPreviousGoodAlt2() throws Exception {
@ -106,7 +106,7 @@ public class TestATNInterpreter extends BaseTest {
errorTokenType = re.getOffendingToken().getType(); errorTokenType = re.getOffendingToken().getType();
} }
assertEquals(2, errorIndex); assertEquals(2, errorIndex);
assertEquals(errorTokenType, 6); assertEquals(4, errorTokenType);
} }
@Test public void testMustTrackPreviousGoodAlt3() throws Exception { @Test public void testMustTrackPreviousGoodAlt3() throws Exception {
@ -129,7 +129,7 @@ public class TestATNInterpreter extends BaseTest {
errorTokenType = re.getOffendingToken().getType(); errorTokenType = re.getOffendingToken().getType();
} }
assertEquals(2, errorIndex); assertEquals(2, errorIndex);
assertEquals(errorTokenType, 6); assertEquals(4, errorTokenType);
} }
@Test public void testAmbigAltChooseFirst() throws Exception { @Test public void testAmbigAltChooseFirst() throws Exception {