org.jastadd.ast.AST.Ast Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jastadd Show documentation
Show all versions of jastadd Show documentation
A metacompilation framework for Java using attribute grammars.
/* Generated By:JJTree&JavaCC: Do not edit this line. Ast.java */
package org.jastadd.ast.AST;
import java.util.*;
import org.jastadd.*;
public class Ast/*@bgen(jjtree)*/implements AstTreeConstants, AstConstants {/*@bgen(jjtree)*/
protected JJTAstState jjtree = new JJTAstState();
private Collection problems = new LinkedList();
public String fileName;
public Collection parseProblems() {
return problems;
}
private void error_skipto(int kind) {
ParseException e = generateParseException();
StringBuffer msg = new StringBuffer();
int line = e.currentToken.next.beginLine;
int column = e.currentToken.next.beginColumn;
problems.add(Problem.builder()
.message("syntax error")
.sourceFile(fileName)
.sourceLine(line)
.sourceColumn(column)
.buildError());
}
// Added methods for NODE_SCOPE_HOOK.
public void jjtreeOpenNodeScope(Node n) {
((SimpleNode) n).firstToken = getToken(1);
}
public void jjtreeCloseNodeScope(Node n) {
((SimpleNode) n).lastToken = getToken(0);
}
final public Grammar Grammar() throws ParseException {
/*@bgen(jjtree) Grammar */
Grammar jjtn000 = new Grammar(JJTGRAMMAR);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
ClassList();
RegionList();
jj_consume_token(0);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
jjtreeCloseNodeScope(jjtn000);
{if (true) return jjtn000;}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
throw new Error("Missing return statement in function");
}
final public void RegionList() throws ParseException {
/*@bgen(jjtree) List */
List jjtn000 = new List(JJTLIST);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
label_1:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case REGION:
;
break;
default:
jj_la1[0] = jj_gen;
break label_1;
}
RegionDecl();
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void RegionDecl() throws ParseException {
/*@bgen(jjtree) RegionDecl */
RegionDecl jjtn000 = new RegionDecl(JJTREGIONDECL);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(REGION);
IdUse();
jj_consume_token(SEMICOLON);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void ClassList() throws ParseException {
/*@bgen(jjtree) List */
List jjtn000 = new List(JJTLIST);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
label_2:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ABSTRACT:
case ID:
;
break;
default:
jj_la1[1] = jj_gen;
break label_2;
}
try {
Class();
} catch (ParseException e) {
}
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void Class() throws ParseException {
/*@bgen(jjtree) ASTDecl */
ASTDecl jjtn000 = new ASTDecl(JJTASTDECL);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);Token first = null, last;
try {
try {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ABSTRACT:
Abstract();
Opt jjtn001 = new Opt(JJTOPT);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
jjtreeOpenNodeScope(jjtn001);
try {
jjtree.closeNodeScope(jjtn001, 1);
jjtc001 = false;
jjtreeCloseNodeScope(jjtn001);
first = token;
} finally {
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, 1);
jjtreeCloseNodeScope(jjtn001);
}
}
break;
default:
jj_la1[2] = jj_gen;
Opt jjtn002 = new Opt(JJTOPT);
boolean jjtc002 = true;
jjtree.openNodeScope(jjtn002);
jjtreeOpenNodeScope(jjtn002);
try {
jjtree.closeNodeScope(jjtn002, 0);
jjtc002 = false;
jjtreeCloseNodeScope(jjtn002);
} finally {
if (jjtc002) {
jjtree.closeNodeScope(jjtn002, 0);
jjtreeCloseNodeScope(jjtn002);
}
}
}
IdDecl();
if(first == null) first = token;
OptSuperClass();
ComponentList();
Attributes();
jj_consume_token(SEMICOLON);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
jjtreeCloseNodeScope(jjtn000);
last = token;
jjtn000.setFileName(fileName);
jjtn000.setStartLine(first.beginLine);
jjtn000.setEndLine(last.endLine);
jjtn000.setComment(jjtn000.unparseComment());
jjtn000.modifiers = "public";
} catch (ParseException e) {
error_skipto(SEMICOLON);
{if (true) throw e;}
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void Attributes() throws ParseException {
List jjtn001 = new List(JJTLIST);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
jjtreeOpenNodeScope(jjtn001);
try {
jjtree.closeNodeScope(jjtn001, 0);
jjtc001 = false;
jjtreeCloseNodeScope(jjtn001);
} finally {
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, 0);
jjtreeCloseNodeScope(jjtn001);
}
}
List jjtn002 = new List(JJTLIST);
boolean jjtc002 = true;
jjtree.openNodeScope(jjtn002);
jjtreeOpenNodeScope(jjtn002);
try {
jjtree.closeNodeScope(jjtn002, 0);
jjtc002 = false;
jjtreeCloseNodeScope(jjtn002);
} finally {
if (jjtc002) {
jjtree.closeNodeScope(jjtn002, 0);
jjtreeCloseNodeScope(jjtn002);
}
}
List jjtn003 = new List(JJTLIST);
boolean jjtc003 = true;
jjtree.openNodeScope(jjtn003);
jjtreeOpenNodeScope(jjtn003);
try {
jjtree.closeNodeScope(jjtn003, 0);
jjtc003 = false;
jjtreeCloseNodeScope(jjtn003);
} finally {
if (jjtc003) {
jjtree.closeNodeScope(jjtn003, 0);
jjtreeCloseNodeScope(jjtn003);
}
}
List jjtn004 = new List(JJTLIST);
boolean jjtc004 = true;
jjtree.openNodeScope(jjtn004);
jjtreeOpenNodeScope(jjtn004);
try {
jjtree.closeNodeScope(jjtn004, 0);
jjtc004 = false;
jjtreeCloseNodeScope(jjtn004);
} finally {
if (jjtc004) {
jjtree.closeNodeScope(jjtn004, 0);
jjtreeCloseNodeScope(jjtn004);
}
}
List jjtn005 = new List(JJTLIST);
boolean jjtc005 = true;
jjtree.openNodeScope(jjtn005);
jjtreeOpenNodeScope(jjtn005);
try {
jjtree.closeNodeScope(jjtn005, 0);
jjtc005 = false;
jjtreeCloseNodeScope(jjtn005);
} finally {
if (jjtc005) {
jjtree.closeNodeScope(jjtn005, 0);
jjtreeCloseNodeScope(jjtn005);
}
}
List jjtn006 = new List(JJTLIST);
boolean jjtc006 = true;
jjtree.openNodeScope(jjtn006);
jjtreeOpenNodeScope(jjtn006);
try {
jjtree.closeNodeScope(jjtn006, 0);
jjtc006 = false;
jjtreeCloseNodeScope(jjtn006);
} finally {
if (jjtc006) {
jjtree.closeNodeScope(jjtn006, 0);
jjtreeCloseNodeScope(jjtn006);
}
}
List jjtn007 = new List(JJTLIST);
boolean jjtc007 = true;
jjtree.openNodeScope(jjtn007);
jjtreeOpenNodeScope(jjtn007);
try {
jjtree.closeNodeScope(jjtn007, 0);
jjtc007 = false;
jjtreeCloseNodeScope(jjtn007);
} finally {
if (jjtc007) {
jjtree.closeNodeScope(jjtn007, 0);
jjtreeCloseNodeScope(jjtn007);
}
}
List jjtn008 = new List(JJTLIST);
boolean jjtc008 = true;
jjtree.openNodeScope(jjtn008);
jjtreeOpenNodeScope(jjtn008);
try {
jjtree.closeNodeScope(jjtn008, 0);
jjtc008 = false;
jjtreeCloseNodeScope(jjtn008);
} finally {
if (jjtc008) {
jjtree.closeNodeScope(jjtn008, 0);
jjtreeCloseNodeScope(jjtn008);
}
}
}
final public void OptAbstract() throws ParseException {
/*@bgen(jjtree) Opt */
Opt jjtn000 = new Opt(JJTOPT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ABSTRACT:
Abstract();
break;
default:
jj_la1[3] = jj_gen;
;
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void Abstract() throws ParseException {
/*@bgen(jjtree) Abstract */
Abstract jjtn000 = new Abstract(JJTABSTRACT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(ABSTRACT);
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void OptSuperClass() throws ParseException {
/*@bgen(jjtree) Opt */
Opt jjtn000 = new Opt(JJTOPT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 29:
jj_consume_token(29);
IdUse();
break;
default:
jj_la1[4] = jj_gen;
;
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void ComponentList() throws ParseException {
/*@bgen(jjtree) List */
List jjtn000 = new List(JJTLIST);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 30:
jj_consume_token(30);
label_3:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ID:
case 32:
case 33:
case 34:
;
break;
default:
jj_la1[5] = jj_gen;
break label_3;
}
Component();
}
break;
default:
jj_la1[6] = jj_gen;
;
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void Component() throws ParseException {
if (jj_2_1(2147483647)) {
ListComponent();
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 33:
OptionalComponent();
break;
case 34:
TokenComponent();
break;
case ID:
AggregateComponent();
break;
default:
jj_la1[7] = jj_gen;
if (jj_2_2(2147483647)) {
ListComponentNTA();
} else if (jj_2_3(2147483647)) {
OptionalComponentNTA();
} else if (jj_2_4(2147483647)) {
TokenComponentNTA();
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 32:
AggregateComponentNTA();
break;
default:
jj_la1[8] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
}
}
final public void ListComponent() throws ParseException {
/*@bgen(jjtree) ListComponent */
ListComponent jjtn000 = new ListComponent(JJTLISTCOMPONENT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
Id();
jj_consume_token(31);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void ListComponentNTA() throws ParseException {
/*@bgen(jjtree) ListComponentNTA */
ListComponentNTA jjtn000 = new ListComponentNTA(JJTLISTCOMPONENTNTA);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(32);
Id();
jj_consume_token(31);
jj_consume_token(32);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void OptionalComponent() throws ParseException {
/*@bgen(jjtree) OptionalComponent */
OptionalComponent jjtn000 = new OptionalComponent(JJTOPTIONALCOMPONENT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(33);
Id();
jj_consume_token(35);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void OptionalComponentNTA() throws ParseException {
/*@bgen(jjtree) OptionalComponentNTA */
OptionalComponentNTA jjtn000 = new OptionalComponentNTA(JJTOPTIONALCOMPONENTNTA);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(32);
jj_consume_token(33);
Id();
jj_consume_token(35);
jj_consume_token(32);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void TokenComponent() throws ParseException {
/*@bgen(jjtree) TokenComponent */
TokenComponent jjtn000 = new TokenComponent(JJTTOKENCOMPONENT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(34);
TokenId();
jj_consume_token(36);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void TokenComponentNTA() throws ParseException {
/*@bgen(jjtree) TokenComponentNTA */
TokenComponentNTA jjtn000 = new TokenComponentNTA(JJTTOKENCOMPONENTNTA);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(32);
jj_consume_token(34);
TokenId();
jj_consume_token(36);
jj_consume_token(32);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void AggregateComponent() throws ParseException {
/*@bgen(jjtree) AggregateComponent */
AggregateComponent jjtn000 = new AggregateComponent(JJTAGGREGATECOMPONENT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
Id();
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void AggregateComponentNTA() throws ParseException {
/*@bgen(jjtree) AggregateComponentNTA */
AggregateComponentNTA jjtn000 = new AggregateComponentNTA(JJTAGGREGATECOMPONENTNTA);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
jj_consume_token(32);
Id();
jj_consume_token(32);
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void Id() throws ParseException {
/*@bgen(jjtree) Id */
Id jjtn000 = new Id(JJTID);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
OptName();
IdUse();
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void OptName() throws ParseException {
/*@bgen(jjtree) Opt */
Opt jjtn000 = new Opt(JJTOPT);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);
try {
if (jj_2_5(2147483647)) {
NameNode();
jj_consume_token(29);
} else {
;
}
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void NameNode() throws ParseException {
/*@bgen(jjtree) NameNode */
NameNode jjtn000 = new NameNode(JJTNAMENODE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);Token t;
try {
t = jj_consume_token(ID);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
jjtreeCloseNodeScope(jjtn000);
jjtn000.setID(t.image);
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void IdUse() throws ParseException {
/*@bgen(jjtree) #IdUse(true) */
IdUse jjtn000 = new IdUse(JJTIDUSE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);Token t;
try {
t = jj_consume_token(ID);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
jjtreeCloseNodeScope(jjtn000);
jjtn000.setID(t.image);
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void IdDecl() throws ParseException {
/*@bgen(jjtree) #IdDecl(true) */
IdDecl jjtn000 = new IdDecl(JJTIDDECL);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);Token t;
try {
t = jj_consume_token(ID);
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
jjtreeCloseNodeScope(jjtn000);
jjtn000.setID(t.image);
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public void TokenId() throws ParseException {
/*@bgen(jjtree) #Id(true) */
Id jjtn000 = new Id(JJTID);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtreeOpenNodeScope(jjtn000);Token t;
String type = null;
boolean hasType = false;
try {
t = jj_consume_token(ID);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 29:
jj_consume_token(29);
type = Type();
hasType = true;
break;
default:
jj_la1[9] = jj_gen;
;
}
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
jjtreeCloseNodeScope(jjtn000);
jjtn000.setNameNode(new NameNode(t.image));
jjtn000.setIdUse(new IdUse(hasType ? type : "String"));
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte000;}
}
if (jjte000 instanceof ParseException) {
{if (true) throw (ParseException)jjte000;}
}
{if (true) throw (Error)jjte000;}
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtreeCloseNodeScope(jjtn000);
}
}
}
final public String Type() throws ParseException {
String s;
if (jj_2_6(2)) {
s = ReferenceType();
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BOOLEAN:
case CHAR:
case BYTE:
case SHORT:
case INT:
case LONG:
case FLOAT:
case DOUBLE:
s = PrimitiveType();
break;
default:
jj_la1[10] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
{if (true) return s;}
throw new Error("Missing return statement in function");
}
final public String ReferenceType() throws ParseException {
String s;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BOOLEAN:
case CHAR:
case BYTE:
case SHORT:
case INT:
case LONG:
case FLOAT:
case DOUBLE:
s = PrimitiveType();
label_4:
while (true) {
jj_consume_token(33);
jj_consume_token(35);
s += "[]";
if (jj_2_7(2)) {
;
} else {
break label_4;
}
}
break;
case ID:
s = ClassOrInterfaceType();
label_5:
while (true) {
if (jj_2_8(2)) {
;
} else {
break label_5;
}
jj_consume_token(33);
jj_consume_token(35);
s += "[]";
}
break;
default:
jj_la1[11] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return s;}
throw new Error("Missing return statement in function");
}
final public String ClassOrInterfaceType() throws ParseException {
Token t; String s; String u;
t = jj_consume_token(ID);
s = t.image;
if (jj_2_9(2)) {
u = TypeArguments();
s += u;
} else {
;
}
label_6:
while (true) {
if (jj_2_10(2)) {
;
} else {
break label_6;
}
jj_consume_token(37);
t = jj_consume_token(ID);
s += "." + t.image;
if (jj_2_11(2)) {
u = TypeArguments();
s += u;
} else {
;
}
}
{if (true) return s;}
throw new Error("Missing return statement in function");
}
final public String TypeArguments() throws ParseException {
String s; String t;
jj_consume_token(34);
s = "<";
t = TypeArgument();
s += t;
label_7:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case 38:
;
break;
default:
jj_la1[12] = jj_gen;
break label_7;
}
jj_consume_token(38);
s += ",";
t = TypeArgument();
s += t;
}
jj_consume_token(36);
s+=">";
{if (true) return s;}
throw new Error("Missing return statement in function");
}
final public String TypeArgument() throws ParseException {
String s; String t;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BOOLEAN:
case CHAR:
case BYTE:
case SHORT:
case INT:
case LONG:
case FLOAT:
case DOUBLE:
case ID:
s = ReferenceType();
break;
case 39:
jj_consume_token(39);
s = "?";
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SUPER:
case EXTENDS:
t = WildcardBounds();
s += t;
break;
default:
jj_la1[13] = jj_gen;
;
}
break;
default:
jj_la1[14] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return s;}
throw new Error("Missing return statement in function");
}
final public String WildcardBounds() throws ParseException {
String s; String t;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTENDS:
jj_consume_token(EXTENDS);
t = ReferenceType();
s = " extends " + t;
break;
case SUPER:
jj_consume_token(SUPER);
t = ReferenceType();
s = " super " + t;
break;
default:
jj_la1[15] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return s;}
throw new Error("Missing return statement in function");
}
final public String PrimitiveType() throws ParseException {
Token t;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BOOLEAN:
t = jj_consume_token(BOOLEAN);
break;
case CHAR:
t = jj_consume_token(CHAR);
break;
case BYTE:
t = jj_consume_token(BYTE);
break;
case SHORT:
t = jj_consume_token(SHORT);
break;
case INT:
t = jj_consume_token(INT);
break;
case LONG:
t = jj_consume_token(LONG);
break;
case FLOAT:
t = jj_consume_token(FLOAT);
break;
case DOUBLE:
t = jj_consume_token(DOUBLE);
break;
default:
jj_la1[16] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return t.image;}
throw new Error("Missing return statement in function");
}
final private boolean jj_2_1(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_1(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(0, xla); }
}
final private boolean jj_2_2(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_2(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(1, xla); }
}
final private boolean jj_2_3(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_3(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(2, xla); }
}
final private boolean jj_2_4(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_4(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(3, xla); }
}
final private boolean jj_2_5(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_5(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(4, xla); }
}
final private boolean jj_2_6(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_6(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(5, xla); }
}
final private boolean jj_2_7(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_7(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(6, xla); }
}
final private boolean jj_2_8(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_8(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(7, xla); }
}
final private boolean jj_2_9(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_9(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(8, xla); }
}
final private boolean jj_2_10(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_10(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(9, xla); }
}
final private boolean jj_2_11(int xla) {
jj_la = xla; jj_lastpos = jj_scanpos = token;
try { return !jj_3_11(); }
catch(LookaheadSuccess ls) { return true; }
finally { jj_save(10, xla); }
}
final private boolean jj_3_7() {
if (jj_scan_token(33)) return true;
if (jj_scan_token(35)) return true;
return false;
}
final private boolean jj_3R_12() {
if (jj_scan_token(34)) return true;
if (jj_3R_16()) return true;
return false;
}
final private boolean jj_3_11() {
if (jj_3R_12()) return true;
return false;
}
final private boolean jj_3_10() {
if (jj_scan_token(37)) return true;
if (jj_scan_token(ID)) return true;
return false;
}
final private boolean jj_3R_18() {
if (jj_scan_token(ID)) return true;
Token xsp;
xsp = jj_scanpos;
if (jj_3_9()) jj_scanpos = xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_10()) { jj_scanpos = xsp; break; }
}
return false;
}
final private boolean jj_3R_9() {
if (jj_scan_token(ID)) return true;
return false;
}
final private boolean jj_3_4() {
if (jj_scan_token(32)) return true;
if (jj_scan_token(34)) return true;
return false;
}
final private boolean jj_3_3() {
if (jj_scan_token(32)) return true;
if (jj_scan_token(33)) return true;
return false;
}
final private boolean jj_3R_15() {
if (jj_3R_18()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
if (jj_3_8()) { jj_scanpos = xsp; break; }
}
return false;
}
final private boolean jj_3_2() {
if (jj_scan_token(32)) return true;
if (jj_3R_8()) return true;
if (jj_3R_9()) return true;
if (jj_scan_token(31)) return true;
return false;
}
final private boolean jj_3_5() {
if (jj_3R_10()) return true;
if (jj_scan_token(29)) return true;
return false;
}
final private boolean jj_3R_14() {
if (jj_3R_17()) return true;
Token xsp;
if (jj_3_7()) return true;
while (true) {
xsp = jj_scanpos;
if (jj_3_7()) { jj_scanpos = xsp; break; }
}
return false;
}
final private boolean jj_3R_11() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_14()) {
jj_scanpos = xsp;
if (jj_3R_15()) return true;
}
return false;
}
final private boolean jj_3R_17() {
Token xsp;
xsp = jj_scanpos;
if (jj_scan_token(15)) {
jj_scanpos = xsp;
if (jj_scan_token(16)) {
jj_scanpos = xsp;
if (jj_scan_token(17)) {
jj_scanpos = xsp;
if (jj_scan_token(18)) {
jj_scanpos = xsp;
if (jj_scan_token(19)) {
jj_scanpos = xsp;
if (jj_scan_token(20)) {
jj_scanpos = xsp;
if (jj_scan_token(21)) {
jj_scanpos = xsp;
if (jj_scan_token(22)) return true;
}
}
}
}
}
}
}
return false;
}
final private boolean jj_3R_10() {
if (jj_scan_token(ID)) return true;
return false;
}
final private boolean jj_3_1() {
if (jj_3R_8()) return true;
if (jj_3R_9()) return true;
if (jj_scan_token(31)) return true;
return false;
}
final private boolean jj_3R_8() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_13()) jj_scanpos = xsp;
return false;
}
final private boolean jj_3R_13() {
if (jj_3R_10()) return true;
if (jj_scan_token(29)) return true;
return false;
}
final private boolean jj_3_9() {
if (jj_3R_12()) return true;
return false;
}
final private boolean jj_3_6() {
if (jj_3R_11()) return true;
return false;
}
final private boolean jj_3_8() {
if (jj_scan_token(33)) return true;
if (jj_scan_token(35)) return true;
return false;
}
final private boolean jj_3R_20() {
if (jj_scan_token(39)) return true;
return false;
}
final private boolean jj_3R_19() {
if (jj_3R_11()) return true;
return false;
}
final private boolean jj_3R_16() {
Token xsp;
xsp = jj_scanpos;
if (jj_3R_19()) {
jj_scanpos = xsp;
if (jj_3R_20()) return true;
}
return false;
}
public AstTokenManager token_source;
SimpleCharStream jj_input_stream;
public Token token, jj_nt;
private int jj_ntk;
private Token jj_scanpos, jj_lastpos;
private int jj_la;
public boolean lookingAhead = false;
private boolean jj_semLA;
private int jj_gen;
final private int[] jj_la1 = new int[17];
static private int[] jj_la1_0;
static private int[] jj_la1_1;
static {
jj_la1_0();
jj_la1_1();
}
private static void jj_la1_0() {
jj_la1_0 = new int[] {0x2000000,0x4002000,0x2000,0x2000,0x20000000,0x4000000,0x40000000,0x4000000,0x0,0x20000000,0x7f8000,0x47f8000,0x0,0x1800000,0x47f8000,0x1800000,0x7f8000,};
}
private static void jj_la1_1() {
jj_la1_1 = new int[] {0x0,0x0,0x0,0x0,0x0,0x7,0x0,0x6,0x1,0x0,0x0,0x0,0x40,0x0,0x80,0x0,0x0,};
}
final private JJCalls[] jj_2_rtns = new JJCalls[11];
private boolean jj_rescan = false;
private int jj_gc = 0;
public Ast(java.io.InputStream stream) {
this(stream, null);
}
public Ast(java.io.InputStream stream, String encoding) {
try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
token_source = new AstTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 17; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public void ReInit(java.io.InputStream stream) {
ReInit(stream, null);
}
public void ReInit(java.io.InputStream stream, String encoding) {
try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jjtree.reset();
jj_gen = 0;
for (int i = 0; i < 17; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public Ast(java.io.Reader stream) {
jj_input_stream = new SimpleCharStream(stream, 1, 1);
token_source = new AstTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 17; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public void ReInit(java.io.Reader stream) {
jj_input_stream.ReInit(stream, 1, 1);
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jjtree.reset();
jj_gen = 0;
for (int i = 0; i < 17; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public Ast(AstTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
for (int i = 0; i < 17; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
public void ReInit(AstTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jjtree.reset();
jj_gen = 0;
for (int i = 0; i < 17; i++) jj_la1[i] = -1;
for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
final private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
if ((oldToken = token).next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
for (int i = 0; i < jj_2_rtns.length; i++) {
JJCalls c = jj_2_rtns[i];
while (c != null) {
if (c.gen < jj_gen) c.first = null;
c = c.next;
}
}
}
return token;
}
token = oldToken;
jj_kind = kind;
throw generateParseException();
}
static private final class LookaheadSuccess extends java.lang.Error { }
final private LookaheadSuccess jj_ls = new LookaheadSuccess();
final private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
} else {
jj_scanpos = jj_scanpos.next;
}
if (jj_rescan) {
int i = 0; Token tok = token;
while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
if (tok != null) jj_add_error_token(kind, i);
}
if (jj_scanpos.kind != kind) return true;
if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
return false;
}
final public Token getNextToken() {
if (token.next != null) token = token.next;
else token = token.next = token_source.getNextToken();
jj_ntk = -1;
jj_gen++;
return token;
}
final public Token getToken(int index) {
Token t = lookingAhead ? jj_scanpos : token;
for (int i = 0; i < index; i++) {
if (t.next != null) t = t.next;
else t = t.next = token_source.getNextToken();
}
return t;
}
final private int jj_ntk() {
if ((jj_nt=token.next) == null)
return (jj_ntk = (token.next=token_source.getNextToken()).kind);
else
return (jj_ntk = jj_nt.kind);
}
private java.util.Vector jj_expentries = new java.util.Vector();
private int[] jj_expentry;
private int jj_kind = -1;
private int[] jj_lasttokens = new int[100];
private int jj_endpos;
private void jj_add_error_token(int kind, int pos) {
if (pos >= 100) return;
if (pos == jj_endpos + 1) {
jj_lasttokens[jj_endpos++] = kind;
} else if (jj_endpos != 0) {
jj_expentry = new int[jj_endpos];
for (int i = 0; i < jj_endpos; i++) {
jj_expentry[i] = jj_lasttokens[i];
}
boolean exists = false;
for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) {
int[] oldentry = (int[])(e.nextElement());
if (oldentry.length == jj_expentry.length) {
exists = true;
for (int i = 0; i < jj_expentry.length; i++) {
if (oldentry[i] != jj_expentry[i]) {
exists = false;
break;
}
}
if (exists) break;
}
}
if (!exists) jj_expentries.addElement(jj_expentry);
if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
}
}
public ParseException generateParseException() {
jj_expentries.removeAllElements();
boolean[] la1tokens = new boolean[40];
for (int i = 0; i < 40; i++) {
la1tokens[i] = false;
}
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
}
for (int i = 0; i < 17; i++) {
if (jj_la1[i] == jj_gen) {
for (int j = 0; j < 32; j++) {
if ((jj_la1_0[i] & (1< jj_gen) {
jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
switch (i) {
case 0: jj_3_1(); break;
case 1: jj_3_2(); break;
case 2: jj_3_3(); break;
case 3: jj_3_4(); break;
case 4: jj_3_5(); break;
case 5: jj_3_6(); break;
case 6: jj_3_7(); break;
case 7: jj_3_8(); break;
case 8: jj_3_9(); break;
case 9: jj_3_10(); break;
case 10: jj_3_11(); break;
}
}
p = p.next;
} while (p != null);
} catch(LookaheadSuccess ls) { }
}
jj_rescan = false;
}
final private void jj_save(int index, int xla) {
JJCalls p = jj_2_rtns[index];
while (p.gen > jj_gen) {
if (p.next == null) { p = p.next = new JJCalls(); break; }
p = p.next;
}
p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
}
static final class JJCalls {
int gen;
Token first;
int arg;
JJCalls next;
}
}