// $ANTLR 2.7.1: "genkit.g" -> "GenKitParser.java"$

import antlr.TokenBuffer;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.ANTLRException;
import antlr.LLkParser;
import antlr.Token;
import antlr.TokenStream;
import antlr.RecognitionException;
import antlr.NoViableAltException;
import antlr.MismatchedTokenException;
import antlr.SemanticException;
import antlr.ParserSharedInputState;
import antlr.collections.impl.BitSet;
import antlr.collections.AST;
import antlr.ASTPair;
import antlr.collections.impl.ASTArray;

public class GenKitParser extends antlr.LLkParser
       implements GenKitParserTokenTypes
 {

protected GenKitParser(TokenBuffer tokenBuf, int k) {
  super(tokenBuf,k);
  tokenNames = _tokenNames;
}

public GenKitParser(TokenBuffer tokenBuf) {
  this(tokenBuf,3);
}

protected GenKitParser(TokenStream lexer, int k) {
  super(lexer,k);
  tokenNames = _tokenNames;
}

public GenKitParser(TokenStream lexer) {
  this(lexer,3);
}

public GenKitParser(ParserSharedInputState state) {
  super(state,3);
  tokenNames = _tokenNames;
}

	public final void rules() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST rules_AST = null;
		
		try {      // for error handling
			if ((LA(1)==LPAREN) && (LA(2)==NT) && (LA(3)==NONSPACED||LA(3)==SPACED)) {
				rule();
				astFactory.addASTChild(currentAST, returnAST);
				rules_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==NT) && (LA(3)==NONSPACED||LA(3)==SPACED)) {
				rule();
				astFactory.addASTChild(currentAST, returnAST);
				rules();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp1_AST = null;
				tmp1_AST = (AST)astFactory.create(LT(1));
				match(Token.EOF_TYPE);
				rules_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_0);
		}
		returnAST = rules_AST;
	}
	
	public final void rule() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST rule_AST = null;
		
		try {      // for error handling
			if ((LA(1)==LPAREN) && (LA(2)==NT) && (LA(3)==NONSPACED||LA(3)==SPACED)) {
				AST tmp2_AST = null;
				tmp2_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp2_AST);
				match(LPAREN);
				production();
				astFactory.addASTChild(currentAST, returnAST);
				equationsgroup();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp3_AST = null;
				tmp3_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp3_AST);
				match(RPAREN);
				rule_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==NT) && (LA(3)==NONSPACED||LA(3)==SPACED)) {
				AST tmp4_AST = null;
				tmp4_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp4_AST);
				match(LPAREN);
				production();
				astFactory.addASTChild(currentAST, returnAST);
				equation();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp5_AST = null;
				tmp5_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp5_AST);
				match(RPAREN);
				rule_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==NT) && (LA(3)==NONSPACED||LA(3)==SPACED)) {
				AST tmp6_AST = null;
				tmp6_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp6_AST);
				match(LPAREN);
				production();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp7_AST = null;
				tmp7_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp7_AST);
				match(RPAREN);
				rule_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_1);
		}
		returnAST = rule_AST;
	}
	
	public final void production() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST production_AST = null;
		
		try {      // for error handling
			if ((LA(1)==NT) && (LA(2)==NONSPACED)) {
				leftside();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp8_AST = null;
				tmp8_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp8_AST);
				match(NONSPACED);
				AST tmp9_AST = null;
				tmp9_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp9_AST);
				match(LPAREN);
				rightside();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp10_AST = null;
				tmp10_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp10_AST);
				match(RPAREN);
				production_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==NT) && (LA(2)==SPACED)) {
				leftside();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp11_AST = null;
				tmp11_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp11_AST);
				match(SPACED);
				AST tmp12_AST = null;
				tmp12_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp12_AST);
				match(LPAREN);
				rightside();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp13_AST = null;
				tmp13_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp13_AST);
				match(RPAREN);
				production_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_2);
		}
		returnAST = production_AST;
	}
	
	public final void equationsgroup() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST equationsgroup_AST = null;
		
		try {      // for error handling
			if ((LA(1)==LPAREN) && (LA(2)==RPAREN)) {
				AST tmp14_AST = null;
				tmp14_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp14_AST);
				match(LPAREN);
				AST tmp15_AST = null;
				tmp15_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp15_AST);
				match(RPAREN);
				equationsgroup_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN) && (_tokenSet_3.member(LA(3)))) {
				AST tmp16_AST = null;
				tmp16_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp16_AST);
				match(LPAREN);
				equations();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp17_AST = null;
				tmp17_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp17_AST);
				match(RPAREN);
				equationsgroup_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (_tokenSet_3.member(LA(2))) && (_tokenSet_4.member(LA(3)))) {
				equation();
				astFactory.addASTChild(currentAST, returnAST);
				equationsgroup_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_2);
		}
		returnAST = equationsgroup_AST;
	}
	
	public final void equation() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST equation_AST = null;
		
		try {      // for error handling
			if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==UNIFY||LA(3)==REFERENCE)) {
				AST tmp18_AST = null;
				tmp18_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp18_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp19_AST = null;
				tmp19_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp19_AST);
				match(UNIFY);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp20_AST = null;
				tmp20_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp20_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==UNIFY||LA(3)==REFERENCE)) {
				AST tmp21_AST = null;
				tmp21_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp21_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp22_AST = null;
				tmp22_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp22_AST);
				match(UNIFY);
				value();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp23_AST = null;
				tmp23_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp23_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==OVERWRITE||LA(3)==REFERENCE)) {
				AST tmp24_AST = null;
				tmp24_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp24_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp25_AST = null;
				tmp25_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp25_AST);
				match(OVERWRITE);
				value();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp26_AST = null;
				tmp26_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp26_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==OVERWRITE||LA(3)==REFERENCE)) {
				AST tmp27_AST = null;
				tmp27_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp27_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp28_AST = null;
				tmp28_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp28_AST);
				match(OVERWRITE);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp29_AST = null;
				tmp29_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp29_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==OVERWRITE||LA(3)==REFERENCE)) {
				AST tmp30_AST = null;
				tmp30_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp30_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp31_AST = null;
				tmp31_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp31_AST);
				match(OVERWRITE);
				function();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp32_AST = null;
				tmp32_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp32_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==ASSIGNREMOVE||LA(3)==REFERENCE)) {
				AST tmp33_AST = null;
				tmp33_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp33_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp34_AST = null;
				tmp34_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp34_AST);
				match(ASSIGNREMOVE);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp35_AST = null;
				tmp35_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp35_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==APPEND||LA(3)==REFERENCE)) {
				AST tmp36_AST = null;
				tmp36_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp36_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp37_AST = null;
				tmp37_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp37_AST);
				match(APPEND);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp38_AST = null;
				tmp38_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp38_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==POP||LA(3)==REFERENCE)) {
				AST tmp39_AST = null;
				tmp39_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp39_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp40_AST = null;
				tmp40_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp40_AST);
				match(POP);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp41_AST = null;
				tmp41_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp41_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==UNIFY||LA(3)==REFERENCE)) {
				AST tmp42_AST = null;
				tmp42_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp42_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp43_AST = null;
				tmp43_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp43_AST);
				match(UNIFY);
				AST tmp44_AST = null;
				tmp44_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp44_AST);
				match(DEFINED);
				AST tmp45_AST = null;
				tmp45_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp45_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==UNIFY||LA(3)==REFERENCE)) {
				AST tmp46_AST = null;
				tmp46_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp46_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp47_AST = null;
				tmp47_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp47_AST);
				match(UNIFY);
				AST tmp48_AST = null;
				tmp48_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp48_AST);
				match(UNDEFINED);
				AST tmp49_AST = null;
				tmp49_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp49_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==CONSTRAIN||LA(3)==REFERENCE)) {
				AST tmp50_AST = null;
				tmp50_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp50_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp51_AST = null;
				tmp51_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp51_AST);
				match(CONSTRAIN);
				value();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp52_AST = null;
				tmp52_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp52_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==UNIFY||LA(3)==REFERENCE)) {
				AST tmp53_AST = null;
				tmp53_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp53_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp54_AST = null;
				tmp54_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp54_AST);
				match(UNIFY);
				AST tmp55_AST = null;
				tmp55_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp55_AST);
				match(REMOVE);
				AST tmp56_AST = null;
				tmp56_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp56_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==LPAREN||LA(2)==REFERENCE) && (LA(3)==NEGATE||LA(3)==REFERENCE)) {
				AST tmp57_AST = null;
				tmp57_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp57_AST);
				match(LPAREN);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp58_AST = null;
				tmp58_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp58_AST);
				match(NEGATE);
				path();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp59_AST = null;
				tmp59_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp59_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==OR)) {
				AST tmp60_AST = null;
				tmp60_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp60_AST);
				match(LPAREN);
				AST tmp61_AST = null;
				tmp61_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp61_AST);
				match(OR);
				equationsgroups();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp62_AST = null;
				tmp62_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp62_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==EOR)) {
				AST tmp63_AST = null;
				tmp63_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp63_AST);
				match(LPAREN);
				AST tmp64_AST = null;
				tmp64_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp64_AST);
				match(EOR);
				equationsgroups();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp65_AST = null;
				tmp65_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp65_AST);
				match(RPAREN);
				equation_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_2);
		}
		returnAST = equation_AST;
	}
	
	public final void leftside() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST leftside_AST = null;
		
		try {      // for error handling
			AST tmp66_AST = null;
			tmp66_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp66_AST);
			match(NT);
			leftside_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_5);
		}
		returnAST = leftside_AST;
	}
	
	public final void rightside() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST rightside_AST = null;
		
		try {      // for error handling
			if ((LA(1)==NT) && (LA(2)==RPAREN)) {
				AST tmp67_AST = null;
				tmp67_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp67_AST);
				match(NT);
				rightside_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==TOKEN) && (LA(2)==RPAREN)) {
				AST tmp68_AST = null;
				tmp68_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp68_AST);
				match(TOKEN);
				rightside_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==WILDCARD) && (LA(2)==RPAREN)) {
				AST tmp69_AST = null;
				tmp69_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp69_AST);
				match(WILDCARD);
				rightside_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==NT) && ((LA(2) >= NT && LA(2) <= WILDCARD))) {
				AST tmp70_AST = null;
				tmp70_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp70_AST);
				match(NT);
				rightside();
				astFactory.addASTChild(currentAST, returnAST);
				rightside_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==TOKEN) && ((LA(2) >= NT && LA(2) <= WILDCARD))) {
				AST tmp71_AST = null;
				tmp71_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp71_AST);
				match(TOKEN);
				rightside();
				astFactory.addASTChild(currentAST, returnAST);
				rightside_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==WILDCARD) && ((LA(2) >= NT && LA(2) <= WILDCARD))) {
				AST tmp72_AST = null;
				tmp72_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp72_AST);
				match(WILDCARD);
				rightside();
				astFactory.addASTChild(currentAST, returnAST);
				rightside_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = rightside_AST;
	}
	
	public final void equationsgroups() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST equationsgroups_AST = null;
		
		try {      // for error handling
			if ((LA(1)==LPAREN) && (_tokenSet_7.member(LA(2))) && (_tokenSet_8.member(LA(3)))) {
				equationsgroup();
				astFactory.addASTChild(currentAST, returnAST);
				equationsgroups_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (_tokenSet_7.member(LA(2))) && (_tokenSet_9.member(LA(3)))) {
				equationsgroup();
				astFactory.addASTChild(currentAST, returnAST);
				equationsgroups();
				astFactory.addASTChild(currentAST, returnAST);
				equationsgroups_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = equationsgroups_AST;
	}
	
	public final void equations() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST equations_AST = null;
		
		try {      // for error handling
			if ((LA(1)==LPAREN) && (_tokenSet_3.member(LA(2))) && (_tokenSet_4.member(LA(3)))) {
				equation();
				astFactory.addASTChild(currentAST, returnAST);
				equations_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (_tokenSet_3.member(LA(2))) && (_tokenSet_4.member(LA(3)))) {
				equation();
				astFactory.addASTChild(currentAST, returnAST);
				equations();
				astFactory.addASTChild(currentAST, returnAST);
				equations_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = equations_AST;
	}
	
	public final void path() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST path_AST = null;
		
		try {      // for error handling
			switch ( LA(1)) {
			case LPAREN:
			{
				AST tmp73_AST = null;
				tmp73_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp73_AST);
				match(LPAREN);
				AST tmp74_AST = null;
				tmp74_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp74_AST);
				match(REFERENCE);
				pathvals();
				astFactory.addASTChild(currentAST, returnAST);
				AST tmp75_AST = null;
				tmp75_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp75_AST);
				match(RPAREN);
				path_AST = (AST)currentAST.root;
				break;
			}
			case REFERENCE:
			{
				AST tmp76_AST = null;
				tmp76_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp76_AST);
				match(REFERENCE);
				path_AST = (AST)currentAST.root;
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_10);
		}
		returnAST = path_AST;
	}
	
	public final void value() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST value_AST = null;
		
		try {      // for error handling
			if ((LA(1)==TOKEN)) {
				AST tmp77_AST = null;
				tmp77_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp77_AST);
				match(TOKEN);
				value_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==OR)) {
				disjunctivevalue();
				astFactory.addASTChild(currentAST, returnAST);
				value_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==NOT)) {
				negativevalue();
				astFactory.addASTChild(currentAST, returnAST);
				value_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==LPAREN) && (LA(2)==MULTIPLE)) {
				multiplevalue();
				astFactory.addASTChild(currentAST, returnAST);
				value_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = value_AST;
	}
	
	public final void function() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST function_AST = null;
		
		try {      // for error handling
			AST tmp78_AST = null;
			tmp78_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp78_AST);
			match(LPAREN);
			AST tmp79_AST = null;
			tmp79_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp79_AST);
			match(TOKEN);
			AST tmp80_AST = null;
			tmp80_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp80_AST);
			match(LPAREN);
			arguments();
			astFactory.addASTChild(currentAST, returnAST);
			AST tmp81_AST = null;
			tmp81_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp81_AST);
			match(RPAREN);
			AST tmp82_AST = null;
			tmp82_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp82_AST);
			match(RPAREN);
			function_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = function_AST;
	}
	
	public final void pathvals() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST pathvals_AST = null;
		
		try {      // for error handling
			if ((LA(1)==TOKEN) && (LA(2)==RPAREN)) {
				AST tmp83_AST = null;
				tmp83_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp83_AST);
				match(TOKEN);
				pathvals_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==TOKEN) && (LA(2)==TOKEN)) {
				AST tmp84_AST = null;
				tmp84_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp84_AST);
				match(TOKEN);
				pathvals();
				astFactory.addASTChild(currentAST, returnAST);
				pathvals_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = pathvals_AST;
	}
	
	public final void disjunctivevalue() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST disjunctivevalue_AST = null;
		
		try {      // for error handling
			AST tmp85_AST = null;
			tmp85_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp85_AST);
			match(LPAREN);
			AST tmp86_AST = null;
			tmp86_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp86_AST);
			match(OR);
			values();
			astFactory.addASTChild(currentAST, returnAST);
			AST tmp87_AST = null;
			tmp87_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp87_AST);
			match(RPAREN);
			disjunctivevalue_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = disjunctivevalue_AST;
	}
	
	public final void negativevalue() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST negativevalue_AST = null;
		
		try {      // for error handling
			AST tmp88_AST = null;
			tmp88_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp88_AST);
			match(LPAREN);
			AST tmp89_AST = null;
			tmp89_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp89_AST);
			match(NOT);
			values();
			astFactory.addASTChild(currentAST, returnAST);
			AST tmp90_AST = null;
			tmp90_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp90_AST);
			match(RPAREN);
			negativevalue_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = negativevalue_AST;
	}
	
	public final void multiplevalue() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST multiplevalue_AST = null;
		
		try {      // for error handling
			AST tmp91_AST = null;
			tmp91_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp91_AST);
			match(LPAREN);
			AST tmp92_AST = null;
			tmp92_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp92_AST);
			match(MULTIPLE);
			values();
			astFactory.addASTChild(currentAST, returnAST);
			AST tmp93_AST = null;
			tmp93_AST = (AST)astFactory.create(LT(1));
			astFactory.addASTChild(currentAST, tmp93_AST);
			match(RPAREN);
			multiplevalue_AST = (AST)currentAST.root;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = multiplevalue_AST;
	}
	
	public final void values() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST values_AST = null;
		
		try {      // for error handling
			if ((LA(1)==TOKEN) && (LA(2)==RPAREN)) {
				AST tmp94_AST = null;
				tmp94_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp94_AST);
				match(TOKEN);
				values_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==TOKEN) && (LA(2)==TOKEN)) {
				AST tmp95_AST = null;
				tmp95_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp95_AST);
				match(TOKEN);
				values();
				astFactory.addASTChild(currentAST, returnAST);
				values_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = values_AST;
	}
	
	public final void arguments() throws RecognitionException, TokenStreamException {
		
		returnAST = null;
		ASTPair currentAST = new ASTPair();
		AST arguments_AST = null;
		
		try {      // for error handling
			if ((LA(1)==REFERENCE) && (LA(2)==RPAREN)) {
				AST tmp96_AST = null;
				tmp96_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp96_AST);
				match(REFERENCE);
				arguments_AST = (AST)currentAST.root;
			}
			else if ((LA(1)==REFERENCE) && (LA(2)==TOKEN)) {
				AST tmp97_AST = null;
				tmp97_AST = (AST)astFactory.create(LT(1));
				astFactory.addASTChild(currentAST, tmp97_AST);
				match(REFERENCE);
				pathvals();
				astFactory.addASTChild(currentAST, returnAST);
				arguments_AST = (AST)currentAST.root;
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
		}
		catch (RecognitionException ex) {
			reportError(ex);
			consume();
			consumeUntil(_tokenSet_6);
		}
		returnAST = arguments_AST;
	}
	
	
	public static final String[] _tokenNames = {
		"<0>",
		"EOF",
		"<2>",
		"NULL_TREE_LOOKAHEAD",
		"LPAREN",
		"RPAREN",
		"NONSPACED",
		"SPACED",
		"NT",
		"TOKEN",
		"WILDCARD",
		"UNIFY",
		"OVERWRITE",
		"ASSIGNREMOVE",
		"APPEND",
		"POP",
		"DEFINED",
		"UNDEFINED",
		"CONSTRAIN",
		"REMOVE",
		"NEGATE",
		"OR",
		"EOR",
		"REFERENCE",
		"NOT",
		"MULTIPLE",
		"SL_COMMENT",
		"ML_COMMENT",
		"WS",
		"NL",
		"CASE",
		"TEST"
	};
	
	private static final long _tokenSet_0_data_[] = { 2L, 0L };
	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
	private static final long _tokenSet_1_data_[] = { 18L, 0L };
	public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_);
	private static final long _tokenSet_2_data_[] = { 48L, 0L };
	public static final BitSet _tokenSet_2 = new BitSet(_tokenSet_2_data_);
	private static final long _tokenSet_3_data_[] = { 14680080L, 0L };
	public static final BitSet _tokenSet_3 = new BitSet(_tokenSet_3_data_);
	private static final long _tokenSet_4_data_[] = { 9762832L, 0L };
	public static final BitSet _tokenSet_4 = new BitSet(_tokenSet_4_data_);
	private static final long _tokenSet_5_data_[] = { 192L, 0L };
	public static final BitSet _tokenSet_5 = new BitSet(_tokenSet_5_data_);
	private static final long _tokenSet_6_data_[] = { 32L, 0L };
	public static final BitSet _tokenSet_6 = new BitSet(_tokenSet_6_data_);
	private static final long _tokenSet_7_data_[] = { 14680112L, 0L };
	public static final BitSet _tokenSet_7 = new BitSet(_tokenSet_7_data_);
	private static final long _tokenSet_8_data_[] = { 16054320L, 0L };
	public static final BitSet _tokenSet_8 = new BitSet(_tokenSet_8_data_);
	private static final long _tokenSet_9_data_[] = { 16054288L, 0L };
	public static final BitSet _tokenSet_9 = new BitSet(_tokenSet_9_data_);
	private static final long _tokenSet_10_data_[] = { 1374240L, 0L };
	public static final BitSet _tokenSet_10 = new BitSet(_tokenSet_10_data_);
	
	}
