org.jaitools.jiffle.parser.TransformExpressions Maven / Gradle / Ivy
// $ANTLR 3.3 Nov 30, 2010 12:46:29 org/jaitools/jiffle/parser/TransformExpressions.g 2012-10-10 10:44:33
package org.jaitools.jiffle.parser;
import org.antlr.runtime.*;
import org.antlr.runtime.tree.*;import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
/**
* Converts calls to proxy functions into the associated variables and
* converts ternary conditional expressions to if calls.
*
* @author Michael Bedward
*/
public class TransformExpressions extends ErrorHandlingTreeParser {
public static final String[] tokenNames = new String[] {
"", "", "", "", "ABS_POS", "BAND_REF", "BLOCK", "CON_CALL", "DECL", "DECLARED_LIST", "EXPR_LIST", "FUNC_CALL", "IMAGE_POS", "JIFFLE_OPTION", "PAR", "PIXEL_REF", "POSTFIX", "PREFIX", "REL_POS", "SEQUENCE", "VAR_DEST", "VAR_IMAGE_SCOPE", "VAR_SOURCE", "CONSTANT", "IMAGE_WRITE", "LIST_NEW", "VAR_IMAGE", "VAR_PIXEL_SCOPE", "VAR_PROVIDED", "VAR_LOOP", "VAR_LIST", "OPTIONS", "LCURLY", "RCURLY", "ID", "EQ", "SEMI", "IMAGES", "READ", "WRITE", "INIT", "WHILE", "LPAR", "RPAR", "UNTIL", "FOREACH", "IN", "IF", "ELSE", "BREAKIF", "BREAK", "COMMA", "COLON", "CON", "APPEND", "TIMESEQ", "DIVEQ", "MODEQ", "PLUSEQ", "MINUSEQ", "QUESTION", "OR", "XOR", "AND", "LOGICALEQ", "NE", "GT", "GE", "LE", "LT", "PLUS", "MINUS", "TIMES", "DIV", "MOD", "NOT", "INCR", "DECR", "POW", "LSQUARE", "RSQUARE", "ABS_POS_PREFIX", "INT_LITERAL", "FLOAT_LITERAL", "TRUE", "FALSE", "NULL", "COMMENT", "INT_TYPE", "FLOAT_TYPE", "DOUBLE_TYPE", "BOOLEAN_TYPE", "Letter", "UNDERSCORE", "Digit", "Dot", "NonZeroDigit", "FloatExp", "WS", "ESC_SEQ", "CHAR", "HEX_DIGIT", "UNICODE_ESC", "OCTAL_ESC"
};
public static final int EOF=-1;
public static final int ABS_POS=4;
public static final int BAND_REF=5;
public static final int BLOCK=6;
public static final int CON_CALL=7;
public static final int DECL=8;
public static final int DECLARED_LIST=9;
public static final int EXPR_LIST=10;
public static final int FUNC_CALL=11;
public static final int IMAGE_POS=12;
public static final int JIFFLE_OPTION=13;
public static final int PAR=14;
public static final int PIXEL_REF=15;
public static final int POSTFIX=16;
public static final int PREFIX=17;
public static final int REL_POS=18;
public static final int SEQUENCE=19;
public static final int VAR_DEST=20;
public static final int VAR_IMAGE_SCOPE=21;
public static final int VAR_SOURCE=22;
public static final int CONSTANT=23;
public static final int IMAGE_WRITE=24;
public static final int LIST_NEW=25;
public static final int VAR_IMAGE=26;
public static final int VAR_PIXEL_SCOPE=27;
public static final int VAR_PROVIDED=28;
public static final int VAR_LOOP=29;
public static final int VAR_LIST=30;
public static final int OPTIONS=31;
public static final int LCURLY=32;
public static final int RCURLY=33;
public static final int ID=34;
public static final int EQ=35;
public static final int SEMI=36;
public static final int IMAGES=37;
public static final int READ=38;
public static final int WRITE=39;
public static final int INIT=40;
public static final int WHILE=41;
public static final int LPAR=42;
public static final int RPAR=43;
public static final int UNTIL=44;
public static final int FOREACH=45;
public static final int IN=46;
public static final int IF=47;
public static final int ELSE=48;
public static final int BREAKIF=49;
public static final int BREAK=50;
public static final int COMMA=51;
public static final int COLON=52;
public static final int CON=53;
public static final int APPEND=54;
public static final int TIMESEQ=55;
public static final int DIVEQ=56;
public static final int MODEQ=57;
public static final int PLUSEQ=58;
public static final int MINUSEQ=59;
public static final int QUESTION=60;
public static final int OR=61;
public static final int XOR=62;
public static final int AND=63;
public static final int LOGICALEQ=64;
public static final int NE=65;
public static final int GT=66;
public static final int GE=67;
public static final int LE=68;
public static final int LT=69;
public static final int PLUS=70;
public static final int MINUS=71;
public static final int TIMES=72;
public static final int DIV=73;
public static final int MOD=74;
public static final int NOT=75;
public static final int INCR=76;
public static final int DECR=77;
public static final int POW=78;
public static final int LSQUARE=79;
public static final int RSQUARE=80;
public static final int ABS_POS_PREFIX=81;
public static final int INT_LITERAL=82;
public static final int FLOAT_LITERAL=83;
public static final int TRUE=84;
public static final int FALSE=85;
public static final int NULL=86;
public static final int COMMENT=87;
public static final int INT_TYPE=88;
public static final int FLOAT_TYPE=89;
public static final int DOUBLE_TYPE=90;
public static final int BOOLEAN_TYPE=91;
public static final int Letter=92;
public static final int UNDERSCORE=93;
public static final int Digit=94;
public static final int Dot=95;
public static final int NonZeroDigit=96;
public static final int FloatExp=97;
public static final int WS=98;
public static final int ESC_SEQ=99;
public static final int CHAR=100;
public static final int HEX_DIGIT=101;
public static final int UNICODE_ESC=102;
public static final int OCTAL_ESC=103;
// delegates
// delegators
public TransformExpressions(TreeNodeStream input) {
this(input, new RecognizerSharedState());
}
public TransformExpressions(TreeNodeStream input, RecognizerSharedState state) {
super(input, state);
}
protected TreeAdaptor adaptor = new CommonTreeAdaptor();
public void setTreeAdaptor(TreeAdaptor adaptor) {
this.adaptor = adaptor;
}
public TreeAdaptor getTreeAdaptor() {
return adaptor;
}
public String[] getTokenNames() { return TransformExpressions.tokenNames; }
public String getGrammarFileName() { return "org/jaitools/jiffle/parser/TransformExpressions.g"; }
private boolean isProxy(String name) {
try {
return FunctionLookup.getInfo(name, null).isProxy();
} catch (UndefinedFunctionException ex) {
// If the function is not defined we let it pass here. It
// will be picked up later by the function checking parser.
return false;
}
}
private String getRuntimeExpr(String name) {
try {
return FunctionLookup.getInfo(name, null).getRuntimeExpr();
} catch (UndefinedFunctionException ex) {
// getting here means a mistake in the grammar action code
throw new RuntimeException(ex);
}
}
public static class start_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "start"
// org/jaitools/jiffle/parser/TransformExpressions.g:68:1: start : ( jiffleOption )* ( varDeclaration )* ( statement )+ ;
public final TransformExpressions.start_return start() throws RecognitionException {
TransformExpressions.start_return retval = new TransformExpressions.start_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
TransformExpressions.jiffleOption_return jiffleOption1 = null;
TransformExpressions.varDeclaration_return varDeclaration2 = null;
TransformExpressions.statement_return statement3 = null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:68:17: ( ( jiffleOption )* ( varDeclaration )* ( statement )+ )
// org/jaitools/jiffle/parser/TransformExpressions.g:68:19: ( jiffleOption )* ( varDeclaration )* ( statement )+
{
root_0 = (CommonTree)adaptor.nil();
// org/jaitools/jiffle/parser/TransformExpressions.g:68:19: ( jiffleOption )*
loop1:
do {
int alt1=2;
switch ( input.LA(1) ) {
case JIFFLE_OPTION:
{
alt1=1;
}
break;
}
switch (alt1) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:68:19: jiffleOption
{
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_jiffleOption_in_start94);
jiffleOption1=jiffleOption();
state._fsp--;
adaptor.addChild(root_0, jiffleOption1.getTree());
}
break;
default :
break loop1;
}
} while (true);
// org/jaitools/jiffle/parser/TransformExpressions.g:68:33: ( varDeclaration )*
loop2:
do {
int alt2=2;
switch ( input.LA(1) ) {
case DECL:
{
alt2=1;
}
break;
}
switch (alt2) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:68:33: varDeclaration
{
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_varDeclaration_in_start97);
varDeclaration2=varDeclaration();
state._fsp--;
adaptor.addChild(root_0, varDeclaration2.getTree());
}
break;
default :
break loop2;
}
} while (true);
// org/jaitools/jiffle/parser/TransformExpressions.g:68:49: ( statement )+
int cnt3=0;
loop3:
do {
int alt3=2;
switch ( input.LA(1) ) {
case BLOCK:
case CON_CALL:
case DECLARED_LIST:
case FUNC_CALL:
case IMAGE_POS:
case PAR:
case POSTFIX:
case PREFIX:
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case IMAGE_WRITE:
case VAR_PIXEL_SCOPE:
case VAR_LOOP:
case VAR_LIST:
case EQ:
case WHILE:
case UNTIL:
case FOREACH:
case IF:
case BREAKIF:
case BREAK:
case APPEND:
case TIMESEQ:
case DIVEQ:
case MODEQ:
case PLUSEQ:
case MINUSEQ:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case POW:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
{
alt3=1;
}
break;
}
switch (alt3) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:68:49: statement
{
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_statement_in_start100);
statement3=statement();
state._fsp--;
adaptor.addChild(root_0, statement3.getTree());
}
break;
default :
if ( cnt3 >= 1 ) break loop3;
EarlyExitException eee =
new EarlyExitException(3, input);
throw eee;
}
cnt3++;
} while (true);
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "start"
public static class jiffleOption_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "jiffleOption"
// org/jaitools/jiffle/parser/TransformExpressions.g:72:1: jiffleOption : ^( JIFFLE_OPTION ( . )+ ) ;
public final TransformExpressions.jiffleOption_return jiffleOption() throws RecognitionException {
TransformExpressions.jiffleOption_return retval = new TransformExpressions.jiffleOption_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree JIFFLE_OPTION4=null;
CommonTree wildcard5=null;
CommonTree JIFFLE_OPTION4_tree=null;
CommonTree wildcard5_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:72:17: ( ^( JIFFLE_OPTION ( . )+ ) )
// org/jaitools/jiffle/parser/TransformExpressions.g:72:19: ^( JIFFLE_OPTION ( . )+ )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
JIFFLE_OPTION4=(CommonTree)match(input,JIFFLE_OPTION,FOLLOW_JIFFLE_OPTION_in_jiffleOption131);
JIFFLE_OPTION4_tree = (CommonTree)adaptor.dupNode(JIFFLE_OPTION4);
root_1 = (CommonTree)adaptor.becomeRoot(JIFFLE_OPTION4_tree, root_1);
match(input, Token.DOWN, null);
// org/jaitools/jiffle/parser/TransformExpressions.g:72:35: ( . )+
int cnt4=0;
loop4:
do {
int alt4=2;
switch ( input.LA(1) ) {
case ABS_POS:
case BAND_REF:
case BLOCK:
case CON_CALL:
case DECL:
case DECLARED_LIST:
case EXPR_LIST:
case FUNC_CALL:
case IMAGE_POS:
case JIFFLE_OPTION:
case PAR:
case PIXEL_REF:
case POSTFIX:
case PREFIX:
case REL_POS:
case SEQUENCE:
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case IMAGE_WRITE:
case LIST_NEW:
case VAR_IMAGE:
case VAR_PIXEL_SCOPE:
case VAR_PROVIDED:
case VAR_LOOP:
case VAR_LIST:
case OPTIONS:
case LCURLY:
case RCURLY:
case ID:
case EQ:
case SEMI:
case IMAGES:
case READ:
case WRITE:
case INIT:
case WHILE:
case LPAR:
case RPAR:
case UNTIL:
case FOREACH:
case IN:
case IF:
case ELSE:
case BREAKIF:
case BREAK:
case COMMA:
case COLON:
case CON:
case APPEND:
case TIMESEQ:
case DIVEQ:
case MODEQ:
case PLUSEQ:
case MINUSEQ:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case NOT:
case INCR:
case DECR:
case POW:
case LSQUARE:
case RSQUARE:
case ABS_POS_PREFIX:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
case COMMENT:
case INT_TYPE:
case FLOAT_TYPE:
case DOUBLE_TYPE:
case BOOLEAN_TYPE:
case Letter:
case UNDERSCORE:
case Digit:
case Dot:
case NonZeroDigit:
case FloatExp:
case WS:
case ESC_SEQ:
case CHAR:
case HEX_DIGIT:
case UNICODE_ESC:
case OCTAL_ESC:
{
alt4=1;
}
break;
case UP:
{
alt4=2;
}
break;
}
switch (alt4) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:72:35: .
{
_last = (CommonTree)input.LT(1);
wildcard5=(CommonTree)input.LT(1);
matchAny(input);
wildcard5_tree = (CommonTree)adaptor.dupTree(wildcard5);
adaptor.addChild(root_1, wildcard5_tree);
}
break;
default :
if ( cnt4 >= 1 ) break loop4;
EarlyExitException eee =
new EarlyExitException(4, input);
throw eee;
}
cnt4++;
} while (true);
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "jiffleOption"
public static class varDeclaration_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "varDeclaration"
// org/jaitools/jiffle/parser/TransformExpressions.g:76:1: varDeclaration : ( ^( DECL VAR_DEST ID ) | ^( DECL VAR_SOURCE ID ) | ^( DECL id= . ( expression )? ) );
public final TransformExpressions.varDeclaration_return varDeclaration() throws RecognitionException {
TransformExpressions.varDeclaration_return retval = new TransformExpressions.varDeclaration_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree DECL6=null;
CommonTree VAR_DEST7=null;
CommonTree ID8=null;
CommonTree DECL9=null;
CommonTree VAR_SOURCE10=null;
CommonTree ID11=null;
CommonTree DECL12=null;
CommonTree id=null;
TransformExpressions.expression_return expression13 = null;
CommonTree DECL6_tree=null;
CommonTree VAR_DEST7_tree=null;
CommonTree ID8_tree=null;
CommonTree DECL9_tree=null;
CommonTree VAR_SOURCE10_tree=null;
CommonTree ID11_tree=null;
CommonTree DECL12_tree=null;
CommonTree id_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:76:17: ( ^( DECL VAR_DEST ID ) | ^( DECL VAR_SOURCE ID ) | ^( DECL id= . ( expression )? ) )
int alt6=3;
switch ( input.LA(1) ) {
case DECL:
{
switch ( input.LA(2) ) {
case DOWN:
{
switch ( input.LA(3) ) {
case VAR_DEST:
{
switch ( input.LA(4) ) {
case ID:
{
alt6=1;
}
break;
case DOWN:
case UP:
case CON_CALL:
case DECLARED_LIST:
case FUNC_CALL:
case IMAGE_POS:
case PAR:
case POSTFIX:
case PREFIX:
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case IMAGE_WRITE:
case VAR_PIXEL_SCOPE:
case VAR_LOOP:
case VAR_LIST:
case APPEND:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case POW:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
{
alt6=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 6, 3, input);
throw nvae;
}
}
break;
case VAR_SOURCE:
{
switch ( input.LA(4) ) {
case ID:
{
alt6=2;
}
break;
case DOWN:
case UP:
case CON_CALL:
case DECLARED_LIST:
case FUNC_CALL:
case IMAGE_POS:
case PAR:
case POSTFIX:
case PREFIX:
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case IMAGE_WRITE:
case VAR_PIXEL_SCOPE:
case VAR_LOOP:
case VAR_LIST:
case APPEND:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case POW:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
{
alt6=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 6, 4, input);
throw nvae;
}
}
break;
case ABS_POS:
case BAND_REF:
case BLOCK:
case CON_CALL:
case DECL:
case DECLARED_LIST:
case EXPR_LIST:
case FUNC_CALL:
case IMAGE_POS:
case JIFFLE_OPTION:
case PAR:
case PIXEL_REF:
case POSTFIX:
case PREFIX:
case REL_POS:
case SEQUENCE:
case VAR_IMAGE_SCOPE:
case CONSTANT:
case IMAGE_WRITE:
case LIST_NEW:
case VAR_IMAGE:
case VAR_PIXEL_SCOPE:
case VAR_PROVIDED:
case VAR_LOOP:
case VAR_LIST:
case OPTIONS:
case LCURLY:
case RCURLY:
case ID:
case EQ:
case SEMI:
case IMAGES:
case READ:
case WRITE:
case INIT:
case WHILE:
case LPAR:
case RPAR:
case UNTIL:
case FOREACH:
case IN:
case IF:
case ELSE:
case BREAKIF:
case BREAK:
case COMMA:
case COLON:
case CON:
case APPEND:
case TIMESEQ:
case DIVEQ:
case MODEQ:
case PLUSEQ:
case MINUSEQ:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case NOT:
case INCR:
case DECR:
case POW:
case LSQUARE:
case RSQUARE:
case ABS_POS_PREFIX:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
case COMMENT:
case INT_TYPE:
case FLOAT_TYPE:
case DOUBLE_TYPE:
case BOOLEAN_TYPE:
case Letter:
case UNDERSCORE:
case Digit:
case Dot:
case NonZeroDigit:
case FloatExp:
case WS:
case ESC_SEQ:
case CHAR:
case HEX_DIGIT:
case UNICODE_ESC:
case OCTAL_ESC:
{
alt6=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 6, 2, input);
throw nvae;
}
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 6, 1, input);
throw nvae;
}
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 6, 0, input);
throw nvae;
}
switch (alt6) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:76:19: ^( DECL VAR_DEST ID )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
DECL6=(CommonTree)match(input,DECL,FOLLOW_DECL_in_varDeclaration163);
DECL6_tree = (CommonTree)adaptor.dupNode(DECL6);
root_1 = (CommonTree)adaptor.becomeRoot(DECL6_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
VAR_DEST7=(CommonTree)match(input,VAR_DEST,FOLLOW_VAR_DEST_in_varDeclaration165);
VAR_DEST7_tree = (CommonTree)adaptor.dupNode(VAR_DEST7);
adaptor.addChild(root_1, VAR_DEST7_tree);
_last = (CommonTree)input.LT(1);
ID8=(CommonTree)match(input,ID,FOLLOW_ID_in_varDeclaration167);
ID8_tree = (CommonTree)adaptor.dupNode(ID8);
adaptor.addChild(root_1, ID8_tree);
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 2 :
// org/jaitools/jiffle/parser/TransformExpressions.g:77:19: ^( DECL VAR_SOURCE ID )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
DECL9=(CommonTree)match(input,DECL,FOLLOW_DECL_in_varDeclaration189);
DECL9_tree = (CommonTree)adaptor.dupNode(DECL9);
root_1 = (CommonTree)adaptor.becomeRoot(DECL9_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
VAR_SOURCE10=(CommonTree)match(input,VAR_SOURCE,FOLLOW_VAR_SOURCE_in_varDeclaration191);
VAR_SOURCE10_tree = (CommonTree)adaptor.dupNode(VAR_SOURCE10);
adaptor.addChild(root_1, VAR_SOURCE10_tree);
_last = (CommonTree)input.LT(1);
ID11=(CommonTree)match(input,ID,FOLLOW_ID_in_varDeclaration193);
ID11_tree = (CommonTree)adaptor.dupNode(ID11);
adaptor.addChild(root_1, ID11_tree);
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 3 :
// org/jaitools/jiffle/parser/TransformExpressions.g:79:18: ^( DECL id= . ( expression )? )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
DECL12=(CommonTree)match(input,DECL,FOLLOW_DECL_in_varDeclaration215);
DECL12_tree = (CommonTree)adaptor.dupNode(DECL12);
root_1 = (CommonTree)adaptor.becomeRoot(DECL12_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
id=(CommonTree)input.LT(1);
matchAny(input);
id_tree = (CommonTree)adaptor.dupTree(id);
adaptor.addChild(root_1, id_tree);
// org/jaitools/jiffle/parser/TransformExpressions.g:79:30: ( expression )?
int alt5=2;
switch ( input.LA(1) ) {
case CON_CALL:
case DECLARED_LIST:
case FUNC_CALL:
case IMAGE_POS:
case PAR:
case POSTFIX:
case PREFIX:
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case IMAGE_WRITE:
case VAR_PIXEL_SCOPE:
case VAR_LOOP:
case VAR_LIST:
case APPEND:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case POW:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
{
alt5=1;
}
break;
}
switch (alt5) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:79:30: expression
{
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_varDeclaration221);
expression13=expression();
state._fsp--;
adaptor.addChild(root_1, expression13.getTree());
}
break;
}
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "varDeclaration"
public static class block_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "block"
// org/jaitools/jiffle/parser/TransformExpressions.g:83:1: block : ^( BLOCK ( statement )* ) ;
public final TransformExpressions.block_return block() throws RecognitionException {
TransformExpressions.block_return retval = new TransformExpressions.block_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree BLOCK14=null;
TransformExpressions.statement_return statement15 = null;
CommonTree BLOCK14_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:83:17: ( ^( BLOCK ( statement )* ) )
// org/jaitools/jiffle/parser/TransformExpressions.g:83:19: ^( BLOCK ( statement )* )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
BLOCK14=(CommonTree)match(input,BLOCK,FOLLOW_BLOCK_in_block260);
BLOCK14_tree = (CommonTree)adaptor.dupNode(BLOCK14);
root_1 = (CommonTree)adaptor.becomeRoot(BLOCK14_tree, root_1);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
// org/jaitools/jiffle/parser/TransformExpressions.g:83:27: ( statement )*
loop7:
do {
int alt7=2;
switch ( input.LA(1) ) {
case BLOCK:
case CON_CALL:
case DECLARED_LIST:
case FUNC_CALL:
case IMAGE_POS:
case PAR:
case POSTFIX:
case PREFIX:
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case IMAGE_WRITE:
case VAR_PIXEL_SCOPE:
case VAR_LOOP:
case VAR_LIST:
case EQ:
case WHILE:
case UNTIL:
case FOREACH:
case IF:
case BREAKIF:
case BREAK:
case APPEND:
case TIMESEQ:
case DIVEQ:
case MODEQ:
case PLUSEQ:
case MINUSEQ:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case POW:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
{
alt7=1;
}
break;
}
switch (alt7) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:83:27: statement
{
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_statement_in_block262);
statement15=statement();
state._fsp--;
adaptor.addChild(root_1, statement15.getTree());
}
break;
default :
break loop7;
}
} while (true);
match(input, Token.UP, null);
}adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "block"
public static class statement_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "statement"
// org/jaitools/jiffle/parser/TransformExpressions.g:87:1: statement : ( block | ifCall | assignmentExpression | ^( WHILE loopCondition statement ) | ^( UNTIL loopCondition statement ) | ^( FOREACH ID loopSet statement ) | ^( BREAKIF expression ) | BREAK | expression );
public final TransformExpressions.statement_return statement() throws RecognitionException {
TransformExpressions.statement_return retval = new TransformExpressions.statement_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree WHILE19=null;
CommonTree UNTIL22=null;
CommonTree FOREACH25=null;
CommonTree ID26=null;
CommonTree BREAKIF29=null;
CommonTree BREAK31=null;
TransformExpressions.block_return block16 = null;
TransformExpressions.ifCall_return ifCall17 = null;
TransformExpressions.assignmentExpression_return assignmentExpression18 = null;
TransformExpressions.loopCondition_return loopCondition20 = null;
TransformExpressions.statement_return statement21 = null;
TransformExpressions.loopCondition_return loopCondition23 = null;
TransformExpressions.statement_return statement24 = null;
TransformExpressions.loopSet_return loopSet27 = null;
TransformExpressions.statement_return statement28 = null;
TransformExpressions.expression_return expression30 = null;
TransformExpressions.expression_return expression32 = null;
CommonTree WHILE19_tree=null;
CommonTree UNTIL22_tree=null;
CommonTree FOREACH25_tree=null;
CommonTree ID26_tree=null;
CommonTree BREAKIF29_tree=null;
CommonTree BREAK31_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:87:17: ( block | ifCall | assignmentExpression | ^( WHILE loopCondition statement ) | ^( UNTIL loopCondition statement ) | ^( FOREACH ID loopSet statement ) | ^( BREAKIF expression ) | BREAK | expression )
int alt8=9;
switch ( input.LA(1) ) {
case BLOCK:
{
alt8=1;
}
break;
case IF:
{
alt8=2;
}
break;
case EQ:
case TIMESEQ:
case DIVEQ:
case MODEQ:
case PLUSEQ:
case MINUSEQ:
{
alt8=3;
}
break;
case WHILE:
{
alt8=4;
}
break;
case UNTIL:
{
alt8=5;
}
break;
case FOREACH:
{
alt8=6;
}
break;
case BREAKIF:
{
alt8=7;
}
break;
case BREAK:
{
alt8=8;
}
break;
case CON_CALL:
case DECLARED_LIST:
case FUNC_CALL:
case IMAGE_POS:
case PAR:
case POSTFIX:
case PREFIX:
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case IMAGE_WRITE:
case VAR_PIXEL_SCOPE:
case VAR_LOOP:
case VAR_LIST:
case APPEND:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case POW:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
{
alt8=9;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 8, 0, input);
throw nvae;
}
switch (alt8) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:87:19: block
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_block_in_statement296);
block16=block();
state._fsp--;
adaptor.addChild(root_0, block16.getTree());
}
break;
case 2 :
// org/jaitools/jiffle/parser/TransformExpressions.g:88:19: ifCall
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_ifCall_in_statement316);
ifCall17=ifCall();
state._fsp--;
adaptor.addChild(root_0, ifCall17.getTree());
}
break;
case 3 :
// org/jaitools/jiffle/parser/TransformExpressions.g:89:19: assignmentExpression
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_assignmentExpression_in_statement336);
assignmentExpression18=assignmentExpression();
state._fsp--;
adaptor.addChild(root_0, assignmentExpression18.getTree());
}
break;
case 4 :
// org/jaitools/jiffle/parser/TransformExpressions.g:90:19: ^( WHILE loopCondition statement )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
WHILE19=(CommonTree)match(input,WHILE,FOLLOW_WHILE_in_statement357);
WHILE19_tree = (CommonTree)adaptor.dupNode(WHILE19);
root_1 = (CommonTree)adaptor.becomeRoot(WHILE19_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_loopCondition_in_statement359);
loopCondition20=loopCondition();
state._fsp--;
adaptor.addChild(root_1, loopCondition20.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_statement_in_statement361);
statement21=statement();
state._fsp--;
adaptor.addChild(root_1, statement21.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 5 :
// org/jaitools/jiffle/parser/TransformExpressions.g:91:19: ^( UNTIL loopCondition statement )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
UNTIL22=(CommonTree)match(input,UNTIL,FOLLOW_UNTIL_in_statement383);
UNTIL22_tree = (CommonTree)adaptor.dupNode(UNTIL22);
root_1 = (CommonTree)adaptor.becomeRoot(UNTIL22_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_loopCondition_in_statement385);
loopCondition23=loopCondition();
state._fsp--;
adaptor.addChild(root_1, loopCondition23.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_statement_in_statement387);
statement24=statement();
state._fsp--;
adaptor.addChild(root_1, statement24.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 6 :
// org/jaitools/jiffle/parser/TransformExpressions.g:92:19: ^( FOREACH ID loopSet statement )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
FOREACH25=(CommonTree)match(input,FOREACH,FOLLOW_FOREACH_in_statement409);
FOREACH25_tree = (CommonTree)adaptor.dupNode(FOREACH25);
root_1 = (CommonTree)adaptor.becomeRoot(FOREACH25_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
ID26=(CommonTree)match(input,ID,FOLLOW_ID_in_statement411);
ID26_tree = (CommonTree)adaptor.dupNode(ID26);
adaptor.addChild(root_1, ID26_tree);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_loopSet_in_statement413);
loopSet27=loopSet();
state._fsp--;
adaptor.addChild(root_1, loopSet27.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_statement_in_statement415);
statement28=statement();
state._fsp--;
adaptor.addChild(root_1, statement28.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 7 :
// org/jaitools/jiffle/parser/TransformExpressions.g:93:19: ^( BREAKIF expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
BREAKIF29=(CommonTree)match(input,BREAKIF,FOLLOW_BREAKIF_in_statement437);
BREAKIF29_tree = (CommonTree)adaptor.dupNode(BREAKIF29);
root_1 = (CommonTree)adaptor.becomeRoot(BREAKIF29_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_statement439);
expression30=expression();
state._fsp--;
adaptor.addChild(root_1, expression30.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 8 :
// org/jaitools/jiffle/parser/TransformExpressions.g:94:19: BREAK
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
BREAK31=(CommonTree)match(input,BREAK,FOLLOW_BREAK_in_statement460);
BREAK31_tree = (CommonTree)adaptor.dupNode(BREAK31);
adaptor.addChild(root_0, BREAK31_tree);
}
break;
case 9 :
// org/jaitools/jiffle/parser/TransformExpressions.g:95:19: expression
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_statement480);
expression32=expression();
state._fsp--;
adaptor.addChild(root_0, expression32.getTree());
}
break;
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "statement"
public static class ifCall_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "ifCall"
// org/jaitools/jiffle/parser/TransformExpressions.g:99:1: ifCall : ^( IF expression statement ( statement )? ) ;
public final TransformExpressions.ifCall_return ifCall() throws RecognitionException {
TransformExpressions.ifCall_return retval = new TransformExpressions.ifCall_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree IF33=null;
TransformExpressions.expression_return expression34 = null;
TransformExpressions.statement_return statement35 = null;
TransformExpressions.statement_return statement36 = null;
CommonTree IF33_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:99:17: ( ^( IF expression statement ( statement )? ) )
// org/jaitools/jiffle/parser/TransformExpressions.g:99:19: ^( IF expression statement ( statement )? )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
IF33=(CommonTree)match(input,IF,FOLLOW_IF_in_ifCall516);
IF33_tree = (CommonTree)adaptor.dupNode(IF33);
root_1 = (CommonTree)adaptor.becomeRoot(IF33_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_ifCall518);
expression34=expression();
state._fsp--;
adaptor.addChild(root_1, expression34.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_statement_in_ifCall520);
statement35=statement();
state._fsp--;
adaptor.addChild(root_1, statement35.getTree());
// org/jaitools/jiffle/parser/TransformExpressions.g:99:45: ( statement )?
int alt9=2;
switch ( input.LA(1) ) {
case BLOCK:
case CON_CALL:
case DECLARED_LIST:
case FUNC_CALL:
case IMAGE_POS:
case PAR:
case POSTFIX:
case PREFIX:
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case IMAGE_WRITE:
case VAR_PIXEL_SCOPE:
case VAR_LOOP:
case VAR_LIST:
case EQ:
case WHILE:
case UNTIL:
case FOREACH:
case IF:
case BREAKIF:
case BREAK:
case APPEND:
case TIMESEQ:
case DIVEQ:
case MODEQ:
case PLUSEQ:
case MINUSEQ:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case POW:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
{
alt9=1;
}
break;
}
switch (alt9) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:99:45: statement
{
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_statement_in_ifCall522);
statement36=statement();
state._fsp--;
adaptor.addChild(root_1, statement36.getTree());
}
break;
}
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "ifCall"
public static class loopCondition_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "loopCondition"
// org/jaitools/jiffle/parser/TransformExpressions.g:103:1: loopCondition : expression ;
public final TransformExpressions.loopCondition_return loopCondition() throws RecognitionException {
TransformExpressions.loopCondition_return retval = new TransformExpressions.loopCondition_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
TransformExpressions.expression_return expression37 = null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:103:17: ( expression )
// org/jaitools/jiffle/parser/TransformExpressions.g:103:19: expression
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_loopCondition552);
expression37=expression();
state._fsp--;
adaptor.addChild(root_0, expression37.getTree());
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "loopCondition"
public static class loopSet_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "loopSet"
// org/jaitools/jiffle/parser/TransformExpressions.g:107:1: loopSet : ( ^( SEQUENCE expression expression ) | listLiteral | VAR_LIST );
public final TransformExpressions.loopSet_return loopSet() throws RecognitionException {
TransformExpressions.loopSet_return retval = new TransformExpressions.loopSet_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree SEQUENCE38=null;
CommonTree VAR_LIST42=null;
TransformExpressions.expression_return expression39 = null;
TransformExpressions.expression_return expression40 = null;
TransformExpressions.listLiteral_return listLiteral41 = null;
CommonTree SEQUENCE38_tree=null;
CommonTree VAR_LIST42_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:107:17: ( ^( SEQUENCE expression expression ) | listLiteral | VAR_LIST )
int alt10=3;
switch ( input.LA(1) ) {
case SEQUENCE:
{
alt10=1;
}
break;
case DECLARED_LIST:
{
alt10=2;
}
break;
case VAR_LIST:
{
alt10=3;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 10, 0, input);
throw nvae;
}
switch (alt10) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:107:19: ^( SEQUENCE expression expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
SEQUENCE38=(CommonTree)match(input,SEQUENCE,FOLLOW_SEQUENCE_in_loopSet587);
SEQUENCE38_tree = (CommonTree)adaptor.dupNode(SEQUENCE38);
root_1 = (CommonTree)adaptor.becomeRoot(SEQUENCE38_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_loopSet589);
expression39=expression();
state._fsp--;
adaptor.addChild(root_1, expression39.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_loopSet591);
expression40=expression();
state._fsp--;
adaptor.addChild(root_1, expression40.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 2 :
// org/jaitools/jiffle/parser/TransformExpressions.g:108:19: listLiteral
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_listLiteral_in_loopSet612);
listLiteral41=listLiteral();
state._fsp--;
adaptor.addChild(root_0, listLiteral41.getTree());
}
break;
case 3 :
// org/jaitools/jiffle/parser/TransformExpressions.g:109:19: VAR_LIST
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
VAR_LIST42=(CommonTree)match(input,VAR_LIST,FOLLOW_VAR_LIST_in_loopSet632);
VAR_LIST42_tree = (CommonTree)adaptor.dupNode(VAR_LIST42);
adaptor.addChild(root_0, VAR_LIST42_tree);
}
break;
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "loopSet"
public static class expressionList_return extends TreeRuleReturnScope {
public List argTypes;
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "expressionList"
// org/jaitools/jiffle/parser/TransformExpressions.g:113:1: expressionList returns [List argTypes] : ^( EXPR_LIST (e= expression )* ) ;
public final TransformExpressions.expressionList_return expressionList() throws RecognitionException {
TransformExpressions.expressionList_return retval = new TransformExpressions.expressionList_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree EXPR_LIST43=null;
TransformExpressions.expression_return e = null;
CommonTree EXPR_LIST43_tree=null;
retval.argTypes = new ArrayList();
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:115:17: ( ^( EXPR_LIST (e= expression )* ) )
// org/jaitools/jiffle/parser/TransformExpressions.g:115:19: ^( EXPR_LIST (e= expression )* )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
EXPR_LIST43=(CommonTree)match(input,EXPR_LIST,FOLLOW_EXPR_LIST_in_expressionList683);
EXPR_LIST43_tree = (CommonTree)adaptor.dupNode(EXPR_LIST43);
root_1 = (CommonTree)adaptor.becomeRoot(EXPR_LIST43_tree, root_1);
if ( input.LA(1)==Token.DOWN ) {
match(input, Token.DOWN, null);
// org/jaitools/jiffle/parser/TransformExpressions.g:115:31: (e= expression )*
loop11:
do {
int alt11=2;
switch ( input.LA(1) ) {
case CON_CALL:
case DECLARED_LIST:
case FUNC_CALL:
case IMAGE_POS:
case PAR:
case POSTFIX:
case PREFIX:
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case IMAGE_WRITE:
case VAR_PIXEL_SCOPE:
case VAR_LOOP:
case VAR_LIST:
case APPEND:
case QUESTION:
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
case POW:
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
{
alt11=1;
}
break;
}
switch (alt11) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:115:32: e= expression
{
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expressionList688);
e=expression();
state._fsp--;
adaptor.addChild(root_1, e.getTree());
retval.argTypes.add((e!=null?((CommonTree)e.start):null).getType() == VAR_LIST ? "List" : "D");
}
break;
default :
break loop11;
}
} while (true);
match(input, Token.UP, null);
}adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "expressionList"
public static class assignmentExpression_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "assignmentExpression"
// org/jaitools/jiffle/parser/TransformExpressions.g:122:1: assignmentExpression : ^( assignmentOp identifier expression ) ;
public final TransformExpressions.assignmentExpression_return assignmentExpression() throws RecognitionException {
TransformExpressions.assignmentExpression_return retval = new TransformExpressions.assignmentExpression_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
TransformExpressions.assignmentOp_return assignmentOp44 = null;
TransformExpressions.identifier_return identifier45 = null;
TransformExpressions.expression_return expression46 = null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:123:17: ( ^( assignmentOp identifier expression ) )
// org/jaitools/jiffle/parser/TransformExpressions.g:123:19: ^( assignmentOp identifier expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_assignmentOp_in_assignmentExpression758);
assignmentOp44=assignmentOp();
state._fsp--;
root_1 = (CommonTree)adaptor.becomeRoot(assignmentOp44.getTree(), root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_identifier_in_assignmentExpression760);
identifier45=identifier();
state._fsp--;
adaptor.addChild(root_1, identifier45.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_assignmentExpression762);
expression46=expression();
state._fsp--;
adaptor.addChild(root_1, expression46.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "assignmentExpression"
public static class assignmentOp_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "assignmentOp"
// org/jaitools/jiffle/parser/TransformExpressions.g:127:1: assignmentOp : ( EQ | TIMESEQ | DIVEQ | MODEQ | PLUSEQ | MINUSEQ );
public final TransformExpressions.assignmentOp_return assignmentOp() throws RecognitionException {
TransformExpressions.assignmentOp_return retval = new TransformExpressions.assignmentOp_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree set47=null;
CommonTree set47_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:127:17: ( EQ | TIMESEQ | DIVEQ | MODEQ | PLUSEQ | MINUSEQ )
// org/jaitools/jiffle/parser/TransformExpressions.g:
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
set47=(CommonTree)input.LT(1);
if ( input.LA(1)==EQ||(input.LA(1)>=TIMESEQ && input.LA(1)<=MINUSEQ) ) {
input.consume();
set47_tree = (CommonTree)adaptor.dupNode(set47);
adaptor.addChild(root_0, set47_tree);
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "assignmentOp"
public static class expression_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "expression"
// org/jaitools/jiffle/parser/TransformExpressions.g:136:1: expression : ( ^( FUNC_CALL ID expressionList ) -> {isProxy($ID.text)}? VAR_PROVIDED[ getRuntimeExpr($ID.text) ] -> ^( FUNC_CALL ID expressionList ) | ^( QUESTION e1= expression e2= expression e3= expression ) -> ^( CON_CALL ^( EXPR_LIST $e1 $e2 $e3) ) | ^( CON_CALL expressionList ) | ^( IMAGE_WRITE identifier expression ) | ^( IMAGE_POS identifier ( bandSpecifier )? ( pixelSpecifier )? ) | ^( logicalOp expression expression ) | ^( arithmeticOp expression expression ) | ^( POW expression expression ) | ^( PREFIX prefixOp expression ) | ^( POSTFIX incdecOp expression ) | ^( PAR expression ) | listOperation | listLiteral | literal | identifier );
public final TransformExpressions.expression_return expression() throws RecognitionException {
TransformExpressions.expression_return retval = new TransformExpressions.expression_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree FUNC_CALL48=null;
CommonTree ID49=null;
CommonTree QUESTION51=null;
CommonTree CON_CALL52=null;
CommonTree IMAGE_WRITE54=null;
CommonTree IMAGE_POS57=null;
CommonTree POW67=null;
CommonTree PREFIX70=null;
CommonTree POSTFIX73=null;
CommonTree PAR76=null;
TransformExpressions.expression_return e1 = null;
TransformExpressions.expression_return e2 = null;
TransformExpressions.expression_return e3 = null;
TransformExpressions.expressionList_return expressionList50 = null;
TransformExpressions.expressionList_return expressionList53 = null;
TransformExpressions.identifier_return identifier55 = null;
TransformExpressions.expression_return expression56 = null;
TransformExpressions.identifier_return identifier58 = null;
TransformExpressions.bandSpecifier_return bandSpecifier59 = null;
TransformExpressions.pixelSpecifier_return pixelSpecifier60 = null;
TransformExpressions.logicalOp_return logicalOp61 = null;
TransformExpressions.expression_return expression62 = null;
TransformExpressions.expression_return expression63 = null;
TransformExpressions.arithmeticOp_return arithmeticOp64 = null;
TransformExpressions.expression_return expression65 = null;
TransformExpressions.expression_return expression66 = null;
TransformExpressions.expression_return expression68 = null;
TransformExpressions.expression_return expression69 = null;
TransformExpressions.prefixOp_return prefixOp71 = null;
TransformExpressions.expression_return expression72 = null;
TransformExpressions.incdecOp_return incdecOp74 = null;
TransformExpressions.expression_return expression75 = null;
TransformExpressions.expression_return expression77 = null;
TransformExpressions.listOperation_return listOperation78 = null;
TransformExpressions.listLiteral_return listLiteral79 = null;
TransformExpressions.literal_return literal80 = null;
TransformExpressions.identifier_return identifier81 = null;
CommonTree FUNC_CALL48_tree=null;
CommonTree ID49_tree=null;
CommonTree QUESTION51_tree=null;
CommonTree CON_CALL52_tree=null;
CommonTree IMAGE_WRITE54_tree=null;
CommonTree IMAGE_POS57_tree=null;
CommonTree POW67_tree=null;
CommonTree PREFIX70_tree=null;
CommonTree POSTFIX73_tree=null;
CommonTree PAR76_tree=null;
RewriteRuleNodeStream stream_QUESTION=new RewriteRuleNodeStream(adaptor,"token QUESTION");
RewriteRuleNodeStream stream_ID=new RewriteRuleNodeStream(adaptor,"token ID");
RewriteRuleNodeStream stream_FUNC_CALL=new RewriteRuleNodeStream(adaptor,"token FUNC_CALL");
RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
RewriteRuleSubtreeStream stream_expressionList=new RewriteRuleSubtreeStream(adaptor,"rule expressionList");
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:137:17: ( ^( FUNC_CALL ID expressionList ) -> {isProxy($ID.text)}? VAR_PROVIDED[ getRuntimeExpr($ID.text) ] -> ^( FUNC_CALL ID expressionList ) | ^( QUESTION e1= expression e2= expression e3= expression ) -> ^( CON_CALL ^( EXPR_LIST $e1 $e2 $e3) ) | ^( CON_CALL expressionList ) | ^( IMAGE_WRITE identifier expression ) | ^( IMAGE_POS identifier ( bandSpecifier )? ( pixelSpecifier )? ) | ^( logicalOp expression expression ) | ^( arithmeticOp expression expression ) | ^( POW expression expression ) | ^( PREFIX prefixOp expression ) | ^( POSTFIX incdecOp expression ) | ^( PAR expression ) | listOperation | listLiteral | literal | identifier )
int alt14=15;
switch ( input.LA(1) ) {
case FUNC_CALL:
{
alt14=1;
}
break;
case QUESTION:
{
alt14=2;
}
break;
case CON_CALL:
{
alt14=3;
}
break;
case IMAGE_WRITE:
{
alt14=4;
}
break;
case IMAGE_POS:
{
alt14=5;
}
break;
case OR:
case XOR:
case AND:
case LOGICALEQ:
case NE:
case GT:
case GE:
case LE:
case LT:
{
alt14=6;
}
break;
case PLUS:
case MINUS:
case TIMES:
case DIV:
case MOD:
{
alt14=7;
}
break;
case POW:
{
alt14=8;
}
break;
case PREFIX:
{
alt14=9;
}
break;
case POSTFIX:
{
alt14=10;
}
break;
case PAR:
{
alt14=11;
}
break;
case APPEND:
{
alt14=12;
}
break;
case DECLARED_LIST:
{
alt14=13;
}
break;
case INT_LITERAL:
case FLOAT_LITERAL:
case TRUE:
case FALSE:
case NULL:
{
alt14=14;
}
break;
case VAR_DEST:
case VAR_IMAGE_SCOPE:
case VAR_SOURCE:
case CONSTANT:
case VAR_PIXEL_SCOPE:
case VAR_LOOP:
case VAR_LIST:
{
alt14=15;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 14, 0, input);
throw nvae;
}
switch (alt14) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:137:19: ^( FUNC_CALL ID expressionList )
{
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
FUNC_CALL48=(CommonTree)match(input,FUNC_CALL,FOLLOW_FUNC_CALL_in_expression935);
stream_FUNC_CALL.add(FUNC_CALL48);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
ID49=(CommonTree)match(input,ID,FOLLOW_ID_in_expression937);
stream_ID.add(ID49);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expressionList_in_expression939);
expressionList50=expressionList();
state._fsp--;
stream_expressionList.add(expressionList50.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
// AST REWRITE
// elements: expressionList, FUNC_CALL, ID
// token labels:
// rule labels: retval
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 138:19: -> {isProxy($ID.text)}? VAR_PROVIDED[ getRuntimeExpr($ID.text) ]
if (isProxy((ID49!=null?ID49.getText():null))) {
adaptor.addChild(root_0, (CommonTree)adaptor.create(VAR_PROVIDED, getRuntimeExpr((ID49!=null?ID49.getText():null))));
}
else // 139:19: -> ^( FUNC_CALL ID expressionList )
{
// org/jaitools/jiffle/parser/TransformExpressions.g:139:22: ^( FUNC_CALL ID expressionList )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot(stream_FUNC_CALL.nextNode(), root_1);
adaptor.addChild(root_1, stream_ID.nextNode());
adaptor.addChild(root_1, stream_expressionList.nextTree());
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
case 2 :
// org/jaitools/jiffle/parser/TransformExpressions.g:142:19: ^( QUESTION e1= expression e2= expression e3= expression )
{
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
QUESTION51=(CommonTree)match(input,QUESTION,FOLLOW_QUESTION_in_expression1036);
stream_QUESTION.add(QUESTION51);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1040);
e1=expression();
state._fsp--;
stream_expression.add(e1.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1044);
e2=expression();
state._fsp--;
stream_expression.add(e2.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1048);
e3=expression();
state._fsp--;
stream_expression.add(e3.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
// AST REWRITE
// elements: e3, e1, e2
// token labels:
// rule labels: e3, retval, e1, e2
// token list labels:
// rule list labels:
// wildcard labels:
retval.tree = root_0;
RewriteRuleSubtreeStream stream_e3=new RewriteRuleSubtreeStream(adaptor,"rule e3",e3!=null?e3.tree:null);
RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
RewriteRuleSubtreeStream stream_e1=new RewriteRuleSubtreeStream(adaptor,"rule e1",e1!=null?e1.tree:null);
RewriteRuleSubtreeStream stream_e2=new RewriteRuleSubtreeStream(adaptor,"rule e2",e2!=null?e2.tree:null);
root_0 = (CommonTree)adaptor.nil();
// 143:19: -> ^( CON_CALL ^( EXPR_LIST $e1 $e2 $e3) )
{
// org/jaitools/jiffle/parser/TransformExpressions.g:143:22: ^( CON_CALL ^( EXPR_LIST $e1 $e2 $e3) )
{
CommonTree root_1 = (CommonTree)adaptor.nil();
root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(CON_CALL, "CON_CALL"), root_1);
// org/jaitools/jiffle/parser/TransformExpressions.g:143:33: ^( EXPR_LIST $e1 $e2 $e3)
{
CommonTree root_2 = (CommonTree)adaptor.nil();
root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(EXPR_LIST, "EXPR_LIST"), root_2);
adaptor.addChild(root_2, stream_e1.nextTree());
adaptor.addChild(root_2, stream_e2.nextTree());
adaptor.addChild(root_2, stream_e3.nextTree());
adaptor.addChild(root_1, root_2);
}
adaptor.addChild(root_0, root_1);
}
}
retval.tree = root_0;
}
break;
case 3 :
// org/jaitools/jiffle/parser/TransformExpressions.g:146:19: ^( CON_CALL expressionList )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
CON_CALL52=(CommonTree)match(input,CON_CALL,FOLLOW_CON_CALL_in_expression1110);
CON_CALL52_tree = (CommonTree)adaptor.dupNode(CON_CALL52);
root_1 = (CommonTree)adaptor.becomeRoot(CON_CALL52_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expressionList_in_expression1112);
expressionList53=expressionList();
state._fsp--;
adaptor.addChild(root_1, expressionList53.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 4 :
// org/jaitools/jiffle/parser/TransformExpressions.g:147:19: ^( IMAGE_WRITE identifier expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
IMAGE_WRITE54=(CommonTree)match(input,IMAGE_WRITE,FOLLOW_IMAGE_WRITE_in_expression1134);
IMAGE_WRITE54_tree = (CommonTree)adaptor.dupNode(IMAGE_WRITE54);
root_1 = (CommonTree)adaptor.becomeRoot(IMAGE_WRITE54_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_identifier_in_expression1136);
identifier55=identifier();
state._fsp--;
adaptor.addChild(root_1, identifier55.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1138);
expression56=expression();
state._fsp--;
adaptor.addChild(root_1, expression56.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 5 :
// org/jaitools/jiffle/parser/TransformExpressions.g:148:19: ^( IMAGE_POS identifier ( bandSpecifier )? ( pixelSpecifier )? )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
IMAGE_POS57=(CommonTree)match(input,IMAGE_POS,FOLLOW_IMAGE_POS_in_expression1160);
IMAGE_POS57_tree = (CommonTree)adaptor.dupNode(IMAGE_POS57);
root_1 = (CommonTree)adaptor.becomeRoot(IMAGE_POS57_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_identifier_in_expression1162);
identifier58=identifier();
state._fsp--;
adaptor.addChild(root_1, identifier58.getTree());
// org/jaitools/jiffle/parser/TransformExpressions.g:148:42: ( bandSpecifier )?
int alt12=2;
switch ( input.LA(1) ) {
case BAND_REF:
{
alt12=1;
}
break;
}
switch (alt12) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:148:42: bandSpecifier
{
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_bandSpecifier_in_expression1164);
bandSpecifier59=bandSpecifier();
state._fsp--;
adaptor.addChild(root_1, bandSpecifier59.getTree());
}
break;
}
// org/jaitools/jiffle/parser/TransformExpressions.g:148:57: ( pixelSpecifier )?
int alt13=2;
switch ( input.LA(1) ) {
case PIXEL_REF:
{
alt13=1;
}
break;
}
switch (alt13) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:148:57: pixelSpecifier
{
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_pixelSpecifier_in_expression1167);
pixelSpecifier60=pixelSpecifier();
state._fsp--;
adaptor.addChild(root_1, pixelSpecifier60.getTree());
}
break;
}
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 6 :
// org/jaitools/jiffle/parser/TransformExpressions.g:149:19: ^( logicalOp expression expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_logicalOp_in_expression1190);
logicalOp61=logicalOp();
state._fsp--;
root_1 = (CommonTree)adaptor.becomeRoot(logicalOp61.getTree(), root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1192);
expression62=expression();
state._fsp--;
adaptor.addChild(root_1, expression62.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1194);
expression63=expression();
state._fsp--;
adaptor.addChild(root_1, expression63.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 7 :
// org/jaitools/jiffle/parser/TransformExpressions.g:150:19: ^( arithmeticOp expression expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_arithmeticOp_in_expression1216);
arithmeticOp64=arithmeticOp();
state._fsp--;
root_1 = (CommonTree)adaptor.becomeRoot(arithmeticOp64.getTree(), root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1218);
expression65=expression();
state._fsp--;
adaptor.addChild(root_1, expression65.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1220);
expression66=expression();
state._fsp--;
adaptor.addChild(root_1, expression66.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 8 :
// org/jaitools/jiffle/parser/TransformExpressions.g:151:19: ^( POW expression expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
POW67=(CommonTree)match(input,POW,FOLLOW_POW_in_expression1242);
POW67_tree = (CommonTree)adaptor.dupNode(POW67);
root_1 = (CommonTree)adaptor.becomeRoot(POW67_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1244);
expression68=expression();
state._fsp--;
adaptor.addChild(root_1, expression68.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1246);
expression69=expression();
state._fsp--;
adaptor.addChild(root_1, expression69.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 9 :
// org/jaitools/jiffle/parser/TransformExpressions.g:152:19: ^( PREFIX prefixOp expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
PREFIX70=(CommonTree)match(input,PREFIX,FOLLOW_PREFIX_in_expression1268);
PREFIX70_tree = (CommonTree)adaptor.dupNode(PREFIX70);
root_1 = (CommonTree)adaptor.becomeRoot(PREFIX70_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_prefixOp_in_expression1270);
prefixOp71=prefixOp();
state._fsp--;
adaptor.addChild(root_1, prefixOp71.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1272);
expression72=expression();
state._fsp--;
adaptor.addChild(root_1, expression72.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 10 :
// org/jaitools/jiffle/parser/TransformExpressions.g:153:19: ^( POSTFIX incdecOp expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
POSTFIX73=(CommonTree)match(input,POSTFIX,FOLLOW_POSTFIX_in_expression1294);
POSTFIX73_tree = (CommonTree)adaptor.dupNode(POSTFIX73);
root_1 = (CommonTree)adaptor.becomeRoot(POSTFIX73_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_incdecOp_in_expression1296);
incdecOp74=incdecOp();
state._fsp--;
adaptor.addChild(root_1, incdecOp74.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1298);
expression75=expression();
state._fsp--;
adaptor.addChild(root_1, expression75.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 11 :
// org/jaitools/jiffle/parser/TransformExpressions.g:154:19: ^( PAR expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
PAR76=(CommonTree)match(input,PAR,FOLLOW_PAR_in_expression1320);
PAR76_tree = (CommonTree)adaptor.dupNode(PAR76);
root_1 = (CommonTree)adaptor.becomeRoot(PAR76_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_expression1322);
expression77=expression();
state._fsp--;
adaptor.addChild(root_1, expression77.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 12 :
// org/jaitools/jiffle/parser/TransformExpressions.g:155:19: listOperation
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_listOperation_in_expression1343);
listOperation78=listOperation();
state._fsp--;
adaptor.addChild(root_0, listOperation78.getTree());
}
break;
case 13 :
// org/jaitools/jiffle/parser/TransformExpressions.g:156:19: listLiteral
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_listLiteral_in_expression1363);
listLiteral79=listLiteral();
state._fsp--;
adaptor.addChild(root_0, listLiteral79.getTree());
}
break;
case 14 :
// org/jaitools/jiffle/parser/TransformExpressions.g:157:19: literal
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_literal_in_expression1383);
literal80=literal();
state._fsp--;
adaptor.addChild(root_0, literal80.getTree());
}
break;
case 15 :
// org/jaitools/jiffle/parser/TransformExpressions.g:158:19: identifier
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_identifier_in_expression1403);
identifier81=identifier();
state._fsp--;
adaptor.addChild(root_0, identifier81.getTree());
}
break;
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "expression"
public static class listOperation_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "listOperation"
// org/jaitools/jiffle/parser/TransformExpressions.g:162:1: listOperation : ^( APPEND VAR_LIST expression ) ;
public final TransformExpressions.listOperation_return listOperation() throws RecognitionException {
TransformExpressions.listOperation_return retval = new TransformExpressions.listOperation_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree APPEND82=null;
CommonTree VAR_LIST83=null;
TransformExpressions.expression_return expression84 = null;
CommonTree APPEND82_tree=null;
CommonTree VAR_LIST83_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:162:17: ( ^( APPEND VAR_LIST expression ) )
// org/jaitools/jiffle/parser/TransformExpressions.g:162:19: ^( APPEND VAR_LIST expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
APPEND82=(CommonTree)match(input,APPEND,FOLLOW_APPEND_in_listOperation1432);
APPEND82_tree = (CommonTree)adaptor.dupNode(APPEND82);
root_1 = (CommonTree)adaptor.becomeRoot(APPEND82_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
VAR_LIST83=(CommonTree)match(input,VAR_LIST,FOLLOW_VAR_LIST_in_listOperation1434);
VAR_LIST83_tree = (CommonTree)adaptor.dupNode(VAR_LIST83);
adaptor.addChild(root_1, VAR_LIST83_tree);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_listOperation1436);
expression84=expression();
state._fsp--;
adaptor.addChild(root_1, expression84.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "listOperation"
public static class listLiteral_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "listLiteral"
// org/jaitools/jiffle/parser/TransformExpressions.g:166:1: listLiteral : ^( DECLARED_LIST expressionList ) ;
public final TransformExpressions.listLiteral_return listLiteral() throws RecognitionException {
TransformExpressions.listLiteral_return retval = new TransformExpressions.listLiteral_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree DECLARED_LIST85=null;
TransformExpressions.expressionList_return expressionList86 = null;
CommonTree DECLARED_LIST85_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:166:17: ( ^( DECLARED_LIST expressionList ) )
// org/jaitools/jiffle/parser/TransformExpressions.g:166:19: ^( DECLARED_LIST expressionList )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
DECLARED_LIST85=(CommonTree)match(input,DECLARED_LIST,FOLLOW_DECLARED_LIST_in_listLiteral1468);
DECLARED_LIST85_tree = (CommonTree)adaptor.dupNode(DECLARED_LIST85);
root_1 = (CommonTree)adaptor.becomeRoot(DECLARED_LIST85_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expressionList_in_listLiteral1470);
expressionList86=expressionList();
state._fsp--;
adaptor.addChild(root_1, expressionList86.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "listLiteral"
public static class identifier_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "identifier"
// org/jaitools/jiffle/parser/TransformExpressions.g:170:1: identifier : ( VAR_SOURCE | VAR_DEST | VAR_IMAGE_SCOPE | VAR_PIXEL_SCOPE | VAR_LOOP | VAR_LIST | CONSTANT );
public final TransformExpressions.identifier_return identifier() throws RecognitionException {
TransformExpressions.identifier_return retval = new TransformExpressions.identifier_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree set87=null;
CommonTree set87_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:170:17: ( VAR_SOURCE | VAR_DEST | VAR_IMAGE_SCOPE | VAR_PIXEL_SCOPE | VAR_LOOP | VAR_LIST | CONSTANT )
// org/jaitools/jiffle/parser/TransformExpressions.g:
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
set87=(CommonTree)input.LT(1);
if ( (input.LA(1)>=VAR_DEST && input.LA(1)<=CONSTANT)||input.LA(1)==VAR_PIXEL_SCOPE||(input.LA(1)>=VAR_LOOP && input.LA(1)<=VAR_LIST) ) {
input.consume();
set87_tree = (CommonTree)adaptor.dupNode(set87);
adaptor.addChild(root_0, set87_tree);
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "identifier"
public static class logicalOp_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "logicalOp"
// org/jaitools/jiffle/parser/TransformExpressions.g:180:1: logicalOp : ( OR | XOR | AND | LOGICALEQ | NE | GT | GE | LT | LE );
public final TransformExpressions.logicalOp_return logicalOp() throws RecognitionException {
TransformExpressions.logicalOp_return retval = new TransformExpressions.logicalOp_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree set88=null;
CommonTree set88_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:180:17: ( OR | XOR | AND | LOGICALEQ | NE | GT | GE | LT | LE )
// org/jaitools/jiffle/parser/TransformExpressions.g:
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
set88=(CommonTree)input.LT(1);
if ( (input.LA(1)>=OR && input.LA(1)<=LT) ) {
input.consume();
set88_tree = (CommonTree)adaptor.dupNode(set88);
adaptor.addChild(root_0, set88_tree);
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "logicalOp"
public static class arithmeticOp_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "arithmeticOp"
// org/jaitools/jiffle/parser/TransformExpressions.g:192:1: arithmeticOp : ( PLUS | MINUS | TIMES | DIV | MOD );
public final TransformExpressions.arithmeticOp_return arithmeticOp() throws RecognitionException {
TransformExpressions.arithmeticOp_return retval = new TransformExpressions.arithmeticOp_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree set89=null;
CommonTree set89_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:192:17: ( PLUS | MINUS | TIMES | DIV | MOD )
// org/jaitools/jiffle/parser/TransformExpressions.g:
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
set89=(CommonTree)input.LT(1);
if ( (input.LA(1)>=PLUS && input.LA(1)<=MOD) ) {
input.consume();
set89_tree = (CommonTree)adaptor.dupNode(set89);
adaptor.addChild(root_0, set89_tree);
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "arithmeticOp"
public static class prefixOp_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "prefixOp"
// org/jaitools/jiffle/parser/TransformExpressions.g:200:1: prefixOp : ( PLUS | MINUS | NOT | incdecOp );
public final TransformExpressions.prefixOp_return prefixOp() throws RecognitionException {
TransformExpressions.prefixOp_return retval = new TransformExpressions.prefixOp_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree PLUS90=null;
CommonTree MINUS91=null;
CommonTree NOT92=null;
TransformExpressions.incdecOp_return incdecOp93 = null;
CommonTree PLUS90_tree=null;
CommonTree MINUS91_tree=null;
CommonTree NOT92_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:200:17: ( PLUS | MINUS | NOT | incdecOp )
int alt15=4;
switch ( input.LA(1) ) {
case PLUS:
{
alt15=1;
}
break;
case MINUS:
{
alt15=2;
}
break;
case NOT:
{
alt15=3;
}
break;
case INCR:
case DECR:
{
alt15=4;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 15, 0, input);
throw nvae;
}
switch (alt15) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:200:19: PLUS
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
PLUS90=(CommonTree)match(input,PLUS,FOLLOW_PLUS_in_prefixOp1956);
PLUS90_tree = (CommonTree)adaptor.dupNode(PLUS90);
adaptor.addChild(root_0, PLUS90_tree);
}
break;
case 2 :
// org/jaitools/jiffle/parser/TransformExpressions.g:201:19: MINUS
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
MINUS91=(CommonTree)match(input,MINUS,FOLLOW_MINUS_in_prefixOp1976);
MINUS91_tree = (CommonTree)adaptor.dupNode(MINUS91);
adaptor.addChild(root_0, MINUS91_tree);
}
break;
case 3 :
// org/jaitools/jiffle/parser/TransformExpressions.g:202:19: NOT
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
NOT92=(CommonTree)match(input,NOT,FOLLOW_NOT_in_prefixOp1996);
NOT92_tree = (CommonTree)adaptor.dupNode(NOT92);
adaptor.addChild(root_0, NOT92_tree);
}
break;
case 4 :
// org/jaitools/jiffle/parser/TransformExpressions.g:203:19: incdecOp
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_incdecOp_in_prefixOp2016);
incdecOp93=incdecOp();
state._fsp--;
adaptor.addChild(root_0, incdecOp93.getTree());
}
break;
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "prefixOp"
public static class incdecOp_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "incdecOp"
// org/jaitools/jiffle/parser/TransformExpressions.g:207:1: incdecOp : ( INCR | DECR );
public final TransformExpressions.incdecOp_return incdecOp() throws RecognitionException {
TransformExpressions.incdecOp_return retval = new TransformExpressions.incdecOp_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree set94=null;
CommonTree set94_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:207:17: ( INCR | DECR )
// org/jaitools/jiffle/parser/TransformExpressions.g:
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
set94=(CommonTree)input.LT(1);
if ( (input.LA(1)>=INCR && input.LA(1)<=DECR) ) {
input.consume();
set94_tree = (CommonTree)adaptor.dupNode(set94);
adaptor.addChild(root_0, set94_tree);
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "incdecOp"
public static class pixelSpecifier_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "pixelSpecifier"
// org/jaitools/jiffle/parser/TransformExpressions.g:212:1: pixelSpecifier : ^( PIXEL_REF pixelPos pixelPos ) ;
public final TransformExpressions.pixelSpecifier_return pixelSpecifier() throws RecognitionException {
TransformExpressions.pixelSpecifier_return retval = new TransformExpressions.pixelSpecifier_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree PIXEL_REF95=null;
TransformExpressions.pixelPos_return pixelPos96 = null;
TransformExpressions.pixelPos_return pixelPos97 = null;
CommonTree PIXEL_REF95_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:212:17: ( ^( PIXEL_REF pixelPos pixelPos ) )
// org/jaitools/jiffle/parser/TransformExpressions.g:212:19: ^( PIXEL_REF pixelPos pixelPos )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
PIXEL_REF95=(CommonTree)match(input,PIXEL_REF,FOLLOW_PIXEL_REF_in_pixelSpecifier2097);
PIXEL_REF95_tree = (CommonTree)adaptor.dupNode(PIXEL_REF95);
root_1 = (CommonTree)adaptor.becomeRoot(PIXEL_REF95_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_pixelPos_in_pixelSpecifier2099);
pixelPos96=pixelPos();
state._fsp--;
adaptor.addChild(root_1, pixelPos96.getTree());
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_pixelPos_in_pixelSpecifier2101);
pixelPos97=pixelPos();
state._fsp--;
adaptor.addChild(root_1, pixelPos97.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "pixelSpecifier"
public static class bandSpecifier_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "bandSpecifier"
// org/jaitools/jiffle/parser/TransformExpressions.g:216:1: bandSpecifier : ^( BAND_REF expression ) ;
public final TransformExpressions.bandSpecifier_return bandSpecifier() throws RecognitionException {
TransformExpressions.bandSpecifier_return retval = new TransformExpressions.bandSpecifier_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree BAND_REF98=null;
TransformExpressions.expression_return expression99 = null;
CommonTree BAND_REF98_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:216:17: ( ^( BAND_REF expression ) )
// org/jaitools/jiffle/parser/TransformExpressions.g:216:19: ^( BAND_REF expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
BAND_REF98=(CommonTree)match(input,BAND_REF,FOLLOW_BAND_REF_in_bandSpecifier2131);
BAND_REF98_tree = (CommonTree)adaptor.dupNode(BAND_REF98);
root_1 = (CommonTree)adaptor.becomeRoot(BAND_REF98_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_bandSpecifier2133);
expression99=expression();
state._fsp--;
adaptor.addChild(root_1, expression99.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "bandSpecifier"
public static class pixelPos_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "pixelPos"
// org/jaitools/jiffle/parser/TransformExpressions.g:220:1: pixelPos : ( ^( ABS_POS expression ) | ^( REL_POS expression ) );
public final TransformExpressions.pixelPos_return pixelPos() throws RecognitionException {
TransformExpressions.pixelPos_return retval = new TransformExpressions.pixelPos_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree ABS_POS100=null;
CommonTree REL_POS102=null;
TransformExpressions.expression_return expression101 = null;
TransformExpressions.expression_return expression103 = null;
CommonTree ABS_POS100_tree=null;
CommonTree REL_POS102_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:220:17: ( ^( ABS_POS expression ) | ^( REL_POS expression ) )
int alt16=2;
switch ( input.LA(1) ) {
case ABS_POS:
{
alt16=1;
}
break;
case REL_POS:
{
alt16=2;
}
break;
default:
NoViableAltException nvae =
new NoViableAltException("", 16, 0, input);
throw nvae;
}
switch (alt16) {
case 1 :
// org/jaitools/jiffle/parser/TransformExpressions.g:220:19: ^( ABS_POS expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
ABS_POS100=(CommonTree)match(input,ABS_POS,FOLLOW_ABS_POS_in_pixelPos2168);
ABS_POS100_tree = (CommonTree)adaptor.dupNode(ABS_POS100);
root_1 = (CommonTree)adaptor.becomeRoot(ABS_POS100_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_pixelPos2170);
expression101=expression();
state._fsp--;
adaptor.addChild(root_1, expression101.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
case 2 :
// org/jaitools/jiffle/parser/TransformExpressions.g:221:19: ^( REL_POS expression )
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
{
CommonTree _save_last_1 = _last;
CommonTree _first_1 = null;
CommonTree root_1 = (CommonTree)adaptor.nil();_last = (CommonTree)input.LT(1);
REL_POS102=(CommonTree)match(input,REL_POS,FOLLOW_REL_POS_in_pixelPos2192);
REL_POS102_tree = (CommonTree)adaptor.dupNode(REL_POS102);
root_1 = (CommonTree)adaptor.becomeRoot(REL_POS102_tree, root_1);
match(input, Token.DOWN, null);
_last = (CommonTree)input.LT(1);
pushFollow(FOLLOW_expression_in_pixelPos2194);
expression103=expression();
state._fsp--;
adaptor.addChild(root_1, expression103.getTree());
match(input, Token.UP, null); adaptor.addChild(root_0, root_1);_last = _save_last_1;
}
}
break;
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "pixelPos"
public static class literal_return extends TreeRuleReturnScope {
CommonTree tree;
public Object getTree() { return tree; }
};
// $ANTLR start "literal"
// org/jaitools/jiffle/parser/TransformExpressions.g:225:1: literal : ( INT_LITERAL | FLOAT_LITERAL | TRUE | FALSE | NULL );
public final TransformExpressions.literal_return literal() throws RecognitionException {
TransformExpressions.literal_return retval = new TransformExpressions.literal_return();
retval.start = input.LT(1);
CommonTree root_0 = null;
CommonTree _first_0 = null;
CommonTree _last = null;
CommonTree set104=null;
CommonTree set104_tree=null;
try {
// org/jaitools/jiffle/parser/TransformExpressions.g:225:17: ( INT_LITERAL | FLOAT_LITERAL | TRUE | FALSE | NULL )
// org/jaitools/jiffle/parser/TransformExpressions.g:
{
root_0 = (CommonTree)adaptor.nil();
_last = (CommonTree)input.LT(1);
set104=(CommonTree)input.LT(1);
if ( (input.LA(1)>=INT_LITERAL && input.LA(1)<=NULL) ) {
input.consume();
set104_tree = (CommonTree)adaptor.dupNode(set104);
adaptor.addChild(root_0, set104_tree);
state.errorRecovery=false;
}
else {
MismatchedSetException mse = new MismatchedSetException(null,input);
throw mse;
}
}
retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
}
return retval;
}
// $ANTLR end "literal"
// Delegated rules
public static final BitSet FOLLOW_jiffleOption_in_start94 = new BitSet(new long[]{0xFFC6B20869F37BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_varDeclaration_in_start97 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_statement_in_start100 = new BitSet(new long[]{0xFFC6B20869F35BC2L,0x00000000007C47FFL});
public static final BitSet FOLLOW_JIFFLE_OPTION_in_jiffleOption131 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_DECL_in_varDeclaration163 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_VAR_DEST_in_varDeclaration165 = new BitSet(new long[]{0x0000000400000000L});
public static final BitSet FOLLOW_ID_in_varDeclaration167 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_DECL_in_varDeclaration189 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_VAR_SOURCE_in_varDeclaration191 = new BitSet(new long[]{0x0000000400000000L});
public static final BitSet FOLLOW_ID_in_varDeclaration193 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_DECL_in_varDeclaration215 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_varDeclaration221 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_BLOCK_in_block260 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_statement_in_block262 = new BitSet(new long[]{0xFFC6B20869F35BC8L,0x00000000007C47FFL});
public static final BitSet FOLLOW_block_in_statement296 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_ifCall_in_statement316 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_assignmentExpression_in_statement336 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_WHILE_in_statement357 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_loopCondition_in_statement359 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_statement_in_statement361 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_UNTIL_in_statement383 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_loopCondition_in_statement385 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_statement_in_statement387 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_FOREACH_in_statement409 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_statement411 = new BitSet(new long[]{0x0000000040080200L});
public static final BitSet FOLLOW_loopSet_in_statement413 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_statement_in_statement415 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_BREAKIF_in_statement437 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_statement439 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_BREAK_in_statement460 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_expression_in_statement480 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_IF_in_ifCall516 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_ifCall518 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_statement_in_ifCall520 = new BitSet(new long[]{0xFFC6B20869F35BC8L,0x00000000007C47FFL});
public static final BitSet FOLLOW_statement_in_ifCall522 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_expression_in_loopCondition552 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_SEQUENCE_in_loopSet587 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_loopSet589 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_loopSet591 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_listLiteral_in_loopSet612 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_VAR_LIST_in_loopSet632 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_EXPR_LIST_in_expressionList683 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_expressionList688 = new BitSet(new long[]{0xFFC6B20869F35BC8L,0x00000000007C47FFL});
public static final BitSet FOLLOW_assignmentOp_in_assignmentExpression758 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_identifier_in_assignmentExpression760 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_assignmentExpression762 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_set_in_assignmentOp0 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_FUNC_CALL_in_expression935 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_ID_in_expression937 = new BitSet(new long[]{0x0000000000000400L});
public static final BitSet FOLLOW_expressionList_in_expression939 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_QUESTION_in_expression1036 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_expression1040 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_expression1044 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_expression1048 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_CON_CALL_in_expression1110 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expressionList_in_expression1112 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_IMAGE_WRITE_in_expression1134 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_identifier_in_expression1136 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_expression1138 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_IMAGE_POS_in_expression1160 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_identifier_in_expression1162 = new BitSet(new long[]{0x0000000000008028L});
public static final BitSet FOLLOW_bandSpecifier_in_expression1164 = new BitSet(new long[]{0x0000000000008008L});
public static final BitSet FOLLOW_pixelSpecifier_in_expression1167 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_logicalOp_in_expression1190 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_expression1192 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_expression1194 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_arithmeticOp_in_expression1216 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_expression1218 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_expression1220 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_POW_in_expression1242 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_expression1244 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_expression1246 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_PREFIX_in_expression1268 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_prefixOp_in_expression1270 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_expression1272 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_POSTFIX_in_expression1294 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_incdecOp_in_expression1296 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_expression1298 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_PAR_in_expression1320 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_expression1322 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_listOperation_in_expression1343 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_listLiteral_in_expression1363 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_literal_in_expression1383 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_identifier_in_expression1403 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_APPEND_in_listOperation1432 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_VAR_LIST_in_listOperation1434 = new BitSet(new long[]{0xFFC6B20869F35BC0L,0x00000000007C47FFL});
public static final BitSet FOLLOW_expression_in_listOperation1436 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_DECLARED_LIST_in_listLiteral1468 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expressionList_in_listLiteral1470 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_set_in_identifier0 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_set_in_logicalOp0 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_set_in_arithmeticOp0 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_PLUS_in_prefixOp1956 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_MINUS_in_prefixOp1976 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_NOT_in_prefixOp1996 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_incdecOp_in_prefixOp2016 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_set_in_incdecOp0 = new BitSet(new long[]{0x0000000000000002L});
public static final BitSet FOLLOW_PIXEL_REF_in_pixelSpecifier2097 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_pixelPos_in_pixelSpecifier2099 = new BitSet(new long[]{0x0000000000040010L});
public static final BitSet FOLLOW_pixelPos_in_pixelSpecifier2101 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_BAND_REF_in_bandSpecifier2131 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_bandSpecifier2133 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_ABS_POS_in_pixelPos2168 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_pixelPos2170 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_REL_POS_in_pixelPos2192 = new BitSet(new long[]{0x0000000000000004L});
public static final BitSet FOLLOW_expression_in_pixelPos2194 = new BitSet(new long[]{0x0000000000000008L});
public static final BitSet FOLLOW_set_in_literal0 = new BitSet(new long[]{0x0000000000000002L});
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy