/* Generated By:JavaCC: Do not edit this line. CobolParser.java */
package com.res.cobol.parser;
import com.res.common.RESConfig;
import com.res.cobol.syntaxtree.*;
import java.util.Vector;
public class CobolParser implements CobolParserConstants {
private boolean notFollowedByEndExec()
{
int i = 1;
while ( getToken(i).kind == COBOL_WORD || getToken(i).kind == IN|| getToken(i).kind == OF )
{
i = skipSubscripts(++i);
if ( getToken(i).kind == PLUSCHAR || getToken(i).kind == MINUSCHAR|| getToken(i).kind == ASTERISKCHAR|| getToken(i).kind == SLASHCHAR )
return false;
}
return true;
}
private boolean notFollowedByOp()
{
int i = 1;
Token t;
while ( canBeIdentifierOrNumber(t = getToken(i)) )
{
i = skipSubscripts(++i);
if ( (t = getToken(i)).kind == PLUSCHAR || t.kind == PLUSCHAR_SUBS|| t.kind == MINUSCHAR_SUBS|| t.kind == ASTERISKCHAR|| t.kind == SLASHCHAR )
return false;
}
return true;
}
private boolean notFollowedByRelOp()
{
int i = 1;
Token t;
while ( canBeIdentifierOrNumber(t = getToken(i)) )
{
i = skipSubscripts(++i);
if ( (t = getToken(i)).kind == LESSTHANCHAR || t.kind == MORETHANCHAR|| t.kind == GREATER|| t.kind == LESS|| t.kind == EQUALCHAR|| t.kind == EQUAL|| t.kind == EQUALS|| t.kind == EQUALS|| t.kind == NOTEQUALCHAR|| t.kind == NOT )
return false;
}
return true;
}
private boolean canBeIdentifierOrNumber(Token t)
{
return t.kind == COBOL_WORD || t.kind == IN|| t.kind == OF|| t.kind == IS|| t.kind == LEVEL_66|| t.kind == LEVEL_77|| t.kind == LEVEL_78|| t.kind == LEVEL_88|| t.kind == LEVEL_NUMBER|| t.kind == INTEGER|| t.kind == COMMA_INTEGER|| t.kind == MINUSCHAR|| t.kind == MINUSCHAR_SUBS|| t.kind == LPARENCHAR|| t.kind == DOTCHAR;
}
private int skipSubscripts(int i)
{
if ( getToken(i).kind == LPARENCHAR )
{
while ( getToken(++i).kind != RPARENCHAR && getToken(i).kind != DOT )
;
if ( getToken(++i).kind == RPARENCHAR )
i++;
}
return i;
}
class SkipToEndExec extends NodeList
{
public SkipToEndExec(NodeList n0)
{
super();
super.nodes.addAll(n0.nodes);
if ( n0 != null )
super.setParent(this);
}
public SkipToEndExec()
{
}
public void accept(com.res.cobol.visitor.Visitor v)
{
v.visit(this);
}
public void setParent(Node n)
{
super.setParent(n);
}
public Node getParent()
{
return super.getParent();
}
}
final public CobolWord CobolWord() throws ParseException {
trace_call("CobolWord");
try {
NodeToken n0;
Token n1;
try {
n1 = jj_consume_token(COBOL_WORD);
n0 = JTBToolkit.makeNodeToken(n1);
} catch (ParseException e) {
error_skipto(DOT); {if (true) return new CobolWord();}
}
{if (true) return new CobolWord(n0);}
throw new Error("Missing return statement in function");
} finally {
trace_return("CobolWord");
}
}
final public IntegerConstant IntegerConstant() throws ParseException {
trace_call("IntegerConstant");
try {
NodeChoice n0;
NodeToken n1;
Token n2;
NodeToken n3;
Token n4;
NodeToken n5;
Token n6;
NodeToken n7;
Token n8;
NodeToken n9;
Token n10;
NodeToken n11;
Token n12;
NodeToken n13;
Token n14;
try {
if (jj_2_1(2)) {
n2 = jj_consume_token(LEVEL_66);
n1 = JTBToolkit.makeNodeToken(n2);
n0 = new NodeChoice(n1, 0);
} else if (jj_2_2(2)) {
n4 = jj_consume_token(LEVEL_77);
n3 = JTBToolkit.makeNodeToken(n4);
n0 = new NodeChoice(n3, 1);
} else if (jj_2_3(2)) {
n6 = jj_consume_token(LEVEL_78);
n5 = JTBToolkit.makeNodeToken(n6);
n0 = new NodeChoice(n5, 2);
} else if (jj_2_4(2)) {
n8 = jj_consume_token(LEVEL_88);
n7 = JTBToolkit.makeNodeToken(n8);
n0 = new NodeChoice(n7, 3);
} else if (jj_2_5(2)) {
n10 = jj_consume_token(LEVEL_NUMBER);
n9 = JTBToolkit.makeNodeToken(n10);
n0 = new NodeChoice(n9, 4);
} else if (jj_2_6(2)) {
n12 = jj_consume_token(INTEGER);
n11 = JTBToolkit.makeNodeToken(n12);
n0 = new NodeChoice(n11, 5);
} else if (jj_2_7(2)) {
n14 = jj_consume_token(COMMA_INTEGER);
n13 = JTBToolkit.makeNodeToken(n14);
n0 = new NodeChoice(n13, 6);
} else {
jj_consume_token(-1);
throw new ParseException();
}
} catch (ParseException e) {
error_skipto(DOT); {if (true) return new IntegerConstant();}
}
{if (true) return new IntegerConstant(n0);}
throw new Error("Missing return statement in function");
} finally {
trace_return("IntegerConstant");
}
}
final public NumericConstant NumericConstant() throws ParseException {
trace_call("NumericConstant");
try {
NodeOptional n0 = new NodeOptional();
NodeChoice n1;
NodeToken n2;
Token n3;
NodeToken n4;
Token n5;
NodeChoice n6;
NodeSequence n7;
IntegerConstant n8;
NodeToken n9;
Token n10;
NodeOptional n11 = new NodeOptional();
IntegerConstant n12;
NodeSequence n13;
NodeToken n14;
Token n15;
IntegerConstant n16;
IntegerConstant n17;
try {
if (jj_2_10(2)) {
if (jj_2_8(2)) {
n3 = jj_consume_token(PLUSCHAR);
n2 = JTBToolkit.makeNodeToken(n3);
n1 = new NodeChoice(n2, 0);
} else if (jj_2_9(2)) {
n5 = jj_consume_token(MINUSCHAR);
n4 = JTBToolkit.makeNodeToken(n5);
n1 = new NodeChoice(n4, 1);
} else {
jj_consume_token(-1);
throw new ParseException();
}
n0.addNode(n1);
} else {
;
}
if (jj_2_12(2147483647)) {
n7 = new NodeSequence(4);
n8 = IntegerConstant();
n7.addNode(n8);
n10 = jj_consume_token(DOTCHAR);
n9 = JTBToolkit.makeNodeToken(n10);
n7.addNode(n9);
if (jj_2_11(2)) {
n12 = IntegerConstant();
n11.addNode(n12);
} else {
;
}
n7.addNode(n11);
n6 = new NodeChoice(n7, 0);
} else if (jj_2_13(2147483647)) {
n13 = new NodeSequence(3);
n15 = jj_consume_token(DOTCHAR);
n14 = JTBToolkit.makeNodeToken(n15);
n13.addNode(n14);
n16 = IntegerConstant();
n13.addNode(n16);
n6 = new NodeChoice(n13, 1);
} else if (jj_2_14(2147483647)) {
n17 = IntegerConstant();
n6 = new NodeChoice(n17, 2);
} else {
jj_consume_token(-1);
throw new ParseException();
}
} catch (ParseException e) {
error_skipto(DOT); {if (true) return new NumericConstant();}
}
{if (true) return new NumericConstant(n0,n6);}
throw new Error("Missing return statement in function");
} finally {
trace_return("NumericConstant");
}
}
final public LevelNumber LevelNumber() throws ParseException {
trace_call("LevelNumber");
try {
NodeToken n0;
Token n1;
try {
n1 = jj_consume_token(LEVEL_NUMBER);
n0 = JTBT