// $ANTLR 3.4 /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g 2018-07-10 08:15:54

package org.irisa.genouest.logol.parser;


import java.util.HashMap;
import java.util.Vector;
import java.util.ArrayList;
import org.irisa.genouest.logol.*;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class logolParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "ANY", "COMPARATOR", "ID", "INT", "LINE_COMMENT", "LOWID", "ModelName", "NEWLINE", "Sequence", "SequenceDef", "VARIABLE", "VARID", "WHITESPACE", "'!'", "'!external'", "'\"'", "'#'", "'$$'", "'$'", "'%'", "'('", "')'", "')+'", "'*'", "'+'", "','", "'-'", "'.'", "'.*'", "'.maxDistance'", "'.minDistance'", "'.nboccur'", "'/'", "':'", "';'", "'==*>'", "'==>'", "'?'", "'@'", "'@@'", "'OPT'", "'['", "']'", "'_'", "'_,'", "'_;'", "'controls:'", "'def:'", "'matrix'", "'morphism'", "'p$$'", "'p$'", "'repeat('", "'{'", "'|'", "'}'"
    };

    public static final int EOF=-1;
    public static final int T__17=17;
    public static final int T__18=18;
    public static final int T__19=19;
    public static final int T__20=20;
    public static final int T__21=21;
    public static final int T__22=22;
    public static final int T__23=23;
    public static final int T__24=24;
    public static final int T__25=25;
    public static final int T__26=26;
    public static final int T__27=27;
    public static final int T__28=28;
    public static final int T__29=29;
    public static final int T__30=30;
    public static final int T__31=31;
    public static final int T__32=32;
    public static final int T__33=33;
    public static final int T__34=34;
    public static final int T__35=35;
    public static final int T__36=36;
    public static final int T__37=37;
    public static final int T__38=38;
    public static final int T__39=39;
    public static final int T__40=40;
    public static final int T__41=41;
    public static final int T__42=42;
    public static final int T__43=43;
    public static final int T__44=44;
    public static final int T__45=45;
    public static final int T__46=46;
    public static final int T__47=47;
    public static final int T__48=48;
    public static final int T__49=49;
    public static final int T__50=50;
    public static final int T__51=51;
    public static final int T__52=52;
    public static final int T__53=53;
    public static final int T__54=54;
    public static final int T__55=55;
    public static final int T__56=56;
    public static final int T__57=57;
    public static final int T__58=58;
    public static final int T__59=59;
    public static final int ANY=4;
    public static final int COMPARATOR=5;
    public static final int ID=6;
    public static final int INT=7;
    public static final int LINE_COMMENT=8;
    public static final int LOWID=9;
    public static final int ModelName=10;
    public static final int NEWLINE=11;
    public static final int Sequence=12;
    public static final int SequenceDef=13;
    public static final int VARIABLE=14;
    public static final int VARID=15;
    public static final int WHITESPACE=16;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public logolParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public logolParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

    public String[] getTokenNames() { return logolParser.tokenNames; }
    public String getGrammarFileName() { return "/opt/conda/conda-bld/logol_1531210364456/work/src/logol.g"; }



    /** Map variable name to Integer object holding value */
    //HashMap variables = new HashMap();
    // Use LogolVariable.variables HashMap userVariables = new HashMap();
    HashMap sequenceFiles = new HashMap();

    HashMap logolModels = new HashMap();

    Vector predicates = new Vector();

    static boolean newModel=false;

    HashMap macroControls = new HashMap();

    ArrayList macroControlsDefs = new ArrayList();

    HashMap getMacroControls() {
      return macroControls;
    }

    ArrayList getMacroControlsDefs() {
      return macroControlsDefs;
    }

    int control=0;

    int expr=0;



    // $ANTLR start "rule"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:59:1: rule : ( definitions )? ( controls )? ( LINE_COMMENT | model | query | NEWLINE )+ EOF ;
    public final void rule() throws RecognitionException {

        		Treatment.counters.clear();
        		LogolVariable.matchedVariables.clear();
        		logolModels.clear();
        		Treatment.definitions.clear();
        		Treatment.models.clear();
        		Treatment.query="";
        	 
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:2: ( ( definitions )? ( controls )? ( LINE_COMMENT | model | query | NEWLINE )+ EOF )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:4: ( definitions )? ( controls )? ( LINE_COMMENT | model | query | NEWLINE )+ EOF
            {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:4: ( definitions )?
            int alt1=2;
            int LA1_0 = input.LA(1);

            if ( (LA1_0==51) ) {
                alt1=1;
            }
            switch (alt1) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:4: definitions
                    {
                    pushFollow(FOLLOW_definitions_in_rule66);
                    definitions();

                    state._fsp--;
                    if (state.failed) return ;

                    }
                    break;

            }


            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:17: ( controls )?
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==50) ) {
                alt2=1;
            }
            switch (alt2) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:17: controls
                    {
                    pushFollow(FOLLOW_controls_in_rule69);
                    controls();

                    state._fsp--;
                    if (state.failed) return ;

                    }
                    break;

            }


            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:27: ( LINE_COMMENT | model | query | NEWLINE )+
            int cnt3=0;
            loop3:
            do {
                int alt3=5;
                alt3 = dfa3.predict(input);
                switch (alt3) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:28: LINE_COMMENT
            	    {
            	    match(input,LINE_COMMENT,FOLLOW_LINE_COMMENT_in_rule73); if (state.failed) return ;

            	    }
            	    break;
            	case 2 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:41: model
            	    {
            	    pushFollow(FOLLOW_model_in_rule75);
            	    model();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    }
            	    break;
            	case 3 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:47: query
            	    {
            	    pushFollow(FOLLOW_query_in_rule77);
            	    query();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    }
            	    break;
            	case 4 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:70:53: NEWLINE
            	    {
            	    match(input,NEWLINE,FOLLOW_NEWLINE_in_rule79); if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    if ( cnt3 >= 1 ) break loop3;
            	    if (state.backtracking>0) {state.failed=true; return ;}
                        EarlyExitException eee =
                            new EarlyExitException(3, input);
                        throw eee;
                }
                cnt3++;
            } while (true);


            match(input,EOF,FOLLOW_EOF_in_rule84); if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
            		
            	}
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "rule"



    // $ANTLR start "controls"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:77:1: controls : 'controls:' ( NEWLINE )? '{' NEWLINE ( LINE_COMMENT | control )* '}' NEWLINE ;
    public final void controls() throws RecognitionException {
         control=0; macroControlsDefs = new ArrayList(); 
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:78:6: ( 'controls:' ( NEWLINE )? '{' NEWLINE ( LINE_COMMENT | control )* '}' NEWLINE )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:78:8: 'controls:' ( NEWLINE )? '{' NEWLINE ( LINE_COMMENT | control )* '}' NEWLINE
            {
            match(input,50,FOLLOW_50_in_controls132); if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:78:20: ( NEWLINE )?
            int alt4=2;
            int LA4_0 = input.LA(1);

            if ( (LA4_0==NEWLINE) ) {
                alt4=1;
            }
            switch (alt4) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:78:20: NEWLINE
                    {
                    match(input,NEWLINE,FOLLOW_NEWLINE_in_controls134); if (state.failed) return ;

                    }
                    break;

            }


            match(input,57,FOLLOW_57_in_controls137); if (state.failed) return ;

            match(input,NEWLINE,FOLLOW_NEWLINE_in_controls139); if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:78:41: ( LINE_COMMENT | control )*
            loop5:
            do {
                int alt5=3;
                int LA5_0 = input.LA(1);

                if ( (LA5_0==LINE_COMMENT) ) {
                    alt5=1;
                }
                else if ( (LA5_0==INT||(LA5_0 >= 20 && LA5_0 <= 24)||(LA5_0 >= 42 && LA5_0 <= 43)||(LA5_0 >= 54 && LA5_0 <= 55)) ) {
                    alt5=2;
                }


                switch (alt5) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:78:42: LINE_COMMENT
            	    {
            	    match(input,LINE_COMMENT,FOLLOW_LINE_COMMENT_in_controls142); if (state.failed) return ;

            	    }
            	    break;
            	case 2 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:78:55: control
            	    {
            	    pushFollow(FOLLOW_control_in_controls144);
            	    control();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    break loop5;
                }
            } while (true);


            match(input,59,FOLLOW_59_in_controls148); if (state.failed) return ;

            match(input,NEWLINE,FOLLOW_NEWLINE_in_controls150); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "controls"



    // $ANTLR start "control"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:81:1: control : matchexp= mathexpr (negation= '!' )? COMPARATOR matchexp2= mathexpr NEWLINE ;
    public final void control() throws RecognitionException {
        Token negation=null;
        Token COMPARATOR1=null;
        String matchexp =null;

        String matchexp2 =null;


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:81:8: (matchexp= mathexpr (negation= '!' )? COMPARATOR matchexp2= mathexpr NEWLINE )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:81:10: matchexp= mathexpr (negation= '!' )? COMPARATOR matchexp2= mathexpr NEWLINE
            {
            pushFollow(FOLLOW_mathexpr_in_control160);
            matchexp=mathexpr();

            state._fsp--;
            if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:81:36: (negation= '!' )?
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==17) ) {
                alt6=1;
            }
            switch (alt6) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:81:36: negation= '!'
                    {
                    negation=(Token)match(input,17,FOLLOW_17_in_control164); if (state.failed) return ;

                    }
                    break;

            }


            COMPARATOR1=(Token)match(input,COMPARATOR,FOLLOW_COMPARATOR_in_control167); if (state.failed) return ;

            pushFollow(FOLLOW_mathexpr_in_control171);
            matchexp2=mathexpr();

            state._fsp--;
            if (state.failed) return ;

            if ( state.backtracking==0 ) { String comparator; int count1=++expr; int count2=++expr; if((COMPARATOR1!=null?COMPARATOR1.getText():null).equals(" = ")) { comparator="is"; } else { comparator = (COMPARATOR1!=null?COMPARATOR1.getText():null); } String controlText = "MATHEXPR"+count1+" is ("+matchexp+"), MATHEXPR"+count2+" is ("+matchexp2+"), MATHEXPR"+count1+comparator+"MATHEXPR"+count2; if(negation!=null) { controlText = "\\+ "+controlText; } macroControlsDefs.add(controlText);}

            match(input,NEWLINE,FOLLOW_NEWLINE_in_control175); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "control"



    // $ANTLR start "mathexpr"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:83:1: mathexpr returns [String value] : e= mathatom ( '+' e= mathatom | '-' e= mathatom | '*' e= mathatom | '/' e= mathatom )* ;
    public final String mathexpr() throws RecognitionException {
        String value = null;


        String e =null;


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:84:5: (e= mathatom ( '+' e= mathatom | '-' e= mathatom | '*' e= mathatom | '/' e= mathatom )* )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:84:9: e= mathatom ( '+' e= mathatom | '-' e= mathatom | '*' e= mathatom | '/' e= mathatom )*
            {
            pushFollow(FOLLOW_mathatom_in_mathexpr195);
            e=mathatom();

            state._fsp--;
            if (state.failed) return value;

            if ( state.backtracking==0 ) {value = e;}

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:85:9: ( '+' e= mathatom | '-' e= mathatom | '*' e= mathatom | '/' e= mathatom )*
            loop7:
            do {
                int alt7=5;
                switch ( input.LA(1) ) {
                case 28:
                    {
                    alt7=1;
                    }
                    break;
                case 30:
                    {
                    alt7=2;
                    }
                    break;
                case 27:
                    {
                    alt7=3;
                    }
                    break;
                case 36:
                    {
                    alt7=4;
                    }
                    break;

                }

                switch (alt7) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:85:13: '+' e= mathatom
            	    {
            	    match(input,28,FOLLOW_28_in_mathexpr211); if (state.failed) return value;

            	    pushFollow(FOLLOW_mathatom_in_mathexpr215);
            	    e=mathatom();

            	    state._fsp--;
            	    if (state.failed) return value;

            	    if ( state.backtracking==0 ) {value += " + "+e;}

            	    }
            	    break;
            	case 2 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:86:13: '-' e= mathatom
            	    {
            	    match(input,30,FOLLOW_30_in_mathexpr231); if (state.failed) return value;

            	    pushFollow(FOLLOW_mathatom_in_mathexpr235);
            	    e=mathatom();

            	    state._fsp--;
            	    if (state.failed) return value;

            	    if ( state.backtracking==0 ) {value += " - "+e;}

            	    }
            	    break;
            	case 3 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:87:13: '*' e= mathatom
            	    {
            	    match(input,27,FOLLOW_27_in_mathexpr251); if (state.failed) return value;

            	    pushFollow(FOLLOW_mathatom_in_mathexpr255);
            	    e=mathatom();

            	    state._fsp--;
            	    if (state.failed) return value;

            	    if ( state.backtracking==0 ) {value += " * "+e;}

            	    }
            	    break;
            	case 4 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:88:13: '/' e= mathatom
            	    {
            	    match(input,36,FOLLOW_36_in_mathexpr271); if (state.failed) return value;

            	    pushFollow(FOLLOW_mathatom_in_mathexpr275);
            	    e=mathatom();

            	    state._fsp--;
            	    if (state.failed) return value;

            	    if ( state.backtracking==0 ) {value += " / "+e;}

            	    }
            	    break;

            	default :
            	    break loop7;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return value;
    }
    // $ANTLR end "mathexpr"



    // $ANTLR start "modvar"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:92:1: modvar returns [String value] : ModelName '.' VARIABLE ;
    public final String modvar() throws RecognitionException {
        String value = null;


        Token ModelName2=null;
        Token VARIABLE3=null;

        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:92:30: ( ModelName '.' VARIABLE )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:92:32: ModelName '.' VARIABLE
            {
            ModelName2=(Token)match(input,ModelName,FOLLOW_ModelName_in_modvar304); if (state.failed) return value;

            match(input,31,FOLLOW_31_in_modvar306); if (state.failed) return value;

            VARIABLE3=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_modvar308); if (state.failed) return value;

            if ( state.backtracking==0 ) {value =  (ModelName2!=null?ModelName2.getText():null)+"."+ (VARIABLE3!=null?VARIABLE3.getText():null);}

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return value;
    }
    // $ANTLR end "modvar"



    // $ANTLR start "mathatom"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:94:1: mathatom returns [String value] : (first= INT ( '.' second= INT )? |op= '@@' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= '@' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= '#' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= '$$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= '$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= 'p$$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= 'p$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' | ( '%' '\"' alphabet= LOWID '\"' ) '[' modvar1= modvar ( ',' modvar2= modvar )* ']' | '(' e= mathexpr ')' );
    public final String mathatom() throws RecognitionException {
        String value = null;


        Token first=null;
        Token second=null;
        Token op=null;
        Token alphabet=null;
        String modvar1 =null;

        String modvar2 =null;

        String e =null;


         
        	ArrayList controlVars = new ArrayList();
        	 
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:98:5: (first= INT ( '.' second= INT )? |op= '@@' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= '@' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= '#' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= '$$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= '$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= 'p$$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' |op= 'p$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']' | ( '%' '\"' alphabet= LOWID '\"' ) '[' modvar1= modvar ( ',' modvar2= modvar )* ']' | '(' e= mathexpr ')' )
            int alt17=10;
            switch ( input.LA(1) ) {
            case INT:
                {
                alt17=1;
                }
                break;
            case 43:
                {
                alt17=2;
                }
                break;
            case 42:
                {
                alt17=3;
                }
                break;
            case 20:
                {
                alt17=4;
                }
                break;
            case 21:
                {
                alt17=5;
                }
                break;
            case 22:
                {
                alt17=6;
                }
                break;
            case 54:
                {
                alt17=7;
                }
                break;
            case 55:
                {
                alt17=8;
                }
                break;
            case 23:
                {
                alt17=9;
                }
                break;
            case 24:
                {
                alt17=10;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return value;}
                NoViableAltException nvae =
                    new NoViableAltException("", 17, 0, input);

                throw nvae;

            }

            switch (alt17) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:98:9: first= INT ( '.' second= INT )?
                    {
                    first=(Token)match(input,INT,FOLLOW_INT_in_mathatom337); if (state.failed) return value;

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:98:19: ( '.' second= INT )?
                    int alt8=2;
                    int LA8_0 = input.LA(1);

                    if ( (LA8_0==31) ) {
                        alt8=1;
                    }
                    switch (alt8) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:98:20: '.' second= INT
                            {
                            match(input,31,FOLLOW_31_in_mathatom340); if (state.failed) return value;

                            second=(Token)match(input,INT,FOLLOW_INT_in_mathatom344); if (state.failed) return value;

                            }
                            break;

                    }


                    if ( state.backtracking==0 ) {value = (first!=null?first.getText():null); if((second!=null) && (!(second!=null?second.getText():null).equals(""))) { value += "."+(second!=null?second.getText():null);} }

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:100:7: op= '@@' '[' modvar1= modvar ( ',' modvar2= modvar )* ']'
                    {
                    op=(Token)match(input,43,FOLLOW_43_in_mathatom359); if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add((op!=null?op.getText():null)); }

                    match(input,45,FOLLOW_45_in_mathatom363); if (state.failed) return value;

                    pushFollow(FOLLOW_modvar_in_mathatom367);
                    modvar1=modvar();

                    state._fsp--;
                    if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add(modvar1);}

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:100:101: ( ',' modvar2= modvar )*
                    loop9:
                    do {
                        int alt9=2;
                        int LA9_0 = input.LA(1);

                        if ( (LA9_0==29) ) {
                            alt9=1;
                        }


                        switch (alt9) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:100:103: ',' modvar2= modvar
                    	    {
                    	    match(input,29,FOLLOW_29_in_mathatom373); if (state.failed) return value;

                    	    pushFollow(FOLLOW_modvar_in_mathatom377);
                    	    modvar2=modvar();

                    	    state._fsp--;
                    	    if (state.failed) return value;

                    	    if ( state.backtracking==0 ) { controlVars.add(modvar2); }

                    	    }
                    	    break;

                    	default :
                    	    break loop9;
                        }
                    } while (true);


                    match(input,46,FOLLOW_46_in_mathatom383); if (state.failed) return value;

                    if ( state.backtracking==0 ) { value = "Control"+control; macroControls.put(value,controlVars); control++; }

                    }
                    break;
                case 3 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:101:7: op= '@' '[' modvar1= modvar ( ',' modvar2= modvar )* ']'
                    {
                    op=(Token)match(input,42,FOLLOW_42_in_mathatom395); if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add((op!=null?op.getText():null)); }

                    match(input,45,FOLLOW_45_in_mathatom399); if (state.failed) return value;

                    pushFollow(FOLLOW_modvar_in_mathatom403);
                    modvar1=modvar();

                    state._fsp--;
                    if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add(modvar1);}

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:101:100: ( ',' modvar2= modvar )*
                    loop10:
                    do {
                        int alt10=2;
                        int LA10_0 = input.LA(1);

                        if ( (LA10_0==29) ) {
                            alt10=1;
                        }


                        switch (alt10) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:101:102: ',' modvar2= modvar
                    	    {
                    	    match(input,29,FOLLOW_29_in_mathatom409); if (state.failed) return value;

                    	    pushFollow(FOLLOW_modvar_in_mathatom413);
                    	    modvar2=modvar();

                    	    state._fsp--;
                    	    if (state.failed) return value;

                    	    if ( state.backtracking==0 ) { controlVars.add(modvar2); }

                    	    }
                    	    break;

                    	default :
                    	    break loop10;
                        }
                    } while (true);


                    match(input,46,FOLLOW_46_in_mathatom419); if (state.failed) return value;

                    if ( state.backtracking==0 ) { value = "Control"+control; macroControls.put(value,controlVars); control++; }

                    }
                    break;
                case 4 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:102:7: op= '#' '[' modvar1= modvar ( ',' modvar2= modvar )* ']'
                    {
                    op=(Token)match(input,20,FOLLOW_20_in_mathatom431); if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add((op!=null?op.getText():null)); }

                    match(input,45,FOLLOW_45_in_mathatom435); if (state.failed) return value;

                    pushFollow(FOLLOW_modvar_in_mathatom439);
                    modvar1=modvar();

                    state._fsp--;
                    if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add(modvar1);}

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:102:100: ( ',' modvar2= modvar )*
                    loop11:
                    do {
                        int alt11=2;
                        int LA11_0 = input.LA(1);

                        if ( (LA11_0==29) ) {
                            alt11=1;
                        }


                        switch (alt11) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:102:102: ',' modvar2= modvar
                    	    {
                    	    match(input,29,FOLLOW_29_in_mathatom445); if (state.failed) return value;

                    	    pushFollow(FOLLOW_modvar_in_mathatom449);
                    	    modvar2=modvar();

                    	    state._fsp--;
                    	    if (state.failed) return value;

                    	    if ( state.backtracking==0 ) { controlVars.add(modvar2); }

                    	    }
                    	    break;

                    	default :
                    	    break loop11;
                        }
                    } while (true);


                    match(input,46,FOLLOW_46_in_mathatom455); if (state.failed) return value;

                    if ( state.backtracking==0 ) { value = "Control"+control; macroControls.put(value,controlVars); control++; }

                    }
                    break;
                case 5 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:103:7: op= '$$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']'
                    {
                    op=(Token)match(input,21,FOLLOW_21_in_mathatom467); if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add((op!=null?op.getText():null)); }

                    match(input,45,FOLLOW_45_in_mathatom471); if (state.failed) return value;

                    pushFollow(FOLLOW_modvar_in_mathatom475);
                    modvar1=modvar();

                    state._fsp--;
                    if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add(modvar1);}

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:103:101: ( ',' modvar2= modvar )*
                    loop12:
                    do {
                        int alt12=2;
                        int LA12_0 = input.LA(1);

                        if ( (LA12_0==29) ) {
                            alt12=1;
                        }


                        switch (alt12) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:103:103: ',' modvar2= modvar
                    	    {
                    	    match(input,29,FOLLOW_29_in_mathatom481); if (state.failed) return value;

                    	    pushFollow(FOLLOW_modvar_in_mathatom485);
                    	    modvar2=modvar();

                    	    state._fsp--;
                    	    if (state.failed) return value;

                    	    if ( state.backtracking==0 ) { controlVars.add(modvar2); }

                    	    }
                    	    break;

                    	default :
                    	    break loop12;
                        }
                    } while (true);


                    match(input,46,FOLLOW_46_in_mathatom491); if (state.failed) return value;

                    if ( state.backtracking==0 ) { value = "Control"+control; macroControls.put(value,controlVars); control++; }

                    }
                    break;
                case 6 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:104:7: op= '$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']'
                    {
                    op=(Token)match(input,22,FOLLOW_22_in_mathatom503); if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add((op!=null?op.getText():null)); }

                    match(input,45,FOLLOW_45_in_mathatom507); if (state.failed) return value;

                    pushFollow(FOLLOW_modvar_in_mathatom511);
                    modvar1=modvar();

                    state._fsp--;
                    if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add(modvar1);}

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:104:100: ( ',' modvar2= modvar )*
                    loop13:
                    do {
                        int alt13=2;
                        int LA13_0 = input.LA(1);

                        if ( (LA13_0==29) ) {
                            alt13=1;
                        }


                        switch (alt13) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:104:102: ',' modvar2= modvar
                    	    {
                    	    match(input,29,FOLLOW_29_in_mathatom517); if (state.failed) return value;

                    	    pushFollow(FOLLOW_modvar_in_mathatom521);
                    	    modvar2=modvar();

                    	    state._fsp--;
                    	    if (state.failed) return value;

                    	    if ( state.backtracking==0 ) { controlVars.add(modvar2); }

                    	    }
                    	    break;

                    	default :
                    	    break loop13;
                        }
                    } while (true);


                    match(input,46,FOLLOW_46_in_mathatom527); if (state.failed) return value;

                    if ( state.backtracking==0 ) { value = "Control"+control; macroControls.put(value,controlVars); control++; }

                    }
                    break;
                case 7 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:105:7: op= 'p$$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']'
                    {
                    op=(Token)match(input,54,FOLLOW_54_in_mathatom539); if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add((op!=null?op.getText():null)); }

                    match(input,45,FOLLOW_45_in_mathatom543); if (state.failed) return value;

                    pushFollow(FOLLOW_modvar_in_mathatom547);
                    modvar1=modvar();

                    state._fsp--;
                    if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add(modvar1);}

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:105:102: ( ',' modvar2= modvar )*
                    loop14:
                    do {
                        int alt14=2;
                        int LA14_0 = input.LA(1);

                        if ( (LA14_0==29) ) {
                            alt14=1;
                        }


                        switch (alt14) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:105:104: ',' modvar2= modvar
                    	    {
                    	    match(input,29,FOLLOW_29_in_mathatom553); if (state.failed) return value;

                    	    pushFollow(FOLLOW_modvar_in_mathatom557);
                    	    modvar2=modvar();

                    	    state._fsp--;
                    	    if (state.failed) return value;

                    	    if ( state.backtracking==0 ) { controlVars.add(modvar2); }

                    	    }
                    	    break;

                    	default :
                    	    break loop14;
                        }
                    } while (true);


                    match(input,46,FOLLOW_46_in_mathatom563); if (state.failed) return value;

                    if ( state.backtracking==0 ) { value = "Control"+control; macroControls.put(value,controlVars); control++; }

                    }
                    break;
                case 8 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:106:7: op= 'p$' '[' modvar1= modvar ( ',' modvar2= modvar )* ']'
                    {
                    op=(Token)match(input,55,FOLLOW_55_in_mathatom575); if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add((op!=null?op.getText():null)); }

                    match(input,45,FOLLOW_45_in_mathatom579); if (state.failed) return value;

                    pushFollow(FOLLOW_modvar_in_mathatom583);
                    modvar1=modvar();

                    state._fsp--;
                    if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add(modvar1);}

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:106:101: ( ',' modvar2= modvar )*
                    loop15:
                    do {
                        int alt15=2;
                        int LA15_0 = input.LA(1);

                        if ( (LA15_0==29) ) {
                            alt15=1;
                        }


                        switch (alt15) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:106:103: ',' modvar2= modvar
                    	    {
                    	    match(input,29,FOLLOW_29_in_mathatom589); if (state.failed) return value;

                    	    pushFollow(FOLLOW_modvar_in_mathatom593);
                    	    modvar2=modvar();

                    	    state._fsp--;
                    	    if (state.failed) return value;

                    	    if ( state.backtracking==0 ) { controlVars.add(modvar2); }

                    	    }
                    	    break;

                    	default :
                    	    break loop15;
                        }
                    } while (true);


                    match(input,46,FOLLOW_46_in_mathatom599); if (state.failed) return value;

                    if ( state.backtracking==0 ) { value = "Control"+control; macroControls.put(value,controlVars); control++; }

                    }
                    break;
                case 9 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:107:7: ( '%' '\"' alphabet= LOWID '\"' ) '[' modvar1= modvar ( ',' modvar2= modvar )* ']'
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:107:7: ( '%' '\"' alphabet= LOWID '\"' )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:107:8: '%' '\"' alphabet= LOWID '\"'
                    {
                    match(input,23,FOLLOW_23_in_mathatom610); if (state.failed) return value;

                    match(input,19,FOLLOW_19_in_mathatom612); if (state.failed) return value;

                    alphabet=(Token)match(input,LOWID,FOLLOW_LOWID_in_mathatom616); if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add("\""+(alphabet!=null?alphabet.getText():null)+"\""); }

                    match(input,19,FOLLOW_19_in_mathatom620); if (state.failed) return value;

                    }


                    match(input,45,FOLLOW_45_in_mathatom623); if (state.failed) return value;

                    pushFollow(FOLLOW_modvar_in_mathatom627);
                    modvar1=modvar();

                    state._fsp--;
                    if (state.failed) return value;

                    if ( state.backtracking==0 ) { controlVars.add(modvar1);}

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:107:139: ( ',' modvar2= modvar )*
                    loop16:
                    do {
                        int alt16=2;
                        int LA16_0 = input.LA(1);

                        if ( (LA16_0==29) ) {
                            alt16=1;
                        }


                        switch (alt16) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:107:141: ',' modvar2= modvar
                    	    {
                    	    match(input,29,FOLLOW_29_in_mathatom634); if (state.failed) return value;

                    	    pushFollow(FOLLOW_modvar_in_mathatom638);
                    	    modvar2=modvar();

                    	    state._fsp--;
                    	    if (state.failed) return value;

                    	    if ( state.backtracking==0 ) { controlVars.add(modvar2); }

                    	    }
                    	    break;

                    	default :
                    	    break loop16;
                        }
                    } while (true);


                    match(input,46,FOLLOW_46_in_mathatom644); if (state.failed) return value;

                    if ( state.backtracking==0 ) { value = "Control"+control; macroControls.put(value,controlVars); control++; }

                    }
                    break;
                case 10 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:108:9: '(' e= mathexpr ')'
                    {
                    match(input,24,FOLLOW_24_in_mathatom656); if (state.failed) return value;

                    pushFollow(FOLLOW_mathexpr_in_mathatom660);
                    e=mathexpr();

                    state._fsp--;
                    if (state.failed) return value;

                    match(input,25,FOLLOW_25_in_mathatom662); if (state.failed) return value;

                    if ( state.backtracking==0 ) {value = '(' + e + ')';}

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return value;
    }
    // $ANTLR end "mathatom"



    // $ANTLR start "model"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:111:1: model : curmod= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' '==>' myview= view[0] ;
    public final void model() throws RecognitionException {
        Token curmod=null;
        Token vars=null;
        List list_vars=null;
        logolParser.view_return myview =null;


         Model mod = new Model();
        		
        	 
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:128:2: (curmod= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' '==>' myview= view[0] )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:128:4: curmod= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' '==>' myview= view[0]
            {
            curmod=(Token)match(input,ModelName,FOLLOW_ModelName_in_model693); if (state.failed) return ;

            if ( state.backtracking==0 ) { mod.name=(curmod!=null?curmod.getText():null); mod.name=mod.name.replaceAll("%\\w+%", ""); Treatment.currentModel=mod; newModel=true; Boolean isPrimaryModel  = LogolVariable.mainModels.get(mod.name); /* If model is a primary model, search is not constrained to the start of the sequence  */ if(isPrimaryModel!=null) { Treatment.isAny=0; Treatment.saveAny=false; Treatment.isAnyMax = "SEQUENCELength";} }

            match(input,24,FOLLOW_24_in_model697); if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:128:413: (vars+= VARIABLE )?
            int alt18=2;
            int LA18_0 = input.LA(1);

            if ( (LA18_0==VARIABLE) ) {
                alt18=1;
            }
            switch (alt18) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:128:413: vars+= VARIABLE
                    {
                    vars=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_model701); if (state.failed) return ;
                    if (list_vars==null) list_vars=new ArrayList();
                    list_vars.add(vars);


                    }
                    break;

            }


            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:128:426: ( ',' vars+= VARIABLE )*
            loop19:
            do {
                int alt19=2;
                int LA19_0 = input.LA(1);

                if ( (LA19_0==29) ) {
                    alt19=1;
                }


                switch (alt19) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:128:427: ',' vars+= VARIABLE
            	    {
            	    match(input,29,FOLLOW_29_in_model706); if (state.failed) return ;

            	    vars=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_model710); if (state.failed) return ;
            	    if (list_vars==null) list_vars=new ArrayList();
            	    list_vars.add(vars);


            	    }
            	    break;

            	default :
            	    break loop19;
                }
            } while (true);


            match(input,25,FOLLOW_25_in_model715); if (state.failed) return ;

            if ( state.backtracking==0 ) { if(list_vars!=null) {	for(int i=0;i<list_vars.size();i++) { org.antlr.runtime.CommonToken token = (org.antlr.runtime.CommonToken) list_vars.get(i); mod.vars.add(token.getText()); Treatment.currentModel=mod;}} }

            match(input,40,FOLLOW_40_in_model719); if (state.failed) return ;

            pushFollow(FOLLOW_view_in_model724);
            myview=view(0);

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) { /*if(list_vars!=null) {	
            		for(int i=0;i<list_vars.size();i++) {
            			org.antlr.runtime.CommonToken token = (org.antlr.runtime.CommonToken) list_vars.get(i);
            			mod.vars.add(token.getText());			
            		}
            		}*/
            		mod.predicate=(myview!=null?myview.value:null);
            		mod.text=(myview!=null?input.toString(myview.start,myview.stop):null);	
            				
            		Treatment.models.add(mod);	
            		logolModels.put(mod.name,mod);
            		
            					
            	}
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "model"


    public static class view_return extends ParserRuleReturnScope {
        public String value;
    };


    // $ANTLR start "view"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:134:1: view[int parentId] returns [String value] : ( ( (op= ( ',' | ';' | '|' ) )? (ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny] ) ) )+ ;
    public final logolParser.view_return view(int parentId) throws RecognitionException {
        logolParser.view_return retval = new logolParser.view_return();
        retval.start = input.LT(1);


        Token op=null;
        String ent =null;



        		retval.value ="";
        		String operator;
        		Entity curView = new Entity();
        		int tmpcounter=0;
        		String tmpdata="";
        		int tmpIsAny = Treatment.isAny;
        		String tmpIsAnyMin = Treatment.isAnyMin;
        		String tmpIsAnyMax = Treatment.isAnyMax;				
        		boolean tmpSaveAny = Treatment.saveAny;
        		
        	
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:2: ( ( ( (op= ( ',' | ';' | '|' ) )? (ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny] ) ) )+ )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:4: ( ( (op= ( ',' | ';' | '|' ) )? (ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny] ) ) )+
            {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:4: ( ( (op= ( ',' | ';' | '|' ) )? (ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny] ) ) )+
            int cnt21=0;
            loop21:
            do {
                int alt21=2;
                alt21 = dfa21.predict(input);
                switch (alt21) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:6: ( (op= ( ',' | ';' | '|' ) )? (ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny] ) )
            	    {
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:6: ( (op= ( ',' | ';' | '|' ) )? (ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny] ) )
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:8: (op= ( ',' | ';' | '|' ) )? (ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny] )
            	    {
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:10: (op= ( ',' | ';' | '|' ) )?
            	    int alt20=2;
            	    int LA20_0 = input.LA(1);

            	    if ( (LA20_0==29||LA20_0==38||LA20_0==58) ) {
            	        alt20=1;
            	    }
            	    switch (alt20) {
            	        case 1 :
            	            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:10: op= ( ',' | ';' | '|' )
            	            {
            	            op=(Token)input.LT(1);

            	            if ( input.LA(1)==29||input.LA(1)==38||input.LA(1)==58 ) {
            	                input.consume();
            	                state.errorRecovery=false;
            	                state.failed=false;
            	            }
            	            else {
            	                if (state.backtracking>0) {state.failed=true; return retval;}
            	                MismatchedSetException mse = new MismatchedSetException(null,input);
            	                throw mse;
            	            }


            	            }
            	            break;

            	    }


            	    if ( state.backtracking==0 ) { if(op!=null && !(op!=null?op.getText():null).equals(Constants.OP_OR)) { tmpIsAny = Treatment.isAny; tmpIsAnyMin = Treatment.isAnyMin; tmpIsAnyMax = Treatment.isAnyMax; tmpSaveAny = Treatment.saveAny; tmpcounter = (Integer) Treatment.counters.get(parentId); tmpcounter++; Treatment.counters.put(parentId,tmpcounter); }}

            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:333: (ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny] )
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:152:335: ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny]
            	    {
            	    pushFollow(FOLLOW_constrainedEntity_in_view821);
            	    ent=constrainedEntity(parentId, tmpIsAny, tmpIsAnyMin, tmpIsAnyMax, tmpSaveAny);

            	    state._fsp--;
            	    if (state.failed) return retval;

            	    }


            	    }


            	    if ( state.backtracking==0 ) { if(op==null) {operator=null; tmpdata+=curView.add(ent,operator,0,tmpcounter); /*tmpcounter = (Integer) counters.get(parentId); tmpcounter++; counters.put(parentId,tmpcounter);*/ } else { operator=(op!=null?op.getText():null); if(!operator.equals("|")) { /*tmpcounter = (Integer) counters.get(parentId); tmpcounter++; counters.put(parentId,tmpcounter);*/ tmpdata+=curView.add(ent,operator,0,tmpcounter); /*tmpcounter = (Integer) counters.get(parentId); tmpcounter++; counters.put(parentId,tmpcounter);*/ } else { tmpdata+=curView.add(ent,operator,0,tmpcounter);}}; }

            	    }
            	    break;

            	default :
            	    if ( cnt21 >= 1 ) break loop21;
            	    if (state.backtracking>0) {state.failed=true; return retval;}
                        EarlyExitException eee =
                            new EarlyExitException(21, input);
                        throw eee;
                }
                cnt21++;
            } while (true);


            }

            retval.stop = input.LT(-1);


            if ( state.backtracking==0 ) {
            		retval.value =tmpdata;
            		tmpcounter = (Integer) Treatment.counters.get(parentId); tmpcounter++; Treatment.counters.put(parentId,tmpcounter);
            	}
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "view"



    // $ANTLR start "query"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:156:1: query :models+= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' ( '.' models+= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' )* '==*>' seq= Sequence ( '.' sequences )* ;
    public final void query() throws RecognitionException {
        Token seq=null;
        Token models=null;
        Token vars=null;
        List list_models=null;
        List list_vars=null;

        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:2: (models+= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' ( '.' models+= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' )* '==*>' seq= Sequence ( '.' sequences )* )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:4: models+= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' ( '.' models+= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' )* '==*>' seq= Sequence ( '.' sequences )*
            {
            models=(Token)match(input,ModelName,FOLLOW_ModelName_in_query851); if (state.failed) return ;
            if (list_models==null) list_models=new ArrayList();
            list_models.add(models);


            match(input,24,FOLLOW_24_in_query853); if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:25: (vars+= VARIABLE )?
            int alt22=2;
            int LA22_0 = input.LA(1);

            if ( (LA22_0==VARIABLE) ) {
                alt22=1;
            }
            switch (alt22) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:26: vars+= VARIABLE
                    {
                    vars=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_query857); if (state.failed) return ;
                    if (list_vars==null) list_vars=new ArrayList();
                    list_vars.add(vars);


                    }
                    break;

            }


            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:43: ( ',' vars+= VARIABLE )*
            loop23:
            do {
                int alt23=2;
                int LA23_0 = input.LA(1);

                if ( (LA23_0==29) ) {
                    alt23=1;
                }


                switch (alt23) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:44: ',' vars+= VARIABLE
            	    {
            	    match(input,29,FOLLOW_29_in_query862); if (state.failed) return ;

            	    vars=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_query866); if (state.failed) return ;
            	    if (list_vars==null) list_vars=new ArrayList();
            	    list_vars.add(vars);


            	    }
            	    break;

            	default :
            	    break loop23;
                }
            } while (true);


            match(input,25,FOLLOW_25_in_query870); if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:70: ( '.' models+= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' )*
            loop26:
            do {
                int alt26=2;
                int LA26_0 = input.LA(1);

                if ( (LA26_0==31) ) {
                    alt26=1;
                }


                switch (alt26) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:71: '.' models+= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')'
            	    {
            	    match(input,31,FOLLOW_31_in_query874); if (state.failed) return ;

            	    models=(Token)match(input,ModelName,FOLLOW_ModelName_in_query878); if (state.failed) return ;
            	    if (list_models==null) list_models=new ArrayList();
            	    list_models.add(models);


            	    match(input,24,FOLLOW_24_in_query880); if (state.failed) return ;

            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:96: (vars+= VARIABLE )?
            	    int alt24=2;
            	    int LA24_0 = input.LA(1);

            	    if ( (LA24_0==VARIABLE) ) {
            	        alt24=1;
            	    }
            	    switch (alt24) {
            	        case 1 :
            	            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:97: vars+= VARIABLE
            	            {
            	            vars=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_query884); if (state.failed) return ;
            	            if (list_vars==null) list_vars=new ArrayList();
            	            list_vars.add(vars);


            	            }
            	            break;

            	    }


            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:114: ( ',' vars+= VARIABLE )*
            	    loop25:
            	    do {
            	        int alt25=2;
            	        int LA25_0 = input.LA(1);

            	        if ( (LA25_0==29) ) {
            	            alt25=1;
            	        }


            	        switch (alt25) {
            	    	case 1 :
            	    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:115: ',' vars+= VARIABLE
            	    	    {
            	    	    match(input,29,FOLLOW_29_in_query889); if (state.failed) return ;

            	    	    vars=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_query893); if (state.failed) return ;
            	    	    if (list_vars==null) list_vars=new ArrayList();
            	    	    list_vars.add(vars);


            	    	    }
            	    	    break;

            	    	default :
            	    	    break loop25;
            	        }
            	    } while (true);


            	    match(input,25,FOLLOW_25_in_query897); if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    break loop26;
                }
            } while (true);


            match(input,39,FOLLOW_39_in_query901); if (state.failed) return ;

            seq=(Token)match(input,Sequence,FOLLOW_Sequence_in_query905); if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:162: ( '.' sequences )*
            loop27:
            do {
                int alt27=2;
                int LA27_0 = input.LA(1);

                if ( (LA27_0==31) ) {
                    alt27=1;
                }


                switch (alt27) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:269:163: '.' sequences
            	    {
            	    match(input,31,FOLLOW_31_in_query908); if (state.failed) return ;

            	    pushFollow(FOLLOW_sequences_in_query910);
            	    sequences();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    break loop27;
                }
            } while (true);


            }

            if ( state.backtracking==0 ) {
            		org.antlr.runtime.CommonToken tokenVar=null;
            		int varcount=0;
            		if(Treatment.getParseStep()==2) {
            		// Pre analysis step
            		
            		String result="Z=[";
            		String query="query(Z):-";
            		int i;
            		Model model=null;
            		org.antlr.runtime.CommonToken token=null;

            		for(i=0;i<list_models.size();i++) {
            		if(i>0) query+=",";
            		token = (org.antlr.runtime.CommonToken) list_models.get(i);
            		model =(Model)logolModels.get(token.getText());
            		// Define the model as a primary model
            		LogolVariable.mainModels.put(token.getText(),new Boolean(true));
            		//Treatment.models.add(model);
            		if((model.vars!=null) && (model.vars.size()==0)) {
            		//query+=model.name+"(Z"+i+")";
            		query+=model.name+"(LOGOLVARDUMMY)";
            		}
            		else {
            		query+=model.name+"(";
            			tokenVar = (org.antlr.runtime.CommonToken) list_vars.get(varcount);
            			varcount++;				
            			query+=tokenVar.getText();
            			if(i>0) result+=",";
            			result+=tokenVar.getText();
            			
            			for(int j=1;j<model.vars.size();j++) {
            			tokenVar = (org.antlr.runtime.CommonToken) list_vars.get(varcount);
            			varcount++;
            			query+=","+tokenVar.getText();
            			result+=","+tokenVar.getText();
            			}
            		
            		
            		query+=")";
            		
            		
            		}
            				
            		}
            		result+="].";
            		Treatment.query=query+","+result;		
            		
            		}
            		
            		
            		// Last step
            		if(Treatment.getParseStep()==3) {
            		varcount=0;
            		// Execute query(Z) with Z = read sequence
            		
            		//String query="query(Z):- retractall(varDefinition(_,_,_,_,_, _, _, _)),bb_get('seq1',Sequence)";
            		String query="query(Z):- retractall(varDefinition(_,_,_,_,_, _, _, _))";
            		
            		int i;
            		Model model=null;
            		org.antlr.runtime.CommonToken token=null;
            		for(i=0;i<list_models.size();i++) {
            		query+=",";
            		token = (org.antlr.runtime.CommonToken) list_models.get(i);
            		model =(Model)logolModels.get(token.getText());
            		
            		//Treatment.models.add(model);
            		if((model.vars!=null) & (model.vars.size()==0)) {
            		query+=model.name+"(0,[],_,_"+","+model.name.toUpperCase()+",_,_)";
            		//query+=model.name+"(Sequence,[],_,_"+","+model.name.toUpperCase()+",_,_)";
            		}
            		else {
            		//query+=model.name+"(Sequence,[],_,";
            		query+=model.name+"(0,[],_,";			
            			tokenVar = (org.antlr.runtime.CommonToken) list_vars.get(varcount);
            			varcount++;				
            			query+=tokenVar.getText();

            			
            			for(int j=1;j<model.vars.size();j++) {
            			tokenVar = (org.antlr.runtime.CommonToken) list_vars.get(varcount);
            			varcount++;
            			query+=","+tokenVar.getText();

            						
            			}
            		
            		
            		query+=",_"+","+model.name.toUpperCase()+",_,_)";
            		
            		}
            		}
            		
            		query+=",Z=[";
            		for(i=0;i<list_models.size();i++) {
            			token = (org.antlr.runtime.CommonToken) list_models.get(i);			
            			model =(Model)logolModels.get(token.getText());
            			if(i>0) query+=",";
            			query+=model.name.toUpperCase();
            		}
            		query+="],outputfile(ResFile),";
            		if(Logol.singlesOnly==true) {
            		query+="matchExist('"+Logol.getFilterType()+"',Z),";
            		}
            		query+=Treatment.checkMetaControls(getMacroControls(),getMacroControlsDefs());
            		query+="(config(Config),nth0(1,Config,USEOPTIMAL),(USEOPTIMAL=0->writeallresult(ResFile,Z);(getCounter(NEWID),parseResults(Z,OPTVARS),isMax(Z,OPTVARS,NEWID)))).";
            		Treatment.query=query;
            		}
            		
            		
            		//System.out.println(query);
            		}
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "query"



    // $ANTLR start "sequences"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:272:1: sequences : ( Sequence | '(' Sequence ( '.' Sequence )* ')' );
    public final void sequences() throws RecognitionException {
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:273:2: ( Sequence | '(' Sequence ( '.' Sequence )* ')' )
            int alt29=2;
            int LA29_0 = input.LA(1);

            if ( (LA29_0==Sequence) ) {
                alt29=1;
            }
            else if ( (LA29_0==24) ) {
                alt29=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return ;}
                NoViableAltException nvae =
                    new NoViableAltException("", 29, 0, input);

                throw nvae;

            }
            switch (alt29) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:273:5: Sequence
                    {
                    match(input,Sequence,FOLLOW_Sequence_in_sequences923); if (state.failed) return ;

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:273:16: '(' Sequence ( '.' Sequence )* ')'
                    {
                    match(input,24,FOLLOW_24_in_sequences927); if (state.failed) return ;

                    match(input,Sequence,FOLLOW_Sequence_in_sequences929); if (state.failed) return ;

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:273:29: ( '.' Sequence )*
                    loop28:
                    do {
                        int alt28=2;
                        int LA28_0 = input.LA(1);

                        if ( (LA28_0==31) ) {
                            alt28=1;
                        }


                        switch (alt28) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:273:30: '.' Sequence
                    	    {
                    	    match(input,31,FOLLOW_31_in_sequences932); if (state.failed) return ;

                    	    match(input,Sequence,FOLLOW_Sequence_in_sequences934); if (state.failed) return ;

                    	    }
                    	    break;

                    	default :
                    	    break loop28;
                        }
                    } while (true);


                    match(input,25,FOLLOW_25_in_sequences938); if (state.failed) return ;

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "sequences"



    // $ANTLR start "definitions"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:280:1: definitions : 'def:' ( NEWLINE )? '{' ( (def= definition NEWLINE ) | LINE_COMMENT | NEWLINE )* '}' NEWLINE ;
    public final void definitions() throws RecognitionException {
        String def =null;


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:2: ( 'def:' ( NEWLINE )? '{' ( (def= definition NEWLINE ) | LINE_COMMENT | NEWLINE )* '}' NEWLINE )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:4: 'def:' ( NEWLINE )? '{' ( (def= definition NEWLINE ) | LINE_COMMENT | NEWLINE )* '}' NEWLINE
            {
            match(input,51,FOLLOW_51_in_definitions979); if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:11: ( NEWLINE )?
            int alt30=2;
            int LA30_0 = input.LA(1);

            if ( (LA30_0==NEWLINE) ) {
                alt30=1;
            }
            switch (alt30) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:11: NEWLINE
                    {
                    match(input,NEWLINE,FOLLOW_NEWLINE_in_definitions981); if (state.failed) return ;

                    }
                    break;

            }


            match(input,57,FOLLOW_57_in_definitions984); if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:24: ( (def= definition NEWLINE ) | LINE_COMMENT | NEWLINE )*
            loop31:
            do {
                int alt31=4;
                switch ( input.LA(1) ) {
                case 52:
                case 53:
                    {
                    alt31=1;
                    }
                    break;
                case LINE_COMMENT:
                    {
                    alt31=2;
                    }
                    break;
                case NEWLINE:
                    {
                    alt31=3;
                    }
                    break;

                }

                switch (alt31) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:25: (def= definition NEWLINE )
            	    {
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:25: (def= definition NEWLINE )
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:26: def= definition NEWLINE
            	    {
            	    pushFollow(FOLLOW_definition_in_definitions990);
            	    def=definition();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    if ( state.backtracking==0 ) {Treatment.definitions.add(def);}

            	    match(input,NEWLINE,FOLLOW_NEWLINE_in_definitions994); if (state.failed) return ;

            	    }


            	    }
            	    break;
            	case 2 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:93: LINE_COMMENT
            	    {
            	    match(input,LINE_COMMENT,FOLLOW_LINE_COMMENT_in_definitions997); if (state.failed) return ;

            	    }
            	    break;
            	case 3 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:281:106: NEWLINE
            	    {
            	    match(input,NEWLINE,FOLLOW_NEWLINE_in_definitions999); if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    break loop31;
                }
            } while (true);


            match(input,59,FOLLOW_59_in_definitions1003); if (state.failed) return ;

            match(input,NEWLINE,FOLLOW_NEWLINE_in_definitions1005); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "definitions"



    // $ANTLR start "definition"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:283:1: definition returns [String content] : ( ( 'matrix' '(' id1= LOWID ',' id2= LOWID ',' mat= matrix ')' ) | ( 'morphism' '(' id1= LOWID ',' id2= LOWID ',' id3= LOWID ')' ) );
    public final String definition() throws RecognitionException {
        String content = null;


        Token id1=null;
        Token id2=null;
        Token id3=null;
        logolParser.matrix_return mat =null;


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:283:37: ( ( 'matrix' '(' id1= LOWID ',' id2= LOWID ',' mat= matrix ')' ) | ( 'morphism' '(' id1= LOWID ',' id2= LOWID ',' id3= LOWID ')' ) )
            int alt32=2;
            int LA32_0 = input.LA(1);

            if ( (LA32_0==52) ) {
                alt32=1;
            }
            else if ( (LA32_0==53) ) {
                alt32=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return content;}
                NoViableAltException nvae =
                    new NoViableAltException("", 32, 0, input);

                throw nvae;

            }
            switch (alt32) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:284:5: ( 'matrix' '(' id1= LOWID ',' id2= LOWID ',' mat= matrix ')' )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:284:5: ( 'matrix' '(' id1= LOWID ',' id2= LOWID ',' mat= matrix ')' )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:284:6: 'matrix' '(' id1= LOWID ',' id2= LOWID ',' mat= matrix ')'
                    {
                    match(input,52,FOLLOW_52_in_definition1024); if (state.failed) return content;

                    match(input,24,FOLLOW_24_in_definition1026); if (state.failed) return content;

                    id1=(Token)match(input,LOWID,FOLLOW_LOWID_in_definition1030); if (state.failed) return content;

                    match(input,29,FOLLOW_29_in_definition1032); if (state.failed) return content;

                    id2=(Token)match(input,LOWID,FOLLOW_LOWID_in_definition1036); if (state.failed) return content;

                    match(input,29,FOLLOW_29_in_definition1038); if (state.failed) return content;

                    pushFollow(FOLLOW_matrix_in_definition1042);
                    mat=matrix();

                    state._fsp--;
                    if (state.failed) return content;

                    match(input,25,FOLLOW_25_in_definition1044); if (state.failed) return content;

                    }


                    if ( state.backtracking==0 ) { content ="matrix('"+(id1!=null?id1.getText():null)+"','"+(id2!=null?id2.getText():null)+"',"+(mat!=null?input.toString(mat.start,mat.stop):null)+")"; }

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:285:6: ( 'morphism' '(' id1= LOWID ',' id2= LOWID ',' id3= LOWID ')' )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:285:6: ( 'morphism' '(' id1= LOWID ',' id2= LOWID ',' id3= LOWID ')' )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:285:8: 'morphism' '(' id1= LOWID ',' id2= LOWID ',' id3= LOWID ')'
                    {
                    match(input,53,FOLLOW_53_in_definition1057); if (state.failed) return content;

                    match(input,24,FOLLOW_24_in_definition1059); if (state.failed) return content;

                    id1=(Token)match(input,LOWID,FOLLOW_LOWID_in_definition1063); if (state.failed) return content;

                    match(input,29,FOLLOW_29_in_definition1065); if (state.failed) return content;

                    id2=(Token)match(input,LOWID,FOLLOW_LOWID_in_definition1069); if (state.failed) return content;

                    match(input,29,FOLLOW_29_in_definition1071); if (state.failed) return content;

                    id3=(Token)match(input,LOWID,FOLLOW_LOWID_in_definition1075); if (state.failed) return content;

                    match(input,25,FOLLOW_25_in_definition1077); if (state.failed) return content;

                    }


                    if ( state.backtracking==0 ) { content ="morphism('"+(id1!=null?id1.getText():null)+"','"+(id2!=null?id2.getText():null)+"','"+(id3!=null?id3.getText():null)+"')"; }

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return content;
    }
    // $ANTLR end "definition"


    public static class matrix_return extends ParserRuleReturnScope {
    };


    // $ANTLR start "matrix"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:288:1: matrix : '[' INT ( ',' INT )* ']' ;
    public final logolParser.matrix_return matrix() throws RecognitionException {
        logolParser.matrix_return retval = new logolParser.matrix_return();
        retval.start = input.LT(1);


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:288:8: ( '[' INT ( ',' INT )* ']' )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:288:10: '[' INT ( ',' INT )* ']'
            {
            match(input,45,FOLLOW_45_in_matrix1090); if (state.failed) return retval;

            match(input,INT,FOLLOW_INT_in_matrix1092); if (state.failed) return retval;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:288:18: ( ',' INT )*
            loop33:
            do {
                int alt33=2;
                int LA33_0 = input.LA(1);

                if ( (LA33_0==29) ) {
                    alt33=1;
                }


                switch (alt33) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:288:19: ',' INT
            	    {
            	    match(input,29,FOLLOW_29_in_matrix1095); if (state.failed) return retval;

            	    match(input,INT,FOLLOW_INT_in_matrix1097); if (state.failed) return retval;

            	    }
            	    break;

            	default :
            	    break loop33;
                }
            } while (true);


            match(input,46,FOLLOW_46_in_matrix1101); if (state.failed) return retval;

            }

            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "matrix"



    // $ANTLR start "constrainedEntity"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:290:1: constrainedEntity[int parentId, int tmpIsAny, String tmpIsAnyMin,String tmpIsAnyMax,boolean tmpSaveAny] returns [String predicate] : lentity= entity[parentId] ( ':' '{' stg= stringConstraints '}' )? ( ':' '{' stc= structConstraints '}' )? ;
    public final String constrainedEntity(int parentId, int tmpIsAny, String tmpIsAnyMin, String tmpIsAnyMax, boolean tmpSaveAny) throws RecognitionException {
        String predicate = null;


        logolParser.entity_return lentity =null;

        logolParser.stringConstraints_return stg =null;

        logolParser.structConstraints_return stc =null;


         LogolVariable lvar=null; String pretreatment="";
        		int curCount = (Integer) Treatment.counters.get(parentId);
        		Treatment.isAny = tmpIsAny;
        		Treatment.isAnyMin = tmpIsAnyMin;
        		Treatment.isAnyMax = tmpIsAnyMax;
        		Treatment.saveAny = tmpSaveAny;
        		// If it is not preanalysis step
        		if(Treatment.getParseStep()!=2) {
        		// FIX remove parentId test for internal predicates
        		//if(parentId==0) {
        			 if(curCount>0 & !newModel) {
        			 	/*
        			 	* set Constants.LOGOLVAR_Before_i to value Constants.LOGOLVAR_After_(i-1), e.g. preceding remaining list
        			 	*/				 		
        			 	pretreatment = "("+Constants.LOGOLVARBEFORE+Integer.toString(curCount)+"="+Constants.LOGOLVARAFTER+Integer.toString(curCount-1)+",";

        			 	}
        			 else { 
        			 	
        			 	if(newModel) newModel=false;
        			 	// Save length of whole sequence
        				// pretreatment = "sequenceData(_,SEQUENCELength),";
        			 	/*
        			 	* set Constants.LOGOLVAR_Before_i to value whole sequence
        			 	*/					 			 
        				 pretreatment += "("+Constants.LOGOLVARBEFORE+Integer.toString(curCount)+"= Input,";

        			 }
        		//	 }
        		//else { pretreatment ="("; }
        		
        		}
        		else { pretreatment ="("; }
        		
        		
        	
        	
        	 
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:344:2: (lentity= entity[parentId] ( ':' '{' stg= stringConstraints '}' )? ( ':' '{' stc= structConstraints '}' )? )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:344:4: lentity= entity[parentId] ( ':' '{' stg= stringConstraints '}' )? ( ':' '{' stc= structConstraints '}' )?
            {
            pushFollow(FOLLOW_entity_in_constrainedEntity1135);
            lentity=entity(parentId);

            state._fsp--;
            if (state.failed) return predicate;

            if ( state.backtracking==0 ) { lvar = (lentity!=null?lentity.lvar:null); lvar.text = (lentity!=null?input.toString(lentity.start,lentity.stop):null); }

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:344:82: ( ':' '{' stg= stringConstraints '}' )?
            int alt34=2;
            alt34 = dfa34.predict(input);
            switch (alt34) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:344:83: ':' '{' stg= stringConstraints '}'
                    {
                    match(input,37,FOLLOW_37_in_constrainedEntity1141); if (state.failed) return predicate;

                    match(input,57,FOLLOW_57_in_constrainedEntity1143); if (state.failed) return predicate;

                    pushFollow(FOLLOW_stringConstraints_in_constrainedEntity1147);
                    stg=stringConstraints();

                    state._fsp--;
                    if (state.failed) return predicate;

                    if ( state.backtracking==0 ) {if((stg!=null?input.toString(stg.start,stg.stop):null)!=null) lvar.stringConstraints=(stg!=null?stg.scout:null); lvar.text += ":{"+(stg!=null?input.toString(stg.start,stg.stop):null)+"}"; }

                    match(input,59,FOLLOW_59_in_constrainedEntity1151); if (state.failed) return predicate;

                    }
                    break;

            }


            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:344:211: ( ':' '{' stc= structConstraints '}' )?
            int alt35=2;
            int LA35_0 = input.LA(1);

            if ( (LA35_0==37) ) {
                alt35=1;
            }
            switch (alt35) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:344:212: ':' '{' stc= structConstraints '}'
                    {
                    match(input,37,FOLLOW_37_in_constrainedEntity1157); if (state.failed) return predicate;

                    match(input,57,FOLLOW_57_in_constrainedEntity1159); if (state.failed) return predicate;

                    pushFollow(FOLLOW_structConstraints_in_constrainedEntity1163);
                    stc=structConstraints();

                    state._fsp--;
                    if (state.failed) return predicate;

                    if ( state.backtracking==0 ) { lvar.structConstraints=(stc!=null?stc.scout:null); lvar.text += ":{"+(stc!=null?input.toString(stc.start,stc.stop):null)+"}";}

                    match(input,59,FOLLOW_59_in_constrainedEntity1167); if (state.failed) return predicate;

                    }
                    break;

            }


            }

            if ( state.backtracking==0 ) { 
            			 /*
            			 * Get treatment to apply to this variable
            			 */
            			 
            			 lvar.parentId=Integer.toString(parentId);
            			 String treatment= new Treatment().get(lvar,curCount);
            			 String posttreatment = ")";
            			predicate = pretreatment+"\n"+treatment+"\n"+posttreatment+"\n";
            			 
            			   
            		
            			   
            			 
            	}
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return predicate;
    }
    // $ANTLR end "constrainedEntity"


    public static class entity_return extends ParserRuleReturnScope {
        public LogolVariable lvar;
    };


    // $ANTLR start "entity"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:350:1: entity[int parentId] returns [ LogolVariable lvar] : ( (neg= '!' )? entityVariable |curmod= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' | (neg= '!' )? modifier complexstring | complexstring | '!' complexstring | repeat[count] | '!external' '(' progname= LOWID ( ',' '[' (in+= VARIABLE |in+= INT ) ( ',' (in+= VARIABLE |in+= INT ) )* ']' ( ',' '[' (out+= VARIABLE |out+= INT ) ( ',' (out+= VARIABLE |out+= INT ) )* ']' )? )? ')' | (neg= '!' )? '(' viewcontent= view[count] ')' );
    public final logolParser.entity_return entity(int parentId) throws RecognitionException {
        logolParser.entity_return retval = new logolParser.entity_return();
        retval.start = input.LT(1);


        Token neg=null;
        Token curmod=null;
        Token progname=null;
        Token vars=null;
        Token in=null;
        Token out=null;
        List list_vars=null;
        List list_in=null;
        List list_out=null;
        logolParser.view_return viewcontent =null;

        LogolVariable entityVariable4 =null;

        Modifier modifier5 =null;

        logolParser.complexstring_return complexstring6 =null;

        logolParser.complexstring_return complexstring7 =null;

        logolParser.complexstring_return complexstring8 =null;

        LogolVariable repeat9 =null;


         
        		Model mod = new Model();
        		int count=(Integer) Treatment.counters.get(parentId);
        		
        		LogolVariable tmpvar = new LogolVariable();
        		
        		// Add variable to the list of variables
        		LogolVariable.variables.add(count);
        	
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:360:2: ( (neg= '!' )? entityVariable |curmod= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')' | (neg= '!' )? modifier complexstring | complexstring | '!' complexstring | repeat[count] | '!external' '(' progname= LOWID ( ',' '[' (in+= VARIABLE |in+= INT ) ( ',' (in+= VARIABLE |in+= INT ) )* ']' ( ',' '[' (out+= VARIABLE |out+= INT ) ( ',' (out+= VARIABLE |out+= INT ) )* ']' )? )? ')' | (neg= '!' )? '(' viewcontent= view[count] ')' )
            int alt49=8;
            switch ( input.LA(1) ) {
            case 17:
                {
                switch ( input.LA(2) ) {
                case 28:
                case 30:
                    {
                    int LA49_2 = input.LA(3);

                    if ( (LA49_2==19) ) {
                        int LA49_11 = input.LA(4);

                        if ( (LA49_11==LOWID) ) {
                            int LA49_13 = input.LA(5);

                            if ( (LA49_13==19) ) {
                                int LA49_15 = input.LA(6);

                                if ( (LA49_15==VARIABLE||LA49_15==32||LA49_15==41) ) {
                                    alt49=1;
                                }
                                else if ( (LA49_15==19) ) {
                                    alt49=3;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 49, 15, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 49, 13, input);

                                throw nvae;

                            }
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 49, 11, input);

                            throw nvae;

                        }
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 49, 2, input);

                        throw nvae;

                    }
                    }
                    break;
                case 22:
                    {
                    int LA49_3 = input.LA(3);

                    if ( (LA49_3==19) ) {
                        int LA49_12 = input.LA(4);

                        if ( (LA49_12==LOWID) ) {
                            int LA49_14 = input.LA(5);

                            if ( (LA49_14==19) ) {
                                int LA49_16 = input.LA(6);

                                if ( (LA49_16==VARIABLE||LA49_16==32||LA49_16==41) ) {
                                    alt49=1;
                                }
                                else if ( (LA49_16==19) ) {
                                    alt49=3;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 49, 16, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 49, 14, input);

                                throw nvae;

                            }
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 49, 12, input);

                            throw nvae;

                        }
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 49, 3, input);

                        throw nvae;

                    }
                    }
                    break;
                case VARIABLE:
                case 32:
                case 41:
                    {
                    alt49=1;
                    }
                    break;
                case 19:
                    {
                    alt49=5;
                    }
                    break;
                case 24:
                    {
                    alt49=8;
                    }
                    break;
                default:
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 49, 1, input);

                    throw nvae;

                }

                }
                break;
            case 28:
            case 30:
                {
                int LA49_2 = input.LA(2);

                if ( (LA49_2==19) ) {
                    int LA49_11 = input.LA(3);

                    if ( (LA49_11==LOWID) ) {
                        int LA49_13 = input.LA(4);

                        if ( (LA49_13==19) ) {
                            int LA49_15 = input.LA(5);

                            if ( (LA49_15==VARIABLE||LA49_15==32||LA49_15==41) ) {
                                alt49=1;
                            }
                            else if ( (LA49_15==19) ) {
                                alt49=3;
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 49, 15, input);

                                throw nvae;

                            }
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 49, 13, input);

                            throw nvae;

                        }
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 49, 11, input);

                        throw nvae;

                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 49, 2, input);

                    throw nvae;

                }
                }
                break;
            case 22:
                {
                int LA49_3 = input.LA(2);

                if ( (LA49_3==19) ) {
                    int LA49_12 = input.LA(3);

                    if ( (LA49_12==LOWID) ) {
                        int LA49_14 = input.LA(4);

                        if ( (LA49_14==19) ) {
                            int LA49_16 = input.LA(5);

                            if ( (LA49_16==VARIABLE||LA49_16==32||LA49_16==41) ) {
                                alt49=1;
                            }
                            else if ( (LA49_16==19) ) {
                                alt49=3;
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 49, 16, input);

                                throw nvae;

                            }
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 49, 14, input);

                            throw nvae;

                        }
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 49, 12, input);

                        throw nvae;

                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 49, 3, input);

                    throw nvae;

                }
                }
                break;
            case VARIABLE:
            case 32:
            case 41:
                {
                alt49=1;
                }
                break;
            case ModelName:
                {
                alt49=2;
                }
                break;
            case 19:
                {
                alt49=4;
                }
                break;
            case 56:
                {
                alt49=6;
                }
                break;
            case 18:
                {
                alt49=7;
                }
                break;
            case 24:
                {
                alt49=8;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 49, 0, input);

                throw nvae;

            }

            switch (alt49) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:360:4: (neg= '!' )? entityVariable
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:360:7: (neg= '!' )?
                    int alt36=2;
                    int LA36_0 = input.LA(1);

                    if ( (LA36_0==17) ) {
                        alt36=1;
                    }
                    switch (alt36) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:360:7: neg= '!'
                            {
                            neg=(Token)match(input,17,FOLLOW_17_in_entity1202); if (state.failed) return retval;

                            }
                            break;

                    }


                    if ( state.backtracking==0 ) { if(neg!=null) { tmpvar.neg =true;} }

                    pushFollow(FOLLOW_entityVariable_in_entity1207);
                    entityVariable4=entityVariable();

                    state._fsp--;
                    if (state.failed) return retval;

                    if ( state.backtracking==0 ) { retval.lvar =entityVariable4; retval.lvar.neg = tmpvar.neg; }

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:361:5: curmod= ModelName '(' (vars+= VARIABLE )? ( ',' vars+= VARIABLE )* ')'
                    {
                    curmod=(Token)match(input,ModelName,FOLLOW_ModelName_in_entity1218); if (state.failed) return retval;

                    if ( state.backtracking==0 ) { mod.name=(curmod!=null?curmod.getText():null); mod.name=mod.name.replaceAll("%\\w+%", "");  }

                    match(input,24,FOLLOW_24_in_entity1222); if (state.failed) return retval;

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:361:104: (vars+= VARIABLE )?
                    int alt37=2;
                    int LA37_0 = input.LA(1);

                    if ( (LA37_0==VARIABLE) ) {
                        alt37=1;
                    }
                    switch (alt37) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:361:104: vars+= VARIABLE
                            {
                            vars=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_entity1226); if (state.failed) return retval;
                            if (list_vars==null) list_vars=new ArrayList();
                            list_vars.add(vars);


                            }
                            break;

                    }


                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:361:117: ( ',' vars+= VARIABLE )*
                    loop38:
                    do {
                        int alt38=2;
                        int LA38_0 = input.LA(1);

                        if ( (LA38_0==29) ) {
                            alt38=1;
                        }


                        switch (alt38) {
                    	case 1 :
                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:361:118: ',' vars+= VARIABLE
                    	    {
                    	    match(input,29,FOLLOW_29_in_entity1231); if (state.failed) return retval;

                    	    vars=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_entity1235); if (state.failed) return retval;
                    	    if (list_vars==null) list_vars=new ArrayList();
                    	    list_vars.add(vars);


                    	    }
                    	    break;

                    	default :
                    	    break loop38;
                        }
                    } while (true);


                    match(input,25,FOLLOW_25_in_entity1240); if (state.failed) return retval;

                    if ( state.backtracking==0 ) { if(list_vars!=null) {	for(int i=0;i<list_vars.size();i++) {org.antlr.runtime.CommonToken token = (org.antlr.runtime.CommonToken) list_vars.get(i);mod.vars.add(token.getText().replaceAll("%\\w+%", ""));}}  tmpvar.type=3; tmpvar.mod=mod; retval.lvar =tmpvar;}

                    }
                    break;
                case 3 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:362:5: (neg= '!' )? modifier complexstring
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:362:8: (neg= '!' )?
                    int alt39=2;
                    int LA39_0 = input.LA(1);

                    if ( (LA39_0==17) ) {
                        alt39=1;
                    }
                    switch (alt39) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:362:8: neg= '!'
                            {
                            neg=(Token)match(input,17,FOLLOW_17_in_entity1250); if (state.failed) return retval;

                            }
                            break;

                    }


                    if ( state.backtracking==0 ) { if(neg!=null) { tmpvar.neg =true;} }

                    pushFollow(FOLLOW_modifier_in_entity1255);
                    modifier5=modifier();

                    state._fsp--;
                    if (state.failed) return retval;

                    pushFollow(FOLLOW_complexstring_in_entity1257);
                    complexstring6=complexstring();

                    state._fsp--;
                    if (state.failed) return retval;

                    if ( state.backtracking==0 ) { tmpvar.modifier=modifier5; tmpvar.fixedValue=(complexstring6!=null?input.toString(complexstring6.start,complexstring6.stop):null); retval.lvar =tmpvar;}

                    }
                    break;
                case 4 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:364:5: complexstring
                    {
                    pushFollow(FOLLOW_complexstring_in_entity1265);
                    complexstring7=complexstring();

                    state._fsp--;
                    if (state.failed) return retval;

                    if ( state.backtracking==0 ) { tmpvar.fixedValue=(complexstring7!=null?input.toString(complexstring7.start,complexstring7.stop):null); retval.lvar =tmpvar;}

                    }
                    break;
                case 5 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:365:5: '!' complexstring
                    {
                    match(input,17,FOLLOW_17_in_entity1273); if (state.failed) return retval;

                    pushFollow(FOLLOW_complexstring_in_entity1275);
                    complexstring8=complexstring();

                    state._fsp--;
                    if (state.failed) return retval;

                    if ( state.backtracking==0 ) { tmpvar.fixedValue=(complexstring8!=null?input.toString(complexstring8.start,complexstring8.stop):null); tmpvar.neg=true;retval.lvar =tmpvar;}

                    }
                    break;
                case 6 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:366:5: repeat[count]
                    {
                    pushFollow(FOLLOW_repeat_in_entity1284);
                    repeat9=repeat(count);

                    state._fsp--;
                    if (state.failed) return retval;

                    if ( state.backtracking==0 ) { retval.lvar =repeat9; }

                    }
                    break;
                case 7 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:5: '!external' '(' progname= LOWID ( ',' '[' (in+= VARIABLE |in+= INT ) ( ',' (in+= VARIABLE |in+= INT ) )* ']' ( ',' '[' (out+= VARIABLE |out+= INT ) ( ',' (out+= VARIABLE |out+= INT ) )* ']' )? )? ')'
                    {
                    match(input,18,FOLLOW_18_in_entity1295); if (state.failed) return retval;

                    match(input,24,FOLLOW_24_in_entity1297); if (state.failed) return retval;

                    progname=(Token)match(input,LOWID,FOLLOW_LOWID_in_entity1301); if (state.failed) return retval;

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:36: ( ',' '[' (in+= VARIABLE |in+= INT ) ( ',' (in+= VARIABLE |in+= INT ) )* ']' ( ',' '[' (out+= VARIABLE |out+= INT ) ( ',' (out+= VARIABLE |out+= INT ) )* ']' )? )?
                    int alt47=2;
                    int LA47_0 = input.LA(1);

                    if ( (LA47_0==29) ) {
                        alt47=1;
                    }
                    switch (alt47) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:37: ',' '[' (in+= VARIABLE |in+= INT ) ( ',' (in+= VARIABLE |in+= INT ) )* ']' ( ',' '[' (out+= VARIABLE |out+= INT ) ( ',' (out+= VARIABLE |out+= INT ) )* ']' )?
                            {
                            match(input,29,FOLLOW_29_in_entity1304); if (state.failed) return retval;

                            match(input,45,FOLLOW_45_in_entity1306); if (state.failed) return retval;

                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:45: (in+= VARIABLE |in+= INT )
                            int alt40=2;
                            int LA40_0 = input.LA(1);

                            if ( (LA40_0==VARIABLE) ) {
                                alt40=1;
                            }
                            else if ( (LA40_0==INT) ) {
                                alt40=2;
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 40, 0, input);

                                throw nvae;

                            }
                            switch (alt40) {
                                case 1 :
                                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:46: in+= VARIABLE
                                    {
                                    in=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_entity1311); if (state.failed) return retval;
                                    if (list_in==null) list_in=new ArrayList();
                                    list_in.add(in);


                                    }
                                    break;
                                case 2 :
                                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:59: in+= INT
                                    {
                                    in=(Token)match(input,INT,FOLLOW_INT_in_entity1315); if (state.failed) return retval;
                                    if (list_in==null) list_in=new ArrayList();
                                    list_in.add(in);


                                    }
                                    break;

                            }


                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:68: ( ',' (in+= VARIABLE |in+= INT ) )*
                            loop42:
                            do {
                                int alt42=2;
                                int LA42_0 = input.LA(1);

                                if ( (LA42_0==29) ) {
                                    alt42=1;
                                }


                                switch (alt42) {
                            	case 1 :
                            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:69: ',' (in+= VARIABLE |in+= INT )
                            	    {
                            	    match(input,29,FOLLOW_29_in_entity1319); if (state.failed) return retval;

                            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:75: (in+= VARIABLE |in+= INT )
                            	    int alt41=2;
                            	    int LA41_0 = input.LA(1);

                            	    if ( (LA41_0==VARIABLE) ) {
                            	        alt41=1;
                            	    }
                            	    else if ( (LA41_0==INT) ) {
                            	        alt41=2;
                            	    }
                            	    else {
                            	        if (state.backtracking>0) {state.failed=true; return retval;}
                            	        NoViableAltException nvae =
                            	            new NoViableAltException("", 41, 0, input);

                            	        throw nvae;

                            	    }
                            	    switch (alt41) {
                            	        case 1 :
                            	            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:76: in+= VARIABLE
                            	            {
                            	            in=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_entity1326); if (state.failed) return retval;
                            	            if (list_in==null) list_in=new ArrayList();
                            	            list_in.add(in);


                            	            }
                            	            break;
                            	        case 2 :
                            	            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:89: in+= INT
                            	            {
                            	            in=(Token)match(input,INT,FOLLOW_INT_in_entity1330); if (state.failed) return retval;
                            	            if (list_in==null) list_in=new ArrayList();
                            	            list_in.add(in);


                            	            }
                            	            break;

                            	    }


                            	    }
                            	    break;

                            	default :
                            	    break loop42;
                                }
                            } while (true);


                            match(input,46,FOLLOW_46_in_entity1335); if (state.failed) return retval;

                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:104: ( ',' '[' (out+= VARIABLE |out+= INT ) ( ',' (out+= VARIABLE |out+= INT ) )* ']' )?
                            int alt46=2;
                            int LA46_0 = input.LA(1);

                            if ( (LA46_0==29) ) {
                                alt46=1;
                            }
                            switch (alt46) {
                                case 1 :
                                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:105: ',' '[' (out+= VARIABLE |out+= INT ) ( ',' (out+= VARIABLE |out+= INT ) )* ']'
                                    {
                                    match(input,29,FOLLOW_29_in_entity1338); if (state.failed) return retval;

                                    match(input,45,FOLLOW_45_in_entity1340); if (state.failed) return retval;

                                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:114: (out+= VARIABLE |out+= INT )
                                    int alt43=2;
                                    int LA43_0 = input.LA(1);

                                    if ( (LA43_0==VARIABLE) ) {
                                        alt43=1;
                                    }
                                    else if ( (LA43_0==INT) ) {
                                        alt43=2;
                                    }
                                    else {
                                        if (state.backtracking>0) {state.failed=true; return retval;}
                                        NoViableAltException nvae =
                                            new NoViableAltException("", 43, 0, input);

                                        throw nvae;

                                    }
                                    switch (alt43) {
                                        case 1 :
                                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:115: out+= VARIABLE
                                            {
                                            out=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_entity1346); if (state.failed) return retval;
                                            if (list_out==null) list_out=new ArrayList();
                                            list_out.add(out);


                                            }
                                            break;
                                        case 2 :
                                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:129: out+= INT
                                            {
                                            out=(Token)match(input,INT,FOLLOW_INT_in_entity1350); if (state.failed) return retval;
                                            if (list_out==null) list_out=new ArrayList();
                                            list_out.add(out);


                                            }
                                            break;

                                    }


                                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:139: ( ',' (out+= VARIABLE |out+= INT ) )*
                                    loop45:
                                    do {
                                        int alt45=2;
                                        int LA45_0 = input.LA(1);

                                        if ( (LA45_0==29) ) {
                                            alt45=1;
                                        }


                                        switch (alt45) {
                                    	case 1 :
                                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:140: ',' (out+= VARIABLE |out+= INT )
                                    	    {
                                    	    match(input,29,FOLLOW_29_in_entity1354); if (state.failed) return retval;

                                    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:143: (out+= VARIABLE |out+= INT )
                                    	    int alt44=2;
                                    	    int LA44_0 = input.LA(1);

                                    	    if ( (LA44_0==VARIABLE) ) {
                                    	        alt44=1;
                                    	    }
                                    	    else if ( (LA44_0==INT) ) {
                                    	        alt44=2;
                                    	    }
                                    	    else {
                                    	        if (state.backtracking>0) {state.failed=true; return retval;}
                                    	        NoViableAltException nvae =
                                    	            new NoViableAltException("", 44, 0, input);

                                    	        throw nvae;

                                    	    }
                                    	    switch (alt44) {
                                    	        case 1 :
                                    	            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:144: out+= VARIABLE
                                    	            {
                                    	            out=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_entity1358); if (state.failed) return retval;
                                    	            if (list_out==null) list_out=new ArrayList();
                                    	            list_out.add(out);


                                    	            }
                                    	            break;
                                    	        case 2 :
                                    	            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:368:158: out+= INT
                                    	            {
                                    	            out=(Token)match(input,INT,FOLLOW_INT_in_entity1362); if (state.failed) return retval;
                                    	            if (list_out==null) list_out=new ArrayList();
                                    	            list_out.add(out);


                                    	            }
                                    	            break;

                                    	    }


                                    	    }
                                    	    break;

                                    	default :
                                    	    break loop45;
                                        }
                                    } while (true);


                                    match(input,46,FOLLOW_46_in_entity1367); if (state.failed) return retval;

                                    }
                                    break;

                            }


                            }
                            break;

                    }


                    match(input,25,FOLLOW_25_in_entity1373); if (state.failed) return retval;

                    if ( state.backtracking==0 ) { tmpvar.name="external"; tmpvar.extra=(progname!=null?progname.getText():null); if(list_in!=null) for(int i=0;i<list_in.size();i++) { tmpvar.externalIn.add(((org.antlr.runtime.CommonToken)list_in.get(i)).getText()); } if(list_out!=null) for(int i=0;i<list_out.size();i++) { tmpvar.externalOut.add(((org.antlr.runtime.CommonToken)list_out.get(i)).getText()); }  retval.lvar =tmpvar;}

                    }
                    break;
                case 8 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:369:5: (neg= '!' )? '(' viewcontent= view[count] ')'
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:369:8: (neg= '!' )?
                    int alt48=2;
                    int LA48_0 = input.LA(1);

                    if ( (LA48_0==17) ) {
                        alt48=1;
                    }
                    switch (alt48) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:369:8: neg= '!'
                            {
                            neg=(Token)match(input,17,FOLLOW_17_in_entity1383); if (state.failed) return retval;

                            }
                            break;

                    }


                    if ( state.backtracking==0 ) { if(neg!=null) { tmpvar.neg =true;} }

                    match(input,24,FOLLOW_24_in_entity1387); if (state.failed) return retval;

                    pushFollow(FOLLOW_view_in_entity1391);
                    viewcontent=view(count);

                    state._fsp--;
                    if (state.failed) return retval;

                    if ( state.backtracking==0 ) { tmpvar.fixedValue=(viewcontent!=null?viewcontent.value:null); tmpvar.type=2; retval.lvar =tmpvar; }

                    match(input,25,FOLLOW_25_in_entity1396); if (state.failed) return retval;

                    }
                    break;

            }
            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "entity"



    // $ANTLR start "entityVariable"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:372:1: entityVariable returns [LogolVariable varEntity] : entityvar= stringVariableElement ;
    public final LogolVariable entityVariable() throws RecognitionException {
        LogolVariable varEntity = null;


        LogolVariable entityvar =null;


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:373:2: (entityvar= stringVariableElement )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:373:4: entityvar= stringVariableElement
            {
            pushFollow(FOLLOW_stringVariableElement_in_entityVariable1415);
            entityvar=stringVariableElement();

            state._fsp--;
            if (state.failed) return varEntity;

            if ( state.backtracking==0 ) { LogolVariable var = entityvar; varEntity =var; }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return varEntity;
    }
    // $ANTLR end "entityVariable"



    // $ANTLR start "stringVariableElement"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:377:1: stringVariableElement returns [LogolVariable lvar] : (modifierData= modifier )? variable= stringVariable ;
    public final LogolVariable stringVariableElement() throws RecognitionException {
        LogolVariable lvar = null;


        Modifier modifierData =null;

        LogolVariable variable =null;


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:378:2: ( (modifierData= modifier )? variable= stringVariable )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:378:4: (modifierData= modifier )? variable= stringVariable
            {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:378:16: (modifierData= modifier )?
            int alt50=2;
            int LA50_0 = input.LA(1);

            if ( (LA50_0==22||LA50_0==28||LA50_0==30) ) {
                alt50=1;
            }
            switch (alt50) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:378:16: modifierData= modifier
                    {
                    pushFollow(FOLLOW_modifier_in_stringVariableElement1437);
                    modifierData=modifier();

                    state._fsp--;
                    if (state.failed) return lvar;

                    }
                    break;

            }


            pushFollow(FOLLOW_stringVariable_in_stringVariableElement1442);
            variable=stringVariable();

            state._fsp--;
            if (state.failed) return lvar;

            if ( state.backtracking==0 ) { lvar = variable; if(modifierData!=null) lvar.modifier=modifierData; }

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return lvar;
    }
    // $ANTLR end "stringVariableElement"



    // $ANTLR start "modifier"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:380:1: modifier returns [ Modifier mod] : ( (morph= morphism ) | ( '$' st= string ) );
    public final Modifier modifier() throws RecognitionException {
        Modifier mod = null;


        logolParser.morphism_return morph =null;

        logolParser.string_return st =null;


         Modifier tmpMod = new Modifier(); 
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:382:2: ( (morph= morphism ) | ( '$' st= string ) )
            int alt51=2;
            int LA51_0 = input.LA(1);

            if ( (LA51_0==28||LA51_0==30) ) {
                alt51=1;
            }
            else if ( (LA51_0==22) ) {
                alt51=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return mod;}
                NoViableAltException nvae =
                    new NoViableAltException("", 51, 0, input);

                throw nvae;

            }
            switch (alt51) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:382:6: (morph= morphism )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:382:6: (morph= morphism )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:382:7: morph= morphism
                    {
                    pushFollow(FOLLOW_morphism_in_modifier1469);
                    morph=morphism();

                    state._fsp--;
                    if (state.failed) return mod;

                    if ( state.backtracking==0 ) {tmpMod.type=(morph!=null?morph.op:0);tmpMod.modifierName=(morph!=null?morph.name:null);mod =tmpMod;}

                    }


                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:382:94: ( '$' st= string )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:382:94: ( '$' st= string )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:382:95: '$' st= string
                    {
                    match(input,22,FOLLOW_22_in_modifier1477); if (state.failed) return mod;

                    pushFollow(FOLLOW_string_in_modifier1481);
                    st=string();

                    state._fsp--;
                    if (state.failed) return mod;

                    if ( state.backtracking==0 ) {tmpMod.type=Constants.MODIFIERCOST;tmpMod.modifierName=(st!=null?input.toString(st.start,st.stop):null);mod =tmpMod;  }

                    }


                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return mod;
    }
    // $ANTLR end "modifier"


    public static class stringConstraints_return extends ParserRuleReturnScope {
        public Vector scout;
    };


    // $ANTLR start "stringConstraints"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:384:1: stringConstraints returns [Vector scout] : stc1= stringConstraint ( ',' stc2= stringConstraint )* ;
    public final logolParser.stringConstraints_return stringConstraints() throws RecognitionException {
        logolParser.stringConstraints_return retval = new logolParser.stringConstraints_return();
        retval.start = input.LT(1);


        StringConstraint stc1 =null;

        StringConstraint stc2 =null;


        	retval.scout = new Vector();	
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:386:2: (stc1= stringConstraint ( ',' stc2= stringConstraint )* )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:386:5: stc1= stringConstraint ( ',' stc2= stringConstraint )*
            {
            pushFollow(FOLLOW_stringConstraint_in_stringConstraints1506);
            stc1=stringConstraint();

            state._fsp--;
            if (state.failed) return retval;

            if ( state.backtracking==0 ) { retval.scout.add(stc1); }

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:386:54: ( ',' stc2= stringConstraint )*
            loop52:
            do {
                int alt52=2;
                int LA52_0 = input.LA(1);

                if ( (LA52_0==29) ) {
                    alt52=1;
                }


                switch (alt52) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:386:55: ',' stc2= stringConstraint
            	    {
            	    match(input,29,FOLLOW_29_in_stringConstraints1512); if (state.failed) return retval;

            	    pushFollow(FOLLOW_stringConstraint_in_stringConstraints1516);
            	    stc2=stringConstraint();

            	    state._fsp--;
            	    if (state.failed) return retval;

            	    if ( state.backtracking==0 ) {retval.scout.add(stc2);}

            	    }
            	    break;

            	default :
            	    break loop52;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "stringConstraints"



    // $ANTLR start "stringConstraint"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:388:1: stringConstraint returns [StringConstraint sc] : ( '_' VARIABLE | '?' VARIABLE | '?' string | '@' interval | '@@' interval | '#' (optimal= 'OPT' )? interval | '!' '@' interval | '!' '@@' interval | '!' '#' interval );
    public final StringConstraint stringConstraint() throws RecognitionException {
        StringConstraint sc = null;


        Token optimal=null;
        Token VARIABLE10=null;
        Token VARIABLE11=null;
        logolParser.string_return string12 =null;

        logolParser.interval_return interval13 =null;

        logolParser.interval_return interval14 =null;

        logolParser.interval_return interval15 =null;

        logolParser.interval_return interval16 =null;

        logolParser.interval_return interval17 =null;

        logolParser.interval_return interval18 =null;


         StringConstraint tmpConst = new StringConstraint(); 
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:391:2: ( '_' VARIABLE | '?' VARIABLE | '?' string | '@' interval | '@@' interval | '#' (optimal= 'OPT' )? interval | '!' '@' interval | '!' '@@' interval | '!' '#' interval )
            int alt54=9;
            switch ( input.LA(1) ) {
            case 47:
                {
                alt54=1;
                }
                break;
            case 41:
                {
                int LA54_2 = input.LA(2);

                if ( (LA54_2==VARIABLE) ) {
                    alt54=2;
                }
                else if ( (LA54_2==19) ) {
                    alt54=3;
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return sc;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 54, 2, input);

                    throw nvae;

                }
                }
                break;
            case 42:
                {
                alt54=4;
                }
                break;
            case 43:
                {
                alt54=5;
                }
                break;
            case 20:
                {
                alt54=6;
                }
                break;
            case 17:
                {
                switch ( input.LA(2) ) {
                case 42:
                    {
                    alt54=7;
                    }
                    break;
                case 43:
                    {
                    alt54=8;
                    }
                    break;
                case 20:
                    {
                    alt54=9;
                    }
                    break;
                default:
                    if (state.backtracking>0) {state.failed=true; return sc;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 54, 6, input);

                    throw nvae;

                }

                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return sc;}
                NoViableAltException nvae =
                    new NoViableAltException("", 54, 0, input);

                throw nvae;

            }

            switch (alt54) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:391:4: '_' VARIABLE
                    {
                    match(input,47,FOLLOW_47_in_stringConstraint1548); if (state.failed) return sc;

                    VARIABLE10=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_stringConstraint1550); if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.SAVECONSTRAINT; tmpConst.variableContent=(VARIABLE10!=null?VARIABLE10.getText():null).replaceAll("%\\w+%", "");;}

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:392:5: '?' VARIABLE
                    {
                    match(input,41,FOLLOW_41_in_stringConstraint1559); if (state.failed) return sc;

                    VARIABLE11=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_stringConstraint1561); if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.CONTENTCONSTRAINT; tmpConst.variableContent=(VARIABLE11!=null?VARIABLE11.getText():null).replaceAll("%\\w+%", "");;}

                    }
                    break;
                case 3 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:393:5: '?' string
                    {
                    match(input,41,FOLLOW_41_in_stringConstraint1569); if (state.failed) return sc;

                    pushFollow(FOLLOW_string_in_stringConstraint1571);
                    string12=string();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.CONTENTCONSTRAINT; tmpConst.contentConstraint=(string12!=null?input.toString(string12.start,string12.stop):null);}

                    }
                    break;
                case 4 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:394:5: '@' interval
                    {
                    match(input,42,FOLLOW_42_in_stringConstraint1580); if (state.failed) return sc;

                    pushFollow(FOLLOW_interval_in_stringConstraint1582);
                    interval13=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.BEGINCONSTRAINT; /*tmpConst.contentConstraint=(interval13!=null?input.toString(interval13.start,interval13.stop):null);*/ tmpConst.min=(interval13!=null?interval13.min:null); tmpConst.max=(interval13!=null?interval13.max:null);}

                    }
                    break;
                case 5 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:395:5: '@@' interval
                    {
                    match(input,43,FOLLOW_43_in_stringConstraint1591); if (state.failed) return sc;

                    pushFollow(FOLLOW_interval_in_stringConstraint1593);
                    interval14=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.ENDCONSTRAINT; /*tmpConst.contentConstraint=(interval14!=null?input.toString(interval14.start,interval14.stop):null);*/ tmpConst.min=(interval14!=null?interval14.min:null); tmpConst.max=(interval14!=null?interval14.max:null);}

                    }
                    break;
                case 6 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:396:5: '#' (optimal= 'OPT' )? interval
                    {
                    match(input,20,FOLLOW_20_in_stringConstraint1601); if (state.failed) return sc;

                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:396:16: (optimal= 'OPT' )?
                    int alt53=2;
                    int LA53_0 = input.LA(1);

                    if ( (LA53_0==44) ) {
                        alt53=1;
                    }
                    switch (alt53) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:396:16: optimal= 'OPT'
                            {
                            optimal=(Token)match(input,44,FOLLOW_44_in_stringConstraint1605); if (state.failed) return sc;

                            }
                            break;

                    }


                    pushFollow(FOLLOW_interval_in_stringConstraint1608);
                    interval15=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.LENGTHCONSTRAINT; /*tmpConst.contentConstraint=(interval15!=null?input.toString(interval15.start,interval15.stop):null);*/ tmpConst.min=(interval15!=null?interval15.min:null); tmpConst.max=(interval15!=null?interval15.max:null); if(optimal!=null && (optimal!=null?optimal.getText():null)!=null) { tmpConst.optimal  = Constants.OPTIMAL_CONSTRAINT.OPTIMAL_LENGTH; }}

                    }
                    break;
                case 7 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:397:5: '!' '@' interval
                    {
                    match(input,17,FOLLOW_17_in_stringConstraint1616); if (state.failed) return sc;

                    match(input,42,FOLLOW_42_in_stringConstraint1618); if (state.failed) return sc;

                    pushFollow(FOLLOW_interval_in_stringConstraint1620);
                    interval16=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.BEGINCONSTRAINT; /*tmpConst.contentConstraint=(interval16!=null?input.toString(interval16.start,interval16.stop):null);*/ tmpConst.min=(interval16!=null?interval16.min:null); tmpConst.max=(interval16!=null?interval16.max:null); tmpConst.neg=true;}

                    }
                    break;
                case 8 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:398:5: '!' '@@' interval
                    {
                    match(input,17,FOLLOW_17_in_stringConstraint1629); if (state.failed) return sc;

                    match(input,43,FOLLOW_43_in_stringConstraint1631); if (state.failed) return sc;

                    pushFollow(FOLLOW_interval_in_stringConstraint1633);
                    interval17=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.ENDCONSTRAINT; /*tmpConst.contentConstraint=(interval17!=null?input.toString(interval17.start,interval17.stop):null);*/ tmpConst.min=(interval17!=null?interval17.min:null); tmpConst.max=(interval17!=null?interval17.max:null); tmpConst.neg=true;}

                    }
                    break;
                case 9 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:399:5: '!' '#' interval
                    {
                    match(input,17,FOLLOW_17_in_stringConstraint1641); if (state.failed) return sc;

                    match(input,20,FOLLOW_20_in_stringConstraint1643); if (state.failed) return sc;

                    pushFollow(FOLLOW_interval_in_stringConstraint1645);
                    interval18=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.LENGTHCONSTRAINT; /*tmpConst.contentConstraint=(interval18!=null?input.toString(interval18.start,interval18.stop):null);*/ tmpConst.min=(interval18!=null?interval18.min:null); tmpConst.max=(interval18!=null?interval18.max:null); tmpConst.neg=true;}

                    }
                    break;

            }
            if ( state.backtracking==0 ) {sc =tmpConst;}
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return sc;
    }
    // $ANTLR end "stringConstraint"


    public static class structConstraints_return extends ParserRuleReturnScope {
        public Vector scout;
    };


    // $ANTLR start "structConstraints"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:402:1: structConstraints returns [Vector scout] : stc1= structConstraint ( ',' stc2= structConstraint )* ;
    public final logolParser.structConstraints_return structConstraints() throws RecognitionException {
        logolParser.structConstraints_return retval = new logolParser.structConstraints_return();
        retval.start = input.LT(1);


        StructConstraint stc1 =null;

        StructConstraint stc2 =null;



        					retval.scout = new Vector();
        					
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:404:8: (stc1= structConstraint ( ',' stc2= structConstraint )* )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:404:10: stc1= structConstraint ( ',' stc2= structConstraint )*
            {
            pushFollow(FOLLOW_structConstraint_in_structConstraints1667);
            stc1=structConstraint();

            state._fsp--;
            if (state.failed) return retval;

            if ( state.backtracking==0 ) { retval.scout.add(stc1); }

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:404:59: ( ',' stc2= structConstraint )*
            loop55:
            do {
                int alt55=2;
                int LA55_0 = input.LA(1);

                if ( (LA55_0==29) ) {
                    alt55=1;
                }


                switch (alt55) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:404:60: ',' stc2= structConstraint
            	    {
            	    match(input,29,FOLLOW_29_in_structConstraints1673); if (state.failed) return retval;

            	    pushFollow(FOLLOW_structConstraint_in_structConstraints1677);
            	    stc2=structConstraint();

            	    state._fsp--;
            	    if (state.failed) return retval;

            	    if ( state.backtracking==0 ) {retval.scout.add(stc2);}

            	    }
            	    break;

            	default :
            	    break loop55;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "structConstraints"



    // $ANTLR start "structConstraint"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:408:1: structConstraint returns [StructConstraint sc] : ( '_' VARIABLE | '?' VARIABLE | '?' string | '%' string ':' percentage= INT |cost= ( '$' | 'p$' ) (name= LOWID )? interval |cost= ( '$$' | 'p$$' ) interval | '!' cost= ( '$' | 'p$' ) (name= LOWID )? interval | '!' cost= ( '$$' | 'p$$' ) interval );
    public final StructConstraint structConstraint() throws RecognitionException {
        StructConstraint sc = null;


        Token percentage=null;
        Token cost=null;
        Token name=null;
        Token VARIABLE19=null;
        Token VARIABLE20=null;
        logolParser.string_return string21 =null;

        logolParser.string_return string22 =null;

        logolParser.interval_return interval23 =null;

        logolParser.interval_return interval24 =null;

        logolParser.interval_return interval25 =null;

        logolParser.interval_return interval26 =null;


         StructConstraint tmpConst = new StructConstraint(); 
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:411:2: ( '_' VARIABLE | '?' VARIABLE | '?' string | '%' string ':' percentage= INT |cost= ( '$' | 'p$' ) (name= LOWID )? interval |cost= ( '$$' | 'p$$' ) interval | '!' cost= ( '$' | 'p$' ) (name= LOWID )? interval | '!' cost= ( '$$' | 'p$$' ) interval )
            int alt58=8;
            switch ( input.LA(1) ) {
            case 47:
                {
                alt58=1;
                }
                break;
            case 41:
                {
                int LA58_2 = input.LA(2);

                if ( (LA58_2==VARIABLE) ) {
                    alt58=2;
                }
                else if ( (LA58_2==19) ) {
                    alt58=3;
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return sc;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 58, 2, input);

                    throw nvae;

                }
                }
                break;
            case 23:
                {
                alt58=4;
                }
                break;
            case 22:
            case 55:
                {
                alt58=5;
                }
                break;
            case 21:
            case 54:
                {
                alt58=6;
                }
                break;
            case 17:
                {
                int LA58_6 = input.LA(2);

                if ( (LA58_6==22||LA58_6==55) ) {
                    alt58=7;
                }
                else if ( (LA58_6==21||LA58_6==54) ) {
                    alt58=8;
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return sc;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 58, 6, input);

                    throw nvae;

                }
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return sc;}
                NoViableAltException nvae =
                    new NoViableAltException("", 58, 0, input);

                throw nvae;

            }

            switch (alt58) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:411:4: '_' VARIABLE
                    {
                    match(input,47,FOLLOW_47_in_structConstraint1718); if (state.failed) return sc;

                    VARIABLE19=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_structConstraint1720); if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.SAVECONSTRAINT; tmpConst.variableContent=(VARIABLE19!=null?VARIABLE19.getText():null).replaceAll("%\\w+%", "");}

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:412:5: '?' VARIABLE
                    {
                    match(input,41,FOLLOW_41_in_structConstraint1729); if (state.failed) return sc;

                    VARIABLE20=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_structConstraint1731); if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.CONTENTCONSTRAINT; tmpConst.variableContent=(VARIABLE20!=null?VARIABLE20.getText():null).replaceAll("%\\w+%", "");}

                    }
                    break;
                case 3 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:413:5: '?' string
                    {
                    match(input,41,FOLLOW_41_in_structConstraint1740); if (state.failed) return sc;

                    pushFollow(FOLLOW_string_in_structConstraint1742);
                    string21=string();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.CONTENTCONSTRAINT; tmpConst.contentConstraint=(string21!=null?input.toString(string21.start,string21.stop):null);}

                    }
                    break;
                case 4 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:414:5: '%' string ':' percentage= INT
                    {
                    match(input,23,FOLLOW_23_in_structConstraint1751); if (state.failed) return sc;

                    pushFollow(FOLLOW_string_in_structConstraint1753);
                    string22=string();

                    state._fsp--;
                    if (state.failed) return sc;

                    match(input,37,FOLLOW_37_in_structConstraint1755); if (state.failed) return sc;

                    percentage=(Token)match(input,INT,FOLLOW_INT_in_structConstraint1759); if (state.failed) return sc;

                    if ( state.backtracking==0 ) { tmpConst.type=Constants.ALPHABETCONSTRAINT; tmpConst.alphabetConstraint=(string22!=null?input.toString(string22.start,string22.stop):null); tmpConst.min=(percentage!=null?percentage.getText():null);}

                    }
                    break;
                case 5 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:415:5: cost= ( '$' | 'p$' ) (name= LOWID )? interval
                    {
                    cost=(Token)input.LT(1);

                    if ( input.LA(1)==22||input.LA(1)==55 ) {
                        input.consume();
                        state.errorRecovery=false;
                        state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return sc;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }


                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:415:25: (name= LOWID )?
                    int alt56=2;
                    int LA56_0 = input.LA(1);

                    if ( (LA56_0==LOWID) ) {
                        alt56=1;
                    }
                    switch (alt56) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:415:25: name= LOWID
                            {
                            name=(Token)match(input,LOWID,FOLLOW_LOWID_in_structConstraint1777); if (state.failed) return sc;

                            }
                            break;

                    }


                    pushFollow(FOLLOW_interval_in_structConstraint1780);
                    interval23=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { if(name!=null && (name!=null?name.getText():null)!=null) {tmpConst.name=(name!=null?name.getText():null);} if((cost!=null?cost.getText():null).equals(Constants.COSTSIGN)) {tmpConst.type=Constants.COSTCONSTRAINT;} else {tmpConst.type=Constants.PERCENTCOSTCONSTRAINT;} /*tmpConst.contentConstraint=(interval23!=null?input.toString(interval23.start,interval23.stop):null);*/ tmpConst.min=(interval23!=null?interval23.min:null); tmpConst.max=(interval23!=null?interval23.max:null);}

                    }
                    break;
                case 6 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:416:5: cost= ( '$$' | 'p$$' ) interval
                    {
                    cost=(Token)input.LT(1);

                    if ( input.LA(1)==21||input.LA(1)==54 ) {
                        input.consume();
                        state.errorRecovery=false;
                        state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return sc;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }


                    pushFollow(FOLLOW_interval_in_structConstraint1797);
                    interval24=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) {  if((cost!=null?cost.getText():null).equals(Constants.DISTANCESIGN)) {tmpConst.type=Constants.DISTANCECONSTRAINT;} else {tmpConst.type=Constants.PERCENTDISTANCECONSTRAINT;} /*tmpConst.contentConstraint=(interval24!=null?input.toString(interval24.start,interval24.stop):null);*/ tmpConst.min=(interval24!=null?interval24.min:null); tmpConst.max=(interval24!=null?interval24.max:null);}

                    }
                    break;
                case 7 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:417:5: '!' cost= ( '$' | 'p$' ) (name= LOWID )? interval
                    {
                    match(input,17,FOLLOW_17_in_structConstraint1806); if (state.failed) return sc;

                    cost=(Token)input.LT(1);

                    if ( input.LA(1)==22||input.LA(1)==55 ) {
                        input.consume();
                        state.errorRecovery=false;
                        state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return sc;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }


                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:417:29: (name= LOWID )?
                    int alt57=2;
                    int LA57_0 = input.LA(1);

                    if ( (LA57_0==LOWID) ) {
                        alt57=1;
                    }
                    switch (alt57) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:417:29: name= LOWID
                            {
                            name=(Token)match(input,LOWID,FOLLOW_LOWID_in_structConstraint1818); if (state.failed) return sc;

                            }
                            break;

                    }


                    pushFollow(FOLLOW_interval_in_structConstraint1821);
                    interval25=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { if(name!=null && (name!=null?name.getText():null)!=null) {tmpConst.name=(name!=null?name.getText():null);} if((cost!=null?cost.getText():null).equals(Constants.COSTSIGN)) {tmpConst.type=Constants.COSTCONSTRAINT;} else {tmpConst.type=Constants.PERCENTCOSTCONSTRAINT;} /*tmpConst.contentConstraint=(interval25!=null?input.toString(interval25.start,interval25.stop):null);*/ tmpConst.neg=true; tmpConst.min=(interval25!=null?interval25.min:null); tmpConst.max=(interval25!=null?interval25.max:null);}

                    }
                    break;
                case 8 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:418:5: '!' cost= ( '$$' | 'p$$' ) interval
                    {
                    match(input,17,FOLLOW_17_in_structConstraint1829); if (state.failed) return sc;

                    cost=(Token)input.LT(1);

                    if ( input.LA(1)==21||input.LA(1)==54 ) {
                        input.consume();
                        state.errorRecovery=false;
                        state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return sc;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }


                    pushFollow(FOLLOW_interval_in_structConstraint1839);
                    interval26=interval();

                    state._fsp--;
                    if (state.failed) return sc;

                    if ( state.backtracking==0 ) { if((cost!=null?cost.getText():null).equals(Constants.DISTANCESIGN)) {tmpConst.type=Constants.DISTANCECONSTRAINT;} else {tmpConst.type=Constants.PERCENTDISTANCECONSTRAINT;} /*tmpConst.contentConstraint=(interval26!=null?input.toString(interval26.start,interval26.stop):null);*/ tmpConst.neg=true; tmpConst.min=(interval26!=null?interval26.min:null); tmpConst.max=(interval26!=null?interval26.max:null);}

                    }
                    break;

            }
            if ( state.backtracking==0 ) {sc =tmpConst;}
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return sc;
    }
    // $ANTLR end "structConstraint"



    // $ANTLR start "structureValues"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:421:1: structureValues : structureValue ( ',' structureValue ) ;
    public final void structureValues() throws RecognitionException {
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:422:2: ( structureValue ( ',' structureValue ) )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:422:4: structureValue ( ',' structureValue )
            {
            pushFollow(FOLLOW_structureValue_in_structureValues1851);
            structureValue();

            state._fsp--;
            if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:422:19: ( ',' structureValue )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:422:20: ',' structureValue
            {
            match(input,29,FOLLOW_29_in_structureValues1854); if (state.failed) return ;

            pushFollow(FOLLOW_structureValue_in_structureValues1856);
            structureValue();

            state._fsp--;
            if (state.failed) return ;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "structureValues"



    // $ANTLR start "structureValue"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:424:1: structureValue : ( '?' VARIABLE | '$' intexpression );
    public final void structureValue() throws RecognitionException {
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:425:2: ( '?' VARIABLE | '$' intexpression )
            int alt59=2;
            int LA59_0 = input.LA(1);

            if ( (LA59_0==41) ) {
                alt59=1;
            }
            else if ( (LA59_0==22) ) {
                alt59=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return ;}
                NoViableAltException nvae =
                    new NoViableAltException("", 59, 0, input);

                throw nvae;

            }
            switch (alt59) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:425:4: '?' VARIABLE
                    {
                    match(input,41,FOLLOW_41_in_structureValue1866); if (state.failed) return ;

                    match(input,VARIABLE,FOLLOW_VARIABLE_in_structureValue1868); if (state.failed) return ;

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:425:19: '$' intexpression
                    {
                    match(input,22,FOLLOW_22_in_structureValue1872); if (state.failed) return ;

                    pushFollow(FOLLOW_intexpression_in_structureValue1874);
                    intexpression();

                    state._fsp--;
                    if (state.failed) return ;

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "structureValue"


    public static class morphism_return extends ParserRuleReturnScope {
        public int op;
        public String name;
    };


    // $ANTLR start "morphism"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:427:1: morphism returns [int op, String name] : oper= operator val= string ;
    public final logolParser.morphism_return morphism() throws RecognitionException {
        logolParser.morphism_return retval = new logolParser.morphism_return();
        retval.start = input.LT(1);


        logolParser.operator_return oper =null;

        logolParser.string_return val =null;


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:427:39: (oper= operator val= string )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:427:42: oper= operator val= string
            {
            pushFollow(FOLLOW_operator_in_morphism1889);
            oper=operator();

            state._fsp--;
            if (state.failed) return retval;

            if ( state.backtracking==0 ) { if((oper!=null?input.toString(oper.start,oper.stop):null).equals("+")) {retval.op =Constants.MODIFIERMORPHPLUS;}  else {retval.op =Constants.MODIFIERMORPHMINUS;} }

            pushFollow(FOLLOW_string_in_morphism1895);
            val=string();

            state._fsp--;
            if (state.failed) return retval;

            if ( state.backtracking==0 ) {retval.name =(val!=null?input.toString(val.start,val.stop):null);}

            }

            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "morphism"



    // $ANTLR start "weight"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:429:1: weight : '$' string ;
    public final void weight() throws RecognitionException {
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:429:8: ( '$' string )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:429:10: '$' string
            {
            match(input,22,FOLLOW_22_in_weight1905); if (state.failed) return ;

            pushFollow(FOLLOW_string_in_weight1907);
            string();

            state._fsp--;
            if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "weight"



    // $ANTLR start "stringVariable"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:431:1: stringVariable returns [ LogolVariable lvar] : ( '.*' | ( (parent= '?' )? var= VARIABLE ) );
    public final LogolVariable stringVariable() throws RecognitionException {
        LogolVariable lvar = null;


        Token parent=null;
        Token var=null;

         boolean isParent=true;  
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:433:2: ( '.*' | ( (parent= '?' )? var= VARIABLE ) )
            int alt61=2;
            int LA61_0 = input.LA(1);

            if ( (LA61_0==32) ) {
                alt61=1;
            }
            else if ( (LA61_0==VARIABLE||LA61_0==41) ) {
                alt61=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return lvar;}
                NoViableAltException nvae =
                    new NoViableAltException("", 61, 0, input);

                throw nvae;

            }
            switch (alt61) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:433:4: '.*'
                    {
                    match(input,32,FOLLOW_32_in_stringVariable1926); if (state.failed) return lvar;

                    if ( state.backtracking==0 ) {lvar =new LogolVariable();lvar.name="_";}

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:433:56: ( (parent= '?' )? var= VARIABLE )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:433:56: ( (parent= '?' )? var= VARIABLE )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:433:57: (parent= '?' )? var= VARIABLE
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:433:63: (parent= '?' )?
                    int alt60=2;
                    int LA60_0 = input.LA(1);

                    if ( (LA60_0==41) ) {
                        alt60=1;
                    }
                    switch (alt60) {
                        case 1 :
                            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:433:63: parent= '?'
                            {
                            parent=(Token)match(input,41,FOLLOW_41_in_stringVariable1936); if (state.failed) return lvar;

                            }
                            break;

                    }


                    if ( state.backtracking==0 ) { if(parent!=null) { isParent=false;} }

                    var=(Token)match(input,VARIABLE,FOLLOW_VARIABLE_in_stringVariable1943); if (state.failed) return lvar;

                    if ( state.backtracking==0 ) {lvar =new LogolVariable();lvar.name=(var!=null?var.getText():null).replaceAll("%\\w+%", ""); if(isParent)  {lvar.isParent=true; } else {lvar.isParent=false;}}

                    }


                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return lvar;
    }
    // $ANTLR end "stringVariable"



    // $ANTLR start "repeat"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:439:1: repeat[int parentId] returns [ LogolVariable lvar] : 'repeat(' view[parentId] (type= ( ',' | ';' ) )? (typeinterval= interval )? ')+' (repeatinterval= interval )? ;
    public final LogolVariable repeat(int parentId) throws RecognitionException {
        LogolVariable lvar = null;


        Token type=null;
        logolParser.interval_return typeinterval =null;

        logolParser.interval_return repeatinterval =null;

        logolParser.view_return view27 =null;


         	lvar = new LogolVariable(); 
        			// If isAny set, postpone treatment of spacer because it will be managed in repeatContent, should not be applied on internal variable
        		        int tmpAny = Treatment.isAny;
        		        String tmpAnyMin = Treatment.isAnyMin;
        		        String tmpAnyMax = Treatment.isAnyMax;
        		        boolean tmpSaveAny = Treatment.saveAny;
        		        Treatment.isAny=-1;
        		        Treatment.isAnyMin="";
        		        Treatment.isAnyMax="";
        		        Treatment.saveAny=false;
        	
        	
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:2: ( 'repeat(' view[parentId] (type= ( ',' | ';' ) )? (typeinterval= interval )? ')+' (repeatinterval= interval )? )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:4: 'repeat(' view[parentId] (type= ( ',' | ';' ) )? (typeinterval= interval )? ')+' (repeatinterval= interval )?
            {
            match(input,56,FOLLOW_56_in_repeat1980); if (state.failed) return lvar;

            pushFollow(FOLLOW_view_in_repeat1982);
            view27=view(parentId);

            state._fsp--;
            if (state.failed) return lvar;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:33: (type= ( ',' | ';' ) )?
            int alt62=2;
            int LA62_0 = input.LA(1);

            if ( (LA62_0==29||LA62_0==38) ) {
                alt62=1;
            }
            switch (alt62) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:33: type= ( ',' | ';' )
                    {
                    type=(Token)input.LT(1);

                    if ( input.LA(1)==29||input.LA(1)==38 ) {
                        input.consume();
                        state.errorRecovery=false;
                        state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return lvar;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }


                    }
                    break;

            }


            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:57: (typeinterval= interval )?
            int alt63=2;
            int LA63_0 = input.LA(1);

            if ( (LA63_0==45) ) {
                alt63=1;
            }
            switch (alt63) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:57: typeinterval= interval
                    {
                    pushFollow(FOLLOW_interval_in_repeat1996);
                    typeinterval=interval();

                    state._fsp--;
                    if (state.failed) return lvar;

                    }
                    break;

            }


            if ( state.backtracking==0 ) { lvar.content=(view27!=null?view27.value:null); if(type!=null) { if((type!=null?type.getText():null).equals(",")) {lvar.repeatType=1; } else {lvar.repeatType=2;} lvar.repeatParam=(typeinterval!=null?input.toString(typeinterval.start,typeinterval.stop):null).replaceAll("%\\w+%", ""); }}

            match(input,26,FOLLOW_26_in_repeat2004); if (state.failed) return lvar;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:282: (repeatinterval= interval )?
            int alt64=2;
            alt64 = dfa64.predict(input);
            switch (alt64) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:282: repeatinterval= interval
                    {
                    pushFollow(FOLLOW_interval_in_repeat2008);
                    repeatinterval=interval();

                    state._fsp--;
                    if (state.failed) return lvar;

                    }
                    break;

            }


            if ( state.backtracking==0 ) {if(repeatinterval!=null) {lvar.repeatQuantity=(repeatinterval!=null?input.toString(repeatinterval.start,repeatinterval.stop):null).replaceAll("%\\w+%", "");} }

            }

            if ( state.backtracking==0 ) {	Treatment.isAny = tmpAny;
                   			Treatment.isAnyMin = tmpAnyMin;
            			Treatment.isAnyMax = tmpAnyMax;
            			Treatment.saveAny = tmpSaveAny;
            		}
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return lvar;
    }
    // $ANTLR end "repeat"


    public static class parameters_return extends ParserRuleReturnScope {
        public int type;
        public String intervalParam;
    };


    // $ANTLR start "parameters"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:461:1: parameters returns [ int type, String intervalParam] : (t= '_,' interval |t= '_;' interval );
    public final logolParser.parameters_return parameters() throws RecognitionException {
        logolParser.parameters_return retval = new logolParser.parameters_return();
        retval.start = input.LT(1);


        Token t=null;
        logolParser.interval_return interval28 =null;


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:462:2: (t= '_,' interval |t= '_;' interval )
            int alt65=2;
            int LA65_0 = input.LA(1);

            if ( (LA65_0==48) ) {
                alt65=1;
            }
            else if ( (LA65_0==49) ) {
                alt65=2;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 65, 0, input);

                throw nvae;

            }
            switch (alt65) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:462:4: t= '_,' interval
                    {
                    t=(Token)match(input,48,FOLLOW_48_in_parameters2028); if (state.failed) return retval;

                    pushFollow(FOLLOW_interval_in_parameters2030);
                    interval();

                    state._fsp--;
                    if (state.failed) return retval;

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:462:22: t= '_;' interval
                    {
                    t=(Token)match(input,49,FOLLOW_49_in_parameters2036); if (state.failed) return retval;

                    pushFollow(FOLLOW_interval_in_parameters2038);
                    interval28=interval();

                    state._fsp--;
                    if (state.failed) return retval;

                    if ( state.backtracking==0 ) { if((t!=null?t.getText():null).equals("_,")) { retval.type =1;} else { retval.type =2;} retval.intervalParam =(interval28!=null?input.toString(interval28.start,interval28.stop):null);}

                    }
                    break;

            }
            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "parameters"



    // $ANTLR start "test"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:465:1: test : '%' string ':' percentage= INT ;
    public final void test() throws RecognitionException {
        Token percentage=null;

        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:465:5: ( '%' string ':' percentage= INT )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:465:7: '%' string ':' percentage= INT
            {
            match(input,23,FOLLOW_23_in_test2048); if (state.failed) return ;

            pushFollow(FOLLOW_string_in_test2050);
            string();

            state._fsp--;
            if (state.failed) return ;

            match(input,37,FOLLOW_37_in_test2052); if (state.failed) return ;

            percentage=(Token)match(input,INT,FOLLOW_INT_in_test2056); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "test"


    public static class operator_return extends ParserRuleReturnScope {
    };


    // $ANTLR start "operator"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:468:1: operator : ( '+' | '-' );
    public final logolParser.operator_return operator() throws RecognitionException {
        logolParser.operator_return retval = new logolParser.operator_return();
        retval.start = input.LT(1);


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:468:9: ( '+' | '-' )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:
            {
            if ( input.LA(1)==28||input.LA(1)==30 ) {
                input.consume();
                state.errorRecovery=false;
                state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "operator"


    public static class string_return extends ParserRuleReturnScope {
    };


    // $ANTLR start "string"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:472:1: string : '\"' LOWID '\"' ;
    public final logolParser.string_return string() throws RecognitionException {
        logolParser.string_return retval = new logolParser.string_return();
        retval.start = input.LT(1);


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:472:8: ( '\"' LOWID '\"' )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:472:10: '\"' LOWID '\"'
            {
            match(input,19,FOLLOW_19_in_string2114); if (state.failed) return retval;

            match(input,LOWID,FOLLOW_LOWID_in_string2116); if (state.failed) return retval;

            match(input,19,FOLLOW_19_in_string2118); if (state.failed) return retval;

            }

            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "string"



    // $ANTLR start "orstring"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:474:1: orstring : '[' ( LOWID )+ ( '|' ( LOWID )+ )* ']' ;
    public final void orstring() throws RecognitionException {
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:474:10: ( '[' ( LOWID )+ ( '|' ( LOWID )+ )* ']' )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:474:12: '[' ( LOWID )+ ( '|' ( LOWID )+ )* ']'
            {
            match(input,45,FOLLOW_45_in_orstring2126); if (state.failed) return ;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:474:16: ( LOWID )+
            int cnt66=0;
            loop66:
            do {
                int alt66=2;
                int LA66_0 = input.LA(1);

                if ( (LA66_0==LOWID) ) {
                    alt66=1;
                }


                switch (alt66) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:474:16: LOWID
            	    {
            	    match(input,LOWID,FOLLOW_LOWID_in_orstring2128); if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    if ( cnt66 >= 1 ) break loop66;
            	    if (state.backtracking>0) {state.failed=true; return ;}
                        EarlyExitException eee =
                            new EarlyExitException(66, input);
                        throw eee;
                }
                cnt66++;
            } while (true);


            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:474:23: ( '|' ( LOWID )+ )*
            loop68:
            do {
                int alt68=2;
                int LA68_0 = input.LA(1);

                if ( (LA68_0==58) ) {
                    alt68=1;
                }


                switch (alt68) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:474:24: '|' ( LOWID )+
            	    {
            	    match(input,58,FOLLOW_58_in_orstring2132); if (state.failed) return ;

            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:474:28: ( LOWID )+
            	    int cnt67=0;
            	    loop67:
            	    do {
            	        int alt67=2;
            	        int LA67_0 = input.LA(1);

            	        if ( (LA67_0==LOWID) ) {
            	            alt67=1;
            	        }


            	        switch (alt67) {
            	    	case 1 :
            	    	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:474:28: LOWID
            	    	    {
            	    	    match(input,LOWID,FOLLOW_LOWID_in_orstring2134); if (state.failed) return ;

            	    	    }
            	    	    break;

            	    	default :
            	    	    if ( cnt67 >= 1 ) break loop67;
            	    	    if (state.backtracking>0) {state.failed=true; return ;}
            	                EarlyExitException eee =
            	                    new EarlyExitException(67, input);
            	                throw eee;
            	        }
            	        cnt67++;
            	    } while (true);


            	    }
            	    break;

            	default :
            	    break loop68;
                }
            } while (true);


            match(input,46,FOLLOW_46_in_orstring2140); if (state.failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "orstring"


    public static class complexstring_return extends ParserRuleReturnScope {
    };


    // $ANTLR start "complexstring"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:475:1: complexstring : '\"' ( LOWID | orstring )+ '\"' ;
    public final logolParser.complexstring_return complexstring() throws RecognitionException {
        logolParser.complexstring_return retval = new logolParser.complexstring_return();
        retval.start = input.LT(1);


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:475:15: ( '\"' ( LOWID | orstring )+ '\"' )
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:475:18: '\"' ( LOWID | orstring )+ '\"'
            {
            match(input,19,FOLLOW_19_in_complexstring2148); if (state.failed) return retval;

            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:475:22: ( LOWID | orstring )+
            int cnt69=0;
            loop69:
            do {
                int alt69=3;
                int LA69_0 = input.LA(1);

                if ( (LA69_0==LOWID) ) {
                    alt69=1;
                }
                else if ( (LA69_0==45) ) {
                    alt69=2;
                }


                switch (alt69) {
            	case 1 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:475:23: LOWID
            	    {
            	    match(input,LOWID,FOLLOW_LOWID_in_complexstring2151); if (state.failed) return retval;

            	    }
            	    break;
            	case 2 :
            	    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:475:29: orstring
            	    {
            	    pushFollow(FOLLOW_orstring_in_complexstring2153);
            	    orstring();

            	    state._fsp--;
            	    if (state.failed) return retval;

            	    }
            	    break;

            	default :
            	    if ( cnt69 >= 1 ) break loop69;
            	    if (state.backtracking>0) {state.failed=true; return retval;}
                        EarlyExitException eee =
                            new EarlyExitException(69, input);
                        throw eee;
                }
                cnt69++;
            } while (true);


            match(input,19,FOLLOW_19_in_complexstring2159); if (state.failed) return retval;

            }

            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "complexstring"



    // $ANTLR start "varrefinteger"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:1: varrefinteger : ( VARIABLE | '@' VARIABLE | '@@' VARIABLE | '#' VARIABLE | '$' VARIABLE | '$$' VARIABLE | ( '?' VARIABLE ( '.nboccur' | '.minDistance' | '.maxDistance' ) ) );
    public final void varrefinteger() throws RecognitionException {
        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:14: ( VARIABLE | '@' VARIABLE | '@@' VARIABLE | '#' VARIABLE | '$' VARIABLE | '$$' VARIABLE | ( '?' VARIABLE ( '.nboccur' | '.minDistance' | '.maxDistance' ) ) )
            int alt70=7;
            switch ( input.LA(1) ) {
            case VARIABLE:
                {
                alt70=1;
                }
                break;
            case 42:
                {
                alt70=2;
                }
                break;
            case 43:
                {
                alt70=3;
                }
                break;
            case 20:
                {
                alt70=4;
                }
                break;
            case 22:
                {
                alt70=5;
                }
                break;
            case 21:
                {
                alt70=6;
                }
                break;
            case 41:
                {
                alt70=7;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return ;}
                NoViableAltException nvae =
                    new NoViableAltException("", 70, 0, input);

                throw nvae;

            }

            switch (alt70) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:16: VARIABLE
                    {
                    match(input,VARIABLE,FOLLOW_VARIABLE_in_varrefinteger2321); if (state.failed) return ;

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:27: '@' VARIABLE
                    {
                    match(input,42,FOLLOW_42_in_varrefinteger2325); if (state.failed) return ;

                    match(input,VARIABLE,FOLLOW_VARIABLE_in_varrefinteger2327); if (state.failed) return ;

                    }
                    break;
                case 3 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:42: '@@' VARIABLE
                    {
                    match(input,43,FOLLOW_43_in_varrefinteger2331); if (state.failed) return ;

                    match(input,VARIABLE,FOLLOW_VARIABLE_in_varrefinteger2333); if (state.failed) return ;

                    }
                    break;
                case 4 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:58: '#' VARIABLE
                    {
                    match(input,20,FOLLOW_20_in_varrefinteger2337); if (state.failed) return ;

                    match(input,VARIABLE,FOLLOW_VARIABLE_in_varrefinteger2339); if (state.failed) return ;

                    }
                    break;
                case 5 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:73: '$' VARIABLE
                    {
                    match(input,22,FOLLOW_22_in_varrefinteger2343); if (state.failed) return ;

                    match(input,VARIABLE,FOLLOW_VARIABLE_in_varrefinteger2345); if (state.failed) return ;

                    }
                    break;
                case 6 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:88: '$$' VARIABLE
                    {
                    match(input,21,FOLLOW_21_in_varrefinteger2349); if (state.failed) return ;

                    match(input,VARIABLE,FOLLOW_VARIABLE_in_varrefinteger2351); if (state.failed) return ;

                    }
                    break;
                case 7 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:104: ( '?' VARIABLE ( '.nboccur' | '.minDistance' | '.maxDistance' ) )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:104: ( '?' VARIABLE ( '.nboccur' | '.minDistance' | '.maxDistance' ) )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:489:105: '?' VARIABLE ( '.nboccur' | '.minDistance' | '.maxDistance' )
                    {
                    match(input,41,FOLLOW_41_in_varrefinteger2356); if (state.failed) return ;

                    match(input,VARIABLE,FOLLOW_VARIABLE_in_varrefinteger2358); if (state.failed) return ;

                    if ( (input.LA(1) >= 33 && input.LA(1) <= 35) ) {
                        input.consume();
                        state.errorRecovery=false;
                        state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return ;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }


                    }


                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "varrefinteger"


    public static class intexpression_return extends ParserRuleReturnScope {
    };


    // $ANTLR start "intexpression"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:1: intexpression : ( '_' | INT | varrefinteger | ( varrefinteger operator INT ) | ( INT operator varrefinteger ) );
    public final logolParser.intexpression_return intexpression() throws RecognitionException {
        logolParser.intexpression_return retval = new logolParser.intexpression_return();
        retval.start = input.LT(1);


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:14: ( '_' | INT | varrefinteger | ( varrefinteger operator INT ) | ( INT operator varrefinteger ) )
            int alt71=5;
            switch ( input.LA(1) ) {
            case 47:
                {
                alt71=1;
                }
                break;
            case INT:
                {
                int LA71_2 = input.LA(2);

                if ( (LA71_2==EOF||LA71_2==29||LA71_2==46) ) {
                    alt71=2;
                }
                else if ( (LA71_2==28||LA71_2==30) ) {
                    alt71=5;
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 71, 2, input);

                    throw nvae;

                }
                }
                break;
            case VARIABLE:
                {
                int LA71_3 = input.LA(2);

                if ( (LA71_3==EOF||LA71_3==29||LA71_3==46) ) {
                    alt71=3;
                }
                else if ( (LA71_3==28||LA71_3==30) ) {
                    alt71=4;
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 71, 3, input);

                    throw nvae;

                }
                }
                break;
            case 42:
                {
                int LA71_4 = input.LA(2);

                if ( (LA71_4==VARIABLE) ) {
                    int LA71_14 = input.LA(3);

                    if ( (LA71_14==EOF||LA71_14==29||LA71_14==46) ) {
                        alt71=3;
                    }
                    else if ( (LA71_14==28||LA71_14==30) ) {
                        alt71=4;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 71, 14, input);

                        throw nvae;

                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 71, 4, input);

                    throw nvae;

                }
                }
                break;
            case 43:
                {
                int LA71_5 = input.LA(2);

                if ( (LA71_5==VARIABLE) ) {
                    int LA71_15 = input.LA(3);

                    if ( (LA71_15==EOF||LA71_15==29||LA71_15==46) ) {
                        alt71=3;
                    }
                    else if ( (LA71_15==28||LA71_15==30) ) {
                        alt71=4;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 71, 15, input);

                        throw nvae;

                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 71, 5, input);

                    throw nvae;

                }
                }
                break;
            case 20:
                {
                int LA71_6 = input.LA(2);

                if ( (LA71_6==VARIABLE) ) {
                    int LA71_16 = input.LA(3);

                    if ( (LA71_16==EOF||LA71_16==29||LA71_16==46) ) {
                        alt71=3;
                    }
                    else if ( (LA71_16==28||LA71_16==30) ) {
                        alt71=4;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 71, 16, input);

                        throw nvae;

                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 71, 6, input);

                    throw nvae;

                }
                }
                break;
            case 22:
                {
                int LA71_7 = input.LA(2);

                if ( (LA71_7==VARIABLE) ) {
                    int LA71_17 = input.LA(3);

                    if ( (LA71_17==EOF||LA71_17==29||LA71_17==46) ) {
                        alt71=3;
                    }
                    else if ( (LA71_17==28||LA71_17==30) ) {
                        alt71=4;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 71, 17, input);

                        throw nvae;

                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 71, 7, input);

                    throw nvae;

                }
                }
                break;
            case 21:
                {
                int LA71_8 = input.LA(2);

                if ( (LA71_8==VARIABLE) ) {
                    int LA71_18 = input.LA(3);

                    if ( (LA71_18==EOF||LA71_18==29||LA71_18==46) ) {
                        alt71=3;
                    }
                    else if ( (LA71_18==28||LA71_18==30) ) {
                        alt71=4;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 71, 18, input);

                        throw nvae;

                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 71, 8, input);

                    throw nvae;

                }
                }
                break;
            case 41:
                {
                int LA71_9 = input.LA(2);

                if ( (LA71_9==VARIABLE) ) {
                    int LA71_19 = input.LA(3);

                    if ( ((LA71_19 >= 33 && LA71_19 <= 35)) ) {
                        int LA71_20 = input.LA(4);

                        if ( (LA71_20==EOF||LA71_20==29||LA71_20==46) ) {
                            alt71=3;
                        }
                        else if ( (LA71_20==28||LA71_20==30) ) {
                            alt71=4;
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 71, 20, input);

                            throw nvae;

                        }
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 71, 19, input);

                        throw nvae;

                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 71, 9, input);

                    throw nvae;

                }
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 71, 0, input);

                throw nvae;

            }

            switch (alt71) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:16: '_'
                    {
                    match(input,47,FOLLOW_47_in_intexpression2379); if (state.failed) return retval;

                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:22: INT
                    {
                    match(input,INT,FOLLOW_INT_in_intexpression2383); if (state.failed) return retval;

                    }
                    break;
                case 3 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:28: varrefinteger
                    {
                    pushFollow(FOLLOW_varrefinteger_in_intexpression2387);
                    varrefinteger();

                    state._fsp--;
                    if (state.failed) return retval;

                    }
                    break;
                case 4 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:44: ( varrefinteger operator INT )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:44: ( varrefinteger operator INT )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:45: varrefinteger operator INT
                    {
                    pushFollow(FOLLOW_varrefinteger_in_intexpression2392);
                    varrefinteger();

                    state._fsp--;
                    if (state.failed) return retval;

                    pushFollow(FOLLOW_operator_in_intexpression2394);
                    operator();

                    state._fsp--;
                    if (state.failed) return retval;

                    match(input,INT,FOLLOW_INT_in_intexpression2396); if (state.failed) return retval;

                    }


                    }
                    break;
                case 5 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:75: ( INT operator varrefinteger )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:75: ( INT operator varrefinteger )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:491:77: INT operator varrefinteger
                    {
                    match(input,INT,FOLLOW_INT_in_intexpression2403); if (state.failed) return retval;

                    pushFollow(FOLLOW_operator_in_intexpression2405);
                    operator();

                    state._fsp--;
                    if (state.failed) return retval;

                    pushFollow(FOLLOW_varrefinteger_in_intexpression2407);
                    varrefinteger();

                    state._fsp--;
                    if (state.failed) return retval;

                    }


                    }
                    break;

            }
            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "intexpression"


    public static class interval_return extends ParserRuleReturnScope {
        public String min;
        public String max;
    };


    // $ANTLR start "interval"
    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:493:1: interval returns [String min, String max] : ( ( '[' s1= intexpression ',' s2= intexpression ']' ) | ( '[' s3= intexpression ']' ) );
    public final logolParser.interval_return interval() throws RecognitionException {
        logolParser.interval_return retval = new logolParser.interval_return();
        retval.start = input.LT(1);


        logolParser.intexpression_return s1 =null;

        logolParser.intexpression_return s2 =null;

        logolParser.intexpression_return s3 =null;


        try {
            // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:493:43: ( ( '[' s1= intexpression ',' s2= intexpression ']' ) | ( '[' s3= intexpression ']' ) )
            int alt72=2;
            int LA72_0 = input.LA(1);

            if ( (LA72_0==45) ) {
                switch ( input.LA(2) ) {
                case 47:
                    {
                    int LA72_2 = input.LA(3);

                    if ( (LA72_2==29) ) {
                        alt72=1;
                    }
                    else if ( (LA72_2==46) ) {
                        alt72=2;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 72, 2, input);

                        throw nvae;

                    }
                    }
                    break;
                case INT:
                    {
                    switch ( input.LA(3) ) {
                    case 29:
                        {
                        alt72=1;
                        }
                        break;
                    case 28:
                    case 30:
                        {
                        switch ( input.LA(4) ) {
                        case VARIABLE:
                            {
                            int LA72_21 = input.LA(5);

                            if ( (LA72_21==29) ) {
                                alt72=1;
                            }
                            else if ( (LA72_21==46) ) {
                                alt72=2;
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 21, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 42:
                            {
                            int LA72_22 = input.LA(5);

                            if ( (LA72_22==VARIABLE) ) {
                                int LA72_30 = input.LA(6);

                                if ( (LA72_30==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_30==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 30, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 22, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 43:
                            {
                            int LA72_23 = input.LA(5);

                            if ( (LA72_23==VARIABLE) ) {
                                int LA72_31 = input.LA(6);

                                if ( (LA72_31==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_31==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 31, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 23, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 20:
                            {
                            int LA72_24 = input.LA(5);

                            if ( (LA72_24==VARIABLE) ) {
                                int LA72_32 = input.LA(6);

                                if ( (LA72_32==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_32==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 32, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 24, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 22:
                            {
                            int LA72_25 = input.LA(5);

                            if ( (LA72_25==VARIABLE) ) {
                                int LA72_33 = input.LA(6);

                                if ( (LA72_33==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_33==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 33, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 25, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 21:
                            {
                            int LA72_26 = input.LA(5);

                            if ( (LA72_26==VARIABLE) ) {
                                int LA72_34 = input.LA(6);

                                if ( (LA72_34==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_34==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 34, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 26, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 41:
                            {
                            int LA72_27 = input.LA(5);

                            if ( (LA72_27==VARIABLE) ) {
                                int LA72_35 = input.LA(6);

                                if ( ((LA72_35 >= 33 && LA72_35 <= 35)) ) {
                                    int LA72_36 = input.LA(7);

                                    if ( (LA72_36==29) ) {
                                        alt72=1;
                                    }
                                    else if ( (LA72_36==46) ) {
                                        alt72=2;
                                    }
                                    else {
                                        if (state.backtracking>0) {state.failed=true; return retval;}
                                        NoViableAltException nvae =
                                            new NoViableAltException("", 72, 36, input);

                                        throw nvae;

                                    }
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 35, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 27, input);

                                throw nvae;

                            }
                            }
                            break;
                        default:
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 72, 13, input);

                            throw nvae;

                        }

                        }
                        break;
                    case 46:
                        {
                        alt72=2;
                        }
                        break;
                    default:
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 72, 3, input);

                        throw nvae;

                    }

                    }
                    break;
                case VARIABLE:
                    {
                    switch ( input.LA(3) ) {
                    case 29:
                        {
                        alt72=1;
                        }
                        break;
                    case 28:
                    case 30:
                        {
                        int LA72_14 = input.LA(4);

                        if ( (LA72_14==INT) ) {
                            int LA72_28 = input.LA(5);

                            if ( (LA72_28==29) ) {
                                alt72=1;
                            }
                            else if ( (LA72_28==46) ) {
                                alt72=2;
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 28, input);

                                throw nvae;

                            }
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 72, 14, input);

                            throw nvae;

                        }
                        }
                        break;
                    case 46:
                        {
                        alt72=2;
                        }
                        break;
                    default:
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 72, 4, input);

                        throw nvae;

                    }

                    }
                    break;
                case 42:
                    {
                    int LA72_5 = input.LA(3);

                    if ( (LA72_5==VARIABLE) ) {
                        switch ( input.LA(4) ) {
                        case 29:
                            {
                            alt72=1;
                            }
                            break;
                        case 28:
                        case 30:
                            {
                            int LA72_14 = input.LA(5);

                            if ( (LA72_14==INT) ) {
                                int LA72_28 = input.LA(6);

                                if ( (LA72_28==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_28==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 28, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 14, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 46:
                            {
                            alt72=2;
                            }
                            break;
                        default:
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 72, 15, input);

                            throw nvae;

                        }

                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 72, 5, input);

                        throw nvae;

                    }
                    }
                    break;
                case 43:
                    {
                    int LA72_6 = input.LA(3);

                    if ( (LA72_6==VARIABLE) ) {
                        switch ( input.LA(4) ) {
                        case 29:
                            {
                            alt72=1;
                            }
                            break;
                        case 28:
                        case 30:
                            {
                            int LA72_14 = input.LA(5);

                            if ( (LA72_14==INT) ) {
                                int LA72_28 = input.LA(6);

                                if ( (LA72_28==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_28==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 28, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 14, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 46:
                            {
                            alt72=2;
                            }
                            break;
                        default:
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 72, 16, input);

                            throw nvae;

                        }

                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 72, 6, input);

                        throw nvae;

                    }
                    }
                    break;
                case 20:
                    {
                    int LA72_7 = input.LA(3);

                    if ( (LA72_7==VARIABLE) ) {
                        switch ( input.LA(4) ) {
                        case 29:
                            {
                            alt72=1;
                            }
                            break;
                        case 28:
                        case 30:
                            {
                            int LA72_14 = input.LA(5);

                            if ( (LA72_14==INT) ) {
                                int LA72_28 = input.LA(6);

                                if ( (LA72_28==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_28==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 28, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 14, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 46:
                            {
                            alt72=2;
                            }
                            break;
                        default:
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 72, 17, input);

                            throw nvae;

                        }

                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 72, 7, input);

                        throw nvae;

                    }
                    }
                    break;
                case 22:
                    {
                    int LA72_8 = input.LA(3);

                    if ( (LA72_8==VARIABLE) ) {
                        switch ( input.LA(4) ) {
                        case 29:
                            {
                            alt72=1;
                            }
                            break;
                        case 28:
                        case 30:
                            {
                            int LA72_14 = input.LA(5);

                            if ( (LA72_14==INT) ) {
                                int LA72_28 = input.LA(6);

                                if ( (LA72_28==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_28==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 28, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 14, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 46:
                            {
                            alt72=2;
                            }
                            break;
                        default:
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 72, 18, input);

                            throw nvae;

                        }

                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 72, 8, input);

                        throw nvae;

                    }
                    }
                    break;
                case 21:
                    {
                    int LA72_9 = input.LA(3);

                    if ( (LA72_9==VARIABLE) ) {
                        switch ( input.LA(4) ) {
                        case 29:
                            {
                            alt72=1;
                            }
                            break;
                        case 28:
                        case 30:
                            {
                            int LA72_14 = input.LA(5);

                            if ( (LA72_14==INT) ) {
                                int LA72_28 = input.LA(6);

                                if ( (LA72_28==29) ) {
                                    alt72=1;
                                }
                                else if ( (LA72_28==46) ) {
                                    alt72=2;
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 28, input);

                                    throw nvae;

                                }
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 14, input);

                                throw nvae;

                            }
                            }
                            break;
                        case 46:
                            {
                            alt72=2;
                            }
                            break;
                        default:
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 72, 19, input);

                            throw nvae;

                        }

                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 72, 9, input);

                        throw nvae;

                    }
                    }
                    break;
                case 41:
                    {
                    int LA72_10 = input.LA(3);

                    if ( (LA72_10==VARIABLE) ) {
                        int LA72_20 = input.LA(4);

                        if ( ((LA72_20 >= 33 && LA72_20 <= 35)) ) {
                            switch ( input.LA(5) ) {
                            case 29:
                                {
                                alt72=1;
                                }
                                break;
                            case 28:
                            case 30:
                                {
                                int LA72_14 = input.LA(6);

                                if ( (LA72_14==INT) ) {
                                    int LA72_28 = input.LA(7);

                                    if ( (LA72_28==29) ) {
                                        alt72=1;
                                    }
                                    else if ( (LA72_28==46) ) {
                                        alt72=2;
                                    }
                                    else {
                                        if (state.backtracking>0) {state.failed=true; return retval;}
                                        NoViableAltException nvae =
                                            new NoViableAltException("", 72, 28, input);

                                        throw nvae;

                                    }
                                }
                                else {
                                    if (state.backtracking>0) {state.failed=true; return retval;}
                                    NoViableAltException nvae =
                                        new NoViableAltException("", 72, 14, input);

                                    throw nvae;

                                }
                                }
                                break;
                            case 46:
                                {
                                alt72=2;
                                }
                                break;
                            default:
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 72, 29, input);

                                throw nvae;

                            }

                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 72, 20, input);

                            throw nvae;

                        }
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 72, 10, input);

                        throw nvae;

                    }
                    }
                    break;
                default:
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 72, 1, input);

                    throw nvae;

                }

            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 72, 0, input);

                throw nvae;

            }
            switch (alt72) {
                case 1 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:493:45: ( '[' s1= intexpression ',' s2= intexpression ']' )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:493:45: ( '[' s1= intexpression ',' s2= intexpression ']' )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:493:46: '[' s1= intexpression ',' s2= intexpression ']'
                    {
                    match(input,45,FOLLOW_45_in_interval2421); if (state.failed) return retval;

                    pushFollow(FOLLOW_intexpression_in_interval2425);
                    s1=intexpression();

                    state._fsp--;
                    if (state.failed) return retval;

                    match(input,29,FOLLOW_29_in_interval2427); if (state.failed) return retval;

                    pushFollow(FOLLOW_intexpression_in_interval2431);
                    s2=intexpression();

                    state._fsp--;
                    if (state.failed) return retval;

                    match(input,46,FOLLOW_46_in_interval2433); if (state.failed) return retval;

                    if ( state.backtracking==0 ) { retval.min = (s1!=null?input.toString(s1.start,s1.stop):null).replaceAll("%\\w+%", ""); retval.max = (s2!=null?input.toString(s2.start,s2.stop):null).replaceAll("%\\w+%", ""); }

                    }


                    }
                    break;
                case 2 :
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:493:186: ( '[' s3= intexpression ']' )
                    {
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:493:186: ( '[' s3= intexpression ']' )
                    // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:493:187: '[' s3= intexpression ']'
                    {
                    match(input,45,FOLLOW_45_in_interval2440); if (state.failed) return retval;

                    pushFollow(FOLLOW_intexpression_in_interval2444);
                    s3=intexpression();

                    state._fsp--;
                    if (state.failed) return retval;

                    match(input,46,FOLLOW_46_in_interval2446); if (state.failed) return retval;

                    if ( state.backtracking==0 ) { retval.min = (s3!=null?input.toString(s3.start,s3.stop):null).replaceAll("%\\w+%", ""); retval.max = (s3!=null?input.toString(s3.start,s3.stop):null).replaceAll("%\\w+%", ""); }

                    }


                    }
                    break;

            }
            retval.stop = input.LT(-1);


        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "interval"

    // $ANTLR start synpred54_logol
    public final void synpred54_logol_fragment() throws RecognitionException {
        logolParser.stringConstraints_return stg =null;


        // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:344:83: ( ':' '{' stg= stringConstraints '}' )
        // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:344:83: ':' '{' stg= stringConstraints '}'
        {
        match(input,37,FOLLOW_37_in_synpred54_logol1141); if (state.failed) return ;

        match(input,57,FOLLOW_57_in_synpred54_logol1143); if (state.failed) return ;

        pushFollow(FOLLOW_stringConstraints_in_synpred54_logol1147);
        stg=stringConstraints();

        state._fsp--;
        if (state.failed) return ;

        match(input,59,FOLLOW_59_in_synpred54_logol1151); if (state.failed) return ;

        }

    }
    // $ANTLR end synpred54_logol

    // $ANTLR start synpred109_logol
    public final void synpred109_logol_fragment() throws RecognitionException {
        logolParser.interval_return repeatinterval =null;


        // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:282: (repeatinterval= interval )
        // /opt/conda/conda-bld/logol_1531210364456/work/src/logol.g:458:282: repeatinterval= interval
        {
        pushFollow(FOLLOW_interval_in_synpred109_logol2008);
        repeatinterval=interval();

        state._fsp--;
        if (state.failed) return ;

        }

    }
    // $ANTLR end synpred109_logol

    // Delegated rules

    public final boolean synpred54_logol() {
        state.backtracking++;
        int start = input.mark();
        try {
            synpred54_logol_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !state.failed;
        input.rewind(start);
        state.backtracking--;
        state.failed=false;
        return success;
    }
    public final boolean synpred109_logol() {
        state.backtracking++;
        int start = input.mark();
        try {
            synpred109_logol_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !state.failed;
        input.rewind(start);
        state.backtracking--;
        state.failed=false;
        return success;
    }


    protected DFA3 dfa3 = new DFA3(this);
    protected DFA21 dfa21 = new DFA21(this);
    protected DFA34 dfa34 = new DFA34(this);
    protected DFA64 dfa64 = new DFA64(this);
    static final String DFA3_eotS =
        "\14\uffff";
    static final String DFA3_eofS =
        "\1\1\13\uffff";
    static final String DFA3_minS =
        "\1\10\2\uffff\1\30\1\uffff\1\16\1\31\1\16\1\37\1\31\2\uffff";
    static final String DFA3_maxS =
        "\1\13\2\uffff\1\30\1\uffff\2\35\1\16\1\50\1\35\2\uffff";
    static final String DFA3_acceptS =
        "\1\uffff\1\5\1\1\1\uffff\1\4\5\uffff\1\3\1\2";
    static final String DFA3_specialS =
        "\14\uffff}>";
    static final String[] DFA3_transitionS = {
            "\1\2\1\uffff\1\3\1\4",
            "",
            "",
            "\1\5",
            "",
            "\1\6\12\uffff\1\10\3\uffff\1\7",
            "\1\10\3\uffff\1\7",
            "\1\11",
            "\1\12\7\uffff\1\12\1\13",
            "\1\10\3\uffff\1\7",
            "",
            ""
    };

    static final short[] DFA3_eot = DFA.unpackEncodedString(DFA3_eotS);
    static final short[] DFA3_eof = DFA.unpackEncodedString(DFA3_eofS);
    static final char[] DFA3_min = DFA.unpackEncodedStringToUnsignedChars(DFA3_minS);
    static final char[] DFA3_max = DFA.unpackEncodedStringToUnsignedChars(DFA3_maxS);
    static final short[] DFA3_accept = DFA.unpackEncodedString(DFA3_acceptS);
    static final short[] DFA3_special = DFA.unpackEncodedString(DFA3_specialS);
    static final short[][] DFA3_transition;

    static {
        int numStates = DFA3_transitionS.length;
        DFA3_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA3_transition[i] = DFA.unpackEncodedString(DFA3_transitionS[i]);
        }
    }

    class DFA3 extends DFA {

        public DFA3(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 3;
            this.eot = DFA3_eot;
            this.eof = DFA3_eof;
            this.min = DFA3_min;
            this.max = DFA3_max;
            this.accept = DFA3_accept;
            this.special = DFA3_special;
            this.transition = DFA3_transition;
        }
        public String getDescription() {
            return "()+ loopback of 70:27: ( LINE_COMMENT | model | query | NEWLINE )+";
        }
    }
    static final String DFA21_eotS =
        "\12\uffff";
    static final String DFA21_eofS =
        "\1\1\7\uffff\1\4\1\uffff";
    static final String DFA21_minS =
        "\1\10\1\uffff\1\30\1\12\1\uffff\1\16\1\31\1\16\1\10\1\31";
    static final String DFA21_maxS =
        "\1\72\1\uffff\1\30\1\70\1\uffff\2\35\1\16\1\72\1\35";
    static final String DFA21_acceptS =
        "\1\uffff\1\2\2\uffff\1\1\5\uffff";
    static final String DFA21_specialS =
        "\12\uffff}>";
    static final String[] DFA21_transitionS = {
            "\1\1\1\uffff\1\2\1\1\2\uffff\1\4\2\uffff\3\4\2\uffff\1\4\1\uffff"+
            "\1\4\2\1\1\uffff\1\4\1\3\1\4\1\uffff\1\4\5\uffff\1\3\2\uffff"+
            "\1\4\3\uffff\1\1\12\uffff\1\4\1\uffff\1\4",
            "",
            "\1\5",
            "\1\4\3\uffff\1\4\2\uffff\3\4\2\uffff\1\4\1\uffff\1\4\1\uffff"+
            "\1\1\1\uffff\1\4\1\uffff\1\4\1\uffff\1\4\10\uffff\1\4\3\uffff"+
            "\1\1\12\uffff\1\4",
            "",
            "\1\6\12\uffff\1\10\3\uffff\1\7",
            "\1\10\3\uffff\1\7",
            "\1\11",
            "\1\4\1\uffff\2\4\2\uffff\1\4\2\uffff\3\4\2\uffff\1\4\1\uffff"+
            "\3\4\1\uffff\3\4\1\1\1\4\4\uffff\2\4\2\1\1\4\3\uffff\1\4\12"+
            "\uffff\1\4\1\uffff\1\4",
            "\1\10\3\uffff\1\7"
    };

    static final short[] DFA21_eot = DFA.unpackEncodedString(DFA21_eotS);
    static final short[] DFA21_eof = DFA.unpackEncodedString(DFA21_eofS);
    static final char[] DFA21_min = DFA.unpackEncodedStringToUnsignedChars(DFA21_minS);
    static final char[] DFA21_max = DFA.unpackEncodedStringToUnsignedChars(DFA21_maxS);
    static final short[] DFA21_accept = DFA.unpackEncodedString(DFA21_acceptS);
    static final short[] DFA21_special = DFA.unpackEncodedString(DFA21_specialS);
    static final short[][] DFA21_transition;

    static {
        int numStates = DFA21_transitionS.length;
        DFA21_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA21_transition[i] = DFA.unpackEncodedString(DFA21_transitionS[i]);
        }
    }

    class DFA21 extends DFA {

        public DFA21(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 21;
            this.eot = DFA21_eot;
            this.eof = DFA21_eof;
            this.min = DFA21_min;
            this.max = DFA21_max;
            this.accept = DFA21_accept;
            this.special = DFA21_special;
            this.transition = DFA21_transition;
        }
        public String getDescription() {
            return "()+ loopback of 152:4: ( ( (op= ( ',' | ';' | '|' ) )? (ent= constrainedEntity[parentId,tmpIsAny,tmpIsAnyMin,tmpIsAnyMax,tmpSaveAny] ) ) )+";
        }
    }
    static final String DFA34_eotS =
        "\34\uffff";
    static final String DFA34_eofS =
        "\1\2\33\uffff";
    static final String DFA34_minS =
        "\1\10\1\71\1\uffff\1\21\2\16\1\uffff\1\24\2\35\1\11\1\21\2\0\1\23"+
        "\2\16\1\24\3\35\1\11\3\0\1\23\1\35\1\0";
    static final String DFA34_maxS =
        "\1\72\1\71\1\uffff\1\67\1\16\1\23\1\uffff\1\67\2\73\1\11\1\67\2"+
        "\0\1\23\1\16\1\23\1\67\3\73\1\11\3\0\1\23\1\73\1\0";
    static final String DFA34_acceptS =
        "\2\uffff\1\2\3\uffff\1\1\25\uffff";
    static final String DFA34_specialS =
        "\14\uffff\1\0\1\1\10\uffff\1\2\1\3\1\4\2\uffff\1\5}>";
    static final String[] DFA34_transitionS = {
            "\1\2\1\uffff\2\2\2\uffff\1\2\2\uffff\3\2\2\uffff\1\2\1\uffff"+
            "\3\2\1\uffff\3\2\1\uffff\1\2\4\uffff\1\1\1\2\2\uffff\1\2\3\uffff"+
            "\1\2\12\uffff\1\2\1\uffff\1\2",
            "\1\3",
            "",
            "\1\7\2\uffff\1\6\3\2\21\uffff\1\5\2\6\3\uffff\1\4\6\uffff\2"+
            "\2",
            "\1\10",
            "\1\11\4\uffff\1\12",
            "",
            "\1\6\2\2\23\uffff\2\6\12\uffff\2\2",
            "\1\13\35\uffff\1\14",
            "\1\13\35\uffff\1\15",
            "\1\16",
            "\1\21\2\uffff\1\6\3\2\21\uffff\1\20\2\6\3\uffff\1\17\6\uffff"+
            "\2\2",
            "\1\uffff",
            "\1\uffff",
            "\1\22",
            "\1\23",
            "\1\24\4\uffff\1\25",
            "\1\6\2\2\23\uffff\2\6\12\uffff\2\2",
            "\1\13\35\uffff\1\26",
            "\1\13\35\uffff\1\27",
            "\1\13\35\uffff\1\30",
            "\1\31",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\32",
            "\1\13\35\uffff\1\33",
            "\1\uffff"
    };

    static final short[] DFA34_eot = DFA.unpackEncodedString(DFA34_eotS);
    static final short[] DFA34_eof = DFA.unpackEncodedString(DFA34_eofS);
    static final char[] DFA34_min = DFA.unpackEncodedStringToUnsignedChars(DFA34_minS);
    static final char[] DFA34_max = DFA.unpackEncodedStringToUnsignedChars(DFA34_maxS);
    static final short[] DFA34_accept = DFA.unpackEncodedString(DFA34_acceptS);
    static final short[] DFA34_special = DFA.unpackEncodedString(DFA34_specialS);
    static final short[][] DFA34_transition;

    static {
        int numStates = DFA34_transitionS.length;
        DFA34_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA34_transition[i] = DFA.unpackEncodedString(DFA34_transitionS[i]);
        }
    }

    class DFA34 extends DFA {

        public DFA34(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 34;
            this.eot = DFA34_eot;
            this.eof = DFA34_eof;
            this.min = DFA34_min;
            this.max = DFA34_max;
            this.accept = DFA34_accept;
            this.special = DFA34_special;
            this.transition = DFA34_transition;
        }
        public String getDescription() {
            return "344:82: ( ':' '{' stg= stringConstraints '}' )?";
        }
        public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
            TokenStream input = (TokenStream)_input;
        	int _s = s;
            switch ( s ) {
                    case 0 : 
                        int LA34_12 = input.LA(1);

                         
                        int index34_12 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred54_logol()) ) {s = 6;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index34_12);

                        if ( s>=0 ) return s;
                        break;

                    case 1 : 
                        int LA34_13 = input.LA(1);

                         
                        int index34_13 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred54_logol()) ) {s = 6;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index34_13);

                        if ( s>=0 ) return s;
                        break;

                    case 2 : 
                        int LA34_22 = input.LA(1);

                         
                        int index34_22 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred54_logol()) ) {s = 6;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index34_22);

                        if ( s>=0 ) return s;
                        break;

                    case 3 : 
                        int LA34_23 = input.LA(1);

                         
                        int index34_23 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred54_logol()) ) {s = 6;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index34_23);

                        if ( s>=0 ) return s;
                        break;

                    case 4 : 
                        int LA34_24 = input.LA(1);

                         
                        int index34_24 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred54_logol()) ) {s = 6;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index34_24);

                        if ( s>=0 ) return s;
                        break;

                    case 5 : 
                        int LA34_27 = input.LA(1);

                         
                        int index34_27 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred54_logol()) ) {s = 6;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index34_27);

                        if ( s>=0 ) return s;
                        break;
            }
            if (state.backtracking>0) {state.failed=true; return -1;}

            NoViableAltException nvae =
                new NoViableAltException(getDescription(), 34, _s, input);
            error(nvae);
            throw nvae;
        }

    }
    static final String DFA64_eotS =
        "\151\uffff";
    static final String DFA64_eofS =
        "\1\2\150\uffff";
    static final String DFA64_minS =
        "\1\10\1\7\1\uffff\1\35\2\34\6\16\1\7\1\0\1\16\1\0\1\7\1\0\5\34\1"+
        "\41\1\56\2\34\6\16\1\uffff\1\35\6\16\1\35\5\0\1\34\2\0\1\16\1\0"+
        "\1\7\5\34\1\41\1\0\5\35\1\41\2\0\1\56\6\16\1\56\5\0\1\34\5\0\1\35"+
        "\1\0\5\56\1\41\10\0\1\56\1\0";
    static final String DFA64_maxS =
        "\1\72\1\57\1\uffff\3\56\6\16\1\57\1\0\1\53\1\0\1\7\1\0\5\56\1\43"+
        "\3\56\6\16\1\uffff\1\56\6\16\1\56\5\0\1\56\2\0\1\53\1\0\1\7\5\56"+
        "\1\43\1\0\5\56\1\43\2\0\1\56\6\16\1\56\5\0\1\56\5\0\1\56\1\0\5\56"+
        "\1\43\10\0\1\56\1\0";
    static final String DFA64_acceptS =
        "\2\uffff\1\2\36\uffff\1\1\107\uffff";
    static final String DFA64_specialS =
        "\15\uffff\1\21\1\uffff\1\22\1\uffff\1\30\30\uffff\1\31\1\32\1\34"+
        "\1\36\1\41\1\uffff\1\3\1\4\1\uffff\1\0\7\uffff\1\27\6\uffff\1\23"+
        "\1\25\10\uffff\1\13\1\1\1\17\1\20\1\10\1\uffff\1\26\1\37\1\35\1"+
        "\33\1\40\1\uffff\1\12\6\uffff\1\11\1\5\1\24\1\14\1\6\1\16\1\2\1"+
        "\15\1\uffff\1\7}>";
    static final String[] DFA64_transitionS = {
            "\1\2\1\uffff\2\2\2\uffff\1\2\2\uffff\3\2\2\uffff\1\2\1\uffff"+
            "\3\2\1\uffff\3\2\1\uffff\1\2\4\uffff\2\2\2\uffff\1\2\3\uffff"+
            "\1\1\12\uffff\1\2\1\uffff\1\2",
            "\1\4\6\uffff\1\5\5\uffff\1\10\1\12\1\11\22\uffff\1\13\1\6\1"+
            "\7\3\uffff\1\3",
            "",
            "\1\14\20\uffff\1\15",
            "\1\16\1\14\1\16\17\uffff\1\17",
            "\1\20\1\14\1\20\17\uffff\1\21",
            "\1\22",
            "\1\23",
            "\1\24",
            "\1\25",
            "\1\26",
            "\1\27",
            "\1\31\6\uffff\1\32\5\uffff\1\35\1\37\1\36\22\uffff\1\40\1\33"+
            "\1\34\3\uffff\1\30",
            "\1\uffff",
            "\1\42\5\uffff\1\45\1\47\1\46\22\uffff\1\50\1\43\1\44",
            "\1\uffff",
            "\1\51",
            "\1\uffff",
            "\1\20\1\14\1\20\17\uffff\1\52",
            "\1\20\1\14\1\20\17\uffff\1\53",
            "\1\20\1\14\1\20\17\uffff\1\54",
            "\1\20\1\14\1\20\17\uffff\1\55",
            "\1\20\1\14\1\20\17\uffff\1\56",
            "\3\57",
            "\1\60",
            "\1\62\1\uffff\1\62\17\uffff\1\61",
            "\1\64\1\uffff\1\64\17\uffff\1\63",
            "\1\65",
            "\1\66",
            "\1\67",
            "\1\70",
            "\1\71",
            "\1\72",
            "",
            "\1\14\20\uffff\1\73",
            "\1\74",
            "\1\75",
            "\1\76",
            "\1\77",
            "\1\100",
            "\1\101",
            "\1\14\20\uffff\1\102",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\20\1\14\1\20\17\uffff\1\103",
            "\1\uffff",
            "\1\uffff",
            "\1\104\5\uffff\1\107\1\111\1\110\22\uffff\1\112\1\105\1\106",
            "\1\uffff",
            "\1\113",
            "\1\64\1\uffff\1\64\17\uffff\1\114",
            "\1\64\1\uffff\1\64\17\uffff\1\115",
            "\1\64\1\uffff\1\64\17\uffff\1\116",
            "\1\64\1\uffff\1\64\17\uffff\1\117",
            "\1\64\1\uffff\1\64\17\uffff\1\120",
            "\3\121",
            "\1\uffff",
            "\1\14\20\uffff\1\122",
            "\1\14\20\uffff\1\123",
            "\1\14\20\uffff\1\124",
            "\1\14\20\uffff\1\125",
            "\1\14\20\uffff\1\126",
            "\3\127",
            "\1\uffff",
            "\1\uffff",
            "\1\130",
            "\1\131",
            "\1\132",
            "\1\133",
            "\1\134",
            "\1\135",
            "\1\136",
            "\1\137",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\64\1\uffff\1\64\17\uffff\1\140",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\14\20\uffff\1\141",
            "\1\uffff",
            "\1\142",
            "\1\143",
            "\1\144",
            "\1\145",
            "\1\146",
            "\3\147",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "\1\150",
            "\1\uffff"
    };

    static final short[] DFA64_eot = DFA.unpackEncodedString(DFA64_eotS);
    static final short[] DFA64_eof = DFA.unpackEncodedString(DFA64_eofS);
    static final char[] DFA64_min = DFA.unpackEncodedStringToUnsignedChars(DFA64_minS);
    static final char[] DFA64_max = DFA.unpackEncodedStringToUnsignedChars(DFA64_maxS);
    static final short[] DFA64_accept = DFA.unpackEncodedString(DFA64_acceptS);
    static final short[] DFA64_special = DFA.unpackEncodedString(DFA64_specialS);
    static final short[][] DFA64_transition;

    static {
        int numStates = DFA64_transitionS.length;
        DFA64_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA64_transition[i] = DFA.unpackEncodedString(DFA64_transitionS[i]);
        }
    }

    class DFA64 extends DFA {

        public DFA64(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 64;
            this.eot = DFA64_eot;
            this.eof = DFA64_eof;
            this.min = DFA64_min;
            this.max = DFA64_max;
            this.accept = DFA64_accept;
            this.special = DFA64_special;
            this.transition = DFA64_transition;
        }
        public String getDescription() {
            return "458:282: (repeatinterval= interval )?";
        }
        public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
            TokenStream input = (TokenStream)_input;
        	int _s = s;
            switch ( s ) {
                    case 0 : 
                        int LA64_51 = input.LA(1);

                         
                        int index64_51 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_51);

                        if ( s>=0 ) return s;
                        break;

                    case 1 : 
                        int LA64_77 = input.LA(1);

                         
                        int index64_77 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_77);

                        if ( s>=0 ) return s;
                        break;

                    case 2 : 
                        int LA64_101 = input.LA(1);

                         
                        int index64_101 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_101);

                        if ( s>=0 ) return s;
                        break;

                    case 3 : 
                        int LA64_48 = input.LA(1);

                         
                        int index64_48 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_48);

                        if ( s>=0 ) return s;
                        break;

                    case 4 : 
                        int LA64_49 = input.LA(1);

                         
                        int index64_49 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_49);

                        if ( s>=0 ) return s;
                        break;

                    case 5 : 
                        int LA64_96 = input.LA(1);

                         
                        int index64_96 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_96);

                        if ( s>=0 ) return s;
                        break;

                    case 6 : 
                        int LA64_99 = input.LA(1);

                         
                        int index64_99 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_99);

                        if ( s>=0 ) return s;
                        break;

                    case 7 : 
                        int LA64_104 = input.LA(1);

                         
                        int index64_104 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_104);

                        if ( s>=0 ) return s;
                        break;

                    case 8 : 
                        int LA64_80 = input.LA(1);

                         
                        int index64_80 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_80);

                        if ( s>=0 ) return s;
                        break;

                    case 9 : 
                        int LA64_95 = input.LA(1);

                         
                        int index64_95 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_95);

                        if ( s>=0 ) return s;
                        break;

                    case 10 : 
                        int LA64_88 = input.LA(1);

                         
                        int index64_88 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_88);

                        if ( s>=0 ) return s;
                        break;

                    case 11 : 
                        int LA64_76 = input.LA(1);

                         
                        int index64_76 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_76);

                        if ( s>=0 ) return s;
                        break;

                    case 12 : 
                        int LA64_98 = input.LA(1);

                         
                        int index64_98 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_98);

                        if ( s>=0 ) return s;
                        break;

                    case 13 : 
                        int LA64_102 = input.LA(1);

                         
                        int index64_102 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_102);

                        if ( s>=0 ) return s;
                        break;

                    case 14 : 
                        int LA64_100 = input.LA(1);

                         
                        int index64_100 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_100);

                        if ( s>=0 ) return s;
                        break;

                    case 15 : 
                        int LA64_78 = input.LA(1);

                         
                        int index64_78 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_78);

                        if ( s>=0 ) return s;
                        break;

                    case 16 : 
                        int LA64_79 = input.LA(1);

                         
                        int index64_79 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_79);

                        if ( s>=0 ) return s;
                        break;

                    case 17 : 
                        int LA64_13 = input.LA(1);

                         
                        int index64_13 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_13);

                        if ( s>=0 ) return s;
                        break;

                    case 18 : 
                        int LA64_15 = input.LA(1);

                         
                        int index64_15 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_15);

                        if ( s>=0 ) return s;
                        break;

                    case 19 : 
                        int LA64_66 = input.LA(1);

                         
                        int index64_66 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_66);

                        if ( s>=0 ) return s;
                        break;

                    case 20 : 
                        int LA64_97 = input.LA(1);

                         
                        int index64_97 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_97);

                        if ( s>=0 ) return s;
                        break;

                    case 21 : 
                        int LA64_67 = input.LA(1);

                         
                        int index64_67 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_67);

                        if ( s>=0 ) return s;
                        break;

                    case 22 : 
                        int LA64_82 = input.LA(1);

                         
                        int index64_82 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_82);

                        if ( s>=0 ) return s;
                        break;

                    case 23 : 
                        int LA64_59 = input.LA(1);

                         
                        int index64_59 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_59);

                        if ( s>=0 ) return s;
                        break;

                    case 24 : 
                        int LA64_17 = input.LA(1);

                         
                        int index64_17 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_17);

                        if ( s>=0 ) return s;
                        break;

                    case 25 : 
                        int LA64_42 = input.LA(1);

                         
                        int index64_42 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_42);

                        if ( s>=0 ) return s;
                        break;

                    case 26 : 
                        int LA64_43 = input.LA(1);

                         
                        int index64_43 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_43);

                        if ( s>=0 ) return s;
                        break;

                    case 27 : 
                        int LA64_85 = input.LA(1);

                         
                        int index64_85 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_85);

                        if ( s>=0 ) return s;
                        break;

                    case 28 : 
                        int LA64_44 = input.LA(1);

                         
                        int index64_44 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_44);

                        if ( s>=0 ) return s;
                        break;

                    case 29 : 
                        int LA64_84 = input.LA(1);

                         
                        int index64_84 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_84);

                        if ( s>=0 ) return s;
                        break;

                    case 30 : 
                        int LA64_45 = input.LA(1);

                         
                        int index64_45 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_45);

                        if ( s>=0 ) return s;
                        break;

                    case 31 : 
                        int LA64_83 = input.LA(1);

                         
                        int index64_83 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_83);

                        if ( s>=0 ) return s;
                        break;

                    case 32 : 
                        int LA64_86 = input.LA(1);

                         
                        int index64_86 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_86);

                        if ( s>=0 ) return s;
                        break;

                    case 33 : 
                        int LA64_46 = input.LA(1);

                         
                        int index64_46 = input.index();
                        input.rewind();

                        s = -1;
                        if ( (synpred109_logol()) ) {s = 33;}

                        else if ( (true) ) {s = 2;}

                         
                        input.seek(index64_46);

                        if ( s>=0 ) return s;
                        break;
            }
            if (state.backtracking>0) {state.failed=true; return -1;}

            NoViableAltException nvae =
                new NoViableAltException(getDescription(), 64, _s, input);
            error(nvae);
            throw nvae;
        }

    }
 

    public static final BitSet FOLLOW_definitions_in_rule66 = new BitSet(new long[]{0x0004000000000D00L});
    public static final BitSet FOLLOW_controls_in_rule69 = new BitSet(new long[]{0x0000000000000D00L});
    public static final BitSet FOLLOW_LINE_COMMENT_in_rule73 = new BitSet(new long[]{0x0000000000000D00L});
    public static final BitSet FOLLOW_model_in_rule75 = new BitSet(new long[]{0x0000000000000D00L});
    public static final BitSet FOLLOW_query_in_rule77 = new BitSet(new long[]{0x0000000000000D00L});
    public static final BitSet FOLLOW_NEWLINE_in_rule79 = new BitSet(new long[]{0x0000000000000D00L});
    public static final BitSet FOLLOW_EOF_in_rule84 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_50_in_controls132 = new BitSet(new long[]{0x0200000000000800L});
    public static final BitSet FOLLOW_NEWLINE_in_controls134 = new BitSet(new long[]{0x0200000000000000L});
    public static final BitSet FOLLOW_57_in_controls137 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_NEWLINE_in_controls139 = new BitSet(new long[]{0x08C00C0001F00180L});
    public static final BitSet FOLLOW_LINE_COMMENT_in_controls142 = new BitSet(new long[]{0x08C00C0001F00180L});
    public static final BitSet FOLLOW_control_in_controls144 = new BitSet(new long[]{0x08C00C0001F00180L});
    public static final BitSet FOLLOW_59_in_controls148 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_NEWLINE_in_controls150 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_mathexpr_in_control160 = new BitSet(new long[]{0x0000000000020020L});
    public static final BitSet FOLLOW_17_in_control164 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_COMPARATOR_in_control167 = new BitSet(new long[]{0x00C00C0001F00080L});
    public static final BitSet FOLLOW_mathexpr_in_control171 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_NEWLINE_in_control175 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_mathatom_in_mathexpr195 = new BitSet(new long[]{0x0000001058000002L});
    public static final BitSet FOLLOW_28_in_mathexpr211 = new BitSet(new long[]{0x00C00C0001F00080L});
    public static final BitSet FOLLOW_mathatom_in_mathexpr215 = new BitSet(new long[]{0x0000001058000002L});
    public static final BitSet FOLLOW_30_in_mathexpr231 = new BitSet(new long[]{0x00C00C0001F00080L});
    public static final BitSet FOLLOW_mathatom_in_mathexpr235 = new BitSet(new long[]{0x0000001058000002L});
    public static final BitSet FOLLOW_27_in_mathexpr251 = new BitSet(new long[]{0x00C00C0001F00080L});
    public static final BitSet FOLLOW_mathatom_in_mathexpr255 = new BitSet(new long[]{0x0000001058000002L});
    public static final BitSet FOLLOW_36_in_mathexpr271 = new BitSet(new long[]{0x00C00C0001F00080L});
    public static final BitSet FOLLOW_mathatom_in_mathexpr275 = new BitSet(new long[]{0x0000001058000002L});
    public static final BitSet FOLLOW_ModelName_in_modvar304 = new BitSet(new long[]{0x0000000080000000L});
    public static final BitSet FOLLOW_31_in_modvar306 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_modvar308 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_in_mathatom337 = new BitSet(new long[]{0x0000000080000002L});
    public static final BitSet FOLLOW_31_in_mathatom340 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_INT_in_mathatom344 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_43_in_mathatom359 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_mathatom363 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom367 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_mathatom373 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom377 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_mathatom383 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_42_in_mathatom395 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_mathatom399 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom403 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_mathatom409 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom413 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_mathatom419 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_20_in_mathatom431 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_mathatom435 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom439 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_mathatom445 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom449 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_mathatom455 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_21_in_mathatom467 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_mathatom471 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom475 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_mathatom481 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom485 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_mathatom491 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_22_in_mathatom503 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_mathatom507 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom511 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_mathatom517 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom521 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_mathatom527 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_54_in_mathatom539 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_mathatom543 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom547 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_mathatom553 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom557 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_mathatom563 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_55_in_mathatom575 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_mathatom579 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom583 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_mathatom589 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom593 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_mathatom599 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_23_in_mathatom610 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_19_in_mathatom612 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_mathatom616 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_19_in_mathatom620 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_mathatom623 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom627 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_mathatom634 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_modvar_in_mathatom638 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_mathatom644 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_24_in_mathatom656 = new BitSet(new long[]{0x00C00C0001F00080L});
    public static final BitSet FOLLOW_mathexpr_in_mathatom660 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_mathatom662 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ModelName_in_model693 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_model697 = new BitSet(new long[]{0x0000000022004000L});
    public static final BitSet FOLLOW_VARIABLE_in_model701 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_29_in_model706 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_model710 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_25_in_model715 = new BitSet(new long[]{0x0000010000000000L});
    public static final BitSet FOLLOW_40_in_model719 = new BitSet(new long[]{0x05000241714E4400L});
    public static final BitSet FOLLOW_view_in_model724 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_view801 = new BitSet(new long[]{0x01000201514E4400L});
    public static final BitSet FOLLOW_constrainedEntity_in_view821 = new BitSet(new long[]{0x05000241714E4402L});
    public static final BitSet FOLLOW_ModelName_in_query851 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_query853 = new BitSet(new long[]{0x0000000022004000L});
    public static final BitSet FOLLOW_VARIABLE_in_query857 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_29_in_query862 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_query866 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_25_in_query870 = new BitSet(new long[]{0x0000008080000000L});
    public static final BitSet FOLLOW_31_in_query874 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_ModelName_in_query878 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_query880 = new BitSet(new long[]{0x0000000022004000L});
    public static final BitSet FOLLOW_VARIABLE_in_query884 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_29_in_query889 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_query893 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_25_in_query897 = new BitSet(new long[]{0x0000008080000000L});
    public static final BitSet FOLLOW_39_in_query901 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Sequence_in_query905 = new BitSet(new long[]{0x0000000080000002L});
    public static final BitSet FOLLOW_31_in_query908 = new BitSet(new long[]{0x0000000001001000L});
    public static final BitSet FOLLOW_sequences_in_query910 = new BitSet(new long[]{0x0000000080000002L});
    public static final BitSet FOLLOW_Sequence_in_sequences923 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_24_in_sequences927 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Sequence_in_sequences929 = new BitSet(new long[]{0x0000000082000000L});
    public static final BitSet FOLLOW_31_in_sequences932 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Sequence_in_sequences934 = new BitSet(new long[]{0x0000000082000000L});
    public static final BitSet FOLLOW_25_in_sequences938 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_51_in_definitions979 = new BitSet(new long[]{0x0200000000000800L});
    public static final BitSet FOLLOW_NEWLINE_in_definitions981 = new BitSet(new long[]{0x0200000000000000L});
    public static final BitSet FOLLOW_57_in_definitions984 = new BitSet(new long[]{0x0830000000000900L});
    public static final BitSet FOLLOW_definition_in_definitions990 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_NEWLINE_in_definitions994 = new BitSet(new long[]{0x0830000000000900L});
    public static final BitSet FOLLOW_LINE_COMMENT_in_definitions997 = new BitSet(new long[]{0x0830000000000900L});
    public static final BitSet FOLLOW_NEWLINE_in_definitions999 = new BitSet(new long[]{0x0830000000000900L});
    public static final BitSet FOLLOW_59_in_definitions1003 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_NEWLINE_in_definitions1005 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_52_in_definition1024 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_definition1026 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_definition1030 = new BitSet(new long[]{0x0000000020000000L});
    public static final BitSet FOLLOW_29_in_definition1032 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_definition1036 = new BitSet(new long[]{0x0000000020000000L});
    public static final BitSet FOLLOW_29_in_definition1038 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_matrix_in_definition1042 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_definition1044 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_53_in_definition1057 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_definition1059 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_definition1063 = new BitSet(new long[]{0x0000000020000000L});
    public static final BitSet FOLLOW_29_in_definition1065 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_definition1069 = new BitSet(new long[]{0x0000000020000000L});
    public static final BitSet FOLLOW_29_in_definition1071 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_definition1075 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_definition1077 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_45_in_matrix1090 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_INT_in_matrix1092 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_matrix1095 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_INT_in_matrix1097 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_matrix1101 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_entity_in_constrainedEntity1135 = new BitSet(new long[]{0x0000002000000002L});
    public static final BitSet FOLLOW_37_in_constrainedEntity1141 = new BitSet(new long[]{0x0200000000000000L});
    public static final BitSet FOLLOW_57_in_constrainedEntity1143 = new BitSet(new long[]{0x00008E0000120000L});
    public static final BitSet FOLLOW_stringConstraints_in_constrainedEntity1147 = new BitSet(new long[]{0x0800000000000000L});
    public static final BitSet FOLLOW_59_in_constrainedEntity1151 = new BitSet(new long[]{0x0000002000000002L});
    public static final BitSet FOLLOW_37_in_constrainedEntity1157 = new BitSet(new long[]{0x0200000000000000L});
    public static final BitSet FOLLOW_57_in_constrainedEntity1159 = new BitSet(new long[]{0x00C0820000E20000L});
    public static final BitSet FOLLOW_structConstraints_in_constrainedEntity1163 = new BitSet(new long[]{0x0800000000000000L});
    public static final BitSet FOLLOW_59_in_constrainedEntity1167 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_entity1202 = new BitSet(new long[]{0x0000020150404000L});
    public static final BitSet FOLLOW_entityVariable_in_entity1207 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ModelName_in_entity1218 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_entity1222 = new BitSet(new long[]{0x0000000022004000L});
    public static final BitSet FOLLOW_VARIABLE_in_entity1226 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_29_in_entity1231 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_entity1235 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_25_in_entity1240 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_entity1250 = new BitSet(new long[]{0x0000000050400000L});
    public static final BitSet FOLLOW_modifier_in_entity1255 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_complexstring_in_entity1257 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_complexstring_in_entity1265 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_entity1273 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_complexstring_in_entity1275 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_repeat_in_entity1284 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_18_in_entity1295 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_entity1297 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_entity1301 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_29_in_entity1304 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_entity1306 = new BitSet(new long[]{0x0000000000004080L});
    public static final BitSet FOLLOW_VARIABLE_in_entity1311 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_INT_in_entity1315 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_entity1319 = new BitSet(new long[]{0x0000000000004080L});
    public static final BitSet FOLLOW_VARIABLE_in_entity1326 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_INT_in_entity1330 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_entity1335 = new BitSet(new long[]{0x0000000022000000L});
    public static final BitSet FOLLOW_29_in_entity1338 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_entity1340 = new BitSet(new long[]{0x0000000000004080L});
    public static final BitSet FOLLOW_VARIABLE_in_entity1346 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_INT_in_entity1350 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_29_in_entity1354 = new BitSet(new long[]{0x0000000000004080L});
    public static final BitSet FOLLOW_VARIABLE_in_entity1358 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_INT_in_entity1362 = new BitSet(new long[]{0x0000400020000000L});
    public static final BitSet FOLLOW_46_in_entity1367 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_entity1373 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_entity1383 = new BitSet(new long[]{0x0000000001000000L});
    public static final BitSet FOLLOW_24_in_entity1387 = new BitSet(new long[]{0x05000241714E4400L});
    public static final BitSet FOLLOW_view_in_entity1391 = new BitSet(new long[]{0x0000000002000000L});
    public static final BitSet FOLLOW_25_in_entity1396 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_stringVariableElement_in_entityVariable1415 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_modifier_in_stringVariableElement1437 = new BitSet(new long[]{0x0000020100004000L});
    public static final BitSet FOLLOW_stringVariable_in_stringVariableElement1442 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_morphism_in_modifier1469 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_22_in_modifier1477 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_string_in_modifier1481 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_stringConstraint_in_stringConstraints1506 = new BitSet(new long[]{0x0000000020000002L});
    public static final BitSet FOLLOW_29_in_stringConstraints1512 = new BitSet(new long[]{0x00008E0000120000L});
    public static final BitSet FOLLOW_stringConstraint_in_stringConstraints1516 = new BitSet(new long[]{0x0000000020000002L});
    public static final BitSet FOLLOW_47_in_stringConstraint1548 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_stringConstraint1550 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_41_in_stringConstraint1559 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_stringConstraint1561 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_41_in_stringConstraint1569 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_string_in_stringConstraint1571 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_42_in_stringConstraint1580 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_stringConstraint1582 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_43_in_stringConstraint1591 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_stringConstraint1593 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_20_in_stringConstraint1601 = new BitSet(new long[]{0x0000300000000000L});
    public static final BitSet FOLLOW_44_in_stringConstraint1605 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_stringConstraint1608 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_stringConstraint1616 = new BitSet(new long[]{0x0000040000000000L});
    public static final BitSet FOLLOW_42_in_stringConstraint1618 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_stringConstraint1620 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_stringConstraint1629 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_stringConstraint1631 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_stringConstraint1633 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_stringConstraint1641 = new BitSet(new long[]{0x0000000000100000L});
    public static final BitSet FOLLOW_20_in_stringConstraint1643 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_stringConstraint1645 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_structConstraint_in_structConstraints1667 = new BitSet(new long[]{0x0000000020000002L});
    public static final BitSet FOLLOW_29_in_structConstraints1673 = new BitSet(new long[]{0x00C0820000E20000L});
    public static final BitSet FOLLOW_structConstraint_in_structConstraints1677 = new BitSet(new long[]{0x0000000020000002L});
    public static final BitSet FOLLOW_47_in_structConstraint1718 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_structConstraint1720 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_41_in_structConstraint1729 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_structConstraint1731 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_41_in_structConstraint1740 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_string_in_structConstraint1742 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_23_in_structConstraint1751 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_string_in_structConstraint1753 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_37_in_structConstraint1755 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_INT_in_structConstraint1759 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_structConstraint1769 = new BitSet(new long[]{0x0000200000000200L});
    public static final BitSet FOLLOW_LOWID_in_structConstraint1777 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_structConstraint1780 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_structConstraint1791 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_structConstraint1797 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_structConstraint1806 = new BitSet(new long[]{0x0080000000400000L});
    public static final BitSet FOLLOW_set_in_structConstraint1810 = new BitSet(new long[]{0x0000200000000200L});
    public static final BitSet FOLLOW_LOWID_in_structConstraint1818 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_structConstraint1821 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_structConstraint1829 = new BitSet(new long[]{0x0040000000200000L});
    public static final BitSet FOLLOW_set_in_structConstraint1833 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_structConstraint1839 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_structureValue_in_structureValues1851 = new BitSet(new long[]{0x0000000020000000L});
    public static final BitSet FOLLOW_29_in_structureValues1854 = new BitSet(new long[]{0x0000020000400000L});
    public static final BitSet FOLLOW_structureValue_in_structureValues1856 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_41_in_structureValue1866 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_structureValue1868 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_22_in_structureValue1872 = new BitSet(new long[]{0x00008E0000704080L});
    public static final BitSet FOLLOW_intexpression_in_structureValue1874 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_operator_in_morphism1889 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_string_in_morphism1895 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_22_in_weight1905 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_string_in_weight1907 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_32_in_stringVariable1926 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_41_in_stringVariable1936 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_stringVariable1943 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_56_in_repeat1980 = new BitSet(new long[]{0x05000241714E4400L});
    public static final BitSet FOLLOW_view_in_repeat1982 = new BitSet(new long[]{0x0000204024000000L});
    public static final BitSet FOLLOW_set_in_repeat1987 = new BitSet(new long[]{0x0000200004000000L});
    public static final BitSet FOLLOW_interval_in_repeat1996 = new BitSet(new long[]{0x0000000004000000L});
    public static final BitSet FOLLOW_26_in_repeat2004 = new BitSet(new long[]{0x0000200000000002L});
    public static final BitSet FOLLOW_interval_in_repeat2008 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_48_in_parameters2028 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_parameters2030 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_49_in_parameters2036 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_interval_in_parameters2038 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_23_in_test2048 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_string_in_test2050 = new BitSet(new long[]{0x0000002000000000L});
    public static final BitSet FOLLOW_37_in_test2052 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_INT_in_test2056 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_19_in_string2114 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_string2116 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_19_in_string2118 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_45_in_orstring2126 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_orstring2128 = new BitSet(new long[]{0x0400400000000200L});
    public static final BitSet FOLLOW_58_in_orstring2132 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_LOWID_in_orstring2134 = new BitSet(new long[]{0x0400400000000200L});
    public static final BitSet FOLLOW_46_in_orstring2140 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_19_in_complexstring2148 = new BitSet(new long[]{0x0000200000000200L});
    public static final BitSet FOLLOW_LOWID_in_complexstring2151 = new BitSet(new long[]{0x0000200000080200L});
    public static final BitSet FOLLOW_orstring_in_complexstring2153 = new BitSet(new long[]{0x0000200000080200L});
    public static final BitSet FOLLOW_19_in_complexstring2159 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_VARIABLE_in_varrefinteger2321 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_42_in_varrefinteger2325 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_varrefinteger2327 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_43_in_varrefinteger2331 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_varrefinteger2333 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_20_in_varrefinteger2337 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_varrefinteger2339 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_22_in_varrefinteger2343 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_varrefinteger2345 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_21_in_varrefinteger2349 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_varrefinteger2351 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_41_in_varrefinteger2356 = new BitSet(new long[]{0x0000000000004000L});
    public static final BitSet FOLLOW_VARIABLE_in_varrefinteger2358 = new BitSet(new long[]{0x0000000E00000000L});
    public static final BitSet FOLLOW_set_in_varrefinteger2360 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_47_in_intexpression2379 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_in_intexpression2383 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_varrefinteger_in_intexpression2387 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_varrefinteger_in_intexpression2392 = new BitSet(new long[]{0x0000000050000000L});
    public static final BitSet FOLLOW_operator_in_intexpression2394 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_INT_in_intexpression2396 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_in_intexpression2403 = new BitSet(new long[]{0x0000000050000000L});
    public static final BitSet FOLLOW_operator_in_intexpression2405 = new BitSet(new long[]{0x00000E0000704000L});
    public static final BitSet FOLLOW_varrefinteger_in_intexpression2407 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_45_in_interval2421 = new BitSet(new long[]{0x00008E0000704080L});
    public static final BitSet FOLLOW_intexpression_in_interval2425 = new BitSet(new long[]{0x0000000020000000L});
    public static final BitSet FOLLOW_29_in_interval2427 = new BitSet(new long[]{0x00008E0000704080L});
    public static final BitSet FOLLOW_intexpression_in_interval2431 = new BitSet(new long[]{0x0000400000000000L});
    public static final BitSet FOLLOW_46_in_interval2433 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_45_in_interval2440 = new BitSet(new long[]{0x00008E0000704080L});
    public static final BitSet FOLLOW_intexpression_in_interval2444 = new BitSet(new long[]{0x0000400000000000L});
    public static final BitSet FOLLOW_46_in_interval2446 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_37_in_synpred54_logol1141 = new BitSet(new long[]{0x0200000000000000L});
    public static final BitSet FOLLOW_57_in_synpred54_logol1143 = new BitSet(new long[]{0x00008E0000120000L});
    public static final BitSet FOLLOW_stringConstraints_in_synpred54_logol1147 = new BitSet(new long[]{0x0800000000000000L});
    public static final BitSet FOLLOW_59_in_synpred54_logol1151 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_interval_in_synpred109_logol2008 = new BitSet(new long[]{0x0000000000000002L});

}