{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
{
switch ( LA(1)) {
case DOC_COMMENT:
{
d = LT(1);
match(DOC_COMMENT);
if ( inputState.guessing==0 ) {
doc=d.getText();
}
break;
}
case LITERAL_lexclass:
case LITERAL_class:
{
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
{
boolean synPredMatched13 = false;
if (((LA(1)==LITERAL_lexclass||LA(1)==LITERAL_class) && (LA(2)==TOKEN_REF||LA(2)==RULE_REF))) {
int _m13 = mark();
synPredMatched13 = true;
inputState.guessing++;
try {
{
switch ( LA(1)) {
case LITERAL_lexclass:
{
match(LITERAL_lexclass);
break;
}
case LITERAL_class:
{
match(LITERAL_class);
id();
match(LITERAL_extends);
match(LITERAL_Lexer);
break;
}
default:
{
throw new NoViableAltException(LT(1), getFilename());
}
}
}
}
catch (RecognitionException pe) {
synPredMatched13 = false;
}
rewind(_m13);
inputState.guessing--;
}
if ( synPredMatched13 ) {
lexerSpec(doc);
}
else {
boolean synPredMatched15 = false;
if (((LA(1)==LITERAL_class) && (LA(2)==TOKEN_REF||LA(2)==RULE_REF))) {
int _m15 = mark();
synPredMatched15 = true;
inputState.guessing++;
try {
{
match(LITERAL_class);
id();
match(LITERAL_extends);
match(LITERAL_TreeParser);
}
}
catch (RecognitionException pe) {
synPredMatched15 = false;
}
rewind(_m15);
inputState.guessing--;
}
if ( synPredMatched15 ) {
treeParserSpec(doc);
}
else if ((LA(1)==LITERAL_class) && (LA(2)==TOKEN_REF||LA(2)==RULE_REF)) {
parserSpec(doc);
}
else {
throw new NoViableAltException(LT(1), getFilename());
}
}
}
rules();
if ( inputState.guessing==0 ) {
behavior.endGrammar();
}
}
catch (RecognitionException ex) {
if (inputState.guessing==0) {
if ( ex instanceof NoViableAltException ) {
NoViableAltException e = (NoViableAltException)ex;
// RK: These probably generate inconsequent error messages...
// have to see how this comes out..
if ( e.token.getType()==DOC_COMMENT ) {
reportError(ex, "JAVADOC comments may only prefix rules and grammars");
}