fr.insee.vtl.parser.VtlParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vtl-parser Show documentation
Show all versions of vtl-parser Show documentation
Artifacts generated by Antlr from the VTL grammar files
// Generated from fr/insee/vtl/parser/Vtl.g4 by ANTLR 4.9.3
package fr.insee.vtl.parser;
import org.antlr.v4.runtime.atn.*;
import org.antlr.v4.runtime.dfa.DFA;
import org.antlr.v4.runtime.*;
import org.antlr.v4.runtime.misc.*;
import org.antlr.v4.runtime.tree.*;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
public class VtlParser extends Parser {
static { RuntimeMetaData.checkVersion("4.9.3", RuntimeMetaData.VERSION); }
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
public static final int
LPAREN=1, RPAREN=2, QLPAREN=3, QRPAREN=4, GLPAREN=5, GRPAREN=6, EQ=7,
LT=8, MT=9, ME=10, NEQ=11, LE=12, PLUS=13, MINUS=14, MUL=15, DIV=16, COMMA=17,
POINTER=18, COLON=19, ASSIGN=20, MEMBERSHIP=21, EVAL=22, IF=23, CASE=24,
THEN=25, ELSE=26, USING=27, WITH=28, CURRENT_DATE=29, DATEDIFF=30, DATEADD=31,
GETYEAR=32, GETMONTH=33, DAYOFMONTH=34, DAYOFYEAR=35, DAYTOYEAR=36, DAYTOMONTH=37,
YEARTODAY=38, MONTHTODAY=39, ON=40, DROP=41, KEEP=42, CALC=43, ATTRCALC=44,
RENAME=45, AS=46, AND=47, OR=48, XOR=49, NOT=50, BETWEEN=51, IN=52, NOT_IN=53,
NULL_CONSTANT=54, ISNULL=55, EX=56, UNION=57, DIFF=58, SYMDIFF=59, INTERSECT=60,
RANDOM=61, KEYS=62, INTYEAR=63, INTMONTH=64, INTDAY=65, CHECK=66, EXISTS_IN=67,
TO=68, RETURN=69, IMBALANCE=70, ERRORCODE=71, ALL=72, AGGREGATE=73, ERRORLEVEL=74,
ORDER=75, BY=76, RANK=77, ASC=78, DESC=79, MIN=80, MAX=81, FIRST=82, LAST=83,
INDEXOF=84, ABS=85, KEY=86, LN=87, LOG=88, TRUNC=89, ROUND=90, POWER=91,
MOD=92, LEN=93, CONCAT=94, TRIM=95, UCASE=96, LCASE=97, SUBSTR=98, SUM=99,
AVG=100, MEDIAN=101, COUNT=102, DIMENSION=103, MEASURE=104, ATTRIBUTE=105,
FILTER=106, MERGE=107, EXP=108, ROLE=109, VIRAL=110, CHARSET_MATCH=111,
TYPE=112, NVL=113, HIERARCHY=114, OPTIONAL=115, INVALID=116, LEVENSHTEIN=117,
VALUE_DOMAIN=118, VARIABLE=119, DATA=120, STRUCTURE=121, DATASET=122,
OPERATOR=123, DEFINE=124, PUT_SYMBOL=125, DATAPOINT=126, HIERARCHICAL=127,
RULESET=128, RULE=129, END=130, ALTER_DATASET=131, LTRIM=132, RTRIM=133,
INSTR=134, REPLACE=135, CEIL=136, FLOOR=137, SQRT=138, ANY=139, SETDIFF=140,
STDDEV_POP=141, STDDEV_SAMP=142, VAR_POP=143, VAR_SAMP=144, GROUP=145,
EXCEPT=146, HAVING=147, FIRST_VALUE=148, LAST_VALUE=149, LAG=150, LEAD=151,
RATIO_TO_REPORT=152, OVER=153, PRECEDING=154, FOLLOWING=155, UNBOUNDED=156,
PARTITION=157, ROWS=158, RANGE=159, CURRENT=160, VALID=161, FILL_TIME_SERIES=162,
FLOW_TO_STOCK=163, STOCK_TO_FLOW=164, TIMESHIFT=165, MEASURES=166, NO_MEASURES=167,
CONDITION=168, BOOLEAN=169, DATE=170, TIME_PERIOD=171, NUMBER=172, STRING=173,
TIME=174, INTEGER=175, FLOAT=176, LIST=177, RECORD=178, RESTRICT=179,
YYYY=180, MM=181, DD=182, MAX_LENGTH=183, REGEXP=184, IS=185, WHEN=186,
FROM=187, AGGREGATES=188, POINTS=189, POINT=190, TOTAL=191, PARTIAL=192,
ALWAYS=193, INNER_JOIN=194, LEFT_JOIN=195, CROSS_JOIN=196, FULL_JOIN=197,
MAPS_FROM=198, MAPS_TO=199, MAP_TO=200, MAP_FROM=201, RETURNS=202, PIVOT=203,
CUSTOMPIVOT=204, UNPIVOT=205, SUBSPACE=206, APPLY=207, CONDITIONED=208,
PERIOD_INDICATOR=209, SINGLE=210, DURATION=211, TIME_AGG=212, UNIT=213,
VALUE=214, VALUEDOMAINS=215, VARIABLES=216, INPUT=217, OUTPUT=218, CAST=219,
RULE_PRIORITY=220, DATASET_PRIORITY=221, DEFAULT=222, CHECK_DATAPOINT=223,
CHECK_HIERARCHY=224, COMPUTED=225, NON_NULL=226, NON_ZERO=227, PARTIAL_NULL=228,
PARTIAL_ZERO=229, ALWAYS_NULL=230, ALWAYS_ZERO=231, COMPONENTS=232, ALL_MEASURES=233,
SCALAR=234, COMPONENT=235, DATAPOINT_ON_VD=236, DATAPOINT_ON_VAR=237,
HIERARCHICAL_ON_VD=238, HIERARCHICAL_ON_VAR=239, SET=240, LANGUAGE=241,
INTEGER_CONSTANT=242, NUMBER_CONSTANT=243, BOOLEAN_CONSTANT=244, STRING_CONSTANT=245,
IDENTIFIER=246, TIME_UNIT=247, WS=248, EOL=249, ML_COMMENT=250, SL_COMMENT=251;
public static final int
RULE_start = 0, RULE_statement = 1, RULE_expr = 2, RULE_functions = 3,
RULE_datasetClause = 4, RULE_renameClause = 5, RULE_aggrClause = 6, RULE_filterClause = 7,
RULE_calcClause = 8, RULE_keepOrDropClause = 9, RULE_pivotOrUnpivotClause = 10,
RULE_customPivotClause = 11, RULE_subspaceClause = 12, RULE_joinOperators = 13,
RULE_defOperators = 14, RULE_genericOperators = 15, RULE_parameter = 16,
RULE_stringOperators = 17, RULE_numericOperators = 18, RULE_comparisonOperators = 19,
RULE_timeOperators = 20, RULE_setOperators = 21, RULE_hierarchyOperators = 22,
RULE_validationOperators = 23, RULE_conditionalOperators = 24, RULE_aggrOperatorsGrouping = 25,
RULE_anFunction = 26, RULE_distanceOperators = 27, RULE_renameClauseItem = 28,
RULE_aggregateClause = 29, RULE_aggrFunctionClause = 30, RULE_calcClauseItem = 31,
RULE_subspaceClauseItem = 32, RULE_joinClauseWithoutUsing = 33, RULE_joinClause = 34,
RULE_joinClauseItem = 35, RULE_joinBody = 36, RULE_joinApplyClause = 37,
RULE_partitionByClause = 38, RULE_orderByClause = 39, RULE_orderByItem = 40,
RULE_windowingClause = 41, RULE_signedInteger = 42, RULE_limitClauseItem = 43,
RULE_groupingClause = 44, RULE_havingClause = 45, RULE_parameterItem = 46,
RULE_outputParameterType = 47, RULE_outputParameterTypeComponent = 48,
RULE_inputParameterType = 49, RULE_rulesetType = 50, RULE_scalarType = 51,
RULE_componentType = 52, RULE_datasetType = 53, RULE_scalarSetType = 54,
RULE_dpRuleset = 55, RULE_hrRuleset = 56, RULE_valueDomainName = 57, RULE_rulesetID = 58,
RULE_rulesetSignature = 59, RULE_signature = 60, RULE_ruleClauseDatapoint = 61,
RULE_ruleItemDatapoint = 62, RULE_ruleClauseHierarchical = 63, RULE_ruleItemHierarchical = 64,
RULE_hierRuleSignature = 65, RULE_valueDomainSignature = 66, RULE_codeItemRelation = 67,
RULE_codeItemRelationClause = 68, RULE_valueDomainValue = 69, RULE_scalarTypeConstraint = 70,
RULE_compConstraint = 71, RULE_multModifier = 72, RULE_validationOutput = 73,
RULE_validationMode = 74, RULE_conditionClause = 75, RULE_inputMode = 76,
RULE_imbalanceExpr = 77, RULE_inputModeHierarchy = 78, RULE_outputModeHierarchy = 79,
RULE_alias = 80, RULE_varID = 81, RULE_simpleComponentId = 82, RULE_componentID = 83,
RULE_lists = 84, RULE_erCode = 85, RULE_erLevel = 86, RULE_comparisonOperand = 87,
RULE_optionalExpr = 88, RULE_componentRole = 89, RULE_viralAttribute = 90,
RULE_valueDomainID = 91, RULE_operatorID = 92, RULE_routineName = 93,
RULE_constant = 94, RULE_basicScalarType = 95, RULE_retainType = 96;
private static String[] makeRuleNames() {
return new String[] {
"start", "statement", "expr", "functions", "datasetClause", "renameClause",
"aggrClause", "filterClause", "calcClause", "keepOrDropClause", "pivotOrUnpivotClause",
"customPivotClause", "subspaceClause", "joinOperators", "defOperators",
"genericOperators", "parameter", "stringOperators", "numericOperators",
"comparisonOperators", "timeOperators", "setOperators", "hierarchyOperators",
"validationOperators", "conditionalOperators", "aggrOperatorsGrouping",
"anFunction", "distanceOperators", "renameClauseItem", "aggregateClause",
"aggrFunctionClause", "calcClauseItem", "subspaceClauseItem", "joinClauseWithoutUsing",
"joinClause", "joinClauseItem", "joinBody", "joinApplyClause", "partitionByClause",
"orderByClause", "orderByItem", "windowingClause", "signedInteger", "limitClauseItem",
"groupingClause", "havingClause", "parameterItem", "outputParameterType",
"outputParameterTypeComponent", "inputParameterType", "rulesetType",
"scalarType", "componentType", "datasetType", "scalarSetType", "dpRuleset",
"hrRuleset", "valueDomainName", "rulesetID", "rulesetSignature", "signature",
"ruleClauseDatapoint", "ruleItemDatapoint", "ruleClauseHierarchical",
"ruleItemHierarchical", "hierRuleSignature", "valueDomainSignature",
"codeItemRelation", "codeItemRelationClause", "valueDomainValue", "scalarTypeConstraint",
"compConstraint", "multModifier", "validationOutput", "validationMode",
"conditionClause", "inputMode", "imbalanceExpr", "inputModeHierarchy",
"outputModeHierarchy", "alias", "varID", "simpleComponentId", "componentID",
"lists", "erCode", "erLevel", "comparisonOperand", "optionalExpr", "componentRole",
"viralAttribute", "valueDomainID", "operatorID", "routineName", "constant",
"basicScalarType", "retainType"
};
}
public static final String[] ruleNames = makeRuleNames();
private static String[] makeLiteralNames() {
return new String[] {
null, "'('", "')'", "'['", "']'", "'{'", "'}'", "'='", "'<'", "'>'",
"'>='", "'<>'", "'<='", "'+'", "'-'", "'*'", "'/'", "','", "'->'", "':'",
"':='", "'#'", "'eval'", "'if'", "'case'", "'then'", "'else'", "'using'",
"'with'", "'current_date'", "'datediff'", "'dateadd'", "'getyear'", "'getmonth'",
"'dayofmonth'", "'dayofyear'", "'daytoyear'", "'daytomonth'", "'yeartoday'",
"'monthtoday'", "'on'", "'drop'", "'keep'", "'calc'", "'attrcalc'", "'rename'",
"'as'", "'and'", "'or'", "'xor'", "'not'", "'between'", "'in'", "'not_in'",
"'null'", "'isnull'", "'ex'", "'union'", "'diff'", "'symdiff'", "'intersect'",
"'random'", "'keys'", "'intyear'", "'intmonth'", "'intday'", "'check'",
"'exists_in'", "'to'", "'return'", "'imbalance'", "'errorcode'", "'all'",
"'aggr'", "'errorlevel'", "'order'", "'by'", "'rank'", "'asc'", "'desc'",
"'min'", "'max'", "'first'", "'last'", "'indexof'", "'abs'", "'key'",
"'ln'", "'log'", "'trunc'", "'round'", "'power'", "'mod'", "'length'",
"'||'", "'trim'", "'upper'", "'lower'", "'substr'", "'sum'", "'avg'",
"'median'", "'count'", "'identifier'", "'measure'", "'attribute'", "'filter'",
"'merge'", "'exp'", "'componentRole'", "'viral'", "'match_characters'",
"'type'", "'nvl'", "'hierarchy'", "'_'", "'invalid'", "'levenshtein'",
"'valuedomain'", "'variable'", "'data'", "'structure'", "'dataset'",
"'operator'", "'define'", "'<-'", "'datapoint'", "'hierarchical'", "'ruleset'",
"'rule'", "'end'", "'alterDataset'", "'ltrim'", "'rtrim'", "'instr'",
"'replace'", "'ceil'", "'floor'", "'sqrt'", "'any'", "'setdiff'", "'stddev_pop'",
"'stddev_samp'", "'var_pop'", "'var_samp'", "'group'", "'except'", "'having'",
"'first_value'", "'last_value'", "'lag'", "'lead'", "'ratio_to_report'",
"'over'", "'preceding'", "'following'", "'unbounded'", "'partition'",
"'rows'", "'range'", "'current'", "'valid'", "'fill_time_series'", "'flow_to_stock'",
"'stock_to_flow'", "'timeshift'", "'measures'", "'no_measures'", "'condition'",
"'boolean'", "'date'", "'time_period'", "'number'", "'string'", "'time'",
"'integer'", "'float'", "'list'", "'record'", "'restrict'", "'yyyy'",
"'mm'", "'dd'", "'maxLength'", "'regexp'", "'is'", "'when'", "'from'",
"'aggregates'", "'points'", "'point'", "'total'", "'partial'", "'always'",
"'inner_join'", "'left_join'", "'cross_join'", "'full_join'", "'maps_from'",
"'maps_to'", "'map_to'", "'map_from'", "'returns'", "'pivot'", "'customPivot'",
"'unpivot'", "'sub'", "'apply'", "'conditioned'", "'period_indicator'",
"'single'", "'duration'", "'time_agg'", "'unit'", "'Value'", "'valuedomains'",
"'variables'", "'input'", "'output'", "'cast'", "'rule_priority'", "'dataset_priority'",
"'default'", "'check_datapoint'", "'check_hierarchy'", "'computed'",
"'non_null'", "'non_zero'", "'partial_null'", "'partial_zero'", "'always_null'",
"'always_zero'", "'components'", "'all_measures'", "'scalar'", "'component'",
"'datapoint_on_valuedomains'", "'datapoint_on_variables'", "'hierarchical_on_valuedomains'",
"'hierarchical_on_variables'", "'set'", "'language'", null, null, null,
null, null, null, null, "';'"
};
}
private static final String[] _LITERAL_NAMES = makeLiteralNames();
private static String[] makeSymbolicNames() {
return new String[] {
null, "LPAREN", "RPAREN", "QLPAREN", "QRPAREN", "GLPAREN", "GRPAREN",
"EQ", "LT", "MT", "ME", "NEQ", "LE", "PLUS", "MINUS", "MUL", "DIV", "COMMA",
"POINTER", "COLON", "ASSIGN", "MEMBERSHIP", "EVAL", "IF", "CASE", "THEN",
"ELSE", "USING", "WITH", "CURRENT_DATE", "DATEDIFF", "DATEADD", "GETYEAR",
"GETMONTH", "DAYOFMONTH", "DAYOFYEAR", "DAYTOYEAR", "DAYTOMONTH", "YEARTODAY",
"MONTHTODAY", "ON", "DROP", "KEEP", "CALC", "ATTRCALC", "RENAME", "AS",
"AND", "OR", "XOR", "NOT", "BETWEEN", "IN", "NOT_IN", "NULL_CONSTANT",
"ISNULL", "EX", "UNION", "DIFF", "SYMDIFF", "INTERSECT", "RANDOM", "KEYS",
"INTYEAR", "INTMONTH", "INTDAY", "CHECK", "EXISTS_IN", "TO", "RETURN",
"IMBALANCE", "ERRORCODE", "ALL", "AGGREGATE", "ERRORLEVEL", "ORDER",
"BY", "RANK", "ASC", "DESC", "MIN", "MAX", "FIRST", "LAST", "INDEXOF",
"ABS", "KEY", "LN", "LOG", "TRUNC", "ROUND", "POWER", "MOD", "LEN", "CONCAT",
"TRIM", "UCASE", "LCASE", "SUBSTR", "SUM", "AVG", "MEDIAN", "COUNT",
"DIMENSION", "MEASURE", "ATTRIBUTE", "FILTER", "MERGE", "EXP", "ROLE",
"VIRAL", "CHARSET_MATCH", "TYPE", "NVL", "HIERARCHY", "OPTIONAL", "INVALID",
"LEVENSHTEIN", "VALUE_DOMAIN", "VARIABLE", "DATA", "STRUCTURE", "DATASET",
"OPERATOR", "DEFINE", "PUT_SYMBOL", "DATAPOINT", "HIERARCHICAL", "RULESET",
"RULE", "END", "ALTER_DATASET", "LTRIM", "RTRIM", "INSTR", "REPLACE",
"CEIL", "FLOOR", "SQRT", "ANY", "SETDIFF", "STDDEV_POP", "STDDEV_SAMP",
"VAR_POP", "VAR_SAMP", "GROUP", "EXCEPT", "HAVING", "FIRST_VALUE", "LAST_VALUE",
"LAG", "LEAD", "RATIO_TO_REPORT", "OVER", "PRECEDING", "FOLLOWING", "UNBOUNDED",
"PARTITION", "ROWS", "RANGE", "CURRENT", "VALID", "FILL_TIME_SERIES",
"FLOW_TO_STOCK", "STOCK_TO_FLOW", "TIMESHIFT", "MEASURES", "NO_MEASURES",
"CONDITION", "BOOLEAN", "DATE", "TIME_PERIOD", "NUMBER", "STRING", "TIME",
"INTEGER", "FLOAT", "LIST", "RECORD", "RESTRICT", "YYYY", "MM", "DD",
"MAX_LENGTH", "REGEXP", "IS", "WHEN", "FROM", "AGGREGATES", "POINTS",
"POINT", "TOTAL", "PARTIAL", "ALWAYS", "INNER_JOIN", "LEFT_JOIN", "CROSS_JOIN",
"FULL_JOIN", "MAPS_FROM", "MAPS_TO", "MAP_TO", "MAP_FROM", "RETURNS",
"PIVOT", "CUSTOMPIVOT", "UNPIVOT", "SUBSPACE", "APPLY", "CONDITIONED",
"PERIOD_INDICATOR", "SINGLE", "DURATION", "TIME_AGG", "UNIT", "VALUE",
"VALUEDOMAINS", "VARIABLES", "INPUT", "OUTPUT", "CAST", "RULE_PRIORITY",
"DATASET_PRIORITY", "DEFAULT", "CHECK_DATAPOINT", "CHECK_HIERARCHY",
"COMPUTED", "NON_NULL", "NON_ZERO", "PARTIAL_NULL", "PARTIAL_ZERO", "ALWAYS_NULL",
"ALWAYS_ZERO", "COMPONENTS", "ALL_MEASURES", "SCALAR", "COMPONENT", "DATAPOINT_ON_VD",
"DATAPOINT_ON_VAR", "HIERARCHICAL_ON_VD", "HIERARCHICAL_ON_VAR", "SET",
"LANGUAGE", "INTEGER_CONSTANT", "NUMBER_CONSTANT", "BOOLEAN_CONSTANT",
"STRING_CONSTANT", "IDENTIFIER", "TIME_UNIT", "WS", "EOL", "ML_COMMENT",
"SL_COMMENT"
};
}
private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames();
public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES);
/**
* @deprecated Use {@link #VOCABULARY} instead.
*/
@Deprecated
public static final String[] tokenNames;
static {
tokenNames = new String[_SYMBOLIC_NAMES.length];
for (int i = 0; i < tokenNames.length; i++) {
tokenNames[i] = VOCABULARY.getLiteralName(i);
if (tokenNames[i] == null) {
tokenNames[i] = VOCABULARY.getSymbolicName(i);
}
if (tokenNames[i] == null) {
tokenNames[i] = "";
}
}
}
@Override
@Deprecated
public String[] getTokenNames() {
return tokenNames;
}
@Override
public Vocabulary getVocabulary() {
return VOCABULARY;
}
@Override
public String getGrammarFileName() { return "Vtl.g4"; }
@Override
public String[] getRuleNames() { return ruleNames; }
@Override
public String getSerializedATN() { return _serializedATN; }
@Override
public ATN getATN() { return _ATN; }
public VtlParser(TokenStream input) {
super(input);
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class StartContext extends ParserRuleContext {
public TerminalNode EOF() { return getToken(VtlParser.EOF, 0); }
public List statement() {
return getRuleContexts(StatementContext.class);
}
public StatementContext statement(int i) {
return getRuleContext(StatementContext.class,i);
}
public List EOL() { return getTokens(VtlParser.EOL); }
public TerminalNode EOL(int i) {
return getToken(VtlParser.EOL, i);
}
public StartContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_start; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterStart(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitStart(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitStart(this);
else return visitor.visitChildren(this);
}
}
public final StartContext start() throws RecognitionException {
StartContext _localctx = new StartContext(_ctx, getState());
enterRule(_localctx, 0, RULE_start);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(199);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==DEFINE || _la==IDENTIFIER) {
{
{
setState(194);
statement();
setState(195);
match(EOL);
}
}
setState(201);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(202);
match(EOF);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StatementContext extends ParserRuleContext {
public StatementContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_statement; }
public StatementContext() { }
public void copyFrom(StatementContext ctx) {
super.copyFrom(ctx);
}
}
public static class DefineExpressionContext extends StatementContext {
public DefOperatorsContext defOperators() {
return getRuleContext(DefOperatorsContext.class,0);
}
public DefineExpressionContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDefineExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDefineExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDefineExpression(this);
else return visitor.visitChildren(this);
}
}
public static class TemporaryAssignmentContext extends StatementContext {
public VarIDContext varID() {
return getRuleContext(VarIDContext.class,0);
}
public TerminalNode ASSIGN() { return getToken(VtlParser.ASSIGN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TemporaryAssignmentContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterTemporaryAssignment(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitTemporaryAssignment(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitTemporaryAssignment(this);
else return visitor.visitChildren(this);
}
}
public static class PersistAssignmentContext extends StatementContext {
public VarIDContext varID() {
return getRuleContext(VarIDContext.class,0);
}
public TerminalNode PUT_SYMBOL() { return getToken(VtlParser.PUT_SYMBOL, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public PersistAssignmentContext(StatementContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterPersistAssignment(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitPersistAssignment(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitPersistAssignment(this);
else return visitor.visitChildren(this);
}
}
public final StatementContext statement() throws RecognitionException {
StatementContext _localctx = new StatementContext(_ctx, getState());
enterRule(_localctx, 2, RULE_statement);
try {
setState(213);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
case 1:
_localctx = new TemporaryAssignmentContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(204);
varID();
setState(205);
match(ASSIGN);
setState(206);
expr(0);
}
break;
case 2:
_localctx = new PersistAssignmentContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(208);
varID();
setState(209);
match(PUT_SYMBOL);
setState(210);
expr(0);
}
break;
case 3:
_localctx = new DefineExpressionContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(212);
defOperators();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ExprContext extends ParserRuleContext {
public ExprContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_expr; }
public ExprContext() { }
public void copyFrom(ExprContext ctx) {
super.copyFrom(ctx);
}
}
public static class VarIdExprContext extends ExprContext {
public VarIDContext varID() {
return getRuleContext(VarIDContext.class,0);
}
public VarIdExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterVarIdExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitVarIdExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitVarIdExpr(this);
else return visitor.visitChildren(this);
}
}
public static class MembershipExprContext extends ExprContext {
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode MEMBERSHIP() { return getToken(VtlParser.MEMBERSHIP, 0); }
public SimpleComponentIdContext simpleComponentId() {
return getRuleContext(SimpleComponentIdContext.class,0);
}
public MembershipExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterMembershipExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitMembershipExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitMembershipExpr(this);
else return visitor.visitChildren(this);
}
}
public static class InNotInExprContext extends ExprContext {
public ExprContext left;
public Token op;
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode IN() { return getToken(VtlParser.IN, 0); }
public TerminalNode NOT_IN() { return getToken(VtlParser.NOT_IN, 0); }
public ListsContext lists() {
return getRuleContext(ListsContext.class,0);
}
public ValueDomainIDContext valueDomainID() {
return getRuleContext(ValueDomainIDContext.class,0);
}
public InNotInExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterInNotInExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitInNotInExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitInNotInExpr(this);
else return visitor.visitChildren(this);
}
}
public static class BooleanExprContext extends ExprContext {
public ExprContext left;
public Token op;
public ExprContext right;
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public TerminalNode AND() { return getToken(VtlParser.AND, 0); }
public TerminalNode OR() { return getToken(VtlParser.OR, 0); }
public TerminalNode XOR() { return getToken(VtlParser.XOR, 0); }
public BooleanExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterBooleanExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitBooleanExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitBooleanExpr(this);
else return visitor.visitChildren(this);
}
}
public static class ComparisonExprContext extends ExprContext {
public ExprContext left;
public ComparisonOperandContext op;
public ExprContext right;
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public ComparisonOperandContext comparisonOperand() {
return getRuleContext(ComparisonOperandContext.class,0);
}
public ComparisonExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterComparisonExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitComparisonExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitComparisonExpr(this);
else return visitor.visitChildren(this);
}
}
public static class UnaryExprContext extends ExprContext {
public Token op;
public ExprContext right;
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode PLUS() { return getToken(VtlParser.PLUS, 0); }
public TerminalNode MINUS() { return getToken(VtlParser.MINUS, 0); }
public TerminalNode NOT() { return getToken(VtlParser.NOT, 0); }
public UnaryExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterUnaryExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitUnaryExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitUnaryExpr(this);
else return visitor.visitChildren(this);
}
}
public static class FunctionsExpressionContext extends ExprContext {
public FunctionsContext functions() {
return getRuleContext(FunctionsContext.class,0);
}
public FunctionsExpressionContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterFunctionsExpression(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitFunctionsExpression(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitFunctionsExpression(this);
else return visitor.visitChildren(this);
}
}
public static class IfExprContext extends ExprContext {
public ExprContext conditionalExpr;
public ExprContext thenExpr;
public ExprContext elseExpr;
public TerminalNode IF() { return getToken(VtlParser.IF, 0); }
public TerminalNode THEN() { return getToken(VtlParser.THEN, 0); }
public TerminalNode ELSE() { return getToken(VtlParser.ELSE, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public IfExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterIfExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitIfExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitIfExpr(this);
else return visitor.visitChildren(this);
}
}
public static class ClauseExprContext extends ExprContext {
public ExprContext dataset;
public DatasetClauseContext clause;
public TerminalNode QLPAREN() { return getToken(VtlParser.QLPAREN, 0); }
public TerminalNode QRPAREN() { return getToken(VtlParser.QRPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public DatasetClauseContext datasetClause() {
return getRuleContext(DatasetClauseContext.class,0);
}
public ClauseExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterClauseExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitClauseExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitClauseExpr(this);
else return visitor.visitChildren(this);
}
}
public static class CaseExprContext extends ExprContext {
public ExprContext whenExpr;
public ExprContext thenExpr;
public ExprContext elseExpr;
public TerminalNode CASE() { return getToken(VtlParser.CASE, 0); }
public List WHEN() { return getTokens(VtlParser.WHEN); }
public TerminalNode WHEN(int i) {
return getToken(VtlParser.WHEN, i);
}
public List THEN() { return getTokens(VtlParser.THEN); }
public TerminalNode THEN(int i) {
return getToken(VtlParser.THEN, i);
}
public TerminalNode ELSE() { return getToken(VtlParser.ELSE, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public CaseExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCaseExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCaseExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCaseExpr(this);
else return visitor.visitChildren(this);
}
}
public static class ArithmeticExprContext extends ExprContext {
public ExprContext left;
public Token op;
public ExprContext right;
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public TerminalNode MUL() { return getToken(VtlParser.MUL, 0); }
public TerminalNode DIV() { return getToken(VtlParser.DIV, 0); }
public ArithmeticExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterArithmeticExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitArithmeticExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitArithmeticExpr(this);
else return visitor.visitChildren(this);
}
}
public static class ParenthesisExprContext extends ExprContext {
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public ParenthesisExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterParenthesisExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitParenthesisExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitParenthesisExpr(this);
else return visitor.visitChildren(this);
}
}
public static class ConstantExprContext extends ExprContext {
public ConstantContext constant() {
return getRuleContext(ConstantContext.class,0);
}
public ConstantExprContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterConstantExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitConstantExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitConstantExpr(this);
else return visitor.visitChildren(this);
}
}
public static class ArithmeticExprOrConcatContext extends ExprContext {
public ExprContext left;
public Token op;
public ExprContext right;
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public TerminalNode PLUS() { return getToken(VtlParser.PLUS, 0); }
public TerminalNode MINUS() { return getToken(VtlParser.MINUS, 0); }
public TerminalNode CONCAT() { return getToken(VtlParser.CONCAT, 0); }
public ArithmeticExprOrConcatContext(ExprContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterArithmeticExprOrConcat(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitArithmeticExprOrConcat(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitArithmeticExprOrConcat(this);
else return visitor.visitChildren(this);
}
}
public final ExprContext expr() throws RecognitionException {
return expr(0);
}
private ExprContext expr(int _p) throws RecognitionException {
ParserRuleContext _parentctx = _ctx;
int _parentState = getState();
ExprContext _localctx = new ExprContext(_ctx, _parentState);
ExprContext _prevctx = _localctx;
int _startState = 4;
enterRecursionRule(_localctx, 4, RULE_expr, _p);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(250);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,3,_ctx) ) {
case 1:
{
_localctx = new ParenthesisExprContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(216);
match(LPAREN);
setState(217);
expr(0);
setState(218);
match(RPAREN);
}
break;
case 2:
{
_localctx = new FunctionsExpressionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(220);
functions();
}
break;
case 3:
{
_localctx = new UnaryExprContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(221);
((UnaryExprContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PLUS) | (1L << MINUS) | (1L << NOT))) != 0)) ) {
((UnaryExprContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(222);
((UnaryExprContext)_localctx).right = expr(11);
}
break;
case 4:
{
_localctx = new IfExprContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(223);
match(IF);
setState(224);
((IfExprContext)_localctx).conditionalExpr = expr(0);
setState(225);
match(THEN);
setState(226);
((IfExprContext)_localctx).thenExpr = expr(0);
setState(227);
match(ELSE);
setState(228);
((IfExprContext)_localctx).elseExpr = expr(4);
}
break;
case 5:
{
_localctx = new CaseExprContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(230);
match(CASE);
setState(231);
match(WHEN);
setState(232);
((CaseExprContext)_localctx).whenExpr = expr(0);
setState(233);
match(THEN);
setState(234);
((CaseExprContext)_localctx).thenExpr = expr(0);
setState(242);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==WHEN) {
{
{
setState(235);
match(WHEN);
setState(236);
((CaseExprContext)_localctx).whenExpr = expr(0);
setState(237);
match(THEN);
setState(238);
((CaseExprContext)_localctx).thenExpr = expr(0);
}
}
setState(244);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(245);
match(ELSE);
setState(246);
((CaseExprContext)_localctx).elseExpr = expr(3);
}
break;
case 6:
{
_localctx = new ConstantExprContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(248);
constant();
}
break;
case 7:
{
_localctx = new VarIdExprContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
setState(249);
varID();
}
break;
}
_ctx.stop = _input.LT(-1);
setState(284);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
_prevctx = _localctx;
{
setState(282);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,5,_ctx) ) {
case 1:
{
_localctx = new ArithmeticExprContext(new ExprContext(_parentctx, _parentState));
((ArithmeticExprContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(252);
if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)");
setState(253);
((ArithmeticExprContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==MUL || _la==DIV) ) {
((ArithmeticExprContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(254);
((ArithmeticExprContext)_localctx).right = expr(11);
}
break;
case 2:
{
_localctx = new ArithmeticExprOrConcatContext(new ExprContext(_parentctx, _parentState));
((ArithmeticExprOrConcatContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(255);
if (!(precpred(_ctx, 9))) throw new FailedPredicateException(this, "precpred(_ctx, 9)");
setState(256);
((ArithmeticExprOrConcatContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS || _la==CONCAT) ) {
((ArithmeticExprOrConcatContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(257);
((ArithmeticExprOrConcatContext)_localctx).right = expr(10);
}
break;
case 3:
{
_localctx = new ComparisonExprContext(new ExprContext(_parentctx, _parentState));
((ComparisonExprContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(258);
if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)");
setState(259);
((ComparisonExprContext)_localctx).op = comparisonOperand();
setState(260);
((ComparisonExprContext)_localctx).right = expr(9);
}
break;
case 4:
{
_localctx = new BooleanExprContext(new ExprContext(_parentctx, _parentState));
((BooleanExprContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(262);
if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)");
setState(263);
((BooleanExprContext)_localctx).op = match(AND);
setState(264);
((BooleanExprContext)_localctx).right = expr(7);
}
break;
case 5:
{
_localctx = new BooleanExprContext(new ExprContext(_parentctx, _parentState));
((BooleanExprContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(265);
if (!(precpred(_ctx, 5))) throw new FailedPredicateException(this, "precpred(_ctx, 5)");
setState(266);
((BooleanExprContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==OR || _la==XOR) ) {
((BooleanExprContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(267);
((BooleanExprContext)_localctx).right = expr(6);
}
break;
case 6:
{
_localctx = new ClauseExprContext(new ExprContext(_parentctx, _parentState));
((ClauseExprContext)_localctx).dataset = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(268);
if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)");
setState(269);
match(QLPAREN);
setState(270);
((ClauseExprContext)_localctx).clause = datasetClause();
setState(271);
match(QRPAREN);
}
break;
case 7:
{
_localctx = new MembershipExprContext(new ExprContext(_parentctx, _parentState));
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(273);
if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)");
setState(274);
match(MEMBERSHIP);
setState(275);
simpleComponentId();
}
break;
case 8:
{
_localctx = new InNotInExprContext(new ExprContext(_parentctx, _parentState));
((InNotInExprContext)_localctx).left = _prevctx;
pushNewRecursionContext(_localctx, _startState, RULE_expr);
setState(276);
if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)");
setState(277);
((InNotInExprContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==IN || _la==NOT_IN) ) {
((InNotInExprContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(280);
_errHandler.sync(this);
switch (_input.LA(1)) {
case GLPAREN:
{
setState(278);
lists();
}
break;
case IDENTIFIER:
{
setState(279);
valueDomainID();
}
break;
default:
throw new NoViableAltException(this);
}
}
break;
}
}
}
setState(286);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input,6,_ctx);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
unrollRecursionContexts(_parentctx);
}
return _localctx;
}
public static class FunctionsContext extends ParserRuleContext {
public FunctionsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_functions; }
public FunctionsContext() { }
public void copyFrom(FunctionsContext ctx) {
super.copyFrom(ctx);
}
}
public static class StringFunctionsContext extends FunctionsContext {
public StringOperatorsContext stringOperators() {
return getRuleContext(StringOperatorsContext.class,0);
}
public StringFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterStringFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitStringFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitStringFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class GenericFunctionsContext extends FunctionsContext {
public GenericOperatorsContext genericOperators() {
return getRuleContext(GenericOperatorsContext.class,0);
}
public GenericFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterGenericFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitGenericFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitGenericFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class ConditionalFunctionsContext extends FunctionsContext {
public ConditionalOperatorsContext conditionalOperators() {
return getRuleContext(ConditionalOperatorsContext.class,0);
}
public ConditionalFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterConditionalFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitConditionalFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitConditionalFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class AggregateFunctionsContext extends FunctionsContext {
public AggrOperatorsGroupingContext aggrOperatorsGrouping() {
return getRuleContext(AggrOperatorsGroupingContext.class,0);
}
public AggregateFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterAggregateFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitAggregateFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitAggregateFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class JoinFunctionsContext extends FunctionsContext {
public JoinOperatorsContext joinOperators() {
return getRuleContext(JoinOperatorsContext.class,0);
}
public JoinFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterJoinFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitJoinFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitJoinFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class TimeFunctionsContext extends FunctionsContext {
public TimeOperatorsContext timeOperators() {
return getRuleContext(TimeOperatorsContext.class,0);
}
public TimeFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterTimeFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitTimeFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitTimeFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class HierarchyFunctionsContext extends FunctionsContext {
public HierarchyOperatorsContext hierarchyOperators() {
return getRuleContext(HierarchyOperatorsContext.class,0);
}
public HierarchyFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterHierarchyFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitHierarchyFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitHierarchyFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class ValidationFunctionsContext extends FunctionsContext {
public ValidationOperatorsContext validationOperators() {
return getRuleContext(ValidationOperatorsContext.class,0);
}
public ValidationFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterValidationFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitValidationFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitValidationFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class DistanceFunctionsContext extends FunctionsContext {
public DistanceOperatorsContext distanceOperators() {
return getRuleContext(DistanceOperatorsContext.class,0);
}
public DistanceFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDistanceFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDistanceFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDistanceFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class ComparisonFunctionsContext extends FunctionsContext {
public ComparisonOperatorsContext comparisonOperators() {
return getRuleContext(ComparisonOperatorsContext.class,0);
}
public ComparisonFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterComparisonFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitComparisonFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitComparisonFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class NumericFunctionsContext extends FunctionsContext {
public NumericOperatorsContext numericOperators() {
return getRuleContext(NumericOperatorsContext.class,0);
}
public NumericFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterNumericFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitNumericFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitNumericFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class SetFunctionsContext extends FunctionsContext {
public SetOperatorsContext setOperators() {
return getRuleContext(SetOperatorsContext.class,0);
}
public SetFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterSetFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitSetFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitSetFunctions(this);
else return visitor.visitChildren(this);
}
}
public static class AnalyticFunctionsContext extends FunctionsContext {
public AnFunctionContext anFunction() {
return getRuleContext(AnFunctionContext.class,0);
}
public AnalyticFunctionsContext(FunctionsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterAnalyticFunctions(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitAnalyticFunctions(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitAnalyticFunctions(this);
else return visitor.visitChildren(this);
}
}
public final FunctionsContext functions() throws RecognitionException {
FunctionsContext _localctx = new FunctionsContext(_ctx, getState());
enterRule(_localctx, 6, RULE_functions);
try {
setState(300);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) {
case 1:
_localctx = new JoinFunctionsContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(287);
joinOperators();
}
break;
case 2:
_localctx = new GenericFunctionsContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(288);
genericOperators();
}
break;
case 3:
_localctx = new StringFunctionsContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(289);
stringOperators();
}
break;
case 4:
_localctx = new NumericFunctionsContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(290);
numericOperators();
}
break;
case 5:
_localctx = new ComparisonFunctionsContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(291);
comparisonOperators();
}
break;
case 6:
_localctx = new TimeFunctionsContext(_localctx);
enterOuterAlt(_localctx, 6);
{
setState(292);
timeOperators();
}
break;
case 7:
_localctx = new SetFunctionsContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(293);
setOperators();
}
break;
case 8:
_localctx = new HierarchyFunctionsContext(_localctx);
enterOuterAlt(_localctx, 8);
{
setState(294);
hierarchyOperators();
}
break;
case 9:
_localctx = new ValidationFunctionsContext(_localctx);
enterOuterAlt(_localctx, 9);
{
setState(295);
validationOperators();
}
break;
case 10:
_localctx = new ConditionalFunctionsContext(_localctx);
enterOuterAlt(_localctx, 10);
{
setState(296);
conditionalOperators();
}
break;
case 11:
_localctx = new AggregateFunctionsContext(_localctx);
enterOuterAlt(_localctx, 11);
{
setState(297);
aggrOperatorsGrouping();
}
break;
case 12:
_localctx = new AnalyticFunctionsContext(_localctx);
enterOuterAlt(_localctx, 12);
{
setState(298);
anFunction();
}
break;
case 13:
_localctx = new DistanceFunctionsContext(_localctx);
enterOuterAlt(_localctx, 13);
{
setState(299);
distanceOperators();
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DatasetClauseContext extends ParserRuleContext {
public RenameClauseContext renameClause() {
return getRuleContext(RenameClauseContext.class,0);
}
public AggrClauseContext aggrClause() {
return getRuleContext(AggrClauseContext.class,0);
}
public FilterClauseContext filterClause() {
return getRuleContext(FilterClauseContext.class,0);
}
public CalcClauseContext calcClause() {
return getRuleContext(CalcClauseContext.class,0);
}
public KeepOrDropClauseContext keepOrDropClause() {
return getRuleContext(KeepOrDropClauseContext.class,0);
}
public PivotOrUnpivotClauseContext pivotOrUnpivotClause() {
return getRuleContext(PivotOrUnpivotClauseContext.class,0);
}
public CustomPivotClauseContext customPivotClause() {
return getRuleContext(CustomPivotClauseContext.class,0);
}
public SubspaceClauseContext subspaceClause() {
return getRuleContext(SubspaceClauseContext.class,0);
}
public DatasetClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_datasetClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDatasetClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDatasetClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDatasetClause(this);
else return visitor.visitChildren(this);
}
}
public final DatasetClauseContext datasetClause() throws RecognitionException {
DatasetClauseContext _localctx = new DatasetClauseContext(_ctx, getState());
enterRule(_localctx, 8, RULE_datasetClause);
try {
setState(310);
_errHandler.sync(this);
switch (_input.LA(1)) {
case RENAME:
enterOuterAlt(_localctx, 1);
{
setState(302);
renameClause();
}
break;
case AGGREGATE:
enterOuterAlt(_localctx, 2);
{
setState(303);
aggrClause();
}
break;
case FILTER:
enterOuterAlt(_localctx, 3);
{
setState(304);
filterClause();
}
break;
case CALC:
enterOuterAlt(_localctx, 4);
{
setState(305);
calcClause();
}
break;
case DROP:
case KEEP:
enterOuterAlt(_localctx, 5);
{
setState(306);
keepOrDropClause();
}
break;
case PIVOT:
case UNPIVOT:
enterOuterAlt(_localctx, 6);
{
setState(307);
pivotOrUnpivotClause();
}
break;
case CUSTOMPIVOT:
enterOuterAlt(_localctx, 7);
{
setState(308);
customPivotClause();
}
break;
case SUBSPACE:
enterOuterAlt(_localctx, 8);
{
setState(309);
subspaceClause();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RenameClauseContext extends ParserRuleContext {
public TerminalNode RENAME() { return getToken(VtlParser.RENAME, 0); }
public List renameClauseItem() {
return getRuleContexts(RenameClauseItemContext.class);
}
public RenameClauseItemContext renameClauseItem(int i) {
return getRuleContext(RenameClauseItemContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public RenameClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_renameClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRenameClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRenameClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRenameClause(this);
else return visitor.visitChildren(this);
}
}
public final RenameClauseContext renameClause() throws RecognitionException {
RenameClauseContext _localctx = new RenameClauseContext(_ctx, getState());
enterRule(_localctx, 10, RULE_renameClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(312);
match(RENAME);
setState(313);
renameClauseItem();
setState(318);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(314);
match(COMMA);
setState(315);
renameClauseItem();
}
}
setState(320);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AggrClauseContext extends ParserRuleContext {
public TerminalNode AGGREGATE() { return getToken(VtlParser.AGGREGATE, 0); }
public AggregateClauseContext aggregateClause() {
return getRuleContext(AggregateClauseContext.class,0);
}
public GroupingClauseContext groupingClause() {
return getRuleContext(GroupingClauseContext.class,0);
}
public HavingClauseContext havingClause() {
return getRuleContext(HavingClauseContext.class,0);
}
public AggrClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_aggrClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterAggrClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitAggrClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitAggrClause(this);
else return visitor.visitChildren(this);
}
}
public final AggrClauseContext aggrClause() throws RecognitionException {
AggrClauseContext _localctx = new AggrClauseContext(_ctx, getState());
enterRule(_localctx, 12, RULE_aggrClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(321);
match(AGGREGATE);
setState(322);
aggregateClause();
setState(327);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GROUP) {
{
setState(323);
groupingClause();
setState(325);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==HAVING) {
{
setState(324);
havingClause();
}
}
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class FilterClauseContext extends ParserRuleContext {
public TerminalNode FILTER() { return getToken(VtlParser.FILTER, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public FilterClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_filterClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterFilterClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitFilterClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitFilterClause(this);
else return visitor.visitChildren(this);
}
}
public final FilterClauseContext filterClause() throws RecognitionException {
FilterClauseContext _localctx = new FilterClauseContext(_ctx, getState());
enterRule(_localctx, 14, RULE_filterClause);
try {
enterOuterAlt(_localctx, 1);
{
setState(329);
match(FILTER);
setState(330);
expr(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CalcClauseContext extends ParserRuleContext {
public TerminalNode CALC() { return getToken(VtlParser.CALC, 0); }
public List calcClauseItem() {
return getRuleContexts(CalcClauseItemContext.class);
}
public CalcClauseItemContext calcClauseItem(int i) {
return getRuleContext(CalcClauseItemContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public CalcClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_calcClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCalcClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCalcClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCalcClause(this);
else return visitor.visitChildren(this);
}
}
public final CalcClauseContext calcClause() throws RecognitionException {
CalcClauseContext _localctx = new CalcClauseContext(_ctx, getState());
enterRule(_localctx, 16, RULE_calcClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(332);
match(CALC);
setState(333);
calcClauseItem();
setState(338);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(334);
match(COMMA);
setState(335);
calcClauseItem();
}
}
setState(340);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class KeepOrDropClauseContext extends ParserRuleContext {
public Token op;
public List componentID() {
return getRuleContexts(ComponentIDContext.class);
}
public ComponentIDContext componentID(int i) {
return getRuleContext(ComponentIDContext.class,i);
}
public TerminalNode KEEP() { return getToken(VtlParser.KEEP, 0); }
public TerminalNode DROP() { return getToken(VtlParser.DROP, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public KeepOrDropClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_keepOrDropClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterKeepOrDropClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitKeepOrDropClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitKeepOrDropClause(this);
else return visitor.visitChildren(this);
}
}
public final KeepOrDropClauseContext keepOrDropClause() throws RecognitionException {
KeepOrDropClauseContext _localctx = new KeepOrDropClauseContext(_ctx, getState());
enterRule(_localctx, 18, RULE_keepOrDropClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(341);
((KeepOrDropClauseContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==DROP || _la==KEEP) ) {
((KeepOrDropClauseContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(342);
componentID();
setState(347);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(343);
match(COMMA);
setState(344);
componentID();
}
}
setState(349);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PivotOrUnpivotClauseContext extends ParserRuleContext {
public Token op;
public ComponentIDContext id_;
public ComponentIDContext mea;
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public List componentID() {
return getRuleContexts(ComponentIDContext.class);
}
public ComponentIDContext componentID(int i) {
return getRuleContext(ComponentIDContext.class,i);
}
public TerminalNode PIVOT() { return getToken(VtlParser.PIVOT, 0); }
public TerminalNode UNPIVOT() { return getToken(VtlParser.UNPIVOT, 0); }
public PivotOrUnpivotClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_pivotOrUnpivotClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterPivotOrUnpivotClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitPivotOrUnpivotClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitPivotOrUnpivotClause(this);
else return visitor.visitChildren(this);
}
}
public final PivotOrUnpivotClauseContext pivotOrUnpivotClause() throws RecognitionException {
PivotOrUnpivotClauseContext _localctx = new PivotOrUnpivotClauseContext(_ctx, getState());
enterRule(_localctx, 20, RULE_pivotOrUnpivotClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(350);
((PivotOrUnpivotClauseContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PIVOT || _la==UNPIVOT) ) {
((PivotOrUnpivotClauseContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(351);
((PivotOrUnpivotClauseContext)_localctx).id_ = componentID();
setState(352);
match(COMMA);
setState(353);
((PivotOrUnpivotClauseContext)_localctx).mea = componentID();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CustomPivotClauseContext extends ParserRuleContext {
public ComponentIDContext id_;
public ComponentIDContext mea;
public TerminalNode CUSTOMPIVOT() { return getToken(VtlParser.CUSTOMPIVOT, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode IN() { return getToken(VtlParser.IN, 0); }
public List constant() {
return getRuleContexts(ConstantContext.class);
}
public ConstantContext constant(int i) {
return getRuleContext(ConstantContext.class,i);
}
public List componentID() {
return getRuleContexts(ComponentIDContext.class);
}
public ComponentIDContext componentID(int i) {
return getRuleContext(ComponentIDContext.class,i);
}
public CustomPivotClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_customPivotClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCustomPivotClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCustomPivotClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCustomPivotClause(this);
else return visitor.visitChildren(this);
}
}
public final CustomPivotClauseContext customPivotClause() throws RecognitionException {
CustomPivotClauseContext _localctx = new CustomPivotClauseContext(_ctx, getState());
enterRule(_localctx, 22, RULE_customPivotClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(355);
match(CUSTOMPIVOT);
setState(356);
((CustomPivotClauseContext)_localctx).id_ = componentID();
setState(357);
match(COMMA);
setState(358);
((CustomPivotClauseContext)_localctx).mea = componentID();
setState(359);
match(IN);
setState(360);
constant();
setState(365);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(361);
match(COMMA);
setState(362);
constant();
}
}
setState(367);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SubspaceClauseContext extends ParserRuleContext {
public TerminalNode SUBSPACE() { return getToken(VtlParser.SUBSPACE, 0); }
public List subspaceClauseItem() {
return getRuleContexts(SubspaceClauseItemContext.class);
}
public SubspaceClauseItemContext subspaceClauseItem(int i) {
return getRuleContext(SubspaceClauseItemContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public SubspaceClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_subspaceClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterSubspaceClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitSubspaceClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitSubspaceClause(this);
else return visitor.visitChildren(this);
}
}
public final SubspaceClauseContext subspaceClause() throws RecognitionException {
SubspaceClauseContext _localctx = new SubspaceClauseContext(_ctx, getState());
enterRule(_localctx, 24, RULE_subspaceClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(368);
match(SUBSPACE);
setState(369);
subspaceClauseItem();
setState(374);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(370);
match(COMMA);
setState(371);
subspaceClauseItem();
}
}
setState(376);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class JoinOperatorsContext extends ParserRuleContext {
public JoinOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_joinOperators; }
public JoinOperatorsContext() { }
public void copyFrom(JoinOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class JoinExprContext extends JoinOperatorsContext {
public Token joinKeyword;
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public JoinClauseContext joinClause() {
return getRuleContext(JoinClauseContext.class,0);
}
public JoinBodyContext joinBody() {
return getRuleContext(JoinBodyContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode INNER_JOIN() { return getToken(VtlParser.INNER_JOIN, 0); }
public TerminalNode LEFT_JOIN() { return getToken(VtlParser.LEFT_JOIN, 0); }
public JoinClauseWithoutUsingContext joinClauseWithoutUsing() {
return getRuleContext(JoinClauseWithoutUsingContext.class,0);
}
public TerminalNode FULL_JOIN() { return getToken(VtlParser.FULL_JOIN, 0); }
public TerminalNode CROSS_JOIN() { return getToken(VtlParser.CROSS_JOIN, 0); }
public JoinExprContext(JoinOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterJoinExpr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitJoinExpr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitJoinExpr(this);
else return visitor.visitChildren(this);
}
}
public final JoinOperatorsContext joinOperators() throws RecognitionException {
JoinOperatorsContext _localctx = new JoinOperatorsContext(_ctx, getState());
enterRule(_localctx, 26, RULE_joinOperators);
int _la;
try {
setState(389);
_errHandler.sync(this);
switch (_input.LA(1)) {
case INNER_JOIN:
case LEFT_JOIN:
_localctx = new JoinExprContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(377);
((JoinExprContext)_localctx).joinKeyword = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==INNER_JOIN || _la==LEFT_JOIN) ) {
((JoinExprContext)_localctx).joinKeyword = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(378);
match(LPAREN);
setState(379);
joinClause();
setState(380);
joinBody();
setState(381);
match(RPAREN);
}
break;
case CROSS_JOIN:
case FULL_JOIN:
_localctx = new JoinExprContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(383);
((JoinExprContext)_localctx).joinKeyword = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==CROSS_JOIN || _la==FULL_JOIN) ) {
((JoinExprContext)_localctx).joinKeyword = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(384);
match(LPAREN);
setState(385);
joinClauseWithoutUsing();
setState(386);
joinBody();
setState(387);
match(RPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DefOperatorsContext extends ParserRuleContext {
public DefOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_defOperators; }
public DefOperatorsContext() { }
public void copyFrom(DefOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class DefOperatorContext extends DefOperatorsContext {
public TerminalNode DEFINE() { return getToken(VtlParser.DEFINE, 0); }
public List OPERATOR() { return getTokens(VtlParser.OPERATOR); }
public TerminalNode OPERATOR(int i) {
return getToken(VtlParser.OPERATOR, i);
}
public OperatorIDContext operatorID() {
return getRuleContext(OperatorIDContext.class,0);
}
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode IS() { return getToken(VtlParser.IS, 0); }
public TerminalNode END() { return getToken(VtlParser.END, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public List parameterItem() {
return getRuleContexts(ParameterItemContext.class);
}
public ParameterItemContext parameterItem(int i) {
return getRuleContext(ParameterItemContext.class,i);
}
public TerminalNode RETURNS() { return getToken(VtlParser.RETURNS, 0); }
public OutputParameterTypeContext outputParameterType() {
return getRuleContext(OutputParameterTypeContext.class,0);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public DefOperatorContext(DefOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDefOperator(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDefOperator(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDefOperator(this);
else return visitor.visitChildren(this);
}
}
public static class DefHierarchicalContext extends DefOperatorsContext {
public TerminalNode DEFINE() { return getToken(VtlParser.DEFINE, 0); }
public List HIERARCHICAL() { return getTokens(VtlParser.HIERARCHICAL); }
public TerminalNode HIERARCHICAL(int i) {
return getToken(VtlParser.HIERARCHICAL, i);
}
public List RULESET() { return getTokens(VtlParser.RULESET); }
public TerminalNode RULESET(int i) {
return getToken(VtlParser.RULESET, i);
}
public RulesetIDContext rulesetID() {
return getRuleContext(RulesetIDContext.class,0);
}
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public HierRuleSignatureContext hierRuleSignature() {
return getRuleContext(HierRuleSignatureContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode IS() { return getToken(VtlParser.IS, 0); }
public RuleClauseHierarchicalContext ruleClauseHierarchical() {
return getRuleContext(RuleClauseHierarchicalContext.class,0);
}
public TerminalNode END() { return getToken(VtlParser.END, 0); }
public DefHierarchicalContext(DefOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDefHierarchical(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDefHierarchical(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDefHierarchical(this);
else return visitor.visitChildren(this);
}
}
public static class DefDatapointRulesetContext extends DefOperatorsContext {
public TerminalNode DEFINE() { return getToken(VtlParser.DEFINE, 0); }
public List DATAPOINT() { return getTokens(VtlParser.DATAPOINT); }
public TerminalNode DATAPOINT(int i) {
return getToken(VtlParser.DATAPOINT, i);
}
public List RULESET() { return getTokens(VtlParser.RULESET); }
public TerminalNode RULESET(int i) {
return getToken(VtlParser.RULESET, i);
}
public RulesetIDContext rulesetID() {
return getRuleContext(RulesetIDContext.class,0);
}
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public RulesetSignatureContext rulesetSignature() {
return getRuleContext(RulesetSignatureContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode IS() { return getToken(VtlParser.IS, 0); }
public RuleClauseDatapointContext ruleClauseDatapoint() {
return getRuleContext(RuleClauseDatapointContext.class,0);
}
public TerminalNode END() { return getToken(VtlParser.END, 0); }
public DefDatapointRulesetContext(DefOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDefDatapointRuleset(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDefDatapointRuleset(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDefDatapointRuleset(this);
else return visitor.visitChildren(this);
}
}
public final DefOperatorsContext defOperators() throws RecognitionException {
DefOperatorsContext _localctx = new DefOperatorsContext(_ctx, getState());
enterRule(_localctx, 28, RULE_defOperators);
int _la;
try {
setState(441);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) {
case 1:
_localctx = new DefOperatorContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(391);
match(DEFINE);
setState(392);
match(OPERATOR);
setState(393);
operatorID();
setState(394);
match(LPAREN);
setState(403);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IDENTIFIER) {
{
setState(395);
parameterItem();
setState(400);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(396);
match(COMMA);
setState(397);
parameterItem();
}
}
setState(402);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(405);
match(RPAREN);
setState(408);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RETURNS) {
{
setState(406);
match(RETURNS);
setState(407);
outputParameterType();
}
}
setState(410);
match(IS);
{
setState(411);
expr(0);
}
setState(412);
match(END);
setState(413);
match(OPERATOR);
}
break;
case 2:
_localctx = new DefDatapointRulesetContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(415);
match(DEFINE);
setState(416);
match(DATAPOINT);
setState(417);
match(RULESET);
setState(418);
rulesetID();
setState(419);
match(LPAREN);
setState(420);
rulesetSignature();
setState(421);
match(RPAREN);
setState(422);
match(IS);
setState(423);
ruleClauseDatapoint();
setState(424);
match(END);
setState(425);
match(DATAPOINT);
setState(426);
match(RULESET);
}
break;
case 3:
_localctx = new DefHierarchicalContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(428);
match(DEFINE);
setState(429);
match(HIERARCHICAL);
setState(430);
match(RULESET);
setState(431);
rulesetID();
setState(432);
match(LPAREN);
setState(433);
hierRuleSignature();
setState(434);
match(RPAREN);
setState(435);
match(IS);
setState(436);
ruleClauseHierarchical();
setState(437);
match(END);
setState(438);
match(HIERARCHICAL);
setState(439);
match(RULESET);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class GenericOperatorsContext extends ParserRuleContext {
public GenericOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_genericOperators; }
public GenericOperatorsContext() { }
public void copyFrom(GenericOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class EvalAtomContext extends GenericOperatorsContext {
public TerminalNode EVAL() { return getToken(VtlParser.EVAL, 0); }
public List LPAREN() { return getTokens(VtlParser.LPAREN); }
public TerminalNode LPAREN(int i) {
return getToken(VtlParser.LPAREN, i);
}
public RoutineNameContext routineName() {
return getRuleContext(RoutineNameContext.class,0);
}
public List RPAREN() { return getTokens(VtlParser.RPAREN); }
public TerminalNode RPAREN(int i) {
return getToken(VtlParser.RPAREN, i);
}
public List varID() {
return getRuleContexts(VarIDContext.class);
}
public VarIDContext varID(int i) {
return getRuleContext(VarIDContext.class,i);
}
public List constant() {
return getRuleContexts(ConstantContext.class);
}
public ConstantContext constant(int i) {
return getRuleContext(ConstantContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode LANGUAGE() { return getToken(VtlParser.LANGUAGE, 0); }
public TerminalNode STRING_CONSTANT() { return getToken(VtlParser.STRING_CONSTANT, 0); }
public TerminalNode RETURNS() { return getToken(VtlParser.RETURNS, 0); }
public DatasetTypeContext datasetType() {
return getRuleContext(DatasetTypeContext.class,0);
}
public EvalAtomContext(GenericOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterEvalAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitEvalAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitEvalAtom(this);
else return visitor.visitChildren(this);
}
}
public static class CastExprDatasetContext extends GenericOperatorsContext {
public TerminalNode CAST() { return getToken(VtlParser.CAST, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public BasicScalarTypeContext basicScalarType() {
return getRuleContext(BasicScalarTypeContext.class,0);
}
public ValueDomainNameContext valueDomainName() {
return getRuleContext(ValueDomainNameContext.class,0);
}
public TerminalNode STRING_CONSTANT() { return getToken(VtlParser.STRING_CONSTANT, 0); }
public CastExprDatasetContext(GenericOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCastExprDataset(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCastExprDataset(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCastExprDataset(this);
else return visitor.visitChildren(this);
}
}
public static class CallDatasetContext extends GenericOperatorsContext {
public OperatorIDContext operatorID() {
return getRuleContext(OperatorIDContext.class,0);
}
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List parameter() {
return getRuleContexts(ParameterContext.class);
}
public ParameterContext parameter(int i) {
return getRuleContext(ParameterContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public CallDatasetContext(GenericOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCallDataset(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCallDataset(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCallDataset(this);
else return visitor.visitChildren(this);
}
}
public final GenericOperatorsContext genericOperators() throws RecognitionException {
GenericOperatorsContext _localctx = new GenericOperatorsContext(_ctx, getState());
enterRule(_localctx, 30, RULE_genericOperators);
int _la;
try {
setState(500);
_errHandler.sync(this);
switch (_input.LA(1)) {
case IDENTIFIER:
_localctx = new CallDatasetContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(443);
operatorID();
setState(444);
match(LPAREN);
setState(453);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NULL_CONSTANT || _la==OPTIONAL || ((((_la - 242)) & ~0x3f) == 0 && ((1L << (_la - 242)) & ((1L << (INTEGER_CONSTANT - 242)) | (1L << (NUMBER_CONSTANT - 242)) | (1L << (BOOLEAN_CONSTANT - 242)) | (1L << (STRING_CONSTANT - 242)) | (1L << (IDENTIFIER - 242)))) != 0)) {
{
setState(445);
parameter();
setState(450);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(446);
match(COMMA);
setState(447);
parameter();
}
}
setState(452);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(455);
match(RPAREN);
}
break;
case EVAL:
_localctx = new EvalAtomContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(457);
match(EVAL);
setState(458);
match(LPAREN);
setState(459);
routineName();
setState(460);
match(LPAREN);
setState(463);
_errHandler.sync(this);
switch (_input.LA(1)) {
case IDENTIFIER:
{
setState(461);
varID();
}
break;
case NULL_CONSTANT:
case INTEGER_CONSTANT:
case NUMBER_CONSTANT:
case BOOLEAN_CONSTANT:
case STRING_CONSTANT:
{
setState(462);
constant();
}
break;
case RPAREN:
case COMMA:
break;
default:
break;
}
setState(472);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(465);
match(COMMA);
setState(468);
_errHandler.sync(this);
switch (_input.LA(1)) {
case IDENTIFIER:
{
setState(466);
varID();
}
break;
case NULL_CONSTANT:
case INTEGER_CONSTANT:
case NUMBER_CONSTANT:
case BOOLEAN_CONSTANT:
case STRING_CONSTANT:
{
setState(467);
constant();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
setState(474);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(475);
match(RPAREN);
setState(478);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LANGUAGE) {
{
setState(476);
match(LANGUAGE);
setState(477);
match(STRING_CONSTANT);
}
}
setState(482);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RETURNS) {
{
setState(480);
match(RETURNS);
setState(481);
datasetType();
}
}
setState(484);
match(RPAREN);
}
break;
case CAST:
_localctx = new CastExprDatasetContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(486);
match(CAST);
setState(487);
match(LPAREN);
setState(488);
expr(0);
setState(489);
match(COMMA);
setState(492);
_errHandler.sync(this);
switch (_input.LA(1)) {
case BOOLEAN:
case DATE:
case TIME_PERIOD:
case NUMBER:
case STRING:
case TIME:
case INTEGER:
case DURATION:
case SCALAR:
{
setState(490);
basicScalarType();
}
break;
case IDENTIFIER:
{
setState(491);
valueDomainName();
}
break;
default:
throw new NoViableAltException(this);
}
setState(496);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
setState(494);
match(COMMA);
setState(495);
match(STRING_CONSTANT);
}
}
setState(498);
match(RPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ParameterContext extends ParserRuleContext {
public VarIDContext varID() {
return getRuleContext(VarIDContext.class,0);
}
public ConstantContext constant() {
return getRuleContext(ConstantContext.class,0);
}
public TerminalNode OPTIONAL() { return getToken(VtlParser.OPTIONAL, 0); }
public ParameterContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parameter; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterParameter(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitParameter(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitParameter(this);
else return visitor.visitChildren(this);
}
}
public final ParameterContext parameter() throws RecognitionException {
ParameterContext _localctx = new ParameterContext(_ctx, getState());
enterRule(_localctx, 32, RULE_parameter);
try {
setState(505);
_errHandler.sync(this);
switch (_input.LA(1)) {
case IDENTIFIER:
enterOuterAlt(_localctx, 1);
{
setState(502);
varID();
}
break;
case NULL_CONSTANT:
case INTEGER_CONSTANT:
case NUMBER_CONSTANT:
case BOOLEAN_CONSTANT:
case STRING_CONSTANT:
enterOuterAlt(_localctx, 2);
{
setState(503);
constant();
}
break;
case OPTIONAL:
enterOuterAlt(_localctx, 3);
{
setState(504);
match(OPTIONAL);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class StringOperatorsContext extends ParserRuleContext {
public StringOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_stringOperators; }
public StringOperatorsContext() { }
public void copyFrom(StringOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class InstrAtomContext extends StringOperatorsContext {
public ExprContext pattern;
public OptionalExprContext startParameter;
public OptionalExprContext occurrenceParameter;
public TerminalNode INSTR() { return getToken(VtlParser.INSTR, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List optionalExpr() {
return getRuleContexts(OptionalExprContext.class);
}
public OptionalExprContext optionalExpr(int i) {
return getRuleContext(OptionalExprContext.class,i);
}
public InstrAtomContext(StringOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterInstrAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitInstrAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitInstrAtom(this);
else return visitor.visitChildren(this);
}
}
public static class UnaryStringFunctionContext extends StringOperatorsContext {
public Token op;
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode TRIM() { return getToken(VtlParser.TRIM, 0); }
public TerminalNode LTRIM() { return getToken(VtlParser.LTRIM, 0); }
public TerminalNode RTRIM() { return getToken(VtlParser.RTRIM, 0); }
public TerminalNode UCASE() { return getToken(VtlParser.UCASE, 0); }
public TerminalNode LCASE() { return getToken(VtlParser.LCASE, 0); }
public TerminalNode LEN() { return getToken(VtlParser.LEN, 0); }
public UnaryStringFunctionContext(StringOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterUnaryStringFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitUnaryStringFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitUnaryStringFunction(this);
else return visitor.visitChildren(this);
}
}
public static class SubstrAtomContext extends StringOperatorsContext {
public OptionalExprContext startParameter;
public OptionalExprContext endParameter;
public TerminalNode SUBSTR() { return getToken(VtlParser.SUBSTR, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public List optionalExpr() {
return getRuleContexts(OptionalExprContext.class);
}
public OptionalExprContext optionalExpr(int i) {
return getRuleContext(OptionalExprContext.class,i);
}
public SubstrAtomContext(StringOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterSubstrAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitSubstrAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitSubstrAtom(this);
else return visitor.visitChildren(this);
}
}
public static class ReplaceAtomContext extends StringOperatorsContext {
public ExprContext param;
public TerminalNode REPLACE() { return getToken(VtlParser.REPLACE, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public OptionalExprContext optionalExpr() {
return getRuleContext(OptionalExprContext.class,0);
}
public ReplaceAtomContext(StringOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterReplaceAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitReplaceAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitReplaceAtom(this);
else return visitor.visitChildren(this);
}
}
public final StringOperatorsContext stringOperators() throws RecognitionException {
StringOperatorsContext _localctx = new StringOperatorsContext(_ctx, getState());
enterRule(_localctx, 34, RULE_stringOperators);
int _la;
try {
setState(555);
_errHandler.sync(this);
switch (_input.LA(1)) {
case LEN:
case TRIM:
case UCASE:
case LCASE:
case LTRIM:
case RTRIM:
_localctx = new UnaryStringFunctionContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(507);
((UnaryStringFunctionContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(((((_la - 93)) & ~0x3f) == 0 && ((1L << (_la - 93)) & ((1L << (LEN - 93)) | (1L << (TRIM - 93)) | (1L << (UCASE - 93)) | (1L << (LCASE - 93)) | (1L << (LTRIM - 93)) | (1L << (RTRIM - 93)))) != 0)) ) {
((UnaryStringFunctionContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(508);
match(LPAREN);
setState(509);
expr(0);
setState(510);
match(RPAREN);
}
break;
case SUBSTR:
_localctx = new SubstrAtomContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(512);
match(SUBSTR);
setState(513);
match(LPAREN);
setState(514);
expr(0);
setState(525);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,33,_ctx) ) {
case 1:
{
setState(521);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
{
setState(515);
match(COMMA);
setState(516);
((SubstrAtomContext)_localctx).startParameter = optionalExpr();
}
{
setState(518);
match(COMMA);
setState(519);
((SubstrAtomContext)_localctx).endParameter = optionalExpr();
}
}
}
}
break;
case 2:
{
setState(523);
match(COMMA);
setState(524);
((SubstrAtomContext)_localctx).startParameter = optionalExpr();
}
break;
}
setState(527);
match(RPAREN);
}
break;
case REPLACE:
_localctx = new ReplaceAtomContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(529);
match(REPLACE);
setState(530);
match(LPAREN);
setState(531);
expr(0);
setState(532);
match(COMMA);
setState(533);
((ReplaceAtomContext)_localctx).param = expr(0);
setState(536);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
setState(534);
match(COMMA);
setState(535);
optionalExpr();
}
}
setState(538);
match(RPAREN);
}
break;
case INSTR:
_localctx = new InstrAtomContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(540);
match(INSTR);
setState(541);
match(LPAREN);
setState(542);
expr(0);
setState(543);
match(COMMA);
setState(544);
((InstrAtomContext)_localctx).pattern = expr(0);
setState(547);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,35,_ctx) ) {
case 1:
{
setState(545);
match(COMMA);
setState(546);
((InstrAtomContext)_localctx).startParameter = optionalExpr();
}
break;
}
setState(551);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
setState(549);
match(COMMA);
setState(550);
((InstrAtomContext)_localctx).occurrenceParameter = optionalExpr();
}
}
setState(553);
match(RPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class NumericOperatorsContext extends ParserRuleContext {
public NumericOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_numericOperators; }
public NumericOperatorsContext() { }
public void copyFrom(NumericOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class UnaryNumericContext extends NumericOperatorsContext {
public Token op;
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode CEIL() { return getToken(VtlParser.CEIL, 0); }
public TerminalNode FLOOR() { return getToken(VtlParser.FLOOR, 0); }
public TerminalNode ABS() { return getToken(VtlParser.ABS, 0); }
public TerminalNode EXP() { return getToken(VtlParser.EXP, 0); }
public TerminalNode LN() { return getToken(VtlParser.LN, 0); }
public TerminalNode SQRT() { return getToken(VtlParser.SQRT, 0); }
public UnaryNumericContext(NumericOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterUnaryNumeric(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitUnaryNumeric(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitUnaryNumeric(this);
else return visitor.visitChildren(this);
}
}
public static class UnaryWithOptionalNumericContext extends NumericOperatorsContext {
public Token op;
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode ROUND() { return getToken(VtlParser.ROUND, 0); }
public TerminalNode TRUNC() { return getToken(VtlParser.TRUNC, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public OptionalExprContext optionalExpr() {
return getRuleContext(OptionalExprContext.class,0);
}
public UnaryWithOptionalNumericContext(NumericOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterUnaryWithOptionalNumeric(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitUnaryWithOptionalNumeric(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitUnaryWithOptionalNumeric(this);
else return visitor.visitChildren(this);
}
}
public static class BinaryNumericContext extends NumericOperatorsContext {
public Token op;
public ExprContext left;
public ExprContext right;
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public TerminalNode MOD() { return getToken(VtlParser.MOD, 0); }
public TerminalNode POWER() { return getToken(VtlParser.POWER, 0); }
public TerminalNode LOG() { return getToken(VtlParser.LOG, 0); }
public TerminalNode RANDOM() { return getToken(VtlParser.RANDOM, 0); }
public BinaryNumericContext(NumericOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterBinaryNumeric(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitBinaryNumeric(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitBinaryNumeric(this);
else return visitor.visitChildren(this);
}
}
public final NumericOperatorsContext numericOperators() throws RecognitionException {
NumericOperatorsContext _localctx = new NumericOperatorsContext(_ctx, getState());
enterRule(_localctx, 36, RULE_numericOperators);
int _la;
try {
setState(578);
_errHandler.sync(this);
switch (_input.LA(1)) {
case ABS:
case LN:
case EXP:
case CEIL:
case FLOOR:
case SQRT:
_localctx = new UnaryNumericContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(557);
((UnaryNumericContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(((((_la - 85)) & ~0x3f) == 0 && ((1L << (_la - 85)) & ((1L << (ABS - 85)) | (1L << (LN - 85)) | (1L << (EXP - 85)) | (1L << (CEIL - 85)) | (1L << (FLOOR - 85)) | (1L << (SQRT - 85)))) != 0)) ) {
((UnaryNumericContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(558);
match(LPAREN);
setState(559);
expr(0);
setState(560);
match(RPAREN);
}
break;
case TRUNC:
case ROUND:
_localctx = new UnaryWithOptionalNumericContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(562);
((UnaryWithOptionalNumericContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==TRUNC || _la==ROUND) ) {
((UnaryWithOptionalNumericContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(563);
match(LPAREN);
setState(564);
expr(0);
setState(567);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
setState(565);
match(COMMA);
setState(566);
optionalExpr();
}
}
setState(569);
match(RPAREN);
}
break;
case RANDOM:
case LOG:
case POWER:
case MOD:
_localctx = new BinaryNumericContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(571);
((BinaryNumericContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(((((_la - 61)) & ~0x3f) == 0 && ((1L << (_la - 61)) & ((1L << (RANDOM - 61)) | (1L << (LOG - 61)) | (1L << (POWER - 61)) | (1L << (MOD - 61)))) != 0)) ) {
((BinaryNumericContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(572);
match(LPAREN);
setState(573);
((BinaryNumericContext)_localctx).left = expr(0);
setState(574);
match(COMMA);
setState(575);
((BinaryNumericContext)_localctx).right = expr(0);
setState(576);
match(RPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ComparisonOperatorsContext extends ParserRuleContext {
public ComparisonOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_comparisonOperators; }
public ComparisonOperatorsContext() { }
public void copyFrom(ComparisonOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class BetweenAtomContext extends ComparisonOperatorsContext {
public ExprContext op;
public ExprContext from_;
public ExprContext to_;
public TerminalNode BETWEEN() { return getToken(VtlParser.BETWEEN, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public BetweenAtomContext(ComparisonOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterBetweenAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitBetweenAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitBetweenAtom(this);
else return visitor.visitChildren(this);
}
}
public static class CharsetMatchAtomContext extends ComparisonOperatorsContext {
public ExprContext op;
public ExprContext pattern;
public TerminalNode CHARSET_MATCH() { return getToken(VtlParser.CHARSET_MATCH, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public CharsetMatchAtomContext(ComparisonOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCharsetMatchAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCharsetMatchAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCharsetMatchAtom(this);
else return visitor.visitChildren(this);
}
}
public static class IsNullAtomContext extends ComparisonOperatorsContext {
public TerminalNode ISNULL() { return getToken(VtlParser.ISNULL, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public IsNullAtomContext(ComparisonOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterIsNullAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitIsNullAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitIsNullAtom(this);
else return visitor.visitChildren(this);
}
}
public static class ExistInAtomContext extends ComparisonOperatorsContext {
public ExprContext left;
public ExprContext right;
public TerminalNode EXISTS_IN() { return getToken(VtlParser.EXISTS_IN, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public RetainTypeContext retainType() {
return getRuleContext(RetainTypeContext.class,0);
}
public ExistInAtomContext(ComparisonOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterExistInAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitExistInAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitExistInAtom(this);
else return visitor.visitChildren(this);
}
}
public final ComparisonOperatorsContext comparisonOperators() throws RecognitionException {
ComparisonOperatorsContext _localctx = new ComparisonOperatorsContext(_ctx, getState());
enterRule(_localctx, 38, RULE_comparisonOperators);
int _la;
try {
setState(612);
_errHandler.sync(this);
switch (_input.LA(1)) {
case BETWEEN:
_localctx = new BetweenAtomContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(580);
match(BETWEEN);
setState(581);
match(LPAREN);
setState(582);
((BetweenAtomContext)_localctx).op = expr(0);
setState(583);
match(COMMA);
setState(584);
((BetweenAtomContext)_localctx).from_ = expr(0);
setState(585);
match(COMMA);
setState(586);
((BetweenAtomContext)_localctx).to_ = expr(0);
setState(587);
match(RPAREN);
}
break;
case CHARSET_MATCH:
_localctx = new CharsetMatchAtomContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(589);
match(CHARSET_MATCH);
setState(590);
match(LPAREN);
setState(591);
((CharsetMatchAtomContext)_localctx).op = expr(0);
setState(592);
match(COMMA);
setState(593);
((CharsetMatchAtomContext)_localctx).pattern = expr(0);
setState(594);
match(RPAREN);
}
break;
case ISNULL:
_localctx = new IsNullAtomContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(596);
match(ISNULL);
setState(597);
match(LPAREN);
setState(598);
expr(0);
setState(599);
match(RPAREN);
}
break;
case EXISTS_IN:
_localctx = new ExistInAtomContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(601);
match(EXISTS_IN);
setState(602);
match(LPAREN);
setState(603);
((ExistInAtomContext)_localctx).left = expr(0);
setState(604);
match(COMMA);
setState(605);
((ExistInAtomContext)_localctx).right = expr(0);
setState(608);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
setState(606);
match(COMMA);
setState(607);
retainType();
}
}
setState(610);
match(RPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class TimeOperatorsContext extends ParserRuleContext {
public TimeOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_timeOperators; }
public TimeOperatorsContext() { }
public void copyFrom(TimeOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class DayToYearAtomContext extends TimeOperatorsContext {
public TerminalNode DAYTOYEAR() { return getToken(VtlParser.DAYTOYEAR, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public DayToYearAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDayToYearAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDayToYearAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDayToYearAtom(this);
else return visitor.visitChildren(this);
}
}
public static class YearAtomContext extends TimeOperatorsContext {
public TerminalNode GETYEAR() { return getToken(VtlParser.GETYEAR, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public YearAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterYearAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitYearAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitYearAtom(this);
else return visitor.visitChildren(this);
}
}
public static class YearTodayAtomContext extends TimeOperatorsContext {
public TerminalNode YEARTODAY() { return getToken(VtlParser.YEARTODAY, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public YearTodayAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterYearTodayAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitYearTodayAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitYearTodayAtom(this);
else return visitor.visitChildren(this);
}
}
public static class DayToMonthAtomContext extends TimeOperatorsContext {
public TerminalNode DAYTOMONTH() { return getToken(VtlParser.DAYTOMONTH, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public DayToMonthAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDayToMonthAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDayToMonthAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDayToMonthAtom(this);
else return visitor.visitChildren(this);
}
}
public static class PeriodAtomContext extends TimeOperatorsContext {
public TerminalNode PERIOD_INDICATOR() { return getToken(VtlParser.PERIOD_INDICATOR, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public PeriodAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterPeriodAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitPeriodAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitPeriodAtom(this);
else return visitor.visitChildren(this);
}
}
public static class MonthTodayAtomContext extends TimeOperatorsContext {
public TerminalNode MONTHTODAY() { return getToken(VtlParser.MONTHTODAY, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public MonthTodayAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterMonthTodayAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitMonthTodayAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitMonthTodayAtom(this);
else return visitor.visitChildren(this);
}
}
public static class FillTimeAtomContext extends TimeOperatorsContext {
public Token op;
public TerminalNode FILL_TIME_SERIES() { return getToken(VtlParser.FILL_TIME_SERIES, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public TerminalNode SINGLE() { return getToken(VtlParser.SINGLE, 0); }
public TerminalNode ALL() { return getToken(VtlParser.ALL, 0); }
public FillTimeAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterFillTimeAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitFillTimeAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitFillTimeAtom(this);
else return visitor.visitChildren(this);
}
}
public static class MonthAtomContext extends TimeOperatorsContext {
public TerminalNode GETMONTH() { return getToken(VtlParser.GETMONTH, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public MonthAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterMonthAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitMonthAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitMonthAtom(this);
else return visitor.visitChildren(this);
}
}
public static class DayOfYearAtomContext extends TimeOperatorsContext {
public TerminalNode DAYOFYEAR() { return getToken(VtlParser.DAYOFYEAR, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public DayOfYearAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDayOfYearAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDayOfYearAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDayOfYearAtom(this);
else return visitor.visitChildren(this);
}
}
public static class FlowAtomContext extends TimeOperatorsContext {
public Token op;
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode FLOW_TO_STOCK() { return getToken(VtlParser.FLOW_TO_STOCK, 0); }
public TerminalNode STOCK_TO_FLOW() { return getToken(VtlParser.STOCK_TO_FLOW, 0); }
public FlowAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterFlowAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitFlowAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitFlowAtom(this);
else return visitor.visitChildren(this);
}
}
public static class TimeShiftAtomContext extends TimeOperatorsContext {
public TerminalNode TIMESHIFT() { return getToken(VtlParser.TIMESHIFT, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public SignedIntegerContext signedInteger() {
return getRuleContext(SignedIntegerContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TimeShiftAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterTimeShiftAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitTimeShiftAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitTimeShiftAtom(this);
else return visitor.visitChildren(this);
}
}
public static class TimeAggAtomContext extends TimeOperatorsContext {
public Token periodIndTo;
public Token periodIndFrom;
public OptionalExprContext op;
public Token delim;
public TerminalNode TIME_AGG() { return getToken(VtlParser.TIME_AGG, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List STRING_CONSTANT() { return getTokens(VtlParser.STRING_CONSTANT); }
public TerminalNode STRING_CONSTANT(int i) {
return getToken(VtlParser.STRING_CONSTANT, i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public OptionalExprContext optionalExpr() {
return getRuleContext(OptionalExprContext.class,0);
}
public TerminalNode OPTIONAL() { return getToken(VtlParser.OPTIONAL, 0); }
public TerminalNode FIRST() { return getToken(VtlParser.FIRST, 0); }
public TerminalNode LAST() { return getToken(VtlParser.LAST, 0); }
public TimeAggAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterTimeAggAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitTimeAggAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitTimeAggAtom(this);
else return visitor.visitChildren(this);
}
}
public static class DateDiffAtomContext extends TimeOperatorsContext {
public ExprContext dateFrom;
public ExprContext dateTo;
public TerminalNode DATEDIFF() { return getToken(VtlParser.DATEDIFF, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public DateDiffAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDateDiffAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDateDiffAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDateDiffAtom(this);
else return visitor.visitChildren(this);
}
}
public static class DateAddAtomContext extends TimeOperatorsContext {
public ExprContext op;
public ExprContext shiftNumber;
public ExprContext periodInd;
public TerminalNode DATEADD() { return getToken(VtlParser.DATEADD, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public DateAddAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDateAddAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDateAddAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDateAddAtom(this);
else return visitor.visitChildren(this);
}
}
public static class DayOfMonthAtomContext extends TimeOperatorsContext {
public TerminalNode DAYOFMONTH() { return getToken(VtlParser.DAYOFMONTH, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public DayOfMonthAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDayOfMonthAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDayOfMonthAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDayOfMonthAtom(this);
else return visitor.visitChildren(this);
}
}
public static class CurrentDateAtomContext extends TimeOperatorsContext {
public TerminalNode CURRENT_DATE() { return getToken(VtlParser.CURRENT_DATE, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public CurrentDateAtomContext(TimeOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCurrentDateAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCurrentDateAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCurrentDateAtom(this);
else return visitor.visitChildren(this);
}
}
public final TimeOperatorsContext timeOperators() throws RecognitionException {
TimeOperatorsContext _localctx = new TimeOperatorsContext(_ctx, getState());
enterRule(_localctx, 40, RULE_timeOperators);
int _la;
try {
setState(716);
_errHandler.sync(this);
switch (_input.LA(1)) {
case PERIOD_INDICATOR:
_localctx = new PeriodAtomContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(614);
match(PERIOD_INDICATOR);
setState(615);
match(LPAREN);
setState(617);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << LPAREN) | (1L << PLUS) | (1L << MINUS) | (1L << EVAL) | (1L << IF) | (1L << CASE) | (1L << CURRENT_DATE) | (1L << DATEDIFF) | (1L << DATEADD) | (1L << GETYEAR) | (1L << GETMONTH) | (1L << DAYOFMONTH) | (1L << DAYOFYEAR) | (1L << DAYTOYEAR) | (1L << DAYTOMONTH) | (1L << YEARTODAY) | (1L << MONTHTODAY) | (1L << NOT) | (1L << BETWEEN) | (1L << NULL_CONSTANT) | (1L << ISNULL) | (1L << UNION) | (1L << SYMDIFF) | (1L << INTERSECT) | (1L << RANDOM))) != 0) || ((((_la - 66)) & ~0x3f) == 0 && ((1L << (_la - 66)) & ((1L << (CHECK - 66)) | (1L << (EXISTS_IN - 66)) | (1L << (RANK - 66)) | (1L << (MIN - 66)) | (1L << (MAX - 66)) | (1L << (ABS - 66)) | (1L << (LN - 66)) | (1L << (LOG - 66)) | (1L << (TRUNC - 66)) | (1L << (ROUND - 66)) | (1L << (POWER - 66)) | (1L << (MOD - 66)) | (1L << (LEN - 66)) | (1L << (TRIM - 66)) | (1L << (UCASE - 66)) | (1L << (LCASE - 66)) | (1L << (SUBSTR - 66)) | (1L << (SUM - 66)) | (1L << (AVG - 66)) | (1L << (MEDIAN - 66)) | (1L << (COUNT - 66)) | (1L << (EXP - 66)) | (1L << (CHARSET_MATCH - 66)) | (1L << (NVL - 66)) | (1L << (HIERARCHY - 66)) | (1L << (LEVENSHTEIN - 66)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LTRIM - 132)) | (1L << (RTRIM - 132)) | (1L << (INSTR - 132)) | (1L << (REPLACE - 132)) | (1L << (CEIL - 132)) | (1L << (FLOOR - 132)) | (1L << (SQRT - 132)) | (1L << (SETDIFF - 132)) | (1L << (STDDEV_POP - 132)) | (1L << (STDDEV_SAMP - 132)) | (1L << (VAR_POP - 132)) | (1L << (VAR_SAMP - 132)) | (1L << (FIRST_VALUE - 132)) | (1L << (LAST_VALUE - 132)) | (1L << (LAG - 132)) | (1L << (LEAD - 132)) | (1L << (RATIO_TO_REPORT - 132)) | (1L << (FILL_TIME_SERIES - 132)) | (1L << (FLOW_TO_STOCK - 132)) | (1L << (STOCK_TO_FLOW - 132)) | (1L << (TIMESHIFT - 132)) | (1L << (INNER_JOIN - 132)) | (1L << (LEFT_JOIN - 132)))) != 0) || ((((_la - 196)) & ~0x3f) == 0 && ((1L << (_la - 196)) & ((1L << (CROSS_JOIN - 196)) | (1L << (FULL_JOIN - 196)) | (1L << (PERIOD_INDICATOR - 196)) | (1L << (TIME_AGG - 196)) | (1L << (CAST - 196)) | (1L << (CHECK_DATAPOINT - 196)) | (1L << (CHECK_HIERARCHY - 196)) | (1L << (INTEGER_CONSTANT - 196)) | (1L << (NUMBER_CONSTANT - 196)) | (1L << (BOOLEAN_CONSTANT - 196)) | (1L << (STRING_CONSTANT - 196)) | (1L << (IDENTIFIER - 196)))) != 0)) {
{
setState(616);
expr(0);
}
}
setState(619);
match(RPAREN);
}
break;
case FILL_TIME_SERIES:
_localctx = new FillTimeAtomContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(620);
match(FILL_TIME_SERIES);
setState(621);
match(LPAREN);
setState(622);
expr(0);
setState(625);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
setState(623);
match(COMMA);
setState(624);
((FillTimeAtomContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==ALL || _la==SINGLE) ) {
((FillTimeAtomContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(627);
match(RPAREN);
}
break;
case FLOW_TO_STOCK:
case STOCK_TO_FLOW:
_localctx = new FlowAtomContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(629);
((FlowAtomContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==FLOW_TO_STOCK || _la==STOCK_TO_FLOW) ) {
((FlowAtomContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(630);
match(LPAREN);
setState(631);
expr(0);
setState(632);
match(RPAREN);
}
break;
case TIMESHIFT:
_localctx = new TimeShiftAtomContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(634);
match(TIMESHIFT);
setState(635);
match(LPAREN);
setState(636);
expr(0);
setState(637);
match(COMMA);
setState(638);
signedInteger();
setState(639);
match(RPAREN);
}
break;
case TIME_AGG:
_localctx = new TimeAggAtomContext(_localctx);
enterOuterAlt(_localctx, 5);
{
setState(641);
match(TIME_AGG);
setState(642);
match(LPAREN);
setState(643);
((TimeAggAtomContext)_localctx).periodIndTo = match(STRING_CONSTANT);
setState(646);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,44,_ctx) ) {
case 1:
{
setState(644);
match(COMMA);
setState(645);
((TimeAggAtomContext)_localctx).periodIndFrom = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==OPTIONAL || _la==STRING_CONSTANT) ) {
((TimeAggAtomContext)_localctx).periodIndFrom = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
break;
}
setState(650);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,45,_ctx) ) {
case 1:
{
setState(648);
match(COMMA);
setState(649);
((TimeAggAtomContext)_localctx).op = optionalExpr();
}
break;
}
setState(654);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
setState(652);
match(COMMA);
setState(653);
((TimeAggAtomContext)_localctx).delim = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==FIRST || _la==LAST) ) {
((TimeAggAtomContext)_localctx).delim = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(656);
match(RPAREN);
}
break;
case CURRENT_DATE:
_localctx = new CurrentDateAtomContext(_localctx);
enterOuterAlt(_localctx, 6);
{
setState(657);
match(CURRENT_DATE);
setState(658);
match(LPAREN);
setState(659);
match(RPAREN);
}
break;
case DATEDIFF:
_localctx = new DateDiffAtomContext(_localctx);
enterOuterAlt(_localctx, 7);
{
setState(660);
match(DATEDIFF);
setState(661);
match(LPAREN);
setState(662);
((DateDiffAtomContext)_localctx).dateFrom = expr(0);
setState(663);
match(COMMA);
setState(664);
((DateDiffAtomContext)_localctx).dateTo = expr(0);
setState(665);
match(RPAREN);
}
break;
case DATEADD:
_localctx = new DateAddAtomContext(_localctx);
enterOuterAlt(_localctx, 8);
{
setState(667);
match(DATEADD);
setState(668);
match(LPAREN);
setState(669);
((DateAddAtomContext)_localctx).op = expr(0);
setState(670);
match(COMMA);
setState(671);
((DateAddAtomContext)_localctx).shiftNumber = expr(0);
setState(672);
match(COMMA);
setState(673);
((DateAddAtomContext)_localctx).periodInd = expr(0);
setState(674);
match(RPAREN);
}
break;
case GETYEAR:
_localctx = new YearAtomContext(_localctx);
enterOuterAlt(_localctx, 9);
{
setState(676);
match(GETYEAR);
setState(677);
match(LPAREN);
setState(678);
expr(0);
setState(679);
match(RPAREN);
}
break;
case GETMONTH:
_localctx = new MonthAtomContext(_localctx);
enterOuterAlt(_localctx, 10);
{
setState(681);
match(GETMONTH);
setState(682);
match(LPAREN);
setState(683);
expr(0);
setState(684);
match(RPAREN);
}
break;
case DAYOFMONTH:
_localctx = new DayOfMonthAtomContext(_localctx);
enterOuterAlt(_localctx, 11);
{
setState(686);
match(DAYOFMONTH);
setState(687);
match(LPAREN);
setState(688);
expr(0);
setState(689);
match(RPAREN);
}
break;
case DAYOFYEAR:
_localctx = new DayOfYearAtomContext(_localctx);
enterOuterAlt(_localctx, 12);
{
setState(691);
match(DAYOFYEAR);
setState(692);
match(LPAREN);
setState(693);
expr(0);
setState(694);
match(RPAREN);
}
break;
case DAYTOYEAR:
_localctx = new DayToYearAtomContext(_localctx);
enterOuterAlt(_localctx, 13);
{
setState(696);
match(DAYTOYEAR);
setState(697);
match(LPAREN);
setState(698);
expr(0);
setState(699);
match(RPAREN);
}
break;
case DAYTOMONTH:
_localctx = new DayToMonthAtomContext(_localctx);
enterOuterAlt(_localctx, 14);
{
setState(701);
match(DAYTOMONTH);
setState(702);
match(LPAREN);
setState(703);
expr(0);
setState(704);
match(RPAREN);
}
break;
case YEARTODAY:
_localctx = new YearTodayAtomContext(_localctx);
enterOuterAlt(_localctx, 15);
{
setState(706);
match(YEARTODAY);
setState(707);
match(LPAREN);
setState(708);
expr(0);
setState(709);
match(RPAREN);
}
break;
case MONTHTODAY:
_localctx = new MonthTodayAtomContext(_localctx);
enterOuterAlt(_localctx, 16);
{
setState(711);
match(MONTHTODAY);
setState(712);
match(LPAREN);
setState(713);
expr(0);
setState(714);
match(RPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SetOperatorsContext extends ParserRuleContext {
public SetOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_setOperators; }
public SetOperatorsContext() { }
public void copyFrom(SetOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class SetOrSYmDiffAtomContext extends SetOperatorsContext {
public Token op;
public ExprContext left;
public ExprContext right;
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public TerminalNode SETDIFF() { return getToken(VtlParser.SETDIFF, 0); }
public TerminalNode SYMDIFF() { return getToken(VtlParser.SYMDIFF, 0); }
public SetOrSYmDiffAtomContext(SetOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterSetOrSYmDiffAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitSetOrSYmDiffAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitSetOrSYmDiffAtom(this);
else return visitor.visitChildren(this);
}
}
public static class IntersectAtomContext extends SetOperatorsContext {
public ExprContext left;
public TerminalNode INTERSECT() { return getToken(VtlParser.INTERSECT, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public IntersectAtomContext(SetOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterIntersectAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitIntersectAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitIntersectAtom(this);
else return visitor.visitChildren(this);
}
}
public static class UnionAtomContext extends SetOperatorsContext {
public ExprContext left;
public TerminalNode UNION() { return getToken(VtlParser.UNION, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public UnionAtomContext(SetOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterUnionAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitUnionAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitUnionAtom(this);
else return visitor.visitChildren(this);
}
}
public final SetOperatorsContext setOperators() throws RecognitionException {
SetOperatorsContext _localctx = new SetOperatorsContext(_ctx, getState());
enterRule(_localctx, 42, RULE_setOperators);
int _la;
try {
setState(747);
_errHandler.sync(this);
switch (_input.LA(1)) {
case UNION:
_localctx = new UnionAtomContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(718);
match(UNION);
setState(719);
match(LPAREN);
setState(720);
((UnionAtomContext)_localctx).left = expr(0);
setState(723);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(721);
match(COMMA);
setState(722);
expr(0);
}
}
setState(725);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==COMMA );
setState(727);
match(RPAREN);
}
break;
case INTERSECT:
_localctx = new IntersectAtomContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(729);
match(INTERSECT);
setState(730);
match(LPAREN);
setState(731);
((IntersectAtomContext)_localctx).left = expr(0);
setState(734);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
setState(732);
match(COMMA);
setState(733);
expr(0);
}
}
setState(736);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==COMMA );
setState(738);
match(RPAREN);
}
break;
case SYMDIFF:
case SETDIFF:
_localctx = new SetOrSYmDiffAtomContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(740);
((SetOrSYmDiffAtomContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==SYMDIFF || _la==SETDIFF) ) {
((SetOrSYmDiffAtomContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(741);
match(LPAREN);
setState(742);
((SetOrSYmDiffAtomContext)_localctx).left = expr(0);
setState(743);
match(COMMA);
setState(744);
((SetOrSYmDiffAtomContext)_localctx).right = expr(0);
setState(745);
match(RPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class HierarchyOperatorsContext extends ParserRuleContext {
public ExprContext op;
public Token hrName;
public ComponentIDContext ruleComponent;
public TerminalNode HIERARCHY() { return getToken(VtlParser.HIERARCHY, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public ConditionClauseContext conditionClause() {
return getRuleContext(ConditionClauseContext.class,0);
}
public TerminalNode RULE() { return getToken(VtlParser.RULE, 0); }
public ValidationModeContext validationMode() {
return getRuleContext(ValidationModeContext.class,0);
}
public InputModeHierarchyContext inputModeHierarchy() {
return getRuleContext(InputModeHierarchyContext.class,0);
}
public OutputModeHierarchyContext outputModeHierarchy() {
return getRuleContext(OutputModeHierarchyContext.class,0);
}
public ComponentIDContext componentID() {
return getRuleContext(ComponentIDContext.class,0);
}
public HierarchyOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_hierarchyOperators; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterHierarchyOperators(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitHierarchyOperators(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitHierarchyOperators(this);
else return visitor.visitChildren(this);
}
}
public final HierarchyOperatorsContext hierarchyOperators() throws RecognitionException {
HierarchyOperatorsContext _localctx = new HierarchyOperatorsContext(_ctx, getState());
enterRule(_localctx, 44, RULE_hierarchyOperators);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(749);
match(HIERARCHY);
setState(750);
match(LPAREN);
setState(751);
((HierarchyOperatorsContext)_localctx).op = expr(0);
setState(752);
match(COMMA);
setState(753);
((HierarchyOperatorsContext)_localctx).hrName = match(IDENTIFIER);
setState(755);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CONDITION) {
{
setState(754);
conditionClause();
}
}
setState(759);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,52,_ctx) ) {
case 1:
{
setState(757);
match(RULE);
setState(758);
((HierarchyOperatorsContext)_localctx).ruleComponent = componentID();
}
break;
}
setState(762);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 226)) & ~0x3f) == 0 && ((1L << (_la - 226)) & ((1L << (NON_NULL - 226)) | (1L << (NON_ZERO - 226)) | (1L << (PARTIAL_NULL - 226)) | (1L << (PARTIAL_ZERO - 226)) | (1L << (ALWAYS_NULL - 226)) | (1L << (ALWAYS_ZERO - 226)))) != 0)) {
{
setState(761);
validationMode();
}
}
setState(765);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==DATASET || _la==RULE || _la==RULE_PRIORITY) {
{
setState(764);
inputModeHierarchy();
}
}
setState(768);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==COMPUTED) {
{
setState(767);
outputModeHierarchy();
}
}
setState(770);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ValidationOperatorsContext extends ParserRuleContext {
public ValidationOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_validationOperators; }
public ValidationOperatorsContext() { }
public void copyFrom(ValidationOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class ValidateHRrulesetContext extends ValidationOperatorsContext {
public ExprContext op;
public Token hrName;
public TerminalNode CHECK_HIERARCHY() { return getToken(VtlParser.CHECK_HIERARCHY, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public ConditionClauseContext conditionClause() {
return getRuleContext(ConditionClauseContext.class,0);
}
public TerminalNode RULE() { return getToken(VtlParser.RULE, 0); }
public ComponentIDContext componentID() {
return getRuleContext(ComponentIDContext.class,0);
}
public ValidationModeContext validationMode() {
return getRuleContext(ValidationModeContext.class,0);
}
public InputModeContext inputMode() {
return getRuleContext(InputModeContext.class,0);
}
public ValidationOutputContext validationOutput() {
return getRuleContext(ValidationOutputContext.class,0);
}
public ValidateHRrulesetContext(ValidationOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterValidateHRruleset(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitValidateHRruleset(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitValidateHRruleset(this);
else return visitor.visitChildren(this);
}
}
public static class ValidateDPrulesetContext extends ValidationOperatorsContext {
public ExprContext op;
public Token dpName;
public TerminalNode CHECK_DATAPOINT() { return getToken(VtlParser.CHECK_DATAPOINT, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public TerminalNode COMPONENTS() { return getToken(VtlParser.COMPONENTS, 0); }
public List componentID() {
return getRuleContexts(ComponentIDContext.class);
}
public ComponentIDContext componentID(int i) {
return getRuleContext(ComponentIDContext.class,i);
}
public ValidationOutputContext validationOutput() {
return getRuleContext(ValidationOutputContext.class,0);
}
public ValidateDPrulesetContext(ValidationOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterValidateDPruleset(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitValidateDPruleset(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitValidateDPruleset(this);
else return visitor.visitChildren(this);
}
}
public static class ValidationSimpleContext extends ValidationOperatorsContext {
public ExprContext op;
public ErCodeContext codeErr;
public ErLevelContext levelCode;
public Token output;
public TerminalNode CHECK() { return getToken(VtlParser.CHECK, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public ImbalanceExprContext imbalanceExpr() {
return getRuleContext(ImbalanceExprContext.class,0);
}
public ErCodeContext erCode() {
return getRuleContext(ErCodeContext.class,0);
}
public ErLevelContext erLevel() {
return getRuleContext(ErLevelContext.class,0);
}
public TerminalNode INVALID() { return getToken(VtlParser.INVALID, 0); }
public TerminalNode ALL() { return getToken(VtlParser.ALL, 0); }
public ValidationSimpleContext(ValidationOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterValidationSimple(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitValidationSimple(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitValidationSimple(this);
else return visitor.visitChildren(this);
}
}
public final ValidationOperatorsContext validationOperators() throws RecognitionException {
ValidationOperatorsContext _localctx = new ValidationOperatorsContext(_ctx, getState());
enterRule(_localctx, 46, RULE_validationOperators);
int _la;
try {
setState(833);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CHECK_DATAPOINT:
_localctx = new ValidateDPrulesetContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(772);
match(CHECK_DATAPOINT);
setState(773);
match(LPAREN);
setState(774);
((ValidateDPrulesetContext)_localctx).op = expr(0);
setState(775);
match(COMMA);
setState(776);
((ValidateDPrulesetContext)_localctx).dpName = match(IDENTIFIER);
setState(786);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMPONENTS) {
{
setState(777);
match(COMPONENTS);
setState(778);
componentID();
setState(783);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(779);
match(COMMA);
setState(780);
componentID();
}
}
setState(785);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
setState(789);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==INVALID || _la==ALL_MEASURES) {
{
setState(788);
validationOutput();
}
}
setState(791);
match(RPAREN);
}
break;
case CHECK_HIERARCHY:
_localctx = new ValidateHRrulesetContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(793);
match(CHECK_HIERARCHY);
setState(794);
match(LPAREN);
setState(795);
((ValidateHRrulesetContext)_localctx).op = expr(0);
setState(796);
match(COMMA);
setState(797);
((ValidateHRrulesetContext)_localctx).hrName = match(IDENTIFIER);
setState(799);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CONDITION) {
{
setState(798);
conditionClause();
}
}
setState(803);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RULE) {
{
setState(801);
match(RULE);
setState(802);
componentID();
}
}
setState(806);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 226)) & ~0x3f) == 0 && ((1L << (_la - 226)) & ((1L << (NON_NULL - 226)) | (1L << (NON_ZERO - 226)) | (1L << (PARTIAL_NULL - 226)) | (1L << (PARTIAL_ZERO - 226)) | (1L << (ALWAYS_NULL - 226)) | (1L << (ALWAYS_ZERO - 226)))) != 0)) {
{
setState(805);
validationMode();
}
}
setState(809);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==DATASET || _la==DATASET_PRIORITY) {
{
setState(808);
inputMode();
}
}
setState(812);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==INVALID || _la==ALL_MEASURES) {
{
setState(811);
validationOutput();
}
}
setState(814);
match(RPAREN);
}
break;
case CHECK:
_localctx = new ValidationSimpleContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(816);
match(CHECK);
setState(817);
match(LPAREN);
setState(818);
((ValidationSimpleContext)_localctx).op = expr(0);
setState(820);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ERRORCODE) {
{
setState(819);
((ValidationSimpleContext)_localctx).codeErr = erCode();
}
}
setState(823);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ERRORLEVEL) {
{
setState(822);
((ValidationSimpleContext)_localctx).levelCode = erLevel();
}
}
setState(826);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==IMBALANCE) {
{
setState(825);
imbalanceExpr();
}
}
setState(829);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ALL || _la==INVALID) {
{
setState(828);
((ValidationSimpleContext)_localctx).output = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==ALL || _la==INVALID) ) {
((ValidationSimpleContext)_localctx).output = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(831);
match(RPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ConditionalOperatorsContext extends ParserRuleContext {
public ConditionalOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_conditionalOperators; }
public ConditionalOperatorsContext() { }
public void copyFrom(ConditionalOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class NvlAtomContext extends ConditionalOperatorsContext {
public ExprContext left;
public ExprContext right;
public TerminalNode NVL() { return getToken(VtlParser.NVL, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public NvlAtomContext(ConditionalOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterNvlAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitNvlAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitNvlAtom(this);
else return visitor.visitChildren(this);
}
}
public final ConditionalOperatorsContext conditionalOperators() throws RecognitionException {
ConditionalOperatorsContext _localctx = new ConditionalOperatorsContext(_ctx, getState());
enterRule(_localctx, 48, RULE_conditionalOperators);
try {
_localctx = new NvlAtomContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(835);
match(NVL);
setState(836);
match(LPAREN);
setState(837);
((NvlAtomContext)_localctx).left = expr(0);
setState(838);
match(COMMA);
setState(839);
((NvlAtomContext)_localctx).right = expr(0);
setState(840);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AggrOperatorsGroupingContext extends ParserRuleContext {
public AggrOperatorsGroupingContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_aggrOperatorsGrouping; }
public AggrOperatorsGroupingContext() { }
public void copyFrom(AggrOperatorsGroupingContext ctx) {
super.copyFrom(ctx);
}
}
public static class AggrDatasetContext extends AggrOperatorsGroupingContext {
public Token op;
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode SUM() { return getToken(VtlParser.SUM, 0); }
public TerminalNode AVG() { return getToken(VtlParser.AVG, 0); }
public TerminalNode COUNT() { return getToken(VtlParser.COUNT, 0); }
public TerminalNode MEDIAN() { return getToken(VtlParser.MEDIAN, 0); }
public TerminalNode MIN() { return getToken(VtlParser.MIN, 0); }
public TerminalNode MAX() { return getToken(VtlParser.MAX, 0); }
public TerminalNode STDDEV_POP() { return getToken(VtlParser.STDDEV_POP, 0); }
public TerminalNode STDDEV_SAMP() { return getToken(VtlParser.STDDEV_SAMP, 0); }
public TerminalNode VAR_POP() { return getToken(VtlParser.VAR_POP, 0); }
public TerminalNode VAR_SAMP() { return getToken(VtlParser.VAR_SAMP, 0); }
public GroupingClauseContext groupingClause() {
return getRuleContext(GroupingClauseContext.class,0);
}
public HavingClauseContext havingClause() {
return getRuleContext(HavingClauseContext.class,0);
}
public AggrDatasetContext(AggrOperatorsGroupingContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterAggrDataset(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitAggrDataset(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitAggrDataset(this);
else return visitor.visitChildren(this);
}
}
public static class CountAggrContext extends AggrOperatorsGroupingContext {
public TerminalNode COUNT() { return getToken(VtlParser.COUNT, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public CountAggrContext(AggrOperatorsGroupingContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCountAggr(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCountAggr(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCountAggr(this);
else return visitor.visitChildren(this);
}
}
public final AggrOperatorsGroupingContext aggrOperatorsGrouping() throws RecognitionException {
AggrOperatorsGroupingContext _localctx = new AggrOperatorsGroupingContext(_ctx, getState());
enterRule(_localctx, 50, RULE_aggrOperatorsGrouping);
int _la;
try {
setState(856);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,71,_ctx) ) {
case 1:
_localctx = new AggrDatasetContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(842);
((AggrDatasetContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(((((_la - 80)) & ~0x3f) == 0 && ((1L << (_la - 80)) & ((1L << (MIN - 80)) | (1L << (MAX - 80)) | (1L << (SUM - 80)) | (1L << (AVG - 80)) | (1L << (MEDIAN - 80)) | (1L << (COUNT - 80)) | (1L << (STDDEV_POP - 80)) | (1L << (STDDEV_SAMP - 80)) | (1L << (VAR_POP - 80)))) != 0) || _la==VAR_SAMP) ) {
((AggrDatasetContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(843);
match(LPAREN);
setState(844);
expr(0);
setState(849);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GROUP) {
{
setState(845);
groupingClause();
setState(847);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==HAVING) {
{
setState(846);
havingClause();
}
}
}
}
setState(851);
match(RPAREN);
}
break;
case 2:
_localctx = new CountAggrContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(853);
match(COUNT);
setState(854);
match(LPAREN);
setState(855);
match(RPAREN);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AnFunctionContext extends ParserRuleContext {
public AnFunctionContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_anFunction; }
public AnFunctionContext() { }
public void copyFrom(AnFunctionContext ctx) {
super.copyFrom(ctx);
}
}
public static class LagOrLeadAnContext extends AnFunctionContext {
public Token op;
public SignedIntegerContext offset;
public ConstantContext defaultValue;
public PartitionByClauseContext partition;
public OrderByClauseContext orderBy;
public List LPAREN() { return getTokens(VtlParser.LPAREN); }
public TerminalNode LPAREN(int i) {
return getToken(VtlParser.LPAREN, i);
}
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode OVER() { return getToken(VtlParser.OVER, 0); }
public List RPAREN() { return getTokens(VtlParser.RPAREN); }
public TerminalNode RPAREN(int i) {
return getToken(VtlParser.RPAREN, i);
}
public TerminalNode LAG() { return getToken(VtlParser.LAG, 0); }
public TerminalNode LEAD() { return getToken(VtlParser.LEAD, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public OrderByClauseContext orderByClause() {
return getRuleContext(OrderByClauseContext.class,0);
}
public SignedIntegerContext signedInteger() {
return getRuleContext(SignedIntegerContext.class,0);
}
public PartitionByClauseContext partitionByClause() {
return getRuleContext(PartitionByClauseContext.class,0);
}
public ConstantContext constant() {
return getRuleContext(ConstantContext.class,0);
}
public LagOrLeadAnContext(AnFunctionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterLagOrLeadAn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitLagOrLeadAn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitLagOrLeadAn(this);
else return visitor.visitChildren(this);
}
}
public static class RatioToReportAnContext extends AnFunctionContext {
public Token op;
public PartitionByClauseContext partition;
public List LPAREN() { return getTokens(VtlParser.LPAREN); }
public TerminalNode LPAREN(int i) {
return getToken(VtlParser.LPAREN, i);
}
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode OVER() { return getToken(VtlParser.OVER, 0); }
public List RPAREN() { return getTokens(VtlParser.RPAREN); }
public TerminalNode RPAREN(int i) {
return getToken(VtlParser.RPAREN, i);
}
public TerminalNode RATIO_TO_REPORT() { return getToken(VtlParser.RATIO_TO_REPORT, 0); }
public PartitionByClauseContext partitionByClause() {
return getRuleContext(PartitionByClauseContext.class,0);
}
public RatioToReportAnContext(AnFunctionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRatioToReportAn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRatioToReportAn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRatioToReportAn(this);
else return visitor.visitChildren(this);
}
}
public static class RankAnContext extends AnFunctionContext {
public Token op;
public PartitionByClauseContext partition;
public OrderByClauseContext orderBy;
public List LPAREN() { return getTokens(VtlParser.LPAREN); }
public TerminalNode LPAREN(int i) {
return getToken(VtlParser.LPAREN, i);
}
public TerminalNode OVER() { return getToken(VtlParser.OVER, 0); }
public List RPAREN() { return getTokens(VtlParser.RPAREN); }
public TerminalNode RPAREN(int i) {
return getToken(VtlParser.RPAREN, i);
}
public TerminalNode RANK() { return getToken(VtlParser.RANK, 0); }
public OrderByClauseContext orderByClause() {
return getRuleContext(OrderByClauseContext.class,0);
}
public PartitionByClauseContext partitionByClause() {
return getRuleContext(PartitionByClauseContext.class,0);
}
public RankAnContext(AnFunctionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRankAn(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRankAn(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRankAn(this);
else return visitor.visitChildren(this);
}
}
public static class AnSimpleFunctionContext extends AnFunctionContext {
public Token op;
public PartitionByClauseContext partition;
public OrderByClauseContext orderBy;
public WindowingClauseContext windowing;
public List LPAREN() { return getTokens(VtlParser.LPAREN); }
public TerminalNode LPAREN(int i) {
return getToken(VtlParser.LPAREN, i);
}
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode OVER() { return getToken(VtlParser.OVER, 0); }
public List RPAREN() { return getTokens(VtlParser.RPAREN); }
public TerminalNode RPAREN(int i) {
return getToken(VtlParser.RPAREN, i);
}
public TerminalNode SUM() { return getToken(VtlParser.SUM, 0); }
public TerminalNode AVG() { return getToken(VtlParser.AVG, 0); }
public TerminalNode COUNT() { return getToken(VtlParser.COUNT, 0); }
public TerminalNode MEDIAN() { return getToken(VtlParser.MEDIAN, 0); }
public TerminalNode MIN() { return getToken(VtlParser.MIN, 0); }
public TerminalNode MAX() { return getToken(VtlParser.MAX, 0); }
public TerminalNode STDDEV_POP() { return getToken(VtlParser.STDDEV_POP, 0); }
public TerminalNode STDDEV_SAMP() { return getToken(VtlParser.STDDEV_SAMP, 0); }
public TerminalNode VAR_POP() { return getToken(VtlParser.VAR_POP, 0); }
public TerminalNode VAR_SAMP() { return getToken(VtlParser.VAR_SAMP, 0); }
public TerminalNode FIRST_VALUE() { return getToken(VtlParser.FIRST_VALUE, 0); }
public TerminalNode LAST_VALUE() { return getToken(VtlParser.LAST_VALUE, 0); }
public PartitionByClauseContext partitionByClause() {
return getRuleContext(PartitionByClauseContext.class,0);
}
public OrderByClauseContext orderByClause() {
return getRuleContext(OrderByClauseContext.class,0);
}
public WindowingClauseContext windowingClause() {
return getRuleContext(WindowingClauseContext.class,0);
}
public AnSimpleFunctionContext(AnFunctionContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterAnSimpleFunction(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitAnSimpleFunction(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitAnSimpleFunction(this);
else return visitor.visitChildren(this);
}
}
public final AnFunctionContext anFunction() throws RecognitionException {
AnFunctionContext _localctx = new AnFunctionContext(_ctx, getState());
enterRule(_localctx, 52, RULE_anFunction);
int _la;
try {
setState(916);
_errHandler.sync(this);
switch (_input.LA(1)) {
case MIN:
case MAX:
case SUM:
case AVG:
case MEDIAN:
case COUNT:
case STDDEV_POP:
case STDDEV_SAMP:
case VAR_POP:
case VAR_SAMP:
case FIRST_VALUE:
case LAST_VALUE:
_localctx = new AnSimpleFunctionContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(858);
((AnSimpleFunctionContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(((((_la - 80)) & ~0x3f) == 0 && ((1L << (_la - 80)) & ((1L << (MIN - 80)) | (1L << (MAX - 80)) | (1L << (SUM - 80)) | (1L << (AVG - 80)) | (1L << (MEDIAN - 80)) | (1L << (COUNT - 80)) | (1L << (STDDEV_POP - 80)) | (1L << (STDDEV_SAMP - 80)) | (1L << (VAR_POP - 80)))) != 0) || ((((_la - 144)) & ~0x3f) == 0 && ((1L << (_la - 144)) & ((1L << (VAR_SAMP - 144)) | (1L << (FIRST_VALUE - 144)) | (1L << (LAST_VALUE - 144)))) != 0)) ) {
((AnSimpleFunctionContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(859);
match(LPAREN);
setState(860);
expr(0);
setState(861);
match(OVER);
setState(862);
match(LPAREN);
{
setState(864);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(863);
((AnSimpleFunctionContext)_localctx).partition = partitionByClause();
}
}
setState(867);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ORDER) {
{
setState(866);
((AnSimpleFunctionContext)_localctx).orderBy = orderByClause();
}
}
setState(870);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==DATA || _la==RANGE) {
{
setState(869);
((AnSimpleFunctionContext)_localctx).windowing = windowingClause();
}
}
}
setState(872);
match(RPAREN);
setState(873);
match(RPAREN);
}
break;
case LAG:
case LEAD:
_localctx = new LagOrLeadAnContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(875);
((LagOrLeadAnContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==LAG || _la==LEAD) ) {
((LagOrLeadAnContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(876);
match(LPAREN);
setState(877);
expr(0);
setState(883);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
setState(878);
match(COMMA);
setState(879);
((LagOrLeadAnContext)_localctx).offset = signedInteger();
setState(881);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NULL_CONSTANT || ((((_la - 242)) & ~0x3f) == 0 && ((1L << (_la - 242)) & ((1L << (INTEGER_CONSTANT - 242)) | (1L << (NUMBER_CONSTANT - 242)) | (1L << (BOOLEAN_CONSTANT - 242)) | (1L << (STRING_CONSTANT - 242)))) != 0)) {
{
setState(880);
((LagOrLeadAnContext)_localctx).defaultValue = constant();
}
}
}
}
setState(885);
match(OVER);
setState(886);
match(LPAREN);
{
setState(888);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(887);
((LagOrLeadAnContext)_localctx).partition = partitionByClause();
}
}
setState(890);
((LagOrLeadAnContext)_localctx).orderBy = orderByClause();
}
setState(892);
match(RPAREN);
setState(893);
match(RPAREN);
}
break;
case RATIO_TO_REPORT:
_localctx = new RatioToReportAnContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(895);
((RatioToReportAnContext)_localctx).op = match(RATIO_TO_REPORT);
setState(896);
match(LPAREN);
setState(897);
expr(0);
setState(898);
match(OVER);
setState(899);
match(LPAREN);
{
setState(900);
((RatioToReportAnContext)_localctx).partition = partitionByClause();
}
setState(901);
match(RPAREN);
setState(902);
match(RPAREN);
}
break;
case RANK:
_localctx = new RankAnContext(_localctx);
enterOuterAlt(_localctx, 4);
{
setState(904);
((RankAnContext)_localctx).op = match(RANK);
setState(905);
match(LPAREN);
setState(906);
match(OVER);
setState(907);
match(LPAREN);
{
setState(909);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PARTITION) {
{
setState(908);
((RankAnContext)_localctx).partition = partitionByClause();
}
}
setState(911);
((RankAnContext)_localctx).orderBy = orderByClause();
}
setState(913);
match(RPAREN);
setState(914);
match(RPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DistanceOperatorsContext extends ParserRuleContext {
public DistanceOperatorsContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_distanceOperators; }
public DistanceOperatorsContext() { }
public void copyFrom(DistanceOperatorsContext ctx) {
super.copyFrom(ctx);
}
}
public static class LevenshteinAtomContext extends DistanceOperatorsContext {
public ExprContext left;
public ExprContext right;
public TerminalNode LEVENSHTEIN() { return getToken(VtlParser.LEVENSHTEIN, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode COMMA() { return getToken(VtlParser.COMMA, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public LevenshteinAtomContext(DistanceOperatorsContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterLevenshteinAtom(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitLevenshteinAtom(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitLevenshteinAtom(this);
else return visitor.visitChildren(this);
}
}
public final DistanceOperatorsContext distanceOperators() throws RecognitionException {
DistanceOperatorsContext _localctx = new DistanceOperatorsContext(_ctx, getState());
enterRule(_localctx, 54, RULE_distanceOperators);
try {
_localctx = new LevenshteinAtomContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(918);
match(LEVENSHTEIN);
setState(919);
match(LPAREN);
setState(920);
((LevenshteinAtomContext)_localctx).left = expr(0);
setState(921);
match(COMMA);
setState(922);
((LevenshteinAtomContext)_localctx).right = expr(0);
setState(923);
match(RPAREN);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RenameClauseItemContext extends ParserRuleContext {
public ComponentIDContext fromName;
public ComponentIDContext toName;
public TerminalNode TO() { return getToken(VtlParser.TO, 0); }
public List componentID() {
return getRuleContexts(ComponentIDContext.class);
}
public ComponentIDContext componentID(int i) {
return getRuleContext(ComponentIDContext.class,i);
}
public RenameClauseItemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_renameClauseItem; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRenameClauseItem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRenameClauseItem(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRenameClauseItem(this);
else return visitor.visitChildren(this);
}
}
public final RenameClauseItemContext renameClauseItem() throws RecognitionException {
RenameClauseItemContext _localctx = new RenameClauseItemContext(_ctx, getState());
enterRule(_localctx, 56, RULE_renameClauseItem);
try {
enterOuterAlt(_localctx, 1);
{
setState(925);
((RenameClauseItemContext)_localctx).fromName = componentID();
setState(926);
match(TO);
setState(927);
((RenameClauseItemContext)_localctx).toName = componentID();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AggregateClauseContext extends ParserRuleContext {
public List aggrFunctionClause() {
return getRuleContexts(AggrFunctionClauseContext.class);
}
public AggrFunctionClauseContext aggrFunctionClause(int i) {
return getRuleContext(AggrFunctionClauseContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public AggregateClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_aggregateClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterAggregateClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitAggregateClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitAggregateClause(this);
else return visitor.visitChildren(this);
}
}
public final AggregateClauseContext aggregateClause() throws RecognitionException {
AggregateClauseContext _localctx = new AggregateClauseContext(_ctx, getState());
enterRule(_localctx, 58, RULE_aggregateClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(929);
aggrFunctionClause();
setState(934);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(930);
match(COMMA);
setState(931);
aggrFunctionClause();
}
}
setState(936);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class AggrFunctionClauseContext extends ParserRuleContext {
public ComponentIDContext componentID() {
return getRuleContext(ComponentIDContext.class,0);
}
public TerminalNode ASSIGN() { return getToken(VtlParser.ASSIGN, 0); }
public AggrOperatorsGroupingContext aggrOperatorsGrouping() {
return getRuleContext(AggrOperatorsGroupingContext.class,0);
}
public ComponentRoleContext componentRole() {
return getRuleContext(ComponentRoleContext.class,0);
}
public AggrFunctionClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_aggrFunctionClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterAggrFunctionClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitAggrFunctionClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitAggrFunctionClause(this);
else return visitor.visitChildren(this);
}
}
public final AggrFunctionClauseContext aggrFunctionClause() throws RecognitionException {
AggrFunctionClauseContext _localctx = new AggrFunctionClauseContext(_ctx, getState());
enterRule(_localctx, 60, RULE_aggrFunctionClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(938);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 103)) & ~0x3f) == 0 && ((1L << (_la - 103)) & ((1L << (DIMENSION - 103)) | (1L << (MEASURE - 103)) | (1L << (ATTRIBUTE - 103)) | (1L << (VIRAL - 103)))) != 0) || _la==COMPONENT) {
{
setState(937);
componentRole();
}
}
setState(940);
componentID();
setState(941);
match(ASSIGN);
setState(942);
aggrOperatorsGrouping();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CalcClauseItemContext extends ParserRuleContext {
public ComponentIDContext componentID() {
return getRuleContext(ComponentIDContext.class,0);
}
public TerminalNode ASSIGN() { return getToken(VtlParser.ASSIGN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public ComponentRoleContext componentRole() {
return getRuleContext(ComponentRoleContext.class,0);
}
public CalcClauseItemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_calcClauseItem; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCalcClauseItem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCalcClauseItem(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCalcClauseItem(this);
else return visitor.visitChildren(this);
}
}
public final CalcClauseItemContext calcClauseItem() throws RecognitionException {
CalcClauseItemContext _localctx = new CalcClauseItemContext(_ctx, getState());
enterRule(_localctx, 62, RULE_calcClauseItem);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(945);
_errHandler.sync(this);
_la = _input.LA(1);
if (((((_la - 103)) & ~0x3f) == 0 && ((1L << (_la - 103)) & ((1L << (DIMENSION - 103)) | (1L << (MEASURE - 103)) | (1L << (ATTRIBUTE - 103)) | (1L << (VIRAL - 103)))) != 0) || _la==COMPONENT) {
{
setState(944);
componentRole();
}
}
setState(947);
componentID();
setState(948);
match(ASSIGN);
setState(949);
expr(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SubspaceClauseItemContext extends ParserRuleContext {
public ComponentIDContext componentID() {
return getRuleContext(ComponentIDContext.class,0);
}
public TerminalNode EQ() { return getToken(VtlParser.EQ, 0); }
public ConstantContext constant() {
return getRuleContext(ConstantContext.class,0);
}
public SubspaceClauseItemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_subspaceClauseItem; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterSubspaceClauseItem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitSubspaceClauseItem(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitSubspaceClauseItem(this);
else return visitor.visitChildren(this);
}
}
public final SubspaceClauseItemContext subspaceClauseItem() throws RecognitionException {
SubspaceClauseItemContext _localctx = new SubspaceClauseItemContext(_ctx, getState());
enterRule(_localctx, 64, RULE_subspaceClauseItem);
try {
enterOuterAlt(_localctx, 1);
{
setState(951);
componentID();
setState(952);
match(EQ);
setState(953);
constant();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class JoinClauseWithoutUsingContext extends ParserRuleContext {
public List joinClauseItem() {
return getRuleContexts(JoinClauseItemContext.class);
}
public JoinClauseItemContext joinClauseItem(int i) {
return getRuleContext(JoinClauseItemContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public JoinClauseWithoutUsingContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_joinClauseWithoutUsing; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterJoinClauseWithoutUsing(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitJoinClauseWithoutUsing(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitJoinClauseWithoutUsing(this);
else return visitor.visitChildren(this);
}
}
public final JoinClauseWithoutUsingContext joinClauseWithoutUsing() throws RecognitionException {
JoinClauseWithoutUsingContext _localctx = new JoinClauseWithoutUsingContext(_ctx, getState());
enterRule(_localctx, 66, RULE_joinClauseWithoutUsing);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(955);
joinClauseItem();
setState(960);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(956);
match(COMMA);
setState(957);
joinClauseItem();
}
}
setState(962);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class JoinClauseContext extends ParserRuleContext {
public List joinClauseItem() {
return getRuleContexts(JoinClauseItemContext.class);
}
public JoinClauseItemContext joinClauseItem(int i) {
return getRuleContext(JoinClauseItemContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode USING() { return getToken(VtlParser.USING, 0); }
public List componentID() {
return getRuleContexts(ComponentIDContext.class);
}
public ComponentIDContext componentID(int i) {
return getRuleContext(ComponentIDContext.class,i);
}
public JoinClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_joinClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterJoinClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitJoinClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitJoinClause(this);
else return visitor.visitChildren(this);
}
}
public final JoinClauseContext joinClause() throws RecognitionException {
JoinClauseContext _localctx = new JoinClauseContext(_ctx, getState());
enterRule(_localctx, 68, RULE_joinClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(963);
joinClauseItem();
setState(968);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(964);
match(COMMA);
setState(965);
joinClauseItem();
}
}
setState(970);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(980);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==USING) {
{
setState(971);
match(USING);
setState(972);
componentID();
setState(977);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(973);
match(COMMA);
setState(974);
componentID();
}
}
setState(979);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class JoinClauseItemContext extends ParserRuleContext {
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode AS() { return getToken(VtlParser.AS, 0); }
public AliasContext alias() {
return getRuleContext(AliasContext.class,0);
}
public JoinClauseItemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_joinClauseItem; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterJoinClauseItem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitJoinClauseItem(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitJoinClauseItem(this);
else return visitor.visitChildren(this);
}
}
public final JoinClauseItemContext joinClauseItem() throws RecognitionException {
JoinClauseItemContext _localctx = new JoinClauseItemContext(_ctx, getState());
enterRule(_localctx, 70, RULE_joinClauseItem);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(982);
expr(0);
setState(985);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(983);
match(AS);
setState(984);
alias();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class JoinBodyContext extends ParserRuleContext {
public FilterClauseContext filterClause() {
return getRuleContext(FilterClauseContext.class,0);
}
public CalcClauseContext calcClause() {
return getRuleContext(CalcClauseContext.class,0);
}
public JoinApplyClauseContext joinApplyClause() {
return getRuleContext(JoinApplyClauseContext.class,0);
}
public AggrClauseContext aggrClause() {
return getRuleContext(AggrClauseContext.class,0);
}
public KeepOrDropClauseContext keepOrDropClause() {
return getRuleContext(KeepOrDropClauseContext.class,0);
}
public RenameClauseContext renameClause() {
return getRuleContext(RenameClauseContext.class,0);
}
public JoinBodyContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_joinBody; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterJoinBody(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitJoinBody(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitJoinBody(this);
else return visitor.visitChildren(this);
}
}
public final JoinBodyContext joinBody() throws RecognitionException {
JoinBodyContext _localctx = new JoinBodyContext(_ctx, getState());
enterRule(_localctx, 72, RULE_joinBody);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(988);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==FILTER) {
{
setState(987);
filterClause();
}
}
setState(993);
_errHandler.sync(this);
switch (_input.LA(1)) {
case CALC:
{
setState(990);
calcClause();
}
break;
case APPLY:
{
setState(991);
joinApplyClause();
}
break;
case AGGREGATE:
{
setState(992);
aggrClause();
}
break;
case RPAREN:
case DROP:
case KEEP:
case RENAME:
break;
default:
break;
}
setState(996);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==DROP || _la==KEEP) {
{
setState(995);
keepOrDropClause();
}
}
setState(999);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==RENAME) {
{
setState(998);
renameClause();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class JoinApplyClauseContext extends ParserRuleContext {
public TerminalNode APPLY() { return getToken(VtlParser.APPLY, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public JoinApplyClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_joinApplyClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterJoinApplyClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitJoinApplyClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitJoinApplyClause(this);
else return visitor.visitChildren(this);
}
}
public final JoinApplyClauseContext joinApplyClause() throws RecognitionException {
JoinApplyClauseContext _localctx = new JoinApplyClauseContext(_ctx, getState());
enterRule(_localctx, 74, RULE_joinApplyClause);
try {
enterOuterAlt(_localctx, 1);
{
setState(1001);
match(APPLY);
setState(1002);
expr(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class PartitionByClauseContext extends ParserRuleContext {
public TerminalNode PARTITION() { return getToken(VtlParser.PARTITION, 0); }
public TerminalNode BY() { return getToken(VtlParser.BY, 0); }
public List componentID() {
return getRuleContexts(ComponentIDContext.class);
}
public ComponentIDContext componentID(int i) {
return getRuleContext(ComponentIDContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public PartitionByClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_partitionByClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterPartitionByClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitPartitionByClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitPartitionByClause(this);
else return visitor.visitChildren(this);
}
}
public final PartitionByClauseContext partitionByClause() throws RecognitionException {
PartitionByClauseContext _localctx = new PartitionByClauseContext(_ctx, getState());
enterRule(_localctx, 76, RULE_partitionByClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1004);
match(PARTITION);
setState(1005);
match(BY);
setState(1006);
componentID();
setState(1011);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1007);
match(COMMA);
setState(1008);
componentID();
}
}
setState(1013);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class OrderByClauseContext extends ParserRuleContext {
public TerminalNode ORDER() { return getToken(VtlParser.ORDER, 0); }
public TerminalNode BY() { return getToken(VtlParser.BY, 0); }
public List orderByItem() {
return getRuleContexts(OrderByItemContext.class);
}
public OrderByItemContext orderByItem(int i) {
return getRuleContext(OrderByItemContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public OrderByClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_orderByClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterOrderByClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitOrderByClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitOrderByClause(this);
else return visitor.visitChildren(this);
}
}
public final OrderByClauseContext orderByClause() throws RecognitionException {
OrderByClauseContext _localctx = new OrderByClauseContext(_ctx, getState());
enterRule(_localctx, 78, RULE_orderByClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1014);
match(ORDER);
setState(1015);
match(BY);
setState(1016);
orderByItem();
setState(1021);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1017);
match(COMMA);
setState(1018);
orderByItem();
}
}
setState(1023);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class OrderByItemContext extends ParserRuleContext {
public ComponentIDContext componentID() {
return getRuleContext(ComponentIDContext.class,0);
}
public TerminalNode ASC() { return getToken(VtlParser.ASC, 0); }
public TerminalNode DESC() { return getToken(VtlParser.DESC, 0); }
public OrderByItemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_orderByItem; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterOrderByItem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitOrderByItem(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitOrderByItem(this);
else return visitor.visitChildren(this);
}
}
public final OrderByItemContext orderByItem() throws RecognitionException {
OrderByItemContext _localctx = new OrderByItemContext(_ctx, getState());
enterRule(_localctx, 80, RULE_orderByItem);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1024);
componentID();
setState(1026);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ASC || _la==DESC) {
{
setState(1025);
_la = _input.LA(1);
if ( !(_la==ASC || _la==DESC) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class WindowingClauseContext extends ParserRuleContext {
public LimitClauseItemContext from_;
public LimitClauseItemContext to_;
public TerminalNode BETWEEN() { return getToken(VtlParser.BETWEEN, 0); }
public TerminalNode AND() { return getToken(VtlParser.AND, 0); }
public List limitClauseItem() {
return getRuleContexts(LimitClauseItemContext.class);
}
public LimitClauseItemContext limitClauseItem(int i) {
return getRuleContext(LimitClauseItemContext.class,i);
}
public TerminalNode RANGE() { return getToken(VtlParser.RANGE, 0); }
public TerminalNode DATA() { return getToken(VtlParser.DATA, 0); }
public TerminalNode POINTS() { return getToken(VtlParser.POINTS, 0); }
public WindowingClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_windowingClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterWindowingClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitWindowingClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitWindowingClause(this);
else return visitor.visitChildren(this);
}
}
public final WindowingClauseContext windowingClause() throws RecognitionException {
WindowingClauseContext _localctx = new WindowingClauseContext(_ctx, getState());
enterRule(_localctx, 82, RULE_windowingClause);
try {
enterOuterAlt(_localctx, 1);
{
setState(1031);
_errHandler.sync(this);
switch (_input.LA(1)) {
case DATA:
{
{
setState(1028);
match(DATA);
setState(1029);
match(POINTS);
}
}
break;
case RANGE:
{
setState(1030);
match(RANGE);
}
break;
default:
throw new NoViableAltException(this);
}
setState(1033);
match(BETWEEN);
setState(1034);
((WindowingClauseContext)_localctx).from_ = limitClauseItem();
setState(1035);
match(AND);
setState(1036);
((WindowingClauseContext)_localctx).to_ = limitClauseItem();
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SignedIntegerContext extends ParserRuleContext {
public TerminalNode INTEGER_CONSTANT() { return getToken(VtlParser.INTEGER_CONSTANT, 0); }
public SignedIntegerContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_signedInteger; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterSignedInteger(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitSignedInteger(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitSignedInteger(this);
else return visitor.visitChildren(this);
}
}
public final SignedIntegerContext signedInteger() throws RecognitionException {
SignedIntegerContext _localctx = new SignedIntegerContext(_ctx, getState());
enterRule(_localctx, 84, RULE_signedInteger);
try {
enterOuterAlt(_localctx, 1);
{
setState(1038);
match(INTEGER_CONSTANT);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class LimitClauseItemContext extends ParserRuleContext {
public Token dir;
public TerminalNode INTEGER_CONSTANT() { return getToken(VtlParser.INTEGER_CONSTANT, 0); }
public TerminalNode PRECEDING() { return getToken(VtlParser.PRECEDING, 0); }
public TerminalNode FOLLOWING() { return getToken(VtlParser.FOLLOWING, 0); }
public TerminalNode CURRENT() { return getToken(VtlParser.CURRENT, 0); }
public TerminalNode DATA() { return getToken(VtlParser.DATA, 0); }
public TerminalNode POINT() { return getToken(VtlParser.POINT, 0); }
public TerminalNode UNBOUNDED() { return getToken(VtlParser.UNBOUNDED, 0); }
public LimitClauseItemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_limitClauseItem; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterLimitClauseItem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitLimitClauseItem(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitLimitClauseItem(this);
else return visitor.visitChildren(this);
}
}
public final LimitClauseItemContext limitClauseItem() throws RecognitionException {
LimitClauseItemContext _localctx = new LimitClauseItemContext(_ctx, getState());
enterRule(_localctx, 86, RULE_limitClauseItem);
try {
setState(1051);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,96,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
setState(1040);
match(INTEGER_CONSTANT);
setState(1041);
((LimitClauseItemContext)_localctx).dir = match(PRECEDING);
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
setState(1042);
match(INTEGER_CONSTANT);
setState(1043);
((LimitClauseItemContext)_localctx).dir = match(FOLLOWING);
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
setState(1044);
match(CURRENT);
setState(1045);
match(DATA);
setState(1046);
match(POINT);
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
setState(1047);
match(UNBOUNDED);
setState(1048);
((LimitClauseItemContext)_localctx).dir = match(PRECEDING);
}
break;
case 5:
enterOuterAlt(_localctx, 5);
{
setState(1049);
match(UNBOUNDED);
setState(1050);
((LimitClauseItemContext)_localctx).dir = match(FOLLOWING);
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class GroupingClauseContext extends ParserRuleContext {
public GroupingClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_groupingClause; }
public GroupingClauseContext() { }
public void copyFrom(GroupingClauseContext ctx) {
super.copyFrom(ctx);
}
}
public static class GroupAllContext extends GroupingClauseContext {
public TerminalNode GROUP() { return getToken(VtlParser.GROUP, 0); }
public TerminalNode ALL() { return getToken(VtlParser.ALL, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode TIME_AGG() { return getToken(VtlParser.TIME_AGG, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode TIME_UNIT() { return getToken(VtlParser.TIME_UNIT, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public GroupAllContext(GroupingClauseContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterGroupAll(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitGroupAll(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitGroupAll(this);
else return visitor.visitChildren(this);
}
}
public static class GroupByOrExceptContext extends GroupingClauseContext {
public Token op;
public Token delim;
public TerminalNode GROUP() { return getToken(VtlParser.GROUP, 0); }
public List componentID() {
return getRuleContexts(ComponentIDContext.class);
}
public ComponentIDContext componentID(int i) {
return getRuleContext(ComponentIDContext.class,i);
}
public TerminalNode BY() { return getToken(VtlParser.BY, 0); }
public TerminalNode EXCEPT() { return getToken(VtlParser.EXCEPT, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public TerminalNode TIME_AGG() { return getToken(VtlParser.TIME_AGG, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode TIME_UNIT() { return getToken(VtlParser.TIME_UNIT, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public TerminalNode FIRST() { return getToken(VtlParser.FIRST, 0); }
public TerminalNode LAST() { return getToken(VtlParser.LAST, 0); }
public GroupByOrExceptContext(GroupingClauseContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterGroupByOrExcept(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitGroupByOrExcept(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitGroupByOrExcept(this);
else return visitor.visitChildren(this);
}
}
public final GroupingClauseContext groupingClause() throws RecognitionException {
GroupingClauseContext _localctx = new GroupingClauseContext(_ctx, getState());
enterRule(_localctx, 88, RULE_groupingClause);
int _la;
try {
setState(1082);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,101,_ctx) ) {
case 1:
_localctx = new GroupByOrExceptContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1053);
match(GROUP);
setState(1054);
((GroupByOrExceptContext)_localctx).op = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==BY || _la==EXCEPT) ) {
((GroupByOrExceptContext)_localctx).op = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1055);
componentID();
setState(1060);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1056);
match(COMMA);
setState(1057);
componentID();
}
}
setState(1062);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1071);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TIME_AGG) {
{
setState(1063);
match(TIME_AGG);
setState(1064);
match(LPAREN);
setState(1065);
match(TIME_UNIT);
setState(1068);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==COMMA) {
{
setState(1066);
match(COMMA);
setState(1067);
((GroupByOrExceptContext)_localctx).delim = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==FIRST || _la==LAST) ) {
((GroupByOrExceptContext)_localctx).delim = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(1070);
match(RPAREN);
}
}
}
break;
case 2:
_localctx = new GroupAllContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1073);
match(GROUP);
setState(1074);
match(ALL);
setState(1075);
expr(0);
setState(1080);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==TIME_AGG) {
{
setState(1076);
match(TIME_AGG);
setState(1077);
match(LPAREN);
setState(1078);
match(TIME_UNIT);
setState(1079);
match(RPAREN);
}
}
}
break;
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class HavingClauseContext extends ParserRuleContext {
public TerminalNode HAVING() { return getToken(VtlParser.HAVING, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public HavingClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_havingClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterHavingClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitHavingClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitHavingClause(this);
else return visitor.visitChildren(this);
}
}
public final HavingClauseContext havingClause() throws RecognitionException {
HavingClauseContext _localctx = new HavingClauseContext(_ctx, getState());
enterRule(_localctx, 90, RULE_havingClause);
try {
enterOuterAlt(_localctx, 1);
{
setState(1084);
match(HAVING);
setState(1085);
expr(0);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ParameterItemContext extends ParserRuleContext {
public VarIDContext varID() {
return getRuleContext(VarIDContext.class,0);
}
public InputParameterTypeContext inputParameterType() {
return getRuleContext(InputParameterTypeContext.class,0);
}
public TerminalNode DEFAULT() { return getToken(VtlParser.DEFAULT, 0); }
public ConstantContext constant() {
return getRuleContext(ConstantContext.class,0);
}
public ParameterItemContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_parameterItem; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterParameterItem(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitParameterItem(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitParameterItem(this);
else return visitor.visitChildren(this);
}
}
public final ParameterItemContext parameterItem() throws RecognitionException {
ParameterItemContext _localctx = new ParameterItemContext(_ctx, getState());
enterRule(_localctx, 92, RULE_parameterItem);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1087);
varID();
setState(1088);
inputParameterType();
setState(1091);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==DEFAULT) {
{
setState(1089);
match(DEFAULT);
setState(1090);
constant();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class OutputParameterTypeContext extends ParserRuleContext {
public ScalarTypeContext scalarType() {
return getRuleContext(ScalarTypeContext.class,0);
}
public DatasetTypeContext datasetType() {
return getRuleContext(DatasetTypeContext.class,0);
}
public ComponentTypeContext componentType() {
return getRuleContext(ComponentTypeContext.class,0);
}
public OutputParameterTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_outputParameterType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterOutputParameterType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitOutputParameterType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitOutputParameterType(this);
else return visitor.visitChildren(this);
}
}
public final OutputParameterTypeContext outputParameterType() throws RecognitionException {
OutputParameterTypeContext _localctx = new OutputParameterTypeContext(_ctx, getState());
enterRule(_localctx, 94, RULE_outputParameterType);
try {
setState(1096);
_errHandler.sync(this);
switch (_input.LA(1)) {
case BOOLEAN:
case DATE:
case TIME_PERIOD:
case NUMBER:
case STRING:
case TIME:
case INTEGER:
case DURATION:
case SCALAR:
case IDENTIFIER:
enterOuterAlt(_localctx, 1);
{
setState(1093);
scalarType();
}
break;
case DATASET:
enterOuterAlt(_localctx, 2);
{
setState(1094);
datasetType();
}
break;
case DIMENSION:
case MEASURE:
case ATTRIBUTE:
case VIRAL:
case COMPONENT:
enterOuterAlt(_localctx, 3);
{
setState(1095);
componentType();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class OutputParameterTypeComponentContext extends ParserRuleContext {
public ComponentTypeContext componentType() {
return getRuleContext(ComponentTypeContext.class,0);
}
public ScalarTypeContext scalarType() {
return getRuleContext(ScalarTypeContext.class,0);
}
public OutputParameterTypeComponentContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_outputParameterTypeComponent; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterOutputParameterTypeComponent(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitOutputParameterTypeComponent(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitOutputParameterTypeComponent(this);
else return visitor.visitChildren(this);
}
}
public final OutputParameterTypeComponentContext outputParameterTypeComponent() throws RecognitionException {
OutputParameterTypeComponentContext _localctx = new OutputParameterTypeComponentContext(_ctx, getState());
enterRule(_localctx, 96, RULE_outputParameterTypeComponent);
try {
setState(1100);
_errHandler.sync(this);
switch (_input.LA(1)) {
case DIMENSION:
case MEASURE:
case ATTRIBUTE:
case VIRAL:
case COMPONENT:
enterOuterAlt(_localctx, 1);
{
setState(1098);
componentType();
}
break;
case BOOLEAN:
case DATE:
case TIME_PERIOD:
case NUMBER:
case STRING:
case TIME:
case INTEGER:
case DURATION:
case SCALAR:
case IDENTIFIER:
enterOuterAlt(_localctx, 2);
{
setState(1099);
scalarType();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class InputParameterTypeContext extends ParserRuleContext {
public ScalarTypeContext scalarType() {
return getRuleContext(ScalarTypeContext.class,0);
}
public DatasetTypeContext datasetType() {
return getRuleContext(DatasetTypeContext.class,0);
}
public ScalarSetTypeContext scalarSetType() {
return getRuleContext(ScalarSetTypeContext.class,0);
}
public RulesetTypeContext rulesetType() {
return getRuleContext(RulesetTypeContext.class,0);
}
public ComponentTypeContext componentType() {
return getRuleContext(ComponentTypeContext.class,0);
}
public InputParameterTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_inputParameterType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterInputParameterType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitInputParameterType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitInputParameterType(this);
else return visitor.visitChildren(this);
}
}
public final InputParameterTypeContext inputParameterType() throws RecognitionException {
InputParameterTypeContext _localctx = new InputParameterTypeContext(_ctx, getState());
enterRule(_localctx, 98, RULE_inputParameterType);
try {
setState(1107);
_errHandler.sync(this);
switch (_input.LA(1)) {
case BOOLEAN:
case DATE:
case TIME_PERIOD:
case NUMBER:
case STRING:
case TIME:
case INTEGER:
case DURATION:
case SCALAR:
case IDENTIFIER:
enterOuterAlt(_localctx, 1);
{
setState(1102);
scalarType();
}
break;
case DATASET:
enterOuterAlt(_localctx, 2);
{
setState(1103);
datasetType();
}
break;
case SET:
enterOuterAlt(_localctx, 3);
{
setState(1104);
scalarSetType();
}
break;
case DATAPOINT:
case HIERARCHICAL:
case RULESET:
case DATAPOINT_ON_VD:
case DATAPOINT_ON_VAR:
case HIERARCHICAL_ON_VD:
case HIERARCHICAL_ON_VAR:
enterOuterAlt(_localctx, 4);
{
setState(1105);
rulesetType();
}
break;
case DIMENSION:
case MEASURE:
case ATTRIBUTE:
case VIRAL:
case COMPONENT:
enterOuterAlt(_localctx, 5);
{
setState(1106);
componentType();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RulesetTypeContext extends ParserRuleContext {
public TerminalNode RULESET() { return getToken(VtlParser.RULESET, 0); }
public DpRulesetContext dpRuleset() {
return getRuleContext(DpRulesetContext.class,0);
}
public HrRulesetContext hrRuleset() {
return getRuleContext(HrRulesetContext.class,0);
}
public RulesetTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rulesetType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRulesetType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRulesetType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRulesetType(this);
else return visitor.visitChildren(this);
}
}
public final RulesetTypeContext rulesetType() throws RecognitionException {
RulesetTypeContext _localctx = new RulesetTypeContext(_ctx, getState());
enterRule(_localctx, 100, RULE_rulesetType);
try {
setState(1112);
_errHandler.sync(this);
switch (_input.LA(1)) {
case RULESET:
enterOuterAlt(_localctx, 1);
{
setState(1109);
match(RULESET);
}
break;
case DATAPOINT:
case DATAPOINT_ON_VD:
case DATAPOINT_ON_VAR:
enterOuterAlt(_localctx, 2);
{
setState(1110);
dpRuleset();
}
break;
case HIERARCHICAL:
case HIERARCHICAL_ON_VD:
case HIERARCHICAL_ON_VAR:
enterOuterAlt(_localctx, 3);
{
setState(1111);
hrRuleset();
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ScalarTypeContext extends ParserRuleContext {
public BasicScalarTypeContext basicScalarType() {
return getRuleContext(BasicScalarTypeContext.class,0);
}
public ValueDomainNameContext valueDomainName() {
return getRuleContext(ValueDomainNameContext.class,0);
}
public ScalarTypeConstraintContext scalarTypeConstraint() {
return getRuleContext(ScalarTypeConstraintContext.class,0);
}
public TerminalNode NULL_CONSTANT() { return getToken(VtlParser.NULL_CONSTANT, 0); }
public TerminalNode NOT() { return getToken(VtlParser.NOT, 0); }
public ScalarTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_scalarType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterScalarType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitScalarType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitScalarType(this);
else return visitor.visitChildren(this);
}
}
public final ScalarTypeContext scalarType() throws RecognitionException {
ScalarTypeContext _localctx = new ScalarTypeContext(_ctx, getState());
enterRule(_localctx, 102, RULE_scalarType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1116);
_errHandler.sync(this);
switch (_input.LA(1)) {
case BOOLEAN:
case DATE:
case TIME_PERIOD:
case NUMBER:
case STRING:
case TIME:
case INTEGER:
case DURATION:
case SCALAR:
{
setState(1114);
basicScalarType();
}
break;
case IDENTIFIER:
{
setState(1115);
valueDomainName();
}
break;
default:
throw new NoViableAltException(this);
}
setState(1119);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==QLPAREN || _la==GLPAREN) {
{
setState(1118);
scalarTypeConstraint();
}
}
setState(1125);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT || _la==NULL_CONSTANT) {
{
setState(1122);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==NOT) {
{
setState(1121);
match(NOT);
}
}
setState(1124);
match(NULL_CONSTANT);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ComponentTypeContext extends ParserRuleContext {
public ComponentRoleContext componentRole() {
return getRuleContext(ComponentRoleContext.class,0);
}
public TerminalNode LT() { return getToken(VtlParser.LT, 0); }
public ScalarTypeContext scalarType() {
return getRuleContext(ScalarTypeContext.class,0);
}
public TerminalNode MT() { return getToken(VtlParser.MT, 0); }
public ComponentTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_componentType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterComponentType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitComponentType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitComponentType(this);
else return visitor.visitChildren(this);
}
}
public final ComponentTypeContext componentType() throws RecognitionException {
ComponentTypeContext _localctx = new ComponentTypeContext(_ctx, getState());
enterRule(_localctx, 104, RULE_componentType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1127);
componentRole();
setState(1132);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LT) {
{
setState(1128);
match(LT);
setState(1129);
scalarType();
setState(1130);
match(MT);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DatasetTypeContext extends ParserRuleContext {
public TerminalNode DATASET() { return getToken(VtlParser.DATASET, 0); }
public TerminalNode GLPAREN() { return getToken(VtlParser.GLPAREN, 0); }
public List compConstraint() {
return getRuleContexts(CompConstraintContext.class);
}
public CompConstraintContext compConstraint(int i) {
return getRuleContext(CompConstraintContext.class,i);
}
public TerminalNode GRPAREN() { return getToken(VtlParser.GRPAREN, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public DatasetTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_datasetType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDatasetType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDatasetType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDatasetType(this);
else return visitor.visitChildren(this);
}
}
public final DatasetTypeContext datasetType() throws RecognitionException {
DatasetTypeContext _localctx = new DatasetTypeContext(_ctx, getState());
enterRule(_localctx, 106, RULE_datasetType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1134);
match(DATASET);
setState(1146);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GLPAREN) {
{
setState(1135);
match(GLPAREN);
setState(1136);
compConstraint();
setState(1141);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1137);
match(COMMA);
setState(1138);
compConstraint();
}
}
setState(1143);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1144);
match(GRPAREN);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ScalarSetTypeContext extends ParserRuleContext {
public TerminalNode SET() { return getToken(VtlParser.SET, 0); }
public TerminalNode LT() { return getToken(VtlParser.LT, 0); }
public ScalarTypeContext scalarType() {
return getRuleContext(ScalarTypeContext.class,0);
}
public TerminalNode MT() { return getToken(VtlParser.MT, 0); }
public ScalarSetTypeContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_scalarSetType; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterScalarSetType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitScalarSetType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitScalarSetType(this);
else return visitor.visitChildren(this);
}
}
public final ScalarSetTypeContext scalarSetType() throws RecognitionException {
ScalarSetTypeContext _localctx = new ScalarSetTypeContext(_ctx, getState());
enterRule(_localctx, 108, RULE_scalarSetType);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1148);
match(SET);
setState(1153);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LT) {
{
setState(1149);
match(LT);
setState(1150);
scalarType();
setState(1151);
match(MT);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class DpRulesetContext extends ParserRuleContext {
public DpRulesetContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_dpRuleset; }
public DpRulesetContext() { }
public void copyFrom(DpRulesetContext ctx) {
super.copyFrom(ctx);
}
}
public static class DataPointVdContext extends DpRulesetContext {
public TerminalNode DATAPOINT_ON_VD() { return getToken(VtlParser.DATAPOINT_ON_VD, 0); }
public TerminalNode GLPAREN() { return getToken(VtlParser.GLPAREN, 0); }
public List valueDomainName() {
return getRuleContexts(ValueDomainNameContext.class);
}
public ValueDomainNameContext valueDomainName(int i) {
return getRuleContext(ValueDomainNameContext.class,i);
}
public TerminalNode GRPAREN() { return getToken(VtlParser.GRPAREN, 0); }
public List MUL() { return getTokens(VtlParser.MUL); }
public TerminalNode MUL(int i) {
return getToken(VtlParser.MUL, i);
}
public DataPointVdContext(DpRulesetContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDataPointVd(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDataPointVd(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDataPointVd(this);
else return visitor.visitChildren(this);
}
}
public static class DataPointVarContext extends DpRulesetContext {
public TerminalNode DATAPOINT_ON_VAR() { return getToken(VtlParser.DATAPOINT_ON_VAR, 0); }
public TerminalNode GLPAREN() { return getToken(VtlParser.GLPAREN, 0); }
public List varID() {
return getRuleContexts(VarIDContext.class);
}
public VarIDContext varID(int i) {
return getRuleContext(VarIDContext.class,i);
}
public TerminalNode GRPAREN() { return getToken(VtlParser.GRPAREN, 0); }
public List MUL() { return getTokens(VtlParser.MUL); }
public TerminalNode MUL(int i) {
return getToken(VtlParser.MUL, i);
}
public DataPointVarContext(DpRulesetContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDataPointVar(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDataPointVar(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDataPointVar(this);
else return visitor.visitChildren(this);
}
}
public static class DataPointContext extends DpRulesetContext {
public TerminalNode DATAPOINT() { return getToken(VtlParser.DATAPOINT, 0); }
public DataPointContext(DpRulesetContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterDataPoint(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitDataPoint(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitDataPoint(this);
else return visitor.visitChildren(this);
}
}
public final DpRulesetContext dpRuleset() throws RecognitionException {
DpRulesetContext _localctx = new DpRulesetContext(_ctx, getState());
enterRule(_localctx, 110, RULE_dpRuleset);
int _la;
try {
setState(1184);
_errHandler.sync(this);
switch (_input.LA(1)) {
case DATAPOINT:
_localctx = new DataPointContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1155);
match(DATAPOINT);
}
break;
case DATAPOINT_ON_VD:
_localctx = new DataPointVdContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1156);
match(DATAPOINT_ON_VD);
setState(1168);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GLPAREN) {
{
setState(1157);
match(GLPAREN);
setState(1158);
valueDomainName();
setState(1163);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==MUL) {
{
{
setState(1159);
match(MUL);
setState(1160);
valueDomainName();
}
}
setState(1165);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1166);
match(GRPAREN);
}
}
}
break;
case DATAPOINT_ON_VAR:
_localctx = new DataPointVarContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1170);
match(DATAPOINT_ON_VAR);
setState(1182);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GLPAREN) {
{
setState(1171);
match(GLPAREN);
setState(1172);
varID();
setState(1177);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==MUL) {
{
{
setState(1173);
match(MUL);
setState(1174);
varID();
}
}
setState(1179);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1180);
match(GRPAREN);
}
}
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class HrRulesetContext extends ParserRuleContext {
public HrRulesetContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_hrRuleset; }
public HrRulesetContext() { }
public void copyFrom(HrRulesetContext ctx) {
super.copyFrom(ctx);
}
}
public static class HrRulesetVdTypeContext extends HrRulesetContext {
public Token vdName;
public TerminalNode HIERARCHICAL_ON_VD() { return getToken(VtlParser.HIERARCHICAL_ON_VD, 0); }
public TerminalNode GLPAREN() { return getToken(VtlParser.GLPAREN, 0); }
public TerminalNode GRPAREN() { return getToken(VtlParser.GRPAREN, 0); }
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public List valueDomainName() {
return getRuleContexts(ValueDomainNameContext.class);
}
public ValueDomainNameContext valueDomainName(int i) {
return getRuleContext(ValueDomainNameContext.class,i);
}
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List MUL() { return getTokens(VtlParser.MUL); }
public TerminalNode MUL(int i) {
return getToken(VtlParser.MUL, i);
}
public HrRulesetVdTypeContext(HrRulesetContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterHrRulesetVdType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitHrRulesetVdType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitHrRulesetVdType(this);
else return visitor.visitChildren(this);
}
}
public static class HrRulesetVarTypeContext extends HrRulesetContext {
public VarIDContext varName;
public TerminalNode HIERARCHICAL_ON_VAR() { return getToken(VtlParser.HIERARCHICAL_ON_VAR, 0); }
public TerminalNode GLPAREN() { return getToken(VtlParser.GLPAREN, 0); }
public TerminalNode GRPAREN() { return getToken(VtlParser.GRPAREN, 0); }
public List varID() {
return getRuleContexts(VarIDContext.class);
}
public VarIDContext varID(int i) {
return getRuleContext(VarIDContext.class,i);
}
public TerminalNode LPAREN() { return getToken(VtlParser.LPAREN, 0); }
public TerminalNode RPAREN() { return getToken(VtlParser.RPAREN, 0); }
public List MUL() { return getTokens(VtlParser.MUL); }
public TerminalNode MUL(int i) {
return getToken(VtlParser.MUL, i);
}
public HrRulesetVarTypeContext(HrRulesetContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterHrRulesetVarType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitHrRulesetVarType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitHrRulesetVarType(this);
else return visitor.visitChildren(this);
}
}
public static class HrRulesetTypeContext extends HrRulesetContext {
public TerminalNode HIERARCHICAL() { return getToken(VtlParser.HIERARCHICAL, 0); }
public HrRulesetTypeContext(HrRulesetContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterHrRulesetType(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitHrRulesetType(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitHrRulesetType(this);
else return visitor.visitChildren(this);
}
}
public final HrRulesetContext hrRuleset() throws RecognitionException {
HrRulesetContext _localctx = new HrRulesetContext(_ctx, getState());
enterRule(_localctx, 112, RULE_hrRuleset);
int _la;
try {
setState(1226);
_errHandler.sync(this);
switch (_input.LA(1)) {
case HIERARCHICAL:
_localctx = new HrRulesetTypeContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1186);
match(HIERARCHICAL);
}
break;
case HIERARCHICAL_ON_VD:
_localctx = new HrRulesetVdTypeContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1187);
match(HIERARCHICAL_ON_VD);
setState(1204);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GLPAREN) {
{
setState(1188);
match(GLPAREN);
setState(1189);
((HrRulesetVdTypeContext)_localctx).vdName = match(IDENTIFIER);
setState(1201);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LPAREN) {
{
setState(1190);
match(LPAREN);
setState(1191);
valueDomainName();
setState(1196);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==MUL) {
{
{
setState(1192);
match(MUL);
setState(1193);
valueDomainName();
}
}
setState(1198);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1199);
match(RPAREN);
}
}
setState(1203);
match(GRPAREN);
}
}
}
break;
case HIERARCHICAL_ON_VAR:
_localctx = new HrRulesetVarTypeContext(_localctx);
enterOuterAlt(_localctx, 3);
{
setState(1206);
match(HIERARCHICAL_ON_VAR);
setState(1224);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==GLPAREN) {
{
setState(1207);
match(GLPAREN);
setState(1208);
((HrRulesetVarTypeContext)_localctx).varName = varID();
setState(1220);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==LPAREN) {
{
setState(1209);
match(LPAREN);
setState(1210);
varID();
setState(1215);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==MUL) {
{
{
setState(1211);
match(MUL);
setState(1212);
varID();
}
}
setState(1217);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1218);
match(RPAREN);
}
}
setState(1222);
match(GRPAREN);
}
}
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ValueDomainNameContext extends ParserRuleContext {
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public ValueDomainNameContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_valueDomainName; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterValueDomainName(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitValueDomainName(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitValueDomainName(this);
else return visitor.visitChildren(this);
}
}
public final ValueDomainNameContext valueDomainName() throws RecognitionException {
ValueDomainNameContext _localctx = new ValueDomainNameContext(_ctx, getState());
enterRule(_localctx, 114, RULE_valueDomainName);
try {
enterOuterAlt(_localctx, 1);
{
setState(1228);
match(IDENTIFIER);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RulesetIDContext extends ParserRuleContext {
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public RulesetIDContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rulesetID; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRulesetID(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRulesetID(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRulesetID(this);
else return visitor.visitChildren(this);
}
}
public final RulesetIDContext rulesetID() throws RecognitionException {
RulesetIDContext _localctx = new RulesetIDContext(_ctx, getState());
enterRule(_localctx, 116, RULE_rulesetID);
try {
enterOuterAlt(_localctx, 1);
{
setState(1230);
match(IDENTIFIER);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RulesetSignatureContext extends ParserRuleContext {
public List signature() {
return getRuleContexts(SignatureContext.class);
}
public SignatureContext signature(int i) {
return getRuleContext(SignatureContext.class,i);
}
public TerminalNode VALUE_DOMAIN() { return getToken(VtlParser.VALUE_DOMAIN, 0); }
public TerminalNode VARIABLE() { return getToken(VtlParser.VARIABLE, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public RulesetSignatureContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_rulesetSignature; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRulesetSignature(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRulesetSignature(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRulesetSignature(this);
else return visitor.visitChildren(this);
}
}
public final RulesetSignatureContext rulesetSignature() throws RecognitionException {
RulesetSignatureContext _localctx = new RulesetSignatureContext(_ctx, getState());
enterRule(_localctx, 118, RULE_rulesetSignature);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1232);
_la = _input.LA(1);
if ( !(_la==VALUE_DOMAIN || _la==VARIABLE) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1233);
signature();
setState(1238);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1234);
match(COMMA);
setState(1235);
signature();
}
}
setState(1240);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class SignatureContext extends ParserRuleContext {
public VarIDContext varID() {
return getRuleContext(VarIDContext.class,0);
}
public TerminalNode AS() { return getToken(VtlParser.AS, 0); }
public AliasContext alias() {
return getRuleContext(AliasContext.class,0);
}
public SignatureContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_signature; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterSignature(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitSignature(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitSignature(this);
else return visitor.visitChildren(this);
}
}
public final SignatureContext signature() throws RecognitionException {
SignatureContext _localctx = new SignatureContext(_ctx, getState());
enterRule(_localctx, 120, RULE_signature);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1241);
varID();
setState(1244);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==AS) {
{
setState(1242);
match(AS);
setState(1243);
alias();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RuleClauseDatapointContext extends ParserRuleContext {
public List ruleItemDatapoint() {
return getRuleContexts(RuleItemDatapointContext.class);
}
public RuleItemDatapointContext ruleItemDatapoint(int i) {
return getRuleContext(RuleItemDatapointContext.class,i);
}
public List EOL() { return getTokens(VtlParser.EOL); }
public TerminalNode EOL(int i) {
return getToken(VtlParser.EOL, i);
}
public RuleClauseDatapointContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ruleClauseDatapoint; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRuleClauseDatapoint(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRuleClauseDatapoint(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRuleClauseDatapoint(this);
else return visitor.visitChildren(this);
}
}
public final RuleClauseDatapointContext ruleClauseDatapoint() throws RecognitionException {
RuleClauseDatapointContext _localctx = new RuleClauseDatapointContext(_ctx, getState());
enterRule(_localctx, 122, RULE_ruleClauseDatapoint);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1246);
ruleItemDatapoint();
setState(1251);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==EOL) {
{
{
setState(1247);
match(EOL);
setState(1248);
ruleItemDatapoint();
}
}
setState(1253);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RuleItemDatapointContext extends ParserRuleContext {
public Token ruleName;
public ExprContext antecedentContiditon;
public ExprContext consequentCondition;
public List expr() {
return getRuleContexts(ExprContext.class);
}
public ExprContext expr(int i) {
return getRuleContext(ExprContext.class,i);
}
public TerminalNode COLON() { return getToken(VtlParser.COLON, 0); }
public TerminalNode WHEN() { return getToken(VtlParser.WHEN, 0); }
public TerminalNode THEN() { return getToken(VtlParser.THEN, 0); }
public ErCodeContext erCode() {
return getRuleContext(ErCodeContext.class,0);
}
public ErLevelContext erLevel() {
return getRuleContext(ErLevelContext.class,0);
}
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public RuleItemDatapointContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ruleItemDatapoint; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRuleItemDatapoint(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRuleItemDatapoint(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRuleItemDatapoint(this);
else return visitor.visitChildren(this);
}
}
public final RuleItemDatapointContext ruleItemDatapoint() throws RecognitionException {
RuleItemDatapointContext _localctx = new RuleItemDatapointContext(_ctx, getState());
enterRule(_localctx, 124, RULE_ruleItemDatapoint);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1256);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,130,_ctx) ) {
case 1:
{
setState(1254);
((RuleItemDatapointContext)_localctx).ruleName = match(IDENTIFIER);
setState(1255);
match(COLON);
}
break;
}
setState(1262);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHEN) {
{
setState(1258);
match(WHEN);
setState(1259);
((RuleItemDatapointContext)_localctx).antecedentContiditon = expr(0);
setState(1260);
match(THEN);
}
}
setState(1264);
((RuleItemDatapointContext)_localctx).consequentCondition = expr(0);
setState(1266);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ERRORCODE) {
{
setState(1265);
erCode();
}
}
setState(1269);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ERRORLEVEL) {
{
setState(1268);
erLevel();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RuleClauseHierarchicalContext extends ParserRuleContext {
public List ruleItemHierarchical() {
return getRuleContexts(RuleItemHierarchicalContext.class);
}
public RuleItemHierarchicalContext ruleItemHierarchical(int i) {
return getRuleContext(RuleItemHierarchicalContext.class,i);
}
public List EOL() { return getTokens(VtlParser.EOL); }
public TerminalNode EOL(int i) {
return getToken(VtlParser.EOL, i);
}
public RuleClauseHierarchicalContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ruleClauseHierarchical; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRuleClauseHierarchical(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRuleClauseHierarchical(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRuleClauseHierarchical(this);
else return visitor.visitChildren(this);
}
}
public final RuleClauseHierarchicalContext ruleClauseHierarchical() throws RecognitionException {
RuleClauseHierarchicalContext _localctx = new RuleClauseHierarchicalContext(_ctx, getState());
enterRule(_localctx, 126, RULE_ruleClauseHierarchical);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1271);
ruleItemHierarchical();
setState(1276);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==EOL) {
{
{
setState(1272);
match(EOL);
setState(1273);
ruleItemHierarchical();
}
}
setState(1278);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class RuleItemHierarchicalContext extends ParserRuleContext {
public Token ruleName;
public CodeItemRelationContext codeItemRelation() {
return getRuleContext(CodeItemRelationContext.class,0);
}
public TerminalNode COLON() { return getToken(VtlParser.COLON, 0); }
public ErCodeContext erCode() {
return getRuleContext(ErCodeContext.class,0);
}
public ErLevelContext erLevel() {
return getRuleContext(ErLevelContext.class,0);
}
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public RuleItemHierarchicalContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_ruleItemHierarchical; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRuleItemHierarchical(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRuleItemHierarchical(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRuleItemHierarchical(this);
else return visitor.visitChildren(this);
}
}
public final RuleItemHierarchicalContext ruleItemHierarchical() throws RecognitionException {
RuleItemHierarchicalContext _localctx = new RuleItemHierarchicalContext(_ctx, getState());
enterRule(_localctx, 128, RULE_ruleItemHierarchical);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1281);
_errHandler.sync(this);
switch ( getInterpreter().adaptivePredict(_input,135,_ctx) ) {
case 1:
{
setState(1279);
((RuleItemHierarchicalContext)_localctx).ruleName = match(IDENTIFIER);
setState(1280);
match(COLON);
}
break;
}
setState(1283);
codeItemRelation();
setState(1285);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ERRORCODE) {
{
setState(1284);
erCode();
}
}
setState(1288);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==ERRORLEVEL) {
{
setState(1287);
erLevel();
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class HierRuleSignatureContext extends ParserRuleContext {
public TerminalNode RULE() { return getToken(VtlParser.RULE, 0); }
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public TerminalNode VALUE_DOMAIN() { return getToken(VtlParser.VALUE_DOMAIN, 0); }
public TerminalNode VARIABLE() { return getToken(VtlParser.VARIABLE, 0); }
public TerminalNode CONDITION() { return getToken(VtlParser.CONDITION, 0); }
public ValueDomainSignatureContext valueDomainSignature() {
return getRuleContext(ValueDomainSignatureContext.class,0);
}
public HierRuleSignatureContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_hierRuleSignature; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterHierRuleSignature(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitHierRuleSignature(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitHierRuleSignature(this);
else return visitor.visitChildren(this);
}
}
public final HierRuleSignatureContext hierRuleSignature() throws RecognitionException {
HierRuleSignatureContext _localctx = new HierRuleSignatureContext(_ctx, getState());
enterRule(_localctx, 130, RULE_hierRuleSignature);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1290);
_la = _input.LA(1);
if ( !(_la==VALUE_DOMAIN || _la==VARIABLE) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
setState(1293);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==CONDITION) {
{
setState(1291);
match(CONDITION);
setState(1292);
valueDomainSignature();
}
}
setState(1295);
match(RULE);
setState(1296);
match(IDENTIFIER);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ValueDomainSignatureContext extends ParserRuleContext {
public List signature() {
return getRuleContexts(SignatureContext.class);
}
public SignatureContext signature(int i) {
return getRuleContext(SignatureContext.class,i);
}
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public ValueDomainSignatureContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_valueDomainSignature; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterValueDomainSignature(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitValueDomainSignature(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitValueDomainSignature(this);
else return visitor.visitChildren(this);
}
}
public final ValueDomainSignatureContext valueDomainSignature() throws RecognitionException {
ValueDomainSignatureContext _localctx = new ValueDomainSignatureContext(_ctx, getState());
enterRule(_localctx, 132, RULE_valueDomainSignature);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1298);
signature();
setState(1303);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1299);
match(COMMA);
setState(1300);
signature();
}
}
setState(1305);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CodeItemRelationContext extends ParserRuleContext {
public ValueDomainValueContext codetemRef;
public List codeItemRelationClause() {
return getRuleContexts(CodeItemRelationClauseContext.class);
}
public CodeItemRelationClauseContext codeItemRelationClause(int i) {
return getRuleContext(CodeItemRelationClauseContext.class,i);
}
public ValueDomainValueContext valueDomainValue() {
return getRuleContext(ValueDomainValueContext.class,0);
}
public TerminalNode WHEN() { return getToken(VtlParser.WHEN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode THEN() { return getToken(VtlParser.THEN, 0); }
public ComparisonOperandContext comparisonOperand() {
return getRuleContext(ComparisonOperandContext.class,0);
}
public CodeItemRelationContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_codeItemRelation; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCodeItemRelation(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCodeItemRelation(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCodeItemRelation(this);
else return visitor.visitChildren(this);
}
}
public final CodeItemRelationContext codeItemRelation() throws RecognitionException {
CodeItemRelationContext _localctx = new CodeItemRelationContext(_ctx, getState());
enterRule(_localctx, 134, RULE_codeItemRelation);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1310);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==WHEN) {
{
setState(1306);
match(WHEN);
setState(1307);
expr(0);
setState(1308);
match(THEN);
}
}
setState(1312);
((CodeItemRelationContext)_localctx).codetemRef = valueDomainValue();
setState(1314);
_errHandler.sync(this);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EQ) | (1L << LT) | (1L << MT) | (1L << ME) | (1L << NEQ) | (1L << LE))) != 0)) {
{
setState(1313);
comparisonOperand();
}
}
setState(1316);
codeItemRelationClause();
setState(1320);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==PLUS || _la==MINUS || ((((_la - 242)) & ~0x3f) == 0 && ((1L << (_la - 242)) & ((1L << (INTEGER_CONSTANT - 242)) | (1L << (NUMBER_CONSTANT - 242)) | (1L << (IDENTIFIER - 242)))) != 0)) {
{
{
setState(1317);
codeItemRelationClause();
}
}
setState(1322);
_errHandler.sync(this);
_la = _input.LA(1);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CodeItemRelationClauseContext extends ParserRuleContext {
public Token opAdd;
public ValueDomainValueContext rightCodeItem;
public ExprContext rightCondition;
public ValueDomainValueContext valueDomainValue() {
return getRuleContext(ValueDomainValueContext.class,0);
}
public TerminalNode QLPAREN() { return getToken(VtlParser.QLPAREN, 0); }
public TerminalNode QRPAREN() { return getToken(VtlParser.QRPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode PLUS() { return getToken(VtlParser.PLUS, 0); }
public TerminalNode MINUS() { return getToken(VtlParser.MINUS, 0); }
public CodeItemRelationClauseContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_codeItemRelationClause; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCodeItemRelationClause(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCodeItemRelationClause(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCodeItemRelationClause(this);
else return visitor.visitChildren(this);
}
}
public final CodeItemRelationClauseContext codeItemRelationClause() throws RecognitionException {
CodeItemRelationClauseContext _localctx = new CodeItemRelationClauseContext(_ctx, getState());
enterRule(_localctx, 136, RULE_codeItemRelationClause);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1324);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PLUS || _la==MINUS) {
{
setState(1323);
((CodeItemRelationClauseContext)_localctx).opAdd = _input.LT(1);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MINUS) ) {
((CodeItemRelationClauseContext)_localctx).opAdd = (Token)_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
setState(1326);
((CodeItemRelationClauseContext)_localctx).rightCodeItem = valueDomainValue();
setState(1331);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==QLPAREN) {
{
setState(1327);
match(QLPAREN);
setState(1328);
((CodeItemRelationClauseContext)_localctx).rightCondition = expr(0);
setState(1329);
match(QRPAREN);
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ValueDomainValueContext extends ParserRuleContext {
public TerminalNode IDENTIFIER() { return getToken(VtlParser.IDENTIFIER, 0); }
public TerminalNode INTEGER_CONSTANT() { return getToken(VtlParser.INTEGER_CONSTANT, 0); }
public TerminalNode NUMBER_CONSTANT() { return getToken(VtlParser.NUMBER_CONSTANT, 0); }
public ValueDomainValueContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_valueDomainValue; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterValueDomainValue(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitValueDomainValue(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitValueDomainValue(this);
else return visitor.visitChildren(this);
}
}
public final ValueDomainValueContext valueDomainValue() throws RecognitionException {
ValueDomainValueContext _localctx = new ValueDomainValueContext(_ctx, getState());
enterRule(_localctx, 138, RULE_valueDomainValue);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1333);
_la = _input.LA(1);
if ( !(((((_la - 242)) & ~0x3f) == 0 && ((1L << (_la - 242)) & ((1L << (INTEGER_CONSTANT - 242)) | (1L << (NUMBER_CONSTANT - 242)) | (1L << (IDENTIFIER - 242)))) != 0)) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ScalarTypeConstraintContext extends ParserRuleContext {
public ScalarTypeConstraintContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_scalarTypeConstraint; }
public ScalarTypeConstraintContext() { }
public void copyFrom(ScalarTypeConstraintContext ctx) {
super.copyFrom(ctx);
}
}
public static class RangeConstraintContext extends ScalarTypeConstraintContext {
public TerminalNode GLPAREN() { return getToken(VtlParser.GLPAREN, 0); }
public List constant() {
return getRuleContexts(ConstantContext.class);
}
public ConstantContext constant(int i) {
return getRuleContext(ConstantContext.class,i);
}
public TerminalNode GRPAREN() { return getToken(VtlParser.GRPAREN, 0); }
public List COMMA() { return getTokens(VtlParser.COMMA); }
public TerminalNode COMMA(int i) {
return getToken(VtlParser.COMMA, i);
}
public RangeConstraintContext(ScalarTypeConstraintContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterRangeConstraint(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitRangeConstraint(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitRangeConstraint(this);
else return visitor.visitChildren(this);
}
}
public static class ConditionConstraintContext extends ScalarTypeConstraintContext {
public TerminalNode QLPAREN() { return getToken(VtlParser.QLPAREN, 0); }
public ExprContext expr() {
return getRuleContext(ExprContext.class,0);
}
public TerminalNode QRPAREN() { return getToken(VtlParser.QRPAREN, 0); }
public ConditionConstraintContext(ScalarTypeConstraintContext ctx) { copyFrom(ctx); }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterConditionConstraint(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitConditionConstraint(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitConditionConstraint(this);
else return visitor.visitChildren(this);
}
}
public final ScalarTypeConstraintContext scalarTypeConstraint() throws RecognitionException {
ScalarTypeConstraintContext _localctx = new ScalarTypeConstraintContext(_ctx, getState());
enterRule(_localctx, 140, RULE_scalarTypeConstraint);
int _la;
try {
setState(1350);
_errHandler.sync(this);
switch (_input.LA(1)) {
case QLPAREN:
_localctx = new ConditionConstraintContext(_localctx);
enterOuterAlt(_localctx, 1);
{
setState(1335);
match(QLPAREN);
setState(1336);
expr(0);
setState(1337);
match(QRPAREN);
}
break;
case GLPAREN:
_localctx = new RangeConstraintContext(_localctx);
enterOuterAlt(_localctx, 2);
{
setState(1339);
match(GLPAREN);
setState(1340);
constant();
setState(1345);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
setState(1341);
match(COMMA);
setState(1342);
constant();
}
}
setState(1347);
_errHandler.sync(this);
_la = _input.LA(1);
}
setState(1348);
match(GRPAREN);
}
break;
default:
throw new NoViableAltException(this);
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class CompConstraintContext extends ParserRuleContext {
public ComponentTypeContext componentType() {
return getRuleContext(ComponentTypeContext.class,0);
}
public ComponentIDContext componentID() {
return getRuleContext(ComponentIDContext.class,0);
}
public MultModifierContext multModifier() {
return getRuleContext(MultModifierContext.class,0);
}
public CompConstraintContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_compConstraint; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterCompConstraint(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitCompConstraint(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitCompConstraint(this);
else return visitor.visitChildren(this);
}
}
public final CompConstraintContext compConstraint() throws RecognitionException {
CompConstraintContext _localctx = new CompConstraintContext(_ctx, getState());
enterRule(_localctx, 142, RULE_compConstraint);
try {
enterOuterAlt(_localctx, 1);
{
setState(1352);
componentType();
setState(1355);
_errHandler.sync(this);
switch (_input.LA(1)) {
case IDENTIFIER:
{
setState(1353);
componentID();
}
break;
case OPTIONAL:
{
setState(1354);
multModifier();
}
break;
default:
throw new NoViableAltException(this);
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class MultModifierContext extends ParserRuleContext {
public TerminalNode OPTIONAL() { return getToken(VtlParser.OPTIONAL, 0); }
public TerminalNode PLUS() { return getToken(VtlParser.PLUS, 0); }
public TerminalNode MUL() { return getToken(VtlParser.MUL, 0); }
public MultModifierContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_multModifier; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterMultModifier(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitMultModifier(this);
}
@Override
public T accept(ParseTreeVisitor extends T> visitor) {
if ( visitor instanceof VtlVisitor ) return ((VtlVisitor extends T>)visitor).visitMultModifier(this);
else return visitor.visitChildren(this);
}
}
public final MultModifierContext multModifier() throws RecognitionException {
MultModifierContext _localctx = new MultModifierContext(_ctx, getState());
enterRule(_localctx, 144, RULE_multModifier);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
setState(1357);
match(OPTIONAL);
setState(1359);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la==PLUS || _la==MUL) {
{
setState(1358);
_la = _input.LA(1);
if ( !(_la==PLUS || _la==MUL) ) {
_errHandler.recoverInline(this);
}
else {
if ( _input.LA(1)==Token.EOF ) matchedEOF = true;
_errHandler.reportMatch(this);
consume();
}
}
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}
public static class ValidationOutputContext extends ParserRuleContext {
public TerminalNode INVALID() { return getToken(VtlParser.INVALID, 0); }
public TerminalNode ALL_MEASURES() { return getToken(VtlParser.ALL_MEASURES, 0); }
public TerminalNode ALL() { return getToken(VtlParser.ALL, 0); }
public ValidationOutputContext(ParserRuleContext parent, int invokingState) {
super(parent, invokingState);
}
@Override public int getRuleIndex() { return RULE_validationOutput; }
@Override
public void enterRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).enterValidationOutput(this);
}
@Override
public void exitRule(ParseTreeListener listener) {
if ( listener instanceof VtlListener ) ((VtlListener)listener).exitValidationOutput(this);
}
@Override
public