parent
0ba5e9fb90
commit
5b836dbb11
|
@ -103,7 +103,7 @@ public class PluginManager {
|
|||
"discovery-multicast",
|
||||
"ingest-geoip",
|
||||
"lang-javascript",
|
||||
"lang-plan-a",
|
||||
"lang-painless",
|
||||
"lang-python",
|
||||
"mapper-attachments",
|
||||
"mapper-murmur3",
|
||||
|
|
|
@ -45,7 +45,7 @@ OFFICIAL PLUGINS
|
|||
- discovery-multicast
|
||||
- ingest-geoip
|
||||
- lang-javascript
|
||||
- lang-plan-a
|
||||
- lang-painless
|
||||
- lang-python
|
||||
- mapper-attachments
|
||||
- mapper-murmur3
|
||||
|
|
|
@ -68,7 +68,7 @@ DEFAULT_PLUGINS = ["analysis-icu",
|
|||
"discovery-gce",
|
||||
"discovery-multicast",
|
||||
"lang-javascript",
|
||||
"lang-plan-a",
|
||||
"lang-painless",
|
||||
"lang-python",
|
||||
"mapper-attachments",
|
||||
"mapper-murmur3",
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
<target name="regenerate" description="Regenerate antlr lexer and parser" depends="run-antlr"/>
|
||||
|
||||
<target name="run-antlr">
|
||||
<regen-delete grammar="PlanA"/>
|
||||
<regen-lexer grammar="PlanA"/>
|
||||
<regen-parser grammar="PlanA"/>
|
||||
<regen-fix grammar="PlanA"/>
|
||||
<regen-delete grammar="Painless"/>
|
||||
<regen-lexer grammar="Painless"/>
|
||||
<regen-parser grammar="Painless"/>
|
||||
<regen-fix grammar="Painless"/>
|
||||
</target>
|
||||
|
||||
<macrodef name="replace-value">
|
||||
|
@ -49,7 +49,7 @@
|
|||
<include name="@{grammar}ParserVisitor.java" />
|
||||
<include name="@{grammar}ParserBaseVisitor.java" />
|
||||
</patternset>
|
||||
<property name="output.path" location="src/main/java/org/elasticsearch/plan/a"/>
|
||||
<property name="output.path" location="src/main/java/org/elasticsearch/painless"/>
|
||||
<!-- delete parser and lexer so files will be generated -->
|
||||
<delete dir="${output.path}">
|
||||
<patternset refid="grammar.@{grammar}.patternset"/>
|
||||
|
@ -63,7 +63,7 @@
|
|||
<local name="grammar.path"/>
|
||||
<local name="output.path"/>
|
||||
<property name="grammar.path" location="src/main/antlr"/>
|
||||
<property name="output.path" location="src/main/java/org/elasticsearch/plan/a"/>
|
||||
<property name="output.path" location="src/main/java/org/elasticsearch/painless"/>
|
||||
<!-- invoke ANTLR4 -->
|
||||
<java classname="org.antlr.v4.Tool" fork="true" failonerror="true" classpathref="regenerate.classpath" taskname="antlr">
|
||||
<sysproperty key="file.encoding" value="UTF-8"/>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<sysproperty key="user.country" value="US"/>
|
||||
<sysproperty key="user.variant" value=""/>
|
||||
<arg value="-package"/>
|
||||
<arg value="org.elasticsearch.plan.a"/>
|
||||
<arg value="org.elasticsearch.painless"/>
|
||||
<arg value="-o"/>
|
||||
<arg path="${output.path}"/>
|
||||
<arg path="${grammar.path}/@{grammar}Lexer.g4"/>
|
||||
|
@ -85,7 +85,7 @@
|
|||
<local name="grammar.path"/>
|
||||
<local name="output.path"/>
|
||||
<property name="grammar.path" location="src/main/antlr"/>
|
||||
<property name="output.path" location="src/main/java/org/elasticsearch/plan/a"/>
|
||||
<property name="output.path" location="src/main/java/org/elasticsearch/painless"/>
|
||||
<!-- invoke ANTLR4 -->
|
||||
<java classname="org.antlr.v4.Tool" fork="true" failonerror="true" classpathref="regenerate.classpath" taskname="antlr">
|
||||
<sysproperty key="file.encoding" value="UTF-8"/>
|
||||
|
@ -93,7 +93,7 @@
|
|||
<sysproperty key="user.country" value="US"/>
|
||||
<sysproperty key="user.variant" value=""/>
|
||||
<arg value="-package"/>
|
||||
<arg value="org.elasticsearch.plan.a"/>
|
||||
<arg value="org.elasticsearch.painless"/>
|
||||
<arg value="-no-listener"/>
|
||||
<arg value="-visitor"/>
|
||||
<!-- <arg value="-Xlog"/> -->
|
||||
|
@ -110,7 +110,7 @@
|
|||
<local name="grammar.path"/>
|
||||
<local name="output.path"/>
|
||||
<property name="grammar.path" location="src/main/antlr"/>
|
||||
<property name="output.path" location="src/main/java/org/elasticsearch/plan/a"/>
|
||||
<property name="output.path" location="src/main/java/org/elasticsearch/painless"/>
|
||||
<patternset id="grammar.@{grammar}.patternset">
|
||||
<include name="@{grammar}Lexer.java" />
|
||||
<include name="@{grammar}Parser.java" />
|
|
@ -21,7 +21,7 @@ import org.apache.tools.ant.types.Path
|
|||
|
||||
esplugin {
|
||||
description 'An easy, safe and fast scripting language for Elasticsearch'
|
||||
classname 'org.elasticsearch.plan.a.PlanAPlugin'
|
||||
classname 'org.elasticsearch.painless.PainlessPlugin'
|
||||
}
|
||||
|
||||
dependencies {
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
lexer grammar PlanALexer;
|
||||
lexer grammar PainlessLexer;
|
||||
|
||||
@header {
|
||||
import java.util.Set;
|
|
@ -17,9 +17,9 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
parser grammar PlanAParser;
|
||||
parser grammar PainlessParser;
|
||||
|
||||
options { tokenVocab=PlanALexer; }
|
||||
options { tokenVocab=PainlessLexer; }
|
||||
|
||||
source
|
||||
: statement+ EOF
|
File diff suppressed because it is too large
Load Diff
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.antlr.v4.runtime.ANTLRInputStream;
|
||||
import org.antlr.v4.runtime.CommonTokenStream;
|
||||
|
@ -31,14 +31,14 @@ import java.security.SecureClassLoader;
|
|||
import java.security.cert.Certificate;
|
||||
|
||||
/**
|
||||
* The Compiler is the entry point for generating a Plan A script. The compiler will generate an ANTLR
|
||||
* The Compiler is the entry point for generating a Painless script. The compiler will generate an ANTLR
|
||||
* parse tree based on the source code that is passed in. Two passes will then be run over the parse tree,
|
||||
* one for analysis using the {@link Analyzer} and another to generate the actual byte code using ASM in
|
||||
* the {@link Writer}.
|
||||
*/
|
||||
final class Compiler {
|
||||
/**
|
||||
* The default language API to be used with Plan A. The second construction is used
|
||||
* The default language API to be used with Painless. The second construction is used
|
||||
* to finalize all the variables, so there is no mistake of modification afterwards.
|
||||
*/
|
||||
private static Definition DEFAULT_DEFINITION = new Definition(new Definition());
|
||||
|
@ -61,7 +61,7 @@ final class Compiler {
|
|||
}
|
||||
|
||||
/**
|
||||
* A secure class loader used to define Plan A scripts.
|
||||
* A secure class loader used to define Painless scripts.
|
||||
*/
|
||||
static class Loader extends SecureClassLoader {
|
||||
/**
|
||||
|
@ -83,12 +83,12 @@ final class Compiler {
|
|||
}
|
||||
|
||||
/**
|
||||
* Runs the two-pass compiler to generate a Plan A script.
|
||||
* Runs the two-pass compiler to generate a Painless script.
|
||||
* @param loader The ClassLoader used to define the script.
|
||||
* @param name The name of the script.
|
||||
* @param source The source code for the script.
|
||||
* @param settings The CompilerSettings to be used during the compilation.
|
||||
* @return An {@link Executable} Plan A script.
|
||||
* @return An {@link Executable} Painless script.
|
||||
*/
|
||||
static Executable compile(final Loader loader, final String name, final String source,
|
||||
final Definition custom, final CompilerSettings settings) {
|
||||
|
@ -107,13 +107,13 @@ final class Compiler {
|
|||
* to ensure that the first error generated by ANTLR will cause the compilation to fail rather than
|
||||
* use ANTLR's recovery strategies that may be potentially dangerous.
|
||||
* @param source The source code for the script.
|
||||
* @param definition The Plan A API.
|
||||
* @param definition The Painless API.
|
||||
* @return The root node for the ANTLR parse tree.
|
||||
*/
|
||||
private static ParserRuleContext createParseTree(final String source, final Definition definition) {
|
||||
final ANTLRInputStream stream = new ANTLRInputStream(source);
|
||||
final ErrorHandlingLexer lexer = new ErrorHandlingLexer(stream);
|
||||
final PlanAParser parser = new PlanAParser(new CommonTokenStream(lexer));
|
||||
final PainlessParser parser = new PainlessParser(new CommonTokenStream(lexer));
|
||||
final ParserErrorStrategy strategy = new ParserErrorStrategy();
|
||||
|
||||
lexer.removeErrorListeners();
|
||||
|
@ -127,13 +127,13 @@ final class Compiler {
|
|||
}
|
||||
|
||||
/**
|
||||
* Generates an {@link Executable} that can run a Plan A script.
|
||||
* Generates an {@link Executable} that can run a Painless script.
|
||||
* @param loader The {@link Loader} to define the script's class file.
|
||||
* @param definition The Plan A API.
|
||||
* @param definition The Painless API.
|
||||
* @param name The name of the script.
|
||||
* @param source The source text of the script.
|
||||
* @param bytes The ASM generated byte code to define the class with.
|
||||
* @return A Plan A {@link Executable} script.
|
||||
* @return A Painless {@link Executable} script.
|
||||
*/
|
||||
private static Executable createExecutable(final Loader loader, final Definition definition,
|
||||
final String name, final String source, final byte[] bytes) {
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/**
|
||||
* Settings to use when compiling a script.
|
|
@ -17,14 +17,14 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.elasticsearch.plan.a.Definition.Cast;
|
||||
import org.elasticsearch.plan.a.Definition.Field;
|
||||
import org.elasticsearch.plan.a.Definition.Method;
|
||||
import org.elasticsearch.plan.a.Definition.Struct;
|
||||
import org.elasticsearch.plan.a.Definition.Transform;
|
||||
import org.elasticsearch.plan.a.Definition.Type;
|
||||
import org.elasticsearch.painless.Definition.Cast;
|
||||
import org.elasticsearch.painless.Definition.Field;
|
||||
import org.elasticsearch.painless.Definition.Method;
|
||||
import org.elasticsearch.painless.Definition.Struct;
|
||||
import org.elasticsearch.painless.Definition.Transform;
|
||||
import org.elasticsearch.painless.Definition.Type;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.reflect.Array;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.lang.invoke.MethodHandle;
|
||||
import java.lang.invoke.MethodHandles;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.antlr.v4.runtime.CharStream;
|
||||
import org.antlr.v4.runtime.LexerNoViableAltException;
|
||||
|
@ -25,7 +25,7 @@ import org.antlr.v4.runtime.misc.Interval;
|
|||
|
||||
import java.text.ParseException;
|
||||
|
||||
class ErrorHandlingLexer extends PlanALexer {
|
||||
class ErrorHandlingLexer extends PainlessLexer {
|
||||
public ErrorHandlingLexer(CharStream charStream) {
|
||||
super(charStream);
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
package org.elasticsearch.plan.a;
|
||||
|
||||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
|
@ -19,6 +17,8 @@ package org.elasticsearch.plan.a;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class Executable {
|
|
@ -17,14 +17,14 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.antlr.v4.runtime.ParserRuleContext;
|
||||
import org.antlr.v4.runtime.tree.ParseTree;
|
||||
import org.elasticsearch.plan.a.Definition.Cast;
|
||||
import org.elasticsearch.plan.a.Definition.Type;
|
||||
import org.elasticsearch.plan.a.PlanAParser.ExpressionContext;
|
||||
import org.elasticsearch.plan.a.PlanAParser.PrecedenceContext;
|
||||
import org.elasticsearch.painless.Definition.Cast;
|
||||
import org.elasticsearch.painless.Definition.Type;
|
||||
import org.elasticsearch.painless.PainlessParser.ExpressionContext;
|
||||
import org.elasticsearch.painless.PainlessParser.PrecedenceContext;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -396,7 +396,7 @@ class Metadata {
|
|||
}
|
||||
|
||||
/**
|
||||
* Acts as both the Plan A API and white-list for what types and methods are allowed.
|
||||
* Acts as both the Painless API and white-list for what types and methods are allowed.
|
||||
*/
|
||||
final Definition definition;
|
||||
|
||||
|
@ -407,7 +407,7 @@ class Metadata {
|
|||
final String source;
|
||||
|
||||
/**
|
||||
* Toot node of the ANTLR tree for the Plan A script.
|
||||
* Toot node of the ANTLR tree for the Painless script.
|
||||
*/
|
||||
final ParserRuleContext root;
|
||||
|
||||
|
@ -457,7 +457,7 @@ class Metadata {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param definition The Plan A definition.
|
||||
* @param definition The Painless definition.
|
||||
* @param source The source text for the script.
|
||||
* @param root The root ANTLR node.
|
||||
* @param settings The compile-time settings.
|
|
@ -17,21 +17,21 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/**
|
||||
* The PlanAError class is used to throw internal errors caused by Plan A scripts that cannot be
|
||||
* The PainlessError class is used to throw internal errors caused by Painless scripts that cannot be
|
||||
* caught using a standard {@link Exception}. This prevents the user from catching this specific error
|
||||
* (as Exceptions are available in the Plan A API, but Errors are not,) and possibly continuing to do
|
||||
* (as Exceptions are available in the Painless API, but Errors are not,) and possibly continuing to do
|
||||
* something hazardous. The alternative was extending {@link Throwable}, but that seemed worse than using
|
||||
* an {@link Error} in this case.
|
||||
*/
|
||||
public class PlanAError extends Error {
|
||||
public class PainlessError extends Error {
|
||||
/**
|
||||
* Constructor.
|
||||
* @param message The error message.
|
||||
*/
|
||||
public PlanAError(final String message) {
|
||||
public PainlessError(final String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// ANTLR GENERATED CODE: DO NOT EDIT
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.antlr.v4.runtime.CharStream;
|
||||
import org.antlr.v4.runtime.Lexer;
|
||||
|
@ -16,7 +16,7 @@ import org.antlr.v4.runtime.dfa.DFA;
|
|||
import java.util.Set;
|
||||
|
||||
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
|
||||
class PlanALexer extends Lexer {
|
||||
class PainlessLexer extends Lexer {
|
||||
static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); }
|
||||
|
||||
protected static final DFA[] _decisionToDFA;
|
||||
|
@ -112,13 +112,13 @@ class PlanALexer extends Lexer {
|
|||
}
|
||||
|
||||
|
||||
public PlanALexer(CharStream input) {
|
||||
public PainlessLexer(CharStream input) {
|
||||
super(input);
|
||||
_interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGrammarFileName() { return "PlanALexer.g4"; }
|
||||
public String getGrammarFileName() { return "PainlessLexer.g4"; }
|
||||
|
||||
@Override
|
||||
public String[] getRuleNames() { return ruleNames; }
|
|
@ -1,5 +1,5 @@
|
|||
// ANTLR GENERATED CODE: DO NOT EDIT
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.antlr.v4.runtime.FailedPredicateException;
|
||||
import org.antlr.v4.runtime.NoViableAltException;
|
||||
|
@ -22,7 +22,7 @@ import org.antlr.v4.runtime.tree.TerminalNode;
|
|||
import java.util.List;
|
||||
|
||||
@SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"})
|
||||
class PlanAParser extends Parser {
|
||||
class PainlessParser extends Parser {
|
||||
static { RuntimeMetaData.checkVersion("4.5.1", RuntimeMetaData.VERSION); }
|
||||
|
||||
protected static final DFA[] _decisionToDFA;
|
||||
|
@ -108,7 +108,7 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getGrammarFileName() { return "PlanAParser.g4"; }
|
||||
public String getGrammarFileName() { return "PainlessParser.g4"; }
|
||||
|
||||
@Override
|
||||
public String[] getRuleNames() { return ruleNames; }
|
||||
|
@ -119,12 +119,12 @@ class PlanAParser extends Parser {
|
|||
@Override
|
||||
public ATN getATN() { return _ATN; }
|
||||
|
||||
public PlanAParser(TokenStream input) {
|
||||
public PainlessParser(TokenStream input) {
|
||||
super(input);
|
||||
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
|
||||
}
|
||||
public static class SourceContext extends ParserRuleContext {
|
||||
public TerminalNode EOF() { return getToken(PlanAParser.EOF, 0); }
|
||||
public TerminalNode EOF() { return getToken(PainlessParser.EOF, 0); }
|
||||
public List<StatementContext> statement() {
|
||||
return getRuleContexts(StatementContext.class);
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_source; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitSource(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitSource(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -193,55 +193,55 @@ class PlanAParser extends Parser {
|
|||
public DeclarationContext declaration() {
|
||||
return getRuleContext(DeclarationContext.class,0);
|
||||
}
|
||||
public TerminalNode SEMICOLON() { return getToken(PlanAParser.SEMICOLON, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PainlessParser.SEMICOLON, 0); }
|
||||
public DeclContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitDecl(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitDecl(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class BreakContext extends StatementContext {
|
||||
public TerminalNode BREAK() { return getToken(PlanAParser.BREAK, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PlanAParser.SEMICOLON, 0); }
|
||||
public TerminalNode BREAK() { return getToken(PainlessParser.BREAK, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PainlessParser.SEMICOLON, 0); }
|
||||
public BreakContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitBreak(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitBreak(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class ThrowContext extends StatementContext {
|
||||
public TerminalNode THROW() { return getToken(PlanAParser.THROW, 0); }
|
||||
public TerminalNode THROW() { return getToken(PainlessParser.THROW, 0); }
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode SEMICOLON() { return getToken(PlanAParser.SEMICOLON, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PainlessParser.SEMICOLON, 0); }
|
||||
public ThrowContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitThrow(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitThrow(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class ContinueContext extends StatementContext {
|
||||
public TerminalNode CONTINUE() { return getToken(PlanAParser.CONTINUE, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PlanAParser.SEMICOLON, 0); }
|
||||
public TerminalNode CONTINUE() { return getToken(PainlessParser.CONTINUE, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PainlessParser.SEMICOLON, 0); }
|
||||
public ContinueContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitContinue(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitContinue(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class ForContext extends StatementContext {
|
||||
public TerminalNode FOR() { return getToken(PlanAParser.FOR, 0); }
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public List<TerminalNode> SEMICOLON() { return getTokens(PlanAParser.SEMICOLON); }
|
||||
public TerminalNode FOR() { return getToken(PainlessParser.FOR, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public List<TerminalNode> SEMICOLON() { return getTokens(PainlessParser.SEMICOLON); }
|
||||
public TerminalNode SEMICOLON(int i) {
|
||||
return getToken(PlanAParser.SEMICOLON, i);
|
||||
return getToken(PainlessParser.SEMICOLON, i);
|
||||
}
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public BlockContext block() {
|
||||
return getRuleContext(BlockContext.class,0);
|
||||
}
|
||||
|
@ -260,12 +260,12 @@ class PlanAParser extends Parser {
|
|||
public ForContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitFor(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitFor(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class TryContext extends StatementContext {
|
||||
public TerminalNode TRY() { return getToken(PlanAParser.TRY, 0); }
|
||||
public TerminalNode TRY() { return getToken(PainlessParser.TRY, 0); }
|
||||
public BlockContext block() {
|
||||
return getRuleContext(BlockContext.class,0);
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ class PlanAParser extends Parser {
|
|||
public TryContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitTry(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitTry(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -286,40 +286,40 @@ class PlanAParser extends Parser {
|
|||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode SEMICOLON() { return getToken(PlanAParser.SEMICOLON, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PainlessParser.SEMICOLON, 0); }
|
||||
public ExprContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExpr(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExpr(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class DoContext extends StatementContext {
|
||||
public TerminalNode DO() { return getToken(PlanAParser.DO, 0); }
|
||||
public TerminalNode DO() { return getToken(PainlessParser.DO, 0); }
|
||||
public BlockContext block() {
|
||||
return getRuleContext(BlockContext.class,0);
|
||||
}
|
||||
public TerminalNode WHILE() { return getToken(PlanAParser.WHILE, 0); }
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public TerminalNode WHILE() { return getToken(PainlessParser.WHILE, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PlanAParser.SEMICOLON, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PainlessParser.SEMICOLON, 0); }
|
||||
public DoContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitDo(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitDo(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class WhileContext extends StatementContext {
|
||||
public TerminalNode WHILE() { return getToken(PlanAParser.WHILE, 0); }
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public TerminalNode WHILE() { return getToken(PainlessParser.WHILE, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public BlockContext block() {
|
||||
return getRuleContext(BlockContext.class,0);
|
||||
}
|
||||
|
@ -329,41 +329,41 @@ class PlanAParser extends Parser {
|
|||
public WhileContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitWhile(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitWhile(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class IfContext extends StatementContext {
|
||||
public TerminalNode IF() { return getToken(PlanAParser.IF, 0); }
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public TerminalNode IF() { return getToken(PainlessParser.IF, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public List<BlockContext> block() {
|
||||
return getRuleContexts(BlockContext.class);
|
||||
}
|
||||
public BlockContext block(int i) {
|
||||
return getRuleContext(BlockContext.class,i);
|
||||
}
|
||||
public TerminalNode ELSE() { return getToken(PlanAParser.ELSE, 0); }
|
||||
public TerminalNode ELSE() { return getToken(PainlessParser.ELSE, 0); }
|
||||
public IfContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitIf(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitIf(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class ReturnContext extends StatementContext {
|
||||
public TerminalNode RETURN() { return getToken(PlanAParser.RETURN, 0); }
|
||||
public TerminalNode RETURN() { return getToken(PainlessParser.RETURN, 0); }
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode SEMICOLON() { return getToken(PlanAParser.SEMICOLON, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PainlessParser.SEMICOLON, 0); }
|
||||
public ReturnContext(StatementContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitReturn(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitReturn(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -684,13 +684,13 @@ class PlanAParser extends Parser {
|
|||
public SingleContext(BlockContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitSingle(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitSingle(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class MultipleContext extends BlockContext {
|
||||
public TerminalNode LBRACK() { return getToken(PlanAParser.LBRACK, 0); }
|
||||
public TerminalNode RBRACK() { return getToken(PlanAParser.RBRACK, 0); }
|
||||
public TerminalNode LBRACK() { return getToken(PainlessParser.LBRACK, 0); }
|
||||
public TerminalNode RBRACK() { return getToken(PainlessParser.RBRACK, 0); }
|
||||
public List<StatementContext> statement() {
|
||||
return getRuleContexts(StatementContext.class);
|
||||
}
|
||||
|
@ -700,7 +700,7 @@ class PlanAParser extends Parser {
|
|||
public MultipleContext(BlockContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitMultiple(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitMultiple(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -790,14 +790,14 @@ class PlanAParser extends Parser {
|
|||
public EmptyscopeContext emptyscope() {
|
||||
return getRuleContext(EmptyscopeContext.class,0);
|
||||
}
|
||||
public TerminalNode SEMICOLON() { return getToken(PlanAParser.SEMICOLON, 0); }
|
||||
public TerminalNode SEMICOLON() { return getToken(PainlessParser.SEMICOLON, 0); }
|
||||
public EmptyContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_empty; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitEmpty(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitEmpty(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -838,15 +838,15 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class EmptyscopeContext extends ParserRuleContext {
|
||||
public TerminalNode LBRACK() { return getToken(PlanAParser.LBRACK, 0); }
|
||||
public TerminalNode RBRACK() { return getToken(PlanAParser.RBRACK, 0); }
|
||||
public TerminalNode LBRACK() { return getToken(PainlessParser.LBRACK, 0); }
|
||||
public TerminalNode RBRACK() { return getToken(PainlessParser.RBRACK, 0); }
|
||||
public EmptyscopeContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_emptyscope; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitEmptyscope(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitEmptyscope(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -887,7 +887,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_initializer; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitInitializer(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitInitializer(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -935,7 +935,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_afterthought; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitAfterthought(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitAfterthought(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -971,9 +971,9 @@ class PlanAParser extends Parser {
|
|||
public DeclvarContext declvar(int i) {
|
||||
return getRuleContext(DeclvarContext.class,i);
|
||||
}
|
||||
public List<TerminalNode> COMMA() { return getTokens(PlanAParser.COMMA); }
|
||||
public List<TerminalNode> COMMA() { return getTokens(PainlessParser.COMMA); }
|
||||
public TerminalNode COMMA(int i) {
|
||||
return getToken(PlanAParser.COMMA, i);
|
||||
return getToken(PainlessParser.COMMA, i);
|
||||
}
|
||||
public DeclarationContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
|
@ -981,7 +981,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_declaration; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitDeclaration(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitDeclaration(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1027,14 +1027,14 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class DecltypeContext extends ParserRuleContext {
|
||||
public TerminalNode TYPE() { return getToken(PlanAParser.TYPE, 0); }
|
||||
public List<TerminalNode> LBRACE() { return getTokens(PlanAParser.LBRACE); }
|
||||
public TerminalNode TYPE() { return getToken(PainlessParser.TYPE, 0); }
|
||||
public List<TerminalNode> LBRACE() { return getTokens(PainlessParser.LBRACE); }
|
||||
public TerminalNode LBRACE(int i) {
|
||||
return getToken(PlanAParser.LBRACE, i);
|
||||
return getToken(PainlessParser.LBRACE, i);
|
||||
}
|
||||
public List<TerminalNode> RBRACE() { return getTokens(PlanAParser.RBRACE); }
|
||||
public List<TerminalNode> RBRACE() { return getTokens(PainlessParser.RBRACE); }
|
||||
public TerminalNode RBRACE(int i) {
|
||||
return getToken(PlanAParser.RBRACE, i);
|
||||
return getToken(PainlessParser.RBRACE, i);
|
||||
}
|
||||
public DecltypeContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
|
@ -1042,7 +1042,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_decltype; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitDecltype(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitDecltype(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1086,8 +1086,8 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class DeclvarContext extends ParserRuleContext {
|
||||
public TerminalNode ID() { return getToken(PlanAParser.ID, 0); }
|
||||
public TerminalNode ASSIGN() { return getToken(PlanAParser.ASSIGN, 0); }
|
||||
public TerminalNode ID() { return getToken(PainlessParser.ID, 0); }
|
||||
public TerminalNode ASSIGN() { return getToken(PainlessParser.ASSIGN, 0); }
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
|
@ -1097,7 +1097,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_declvar; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitDeclvar(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitDeclvar(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1136,11 +1136,11 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class TrapContext extends ParserRuleContext {
|
||||
public TerminalNode CATCH() { return getToken(PlanAParser.CATCH, 0); }
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode TYPE() { return getToken(PlanAParser.TYPE, 0); }
|
||||
public TerminalNode ID() { return getToken(PlanAParser.ID, 0); }
|
||||
public TerminalNode CATCH() { return getToken(PainlessParser.CATCH, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public TerminalNode TYPE() { return getToken(PainlessParser.TYPE, 0); }
|
||||
public TerminalNode ID() { return getToken(PainlessParser.ID, 0); }
|
||||
public BlockContext block() {
|
||||
return getRuleContext(BlockContext.class,0);
|
||||
}
|
||||
|
@ -1153,7 +1153,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_trap; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitTrap(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitTrap(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1222,18 +1222,18 @@ class PlanAParser extends Parser {
|
|||
public ExpressionContext expression(int i) {
|
||||
return getRuleContext(ExpressionContext.class,i);
|
||||
}
|
||||
public TerminalNode LT() { return getToken(PlanAParser.LT, 0); }
|
||||
public TerminalNode LTE() { return getToken(PlanAParser.LTE, 0); }
|
||||
public TerminalNode GT() { return getToken(PlanAParser.GT, 0); }
|
||||
public TerminalNode GTE() { return getToken(PlanAParser.GTE, 0); }
|
||||
public TerminalNode EQ() { return getToken(PlanAParser.EQ, 0); }
|
||||
public TerminalNode EQR() { return getToken(PlanAParser.EQR, 0); }
|
||||
public TerminalNode NE() { return getToken(PlanAParser.NE, 0); }
|
||||
public TerminalNode NER() { return getToken(PlanAParser.NER, 0); }
|
||||
public TerminalNode LT() { return getToken(PainlessParser.LT, 0); }
|
||||
public TerminalNode LTE() { return getToken(PainlessParser.LTE, 0); }
|
||||
public TerminalNode GT() { return getToken(PainlessParser.GT, 0); }
|
||||
public TerminalNode GTE() { return getToken(PainlessParser.GTE, 0); }
|
||||
public TerminalNode EQ() { return getToken(PainlessParser.EQ, 0); }
|
||||
public TerminalNode EQR() { return getToken(PainlessParser.EQR, 0); }
|
||||
public TerminalNode NE() { return getToken(PainlessParser.NE, 0); }
|
||||
public TerminalNode NER() { return getToken(PainlessParser.NER, 0); }
|
||||
public CompContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitComp(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitComp(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1244,12 +1244,12 @@ class PlanAParser extends Parser {
|
|||
public ExpressionContext expression(int i) {
|
||||
return getRuleContext(ExpressionContext.class,i);
|
||||
}
|
||||
public TerminalNode BOOLAND() { return getToken(PlanAParser.BOOLAND, 0); }
|
||||
public TerminalNode BOOLOR() { return getToken(PlanAParser.BOOLOR, 0); }
|
||||
public TerminalNode BOOLAND() { return getToken(PainlessParser.BOOLAND, 0); }
|
||||
public TerminalNode BOOLOR() { return getToken(PainlessParser.BOOLOR, 0); }
|
||||
public BoolContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitBool(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitBool(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1260,12 +1260,12 @@ class PlanAParser extends Parser {
|
|||
public ExpressionContext expression(int i) {
|
||||
return getRuleContext(ExpressionContext.class,i);
|
||||
}
|
||||
public TerminalNode COND() { return getToken(PlanAParser.COND, 0); }
|
||||
public TerminalNode COLON() { return getToken(PlanAParser.COLON, 0); }
|
||||
public TerminalNode COND() { return getToken(PainlessParser.COND, 0); }
|
||||
public TerminalNode COLON() { return getToken(PainlessParser.COLON, 0); }
|
||||
public ConditionalContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitConditional(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitConditional(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1276,43 +1276,43 @@ class PlanAParser extends Parser {
|
|||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode ASSIGN() { return getToken(PlanAParser.ASSIGN, 0); }
|
||||
public TerminalNode AADD() { return getToken(PlanAParser.AADD, 0); }
|
||||
public TerminalNode ASUB() { return getToken(PlanAParser.ASUB, 0); }
|
||||
public TerminalNode AMUL() { return getToken(PlanAParser.AMUL, 0); }
|
||||
public TerminalNode ADIV() { return getToken(PlanAParser.ADIV, 0); }
|
||||
public TerminalNode AREM() { return getToken(PlanAParser.AREM, 0); }
|
||||
public TerminalNode AAND() { return getToken(PlanAParser.AAND, 0); }
|
||||
public TerminalNode AXOR() { return getToken(PlanAParser.AXOR, 0); }
|
||||
public TerminalNode AOR() { return getToken(PlanAParser.AOR, 0); }
|
||||
public TerminalNode ALSH() { return getToken(PlanAParser.ALSH, 0); }
|
||||
public TerminalNode ARSH() { return getToken(PlanAParser.ARSH, 0); }
|
||||
public TerminalNode AUSH() { return getToken(PlanAParser.AUSH, 0); }
|
||||
public TerminalNode ASSIGN() { return getToken(PainlessParser.ASSIGN, 0); }
|
||||
public TerminalNode AADD() { return getToken(PainlessParser.AADD, 0); }
|
||||
public TerminalNode ASUB() { return getToken(PainlessParser.ASUB, 0); }
|
||||
public TerminalNode AMUL() { return getToken(PainlessParser.AMUL, 0); }
|
||||
public TerminalNode ADIV() { return getToken(PainlessParser.ADIV, 0); }
|
||||
public TerminalNode AREM() { return getToken(PainlessParser.AREM, 0); }
|
||||
public TerminalNode AAND() { return getToken(PainlessParser.AAND, 0); }
|
||||
public TerminalNode AXOR() { return getToken(PainlessParser.AXOR, 0); }
|
||||
public TerminalNode AOR() { return getToken(PainlessParser.AOR, 0); }
|
||||
public TerminalNode ALSH() { return getToken(PainlessParser.ALSH, 0); }
|
||||
public TerminalNode ARSH() { return getToken(PainlessParser.ARSH, 0); }
|
||||
public TerminalNode AUSH() { return getToken(PainlessParser.AUSH, 0); }
|
||||
public AssignmentContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitAssignment(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitAssignment(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class FalseContext extends ExpressionContext {
|
||||
public TerminalNode FALSE() { return getToken(PlanAParser.FALSE, 0); }
|
||||
public TerminalNode FALSE() { return getToken(PainlessParser.FALSE, 0); }
|
||||
public FalseContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitFalse(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitFalse(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class NumericContext extends ExpressionContext {
|
||||
public TerminalNode OCTAL() { return getToken(PlanAParser.OCTAL, 0); }
|
||||
public TerminalNode HEX() { return getToken(PlanAParser.HEX, 0); }
|
||||
public TerminalNode INTEGER() { return getToken(PlanAParser.INTEGER, 0); }
|
||||
public TerminalNode DECIMAL() { return getToken(PlanAParser.DECIMAL, 0); }
|
||||
public TerminalNode OCTAL() { return getToken(PainlessParser.OCTAL, 0); }
|
||||
public TerminalNode HEX() { return getToken(PainlessParser.HEX, 0); }
|
||||
public TerminalNode INTEGER() { return getToken(PainlessParser.INTEGER, 0); }
|
||||
public TerminalNode DECIMAL() { return getToken(PainlessParser.DECIMAL, 0); }
|
||||
public NumericContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitNumeric(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitNumeric(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1320,27 +1320,27 @@ class PlanAParser extends Parser {
|
|||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode BOOLNOT() { return getToken(PlanAParser.BOOLNOT, 0); }
|
||||
public TerminalNode BWNOT() { return getToken(PlanAParser.BWNOT, 0); }
|
||||
public TerminalNode ADD() { return getToken(PlanAParser.ADD, 0); }
|
||||
public TerminalNode SUB() { return getToken(PlanAParser.SUB, 0); }
|
||||
public TerminalNode BOOLNOT() { return getToken(PainlessParser.BOOLNOT, 0); }
|
||||
public TerminalNode BWNOT() { return getToken(PainlessParser.BWNOT, 0); }
|
||||
public TerminalNode ADD() { return getToken(PainlessParser.ADD, 0); }
|
||||
public TerminalNode SUB() { return getToken(PainlessParser.SUB, 0); }
|
||||
public UnaryContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitUnary(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitUnary(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class PrecedenceContext extends ExpressionContext {
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public PrecedenceContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitPrecedence(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitPrecedence(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1354,7 +1354,7 @@ class PlanAParser extends Parser {
|
|||
public PreincContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitPreinc(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitPreinc(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1368,23 +1368,23 @@ class PlanAParser extends Parser {
|
|||
public PostincContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitPostinc(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitPostinc(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class CastContext extends ExpressionContext {
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public DecltypeContext decltype() {
|
||||
return getRuleContext(DecltypeContext.class,0);
|
||||
}
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public CastContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitCast(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitCast(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1395,16 +1395,16 @@ class PlanAParser extends Parser {
|
|||
public ExternalContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExternal(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExternal(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class NullContext extends ExpressionContext {
|
||||
public TerminalNode NULL() { return getToken(PlanAParser.NULL, 0); }
|
||||
public TerminalNode NULL() { return getToken(PainlessParser.NULL, 0); }
|
||||
public NullContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitNull(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitNull(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1415,39 +1415,39 @@ class PlanAParser extends Parser {
|
|||
public ExpressionContext expression(int i) {
|
||||
return getRuleContext(ExpressionContext.class,i);
|
||||
}
|
||||
public TerminalNode MUL() { return getToken(PlanAParser.MUL, 0); }
|
||||
public TerminalNode DIV() { return getToken(PlanAParser.DIV, 0); }
|
||||
public TerminalNode REM() { return getToken(PlanAParser.REM, 0); }
|
||||
public TerminalNode ADD() { return getToken(PlanAParser.ADD, 0); }
|
||||
public TerminalNode SUB() { return getToken(PlanAParser.SUB, 0); }
|
||||
public TerminalNode LSH() { return getToken(PlanAParser.LSH, 0); }
|
||||
public TerminalNode RSH() { return getToken(PlanAParser.RSH, 0); }
|
||||
public TerminalNode USH() { return getToken(PlanAParser.USH, 0); }
|
||||
public TerminalNode BWAND() { return getToken(PlanAParser.BWAND, 0); }
|
||||
public TerminalNode BWXOR() { return getToken(PlanAParser.BWXOR, 0); }
|
||||
public TerminalNode BWOR() { return getToken(PlanAParser.BWOR, 0); }
|
||||
public TerminalNode MUL() { return getToken(PainlessParser.MUL, 0); }
|
||||
public TerminalNode DIV() { return getToken(PainlessParser.DIV, 0); }
|
||||
public TerminalNode REM() { return getToken(PainlessParser.REM, 0); }
|
||||
public TerminalNode ADD() { return getToken(PainlessParser.ADD, 0); }
|
||||
public TerminalNode SUB() { return getToken(PainlessParser.SUB, 0); }
|
||||
public TerminalNode LSH() { return getToken(PainlessParser.LSH, 0); }
|
||||
public TerminalNode RSH() { return getToken(PainlessParser.RSH, 0); }
|
||||
public TerminalNode USH() { return getToken(PainlessParser.USH, 0); }
|
||||
public TerminalNode BWAND() { return getToken(PainlessParser.BWAND, 0); }
|
||||
public TerminalNode BWXOR() { return getToken(PainlessParser.BWXOR, 0); }
|
||||
public TerminalNode BWOR() { return getToken(PainlessParser.BWOR, 0); }
|
||||
public BinaryContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitBinary(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitBinary(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class CharContext extends ExpressionContext {
|
||||
public TerminalNode CHAR() { return getToken(PlanAParser.CHAR, 0); }
|
||||
public TerminalNode CHAR() { return getToken(PainlessParser.CHAR, 0); }
|
||||
public CharContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitChar(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitChar(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
public static class TrueContext extends ExpressionContext {
|
||||
public TerminalNode TRUE() { return getToken(PlanAParser.TRUE, 0); }
|
||||
public TerminalNode TRUE() { return getToken(PainlessParser.TRUE, 0); }
|
||||
public TrueContext(ExpressionContext ctx) { copyFrom(ctx); }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitTrue(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitTrue(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1832,7 +1832,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extstart; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtstart(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtstart(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -1899,8 +1899,8 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExtprecContext extends ParserRuleContext {
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public ExtprecContext extprec() {
|
||||
return getRuleContext(ExtprecContext.class,0);
|
||||
}
|
||||
|
@ -1931,7 +1931,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extprec; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtprec(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtprec(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2014,11 +2014,11 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExtcastContext extends ParserRuleContext {
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public DecltypeContext decltype() {
|
||||
return getRuleContext(DecltypeContext.class,0);
|
||||
}
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public ExtprecContext extprec() {
|
||||
return getRuleContext(ExtprecContext.class,0);
|
||||
}
|
||||
|
@ -2043,7 +2043,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extcast; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtcast(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtcast(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2113,11 +2113,11 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExtbraceContext extends ParserRuleContext {
|
||||
public TerminalNode LBRACE() { return getToken(PlanAParser.LBRACE, 0); }
|
||||
public TerminalNode LBRACE() { return getToken(PainlessParser.LBRACE, 0); }
|
||||
public ExpressionContext expression() {
|
||||
return getRuleContext(ExpressionContext.class,0);
|
||||
}
|
||||
public TerminalNode RBRACE() { return getToken(PlanAParser.RBRACE, 0); }
|
||||
public TerminalNode RBRACE() { return getToken(PainlessParser.RBRACE, 0); }
|
||||
public ExtdotContext extdot() {
|
||||
return getRuleContext(ExtdotContext.class,0);
|
||||
}
|
||||
|
@ -2130,7 +2130,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extbrace; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtbrace(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtbrace(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2176,7 +2176,7 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExtdotContext extends ParserRuleContext {
|
||||
public TerminalNode DOT() { return getToken(PlanAParser.DOT, 0); }
|
||||
public TerminalNode DOT() { return getToken(PainlessParser.DOT, 0); }
|
||||
public ExtcallContext extcall() {
|
||||
return getRuleContext(ExtcallContext.class,0);
|
||||
}
|
||||
|
@ -2189,7 +2189,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extdot; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtdot(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtdot(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2231,7 +2231,7 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExttypeContext extends ParserRuleContext {
|
||||
public TerminalNode TYPE() { return getToken(PlanAParser.TYPE, 0); }
|
||||
public TerminalNode TYPE() { return getToken(PainlessParser.TYPE, 0); }
|
||||
public ExtdotContext extdot() {
|
||||
return getRuleContext(ExtdotContext.class,0);
|
||||
}
|
||||
|
@ -2241,7 +2241,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_exttype; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExttype(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExttype(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2270,7 +2270,7 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExtcallContext extends ParserRuleContext {
|
||||
public TerminalNode EXTID() { return getToken(PlanAParser.EXTID, 0); }
|
||||
public TerminalNode EXTID() { return getToken(PainlessParser.EXTID, 0); }
|
||||
public ArgumentsContext arguments() {
|
||||
return getRuleContext(ArgumentsContext.class,0);
|
||||
}
|
||||
|
@ -2286,7 +2286,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extcall; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtcall(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtcall(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2330,7 +2330,7 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExtvarContext extends ParserRuleContext {
|
||||
public TerminalNode ID() { return getToken(PlanAParser.ID, 0); }
|
||||
public TerminalNode ID() { return getToken(PainlessParser.ID, 0); }
|
||||
public ExtdotContext extdot() {
|
||||
return getRuleContext(ExtdotContext.class,0);
|
||||
}
|
||||
|
@ -2343,7 +2343,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extvar; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtvar(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtvar(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2385,8 +2385,8 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExtfieldContext extends ParserRuleContext {
|
||||
public TerminalNode EXTID() { return getToken(PlanAParser.EXTID, 0); }
|
||||
public TerminalNode EXTINTEGER() { return getToken(PlanAParser.EXTINTEGER, 0); }
|
||||
public TerminalNode EXTID() { return getToken(PainlessParser.EXTID, 0); }
|
||||
public TerminalNode EXTINTEGER() { return getToken(PainlessParser.EXTINTEGER, 0); }
|
||||
public ExtdotContext extdot() {
|
||||
return getRuleContext(ExtdotContext.class,0);
|
||||
}
|
||||
|
@ -2399,7 +2399,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extfield; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtfield(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtfield(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2447,8 +2447,8 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExtnewContext extends ParserRuleContext {
|
||||
public TerminalNode NEW() { return getToken(PlanAParser.NEW, 0); }
|
||||
public TerminalNode TYPE() { return getToken(PlanAParser.TYPE, 0); }
|
||||
public TerminalNode NEW() { return getToken(PainlessParser.NEW, 0); }
|
||||
public TerminalNode TYPE() { return getToken(PainlessParser.TYPE, 0); }
|
||||
public ArgumentsContext arguments() {
|
||||
return getRuleContext(ArgumentsContext.class,0);
|
||||
}
|
||||
|
@ -2458,9 +2458,9 @@ class PlanAParser extends Parser {
|
|||
public ExtbraceContext extbrace() {
|
||||
return getRuleContext(ExtbraceContext.class,0);
|
||||
}
|
||||
public List<TerminalNode> LBRACE() { return getTokens(PlanAParser.LBRACE); }
|
||||
public List<TerminalNode> LBRACE() { return getTokens(PainlessParser.LBRACE); }
|
||||
public TerminalNode LBRACE(int i) {
|
||||
return getToken(PlanAParser.LBRACE, i);
|
||||
return getToken(PainlessParser.LBRACE, i);
|
||||
}
|
||||
public List<ExpressionContext> expression() {
|
||||
return getRuleContexts(ExpressionContext.class);
|
||||
|
@ -2468,9 +2468,9 @@ class PlanAParser extends Parser {
|
|||
public ExpressionContext expression(int i) {
|
||||
return getRuleContext(ExpressionContext.class,i);
|
||||
}
|
||||
public List<TerminalNode> RBRACE() { return getTokens(PlanAParser.RBRACE); }
|
||||
public List<TerminalNode> RBRACE() { return getTokens(PainlessParser.RBRACE); }
|
||||
public TerminalNode RBRACE(int i) {
|
||||
return getToken(PlanAParser.RBRACE, i);
|
||||
return getToken(PainlessParser.RBRACE, i);
|
||||
}
|
||||
public ExtnewContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
|
@ -2478,7 +2478,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extnew; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtnew(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtnew(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2575,7 +2575,7 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ExtstringContext extends ParserRuleContext {
|
||||
public TerminalNode STRING() { return getToken(PlanAParser.STRING, 0); }
|
||||
public TerminalNode STRING() { return getToken(PainlessParser.STRING, 0); }
|
||||
public ExtdotContext extdot() {
|
||||
return getRuleContext(ExtdotContext.class,0);
|
||||
}
|
||||
|
@ -2588,7 +2588,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_extstring; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitExtstring(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitExtstring(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2630,17 +2630,17 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class ArgumentsContext extends ParserRuleContext {
|
||||
public TerminalNode LP() { return getToken(PlanAParser.LP, 0); }
|
||||
public TerminalNode RP() { return getToken(PlanAParser.RP, 0); }
|
||||
public TerminalNode LP() { return getToken(PainlessParser.LP, 0); }
|
||||
public TerminalNode RP() { return getToken(PainlessParser.RP, 0); }
|
||||
public List<ExpressionContext> expression() {
|
||||
return getRuleContexts(ExpressionContext.class);
|
||||
}
|
||||
public ExpressionContext expression(int i) {
|
||||
return getRuleContext(ExpressionContext.class,i);
|
||||
}
|
||||
public List<TerminalNode> COMMA() { return getTokens(PlanAParser.COMMA); }
|
||||
public List<TerminalNode> COMMA() { return getTokens(PainlessParser.COMMA); }
|
||||
public TerminalNode COMMA(int i) {
|
||||
return getToken(PlanAParser.COMMA, i);
|
||||
return getToken(PainlessParser.COMMA, i);
|
||||
}
|
||||
public ArgumentsContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
|
@ -2648,7 +2648,7 @@ class PlanAParser extends Parser {
|
|||
@Override public int getRuleIndex() { return RULE_arguments; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitArguments(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitArguments(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
||||
|
@ -2705,15 +2705,15 @@ class PlanAParser extends Parser {
|
|||
}
|
||||
|
||||
public static class IncrementContext extends ParserRuleContext {
|
||||
public TerminalNode INCR() { return getToken(PlanAParser.INCR, 0); }
|
||||
public TerminalNode DECR() { return getToken(PlanAParser.DECR, 0); }
|
||||
public TerminalNode INCR() { return getToken(PainlessParser.INCR, 0); }
|
||||
public TerminalNode DECR() { return getToken(PainlessParser.DECR, 0); }
|
||||
public IncrementContext(ParserRuleContext parent, int invokingState) {
|
||||
super(parent, invokingState);
|
||||
}
|
||||
@Override public int getRuleIndex() { return RULE_increment; }
|
||||
@Override
|
||||
public <T> T accept(ParseTreeVisitor<? extends T> visitor) {
|
||||
if ( visitor instanceof PlanAParserVisitor ) return ((PlanAParserVisitor<? extends T>)visitor).visitIncrement(this);
|
||||
if ( visitor instanceof PainlessParserVisitor ) return ((PainlessParserVisitor<? extends T>)visitor).visitIncrement(this);
|
||||
else return visitor.visitChildren(this);
|
||||
}
|
||||
}
|
|
@ -1,371 +1,371 @@
|
|||
// ANTLR GENERATED CODE: DO NOT EDIT
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
|
||||
|
||||
/**
|
||||
* This class provides an empty implementation of {@link PlanAParserVisitor},
|
||||
* This class provides an empty implementation of {@link PainlessParserVisitor},
|
||||
* which can be extended to create a visitor which only needs to handle a subset
|
||||
* of the available methods.
|
||||
*
|
||||
* @param <T> The return type of the visit operation. Use {@link Void} for
|
||||
* operations with no return type.
|
||||
*/
|
||||
class PlanAParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements PlanAParserVisitor<T> {
|
||||
class PainlessParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements PainlessParserVisitor<T> {
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitSource(PlanAParser.SourceContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitSource(PainlessParser.SourceContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitIf(PlanAParser.IfContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitIf(PainlessParser.IfContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitWhile(PlanAParser.WhileContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitWhile(PainlessParser.WhileContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitDo(PlanAParser.DoContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitDo(PainlessParser.DoContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitFor(PlanAParser.ForContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitFor(PainlessParser.ForContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitDecl(PlanAParser.DeclContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitDecl(PainlessParser.DeclContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitContinue(PlanAParser.ContinueContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitContinue(PainlessParser.ContinueContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitBreak(PlanAParser.BreakContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitBreak(PainlessParser.BreakContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitReturn(PlanAParser.ReturnContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitReturn(PainlessParser.ReturnContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTry(PlanAParser.TryContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitTry(PainlessParser.TryContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitThrow(PlanAParser.ThrowContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitThrow(PainlessParser.ThrowContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExpr(PlanAParser.ExprContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExpr(PainlessParser.ExprContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitMultiple(PlanAParser.MultipleContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitMultiple(PainlessParser.MultipleContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitSingle(PlanAParser.SingleContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitSingle(PainlessParser.SingleContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitEmpty(PlanAParser.EmptyContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitEmpty(PainlessParser.EmptyContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitEmptyscope(PlanAParser.EmptyscopeContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitEmptyscope(PainlessParser.EmptyscopeContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitInitializer(PlanAParser.InitializerContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitInitializer(PainlessParser.InitializerContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitAfterthought(PlanAParser.AfterthoughtContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitAfterthought(PainlessParser.AfterthoughtContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitDeclaration(PlanAParser.DeclarationContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitDeclaration(PainlessParser.DeclarationContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitDecltype(PlanAParser.DecltypeContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitDecltype(PainlessParser.DecltypeContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitDeclvar(PlanAParser.DeclvarContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitDeclvar(PainlessParser.DeclvarContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTrap(PlanAParser.TrapContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitTrap(PainlessParser.TrapContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitComp(PlanAParser.CompContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitComp(PainlessParser.CompContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitBool(PlanAParser.BoolContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitBool(PainlessParser.BoolContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitConditional(PlanAParser.ConditionalContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitConditional(PainlessParser.ConditionalContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitAssignment(PlanAParser.AssignmentContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitAssignment(PainlessParser.AssignmentContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitFalse(PlanAParser.FalseContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitFalse(PainlessParser.FalseContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitNumeric(PlanAParser.NumericContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitNumeric(PainlessParser.NumericContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitUnary(PlanAParser.UnaryContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitUnary(PainlessParser.UnaryContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitPrecedence(PlanAParser.PrecedenceContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitPrecedence(PainlessParser.PrecedenceContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitPreinc(PlanAParser.PreincContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitPreinc(PainlessParser.PreincContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitPostinc(PlanAParser.PostincContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitPostinc(PainlessParser.PostincContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitCast(PlanAParser.CastContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitCast(PainlessParser.CastContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExternal(PlanAParser.ExternalContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExternal(PainlessParser.ExternalContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitNull(PlanAParser.NullContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitNull(PainlessParser.NullContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitBinary(PlanAParser.BinaryContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitBinary(PainlessParser.BinaryContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitChar(PlanAParser.CharContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitChar(PainlessParser.CharContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTrue(PlanAParser.TrueContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitTrue(PainlessParser.TrueContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtstart(PlanAParser.ExtstartContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtstart(PainlessParser.ExtstartContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtprec(PlanAParser.ExtprecContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtprec(PainlessParser.ExtprecContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtcast(PlanAParser.ExtcastContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtcast(PainlessParser.ExtcastContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtbrace(PlanAParser.ExtbraceContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtbrace(PainlessParser.ExtbraceContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtdot(PlanAParser.ExtdotContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtdot(PainlessParser.ExtdotContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExttype(PlanAParser.ExttypeContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExttype(PainlessParser.ExttypeContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtcall(PlanAParser.ExtcallContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtcall(PainlessParser.ExtcallContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtvar(PlanAParser.ExtvarContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtvar(PainlessParser.ExtvarContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtfield(PlanAParser.ExtfieldContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtfield(PainlessParser.ExtfieldContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtnew(PlanAParser.ExtnewContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtnew(PainlessParser.ExtnewContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitExtstring(PlanAParser.ExtstringContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitExtstring(PainlessParser.ExtstringContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitArguments(PlanAParser.ArgumentsContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitArguments(PainlessParser.ArgumentsContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitIncrement(PlanAParser.IncrementContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitIncrement(PainlessParser.IncrementContext ctx) { return visitChildren(ctx); }
|
||||
}
|
|
@ -0,0 +1,348 @@
|
|||
// ANTLR GENERATED CODE: DO NOT EDIT
|
||||
package org.elasticsearch.painless;
|
||||
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
|
||||
|
||||
/**
|
||||
* This interface defines a complete generic visitor for a parse tree produced
|
||||
* by {@link PainlessParser}.
|
||||
*
|
||||
* @param <T> The return type of the visit operation. Use {@link Void} for
|
||||
* operations with no return type.
|
||||
*/
|
||||
interface PainlessParserVisitor<T> extends ParseTreeVisitor<T> {
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#source}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitSource(PainlessParser.SourceContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code if}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitIf(PainlessParser.IfContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code while}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitWhile(PainlessParser.WhileContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code do}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDo(PainlessParser.DoContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code for}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitFor(PainlessParser.ForContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code decl}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDecl(PainlessParser.DeclContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code continue}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitContinue(PainlessParser.ContinueContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code break}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitBreak(PainlessParser.BreakContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code return}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitReturn(PainlessParser.ReturnContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code try}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTry(PainlessParser.TryContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code throw}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitThrow(PainlessParser.ThrowContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code expr}
|
||||
* labeled alternative in {@link PainlessParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExpr(PainlessParser.ExprContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code multiple}
|
||||
* labeled alternative in {@link PainlessParser#block}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitMultiple(PainlessParser.MultipleContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code single}
|
||||
* labeled alternative in {@link PainlessParser#block}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitSingle(PainlessParser.SingleContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#empty}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitEmpty(PainlessParser.EmptyContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#emptyscope}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitEmptyscope(PainlessParser.EmptyscopeContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#initializer}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitInitializer(PainlessParser.InitializerContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#afterthought}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitAfterthought(PainlessParser.AfterthoughtContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#declaration}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDeclaration(PainlessParser.DeclarationContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#decltype}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDecltype(PainlessParser.DecltypeContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#declvar}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDeclvar(PainlessParser.DeclvarContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#trap}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTrap(PainlessParser.TrapContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code comp}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitComp(PainlessParser.CompContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code bool}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitBool(PainlessParser.BoolContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code conditional}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitConditional(PainlessParser.ConditionalContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code assignment}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitAssignment(PainlessParser.AssignmentContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code false}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitFalse(PainlessParser.FalseContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code numeric}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitNumeric(PainlessParser.NumericContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code unary}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitUnary(PainlessParser.UnaryContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code precedence}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitPrecedence(PainlessParser.PrecedenceContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code preinc}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitPreinc(PainlessParser.PreincContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code postinc}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitPostinc(PainlessParser.PostincContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code cast}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitCast(PainlessParser.CastContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code external}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExternal(PainlessParser.ExternalContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code null}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitNull(PainlessParser.NullContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code binary}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitBinary(PainlessParser.BinaryContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code char}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitChar(PainlessParser.CharContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code true}
|
||||
* labeled alternative in {@link PainlessParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTrue(PainlessParser.TrueContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extstart}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtstart(PainlessParser.ExtstartContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extprec}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtprec(PainlessParser.ExtprecContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extcast}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtcast(PainlessParser.ExtcastContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extbrace}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtbrace(PainlessParser.ExtbraceContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extdot}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtdot(PainlessParser.ExtdotContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#exttype}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExttype(PainlessParser.ExttypeContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extcall}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtcall(PainlessParser.ExtcallContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extvar}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtvar(PainlessParser.ExtvarContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extfield}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtfield(PainlessParser.ExtfieldContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extnew}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtnew(PainlessParser.ExtnewContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#extstring}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtstring(PainlessParser.ExtstringContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#arguments}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitArguments(PainlessParser.ArgumentsContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PainlessParser#increment}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitIncrement(PainlessParser.IncrementContext ctx);
|
||||
}
|
|
@ -17,25 +17,25 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.script.ScriptEngineRegistry;
|
||||
import org.elasticsearch.script.ScriptModule;
|
||||
|
||||
public final class PlanAPlugin extends Plugin {
|
||||
public final class PainlessPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "lang-plan-a";
|
||||
return "lang-painless";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Plan A scripting language for Elasticsearch";
|
||||
return "Painless scripting language for Elasticsearch";
|
||||
}
|
||||
|
||||
public void onModule(final ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(PlanAScriptEngineService.class, PlanAScriptEngineService.TYPES));
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(PainlessScriptEngineService.class, PainlessScriptEngineService.TYPES));
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.apache.lucene.index.LeafReaderContext;
|
||||
import org.elasticsearch.SpecialPermission;
|
||||
|
@ -43,17 +43,30 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Implementation of a ScriptEngine for the Plan A language.
|
||||
* Implementation of a ScriptEngine for the Painless language.
|
||||
*/
|
||||
public class PlanAScriptEngineService extends AbstractComponent implements ScriptEngineService {
|
||||
public class PainlessScriptEngineService extends AbstractComponent implements ScriptEngineService {
|
||||
|
||||
/**
|
||||
* Standard name of the Plan A language.
|
||||
* Standard name of the Painless language.
|
||||
*/
|
||||
public static final String NAME = "plan-a";
|
||||
public static final String NAME = "painless";
|
||||
|
||||
/**
|
||||
* Standard list of names for the Painless language. (There is only one.)
|
||||
*/
|
||||
public static final List<String> TYPES = Collections.singletonList(NAME);
|
||||
|
||||
/**
|
||||
* Standard extension of the Painless language.
|
||||
*/
|
||||
public static final String EXTENSION = "pain";
|
||||
|
||||
/**
|
||||
* Standard list of extensions for the Painless language. (There is only one.)
|
||||
*/
|
||||
public static final List<String> EXTENSIONS = Collections.singletonList(EXTENSION);
|
||||
|
||||
/**
|
||||
* Default compiler settings to be used.
|
||||
*/
|
||||
|
@ -92,7 +105,7 @@ public class PlanAScriptEngineService extends AbstractComponent implements Scrip
|
|||
* @param settings The settings to initialize the engine with.
|
||||
*/
|
||||
@Inject
|
||||
public PlanAScriptEngineService(final Settings settings) {
|
||||
public PainlessScriptEngineService(final Settings settings) {
|
||||
super(settings);
|
||||
}
|
||||
|
||||
|
@ -111,7 +124,7 @@ public class PlanAScriptEngineService extends AbstractComponent implements Scrip
|
|||
*/
|
||||
@Override
|
||||
public List<String> getExtensions() {
|
||||
return TYPES;
|
||||
return EXTENSIONS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -124,7 +137,7 @@ public class PlanAScriptEngineService extends AbstractComponent implements Scrip
|
|||
}
|
||||
|
||||
/**
|
||||
* Compiles a Plan A script with the specified parameters.
|
||||
* Compiles a Painless script with the specified parameters.
|
||||
* @param script The code to be compiled.
|
||||
* @param params The params used to modify the compiler settings on a per script basis.
|
||||
* @return Compiled script object represented by an {@link Executable}.
|
|
@ -1,5 +1,3 @@
|
|||
package org.elasticsearch.plan.a;
|
||||
|
||||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
|
@ -19,6 +17,8 @@ package org.elasticsearch.plan.a;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.antlr.v4.runtime.DefaultErrorStrategy;
|
||||
import org.antlr.v4.runtime.InputMismatchException;
|
||||
import org.antlr.v4.runtime.NoViableAltException;
|
||||
|
@ -41,7 +41,7 @@ class ParserErrorStrategy extends DefaultErrorStrategy {
|
|||
" unexpected token [" + getTokenErrorDisplay(token) + "]" +
|
||||
" was expecting one of [" + re.getExpectedTokens().toString(recognizer.getVocabulary()) + "].";
|
||||
} else if (re instanceof NoViableAltException) {
|
||||
if (token.getType() == PlanAParser.EOF) {
|
||||
if (token.getType() == PainlessParser.EOF) {
|
||||
message = "Error: unexpected end of script.";
|
||||
} else {
|
||||
message = "Error[" + token.getLine() + ":" + token.getCharPositionInLine() + "]:" +
|
|
@ -17,10 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.apache.lucene.search.Scorer;
|
||||
import org.elasticsearch.script.ExecutableScript;
|
||||
|
@ -28,13 +25,16 @@ import org.elasticsearch.script.LeafSearchScript;
|
|||
import org.elasticsearch.script.ScoreAccessor;
|
||||
import org.elasticsearch.search.lookup.LeafSearchLookup;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* ScriptImpl can be used as either an {@link ExecutableScript} or a {@link LeafSearchScript}
|
||||
* to run a previously compiled Plan A script.
|
||||
* to run a previously compiled Painless script.
|
||||
*/
|
||||
final class ScriptImpl implements ExecutableScript, LeafSearchScript {
|
||||
/**
|
||||
* The Plan A Executable script that can be run.
|
||||
* The Painless Executable script that can be run.
|
||||
*/
|
||||
private final Executable executable;
|
||||
|
||||
|
@ -49,8 +49,8 @@ final class ScriptImpl implements ExecutableScript, LeafSearchScript {
|
|||
private final LeafSearchLookup lookup;
|
||||
|
||||
/**
|
||||
* Creates a ScriptImpl for the a previously compiled Plan A script.
|
||||
* @param executable The previously compiled Plan A script.
|
||||
* Creates a ScriptImpl for the a previously compiled Painless script.
|
||||
* @param executable The previously compiled Painless script.
|
||||
* @param vars The initial variables to run the script with.
|
||||
* @param lookup The lookup to allow search fields to be available if this is run as a search script.
|
||||
*/
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
public class Utility {
|
||||
public static boolean NumberToboolean(final Number value) {
|
|
@ -17,10 +17,17 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.antlr.v4.runtime.ParserRuleContext;
|
||||
import org.antlr.v4.runtime.tree.ParseTree;
|
||||
import org.elasticsearch.painless.Definition.Cast;
|
||||
import org.elasticsearch.painless.Definition.Constructor;
|
||||
import org.elasticsearch.painless.Definition.Field;
|
||||
import org.elasticsearch.painless.Definition.Method;
|
||||
import org.elasticsearch.painless.Definition.Sort;
|
||||
import org.elasticsearch.painless.Definition.Transform;
|
||||
import org.elasticsearch.painless.Definition.Type;
|
||||
import org.elasticsearch.script.ScoreAccessor;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
import org.objectweb.asm.Label;
|
||||
|
@ -35,85 +42,73 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.elasticsearch.plan.a.Definition.Cast;
|
||||
import static org.elasticsearch.plan.a.Definition.Constructor;
|
||||
import static org.elasticsearch.plan.a.Definition.Field;
|
||||
import static org.elasticsearch.plan.a.Definition.Method;
|
||||
import static org.elasticsearch.plan.a.Definition.Sort;
|
||||
import static org.elasticsearch.plan.a.Definition.Transform;
|
||||
import static org.elasticsearch.plan.a.Definition.Type;
|
||||
import static org.elasticsearch.plan.a.Metadata.ExpressionMetadata;
|
||||
import static org.elasticsearch.plan.a.Metadata.ExtNodeMetadata;
|
||||
import static org.elasticsearch.plan.a.Metadata.ExternalMetadata;
|
||||
import static org.elasticsearch.plan.a.Metadata.StatementMetadata;
|
||||
import static org.elasticsearch.plan.a.Metadata.error;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ADD;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.AfterthoughtContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ArgumentsContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.AssignmentContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.BWAND;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.BWOR;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.BWXOR;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.BinaryContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.BlockContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.BoolContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.BreakContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.CastContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.CharContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.CompContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ConditionalContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ContinueContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.DIV;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.DeclContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.DeclarationContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.DecltypeContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.DeclvarContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.DoContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.EmptyContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.EmptyscopeContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExprContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExpressionContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtbraceContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtcallContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtcastContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtdotContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExternalContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtfieldContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtnewContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtprecContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtstartContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtstringContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExttypeContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ExtvarContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.FalseContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ForContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.IfContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.IncrementContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.InitializerContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.LSH;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.MUL;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.MultipleContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.NullContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.NumericContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.PostincContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.PrecedenceContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.PreincContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.REM;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.RSH;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ReturnContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.SUB;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.SingleContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.SourceContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.StatementContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.ThrowContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.TrapContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.TrueContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.TryContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.USH;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.UnaryContext;
|
||||
import static org.elasticsearch.plan.a.PlanAParser.WhileContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ADD;
|
||||
import static org.elasticsearch.painless.PainlessParser.AfterthoughtContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ArgumentsContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.AssignmentContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.BWAND;
|
||||
import static org.elasticsearch.painless.PainlessParser.BWOR;
|
||||
import static org.elasticsearch.painless.PainlessParser.BWXOR;
|
||||
import static org.elasticsearch.painless.PainlessParser.BinaryContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.BlockContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.BoolContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.BreakContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.CastContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.CharContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.CompContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ConditionalContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ContinueContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.DIV;
|
||||
import static org.elasticsearch.painless.PainlessParser.DeclContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.DeclarationContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.DecltypeContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.DeclvarContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.DoContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.EmptyContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.EmptyscopeContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExprContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExpressionContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtbraceContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtcallContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtcastContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtdotContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExternalContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtfieldContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtnewContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtprecContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtstartContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtstringContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExttypeContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ExtvarContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.FalseContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ForContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.IfContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.IncrementContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.InitializerContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.LSH;
|
||||
import static org.elasticsearch.painless.PainlessParser.MUL;
|
||||
import static org.elasticsearch.painless.PainlessParser.MultipleContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.NullContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.NumericContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.PostincContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.PrecedenceContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.PreincContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.REM;
|
||||
import static org.elasticsearch.painless.PainlessParser.RSH;
|
||||
import static org.elasticsearch.painless.PainlessParser.ReturnContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.SUB;
|
||||
import static org.elasticsearch.painless.PainlessParser.SingleContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.SourceContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.StatementContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.ThrowContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.TrapContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.TrueContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.TryContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.USH;
|
||||
import static org.elasticsearch.painless.PainlessParser.UnaryContext;
|
||||
import static org.elasticsearch.painless.PainlessParser.WhileContext;
|
||||
|
||||
class Writer extends PlanAParserBaseVisitor<Void> {
|
||||
class Writer extends PainlessParserBaseVisitor<Void> {
|
||||
private static class Branch {
|
||||
final ParserRuleContext source;
|
||||
|
||||
|
@ -128,15 +123,15 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
}
|
||||
|
||||
final static String BASE_CLASS_NAME = Executable.class.getName();
|
||||
final static String CLASS_NAME = BASE_CLASS_NAME + "$CompiledPlanAExecutable";
|
||||
final static String CLASS_NAME = BASE_CLASS_NAME + "$CompiledPainlessExecutable";
|
||||
private final static org.objectweb.asm.Type BASE_CLASS_TYPE = org.objectweb.asm.Type.getType(Executable.class);
|
||||
private final static org.objectweb.asm.Type CLASS_TYPE =
|
||||
org.objectweb.asm.Type.getType("L" + CLASS_NAME.replace(".", "/") + ";");
|
||||
|
||||
private final static org.objectweb.asm.Type PLAN_A_ERROR_TYPE = org.objectweb.asm.Type.getType(PlanAError.class);
|
||||
private final static org.objectweb.asm.Type PAINLESS_ERROR_TYPE = org.objectweb.asm.Type.getType(PainlessError.class);
|
||||
|
||||
private final static org.objectweb.asm.commons.Method CONSTRUCTOR = org.objectweb.asm.commons.Method.getMethod(
|
||||
"void <init>(org.elasticsearch.plan.a.Definition, java.lang.String, java.lang.String)");
|
||||
"void <init>(org.elasticsearch.painless.Definition, java.lang.String, java.lang.String)");
|
||||
private final static org.objectweb.asm.commons.Method EXECUTE = org.objectweb.asm.commons.Method.getMethod(
|
||||
"java.lang.Object execute(java.util.Map)");
|
||||
private final static String SIGNATURE = "(Ljava/util/Map<Ljava/lang/String;Ljava/lang/Object;>;)Ljava/lang/Object;";
|
||||
|
@ -153,18 +148,18 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
private final static org.objectweb.asm.commons.Method DEF_METHOD_CALL = org.objectweb.asm.commons.Method.getMethod(
|
||||
"java.lang.Object methodCall(java.lang.Object, java.lang.String, " +
|
||||
"org.elasticsearch.plan.a.Definition, java.lang.Object[], boolean[])");
|
||||
"org.elasticsearch.painless.Definition, java.lang.Object[], boolean[])");
|
||||
private final static org.objectweb.asm.commons.Method DEF_ARRAY_STORE = org.objectweb.asm.commons.Method.getMethod(
|
||||
"void arrayStore(java.lang.Object, java.lang.Object, java.lang.Object, " +
|
||||
"org.elasticsearch.plan.a.Definition, boolean, boolean)");
|
||||
"org.elasticsearch.painless.Definition, boolean, boolean)");
|
||||
private final static org.objectweb.asm.commons.Method DEF_ARRAY_LOAD = org.objectweb.asm.commons.Method.getMethod(
|
||||
"java.lang.Object arrayLoad(java.lang.Object, java.lang.Object, " +
|
||||
"org.elasticsearch.plan.a.Definition, boolean)");
|
||||
"org.elasticsearch.painless.Definition, boolean)");
|
||||
private final static org.objectweb.asm.commons.Method DEF_FIELD_STORE = org.objectweb.asm.commons.Method.getMethod(
|
||||
"void fieldStore(java.lang.Object, java.lang.Object, java.lang.String, " +
|
||||
"org.elasticsearch.plan.a.Definition, boolean)");
|
||||
"org.elasticsearch.painless.Definition, boolean)");
|
||||
private final static org.objectweb.asm.commons.Method DEF_FIELD_LOAD = org.objectweb.asm.commons.Method.getMethod(
|
||||
"java.lang.Object fieldLoad(java.lang.Object, java.lang.String, org.elasticsearch.plan.a.Definition)");
|
||||
"java.lang.Object fieldLoad(java.lang.Object, java.lang.String, org.elasticsearch.painless.Definition)");
|
||||
|
||||
private final static org.objectweb.asm.commons.Method DEF_NOT_CALL = org.objectweb.asm.commons.Method.getMethod(
|
||||
"java.lang.Object not(java.lang.Object)");
|
||||
|
@ -409,7 +404,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitSource(final SourceContext ctx) {
|
||||
final StatementMetadata sourcesmd = metadata.getStatementMetadata(ctx);
|
||||
final Metadata.StatementMetadata sourcesmd = metadata.getStatementMetadata(ctx);
|
||||
|
||||
for (final StatementContext sctx : ctx.statement()) {
|
||||
visit(sctx);
|
||||
|
@ -434,7 +429,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
visit(exprctx);
|
||||
|
||||
final BlockContext blockctx0 = ctx.block(0);
|
||||
final StatementMetadata blockmd0 = metadata.getStatementMetadata(blockctx0);
|
||||
final Metadata.StatementMetadata blockmd0 = metadata.getStatementMetadata(blockctx0);
|
||||
visit(blockctx0);
|
||||
|
||||
if (els) {
|
||||
|
@ -467,14 +462,14 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
boolean allLast = false;
|
||||
|
||||
if (blockctx != null) {
|
||||
final StatementMetadata blocksmd = metadata.getStatementMetadata(blockctx);
|
||||
final Metadata.StatementMetadata blocksmd = metadata.getStatementMetadata(blockctx);
|
||||
allLast = blocksmd.allLast;
|
||||
writeLoopCounter(blocksmd.count > 0 ? blocksmd.count : 1);
|
||||
visit(blockctx);
|
||||
} else if (ctx.empty() != null) {
|
||||
writeLoopCounter(1);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
if (!allLast) {
|
||||
|
@ -497,7 +492,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
branch.fals = branch.end;
|
||||
|
||||
final BlockContext blockctx = ctx.block();
|
||||
final StatementMetadata blocksmd = metadata.getStatementMetadata(blockctx);
|
||||
final Metadata.StatementMetadata blocksmd = metadata.getStatementMetadata(blockctx);
|
||||
|
||||
jumps.push(branch);
|
||||
execute.mark(start);
|
||||
|
@ -538,7 +533,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
boolean allLast = false;
|
||||
|
||||
if (blockctx != null) {
|
||||
StatementMetadata blocksmd = metadata.getStatementMetadata(blockctx);
|
||||
Metadata.StatementMetadata blocksmd = metadata.getStatementMetadata(blockctx);
|
||||
allLast = blocksmd.allLast;
|
||||
|
||||
int count = blocksmd.count > 0 ? blocksmd.count : 1;
|
||||
|
@ -552,7 +547,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
} else if (ctx.empty() != null) {
|
||||
writeLoopCounter(1);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
if (atctx != null) {
|
||||
|
@ -615,7 +610,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
execute.mark(branch.begin);
|
||||
|
||||
final BlockContext blockctx = ctx.block();
|
||||
final StatementMetadata blocksmd = metadata.getStatementMetadata(blockctx);
|
||||
final Metadata.StatementMetadata blocksmd = metadata.getStatementMetadata(blockctx);
|
||||
visit(blockctx);
|
||||
|
||||
if (!blocksmd.allLast) {
|
||||
|
@ -645,9 +640,9 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitExpr(final ExprContext ctx) {
|
||||
final StatementMetadata exprsmd = metadata.getStatementMetadata(ctx);
|
||||
final Metadata.StatementMetadata exprsmd = metadata.getStatementMetadata(ctx);
|
||||
final ExpressionContext exprctx = ctx.expression();
|
||||
final ExpressionMetadata expremd = metadata.getExpressionMetadata(exprctx);
|
||||
final Metadata.ExpressionMetadata expremd = metadata.getExpressionMetadata(exprctx);
|
||||
visit(exprctx);
|
||||
|
||||
if (exprsmd.methodEscape) {
|
||||
|
@ -677,7 +672,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitEmpty(final EmptyContext ctx) {
|
||||
throw new UnsupportedOperationException(error(ctx) + "Unexpected writer state.");
|
||||
throw new UnsupportedOperationException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -688,11 +683,11 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
if (declctx != null) {
|
||||
visit(declctx);
|
||||
} else if (exprctx != null) {
|
||||
final ExpressionMetadata expremd = metadata.getExpressionMetadata(exprctx);
|
||||
final Metadata.ExpressionMetadata expremd = metadata.getExpressionMetadata(exprctx);
|
||||
visit(exprctx);
|
||||
writePop(expremd.to.type.getSize());
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -701,7 +696,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
@Override
|
||||
public Void visitAfterthought(AfterthoughtContext ctx) {
|
||||
final ExpressionContext exprctx = ctx.expression();
|
||||
final ExpressionMetadata expremd = metadata.getExpressionMetadata(exprctx);
|
||||
final Metadata.ExpressionMetadata expremd = metadata.getExpressionMetadata(exprctx);
|
||||
visit(ctx.expression());
|
||||
writePop(expremd.to.type.getSize());
|
||||
|
||||
|
@ -719,12 +714,12 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitDecltype(final DecltypeContext ctx) {
|
||||
throw new UnsupportedOperationException(error(ctx) + "Unexpected writer state.");
|
||||
throw new UnsupportedOperationException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visitDeclvar(final DeclvarContext ctx) {
|
||||
final ExpressionMetadata declvaremd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata declvaremd = metadata.getExpressionMetadata(ctx);
|
||||
final org.objectweb.asm.Type type = declvaremd.to.type;
|
||||
final Sort sort = declvaremd.to.sort;
|
||||
final int slot = (int)declvaremd.postConst;
|
||||
|
@ -737,7 +732,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
}
|
||||
|
||||
switch (sort) {
|
||||
case VOID: throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
case VOID: throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
case BOOL:
|
||||
case BYTE:
|
||||
case SHORT:
|
||||
|
@ -756,7 +751,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitTrap(final TrapContext ctx) {
|
||||
final StatementMetadata trapsmd = metadata.getStatementMetadata(ctx);
|
||||
final Metadata.StatementMetadata trapsmd = metadata.getStatementMetadata(ctx);
|
||||
|
||||
final Branch branch = getBranch(ctx);
|
||||
final Label jump = new Label();
|
||||
|
@ -770,7 +765,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
if (blockctx != null) {
|
||||
visit(ctx.block());
|
||||
} else if (emptyctx == null) {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
execute.visitTryCatchBlock(branch.begin, branch.end, jump, trapsmd.exception.type.getInternalName());
|
||||
|
@ -784,12 +779,12 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitPrecedence(final PrecedenceContext ctx) {
|
||||
throw new UnsupportedOperationException(error(ctx) + "Unexpected writer state.");
|
||||
throw new UnsupportedOperationException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visitNumeric(final NumericContext ctx) {
|
||||
final ExpressionMetadata numericemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata numericemd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = numericemd.postConst;
|
||||
|
||||
if (postConst == null) {
|
||||
|
@ -806,7 +801,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitChar(final CharContext ctx) {
|
||||
final ExpressionMetadata charemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata charemd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = charemd.postConst;
|
||||
|
||||
if (postConst == null) {
|
||||
|
@ -823,7 +818,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitTrue(final TrueContext ctx) {
|
||||
final ExpressionMetadata trueemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata trueemd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = trueemd.postConst;
|
||||
final Branch branch = getBranch(ctx);
|
||||
|
||||
|
@ -843,7 +838,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitFalse(final FalseContext ctx) {
|
||||
final ExpressionMetadata falseemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata falseemd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = falseemd.postConst;
|
||||
final Branch branch = getBranch(ctx);
|
||||
|
||||
|
@ -863,7 +858,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitNull(final NullContext ctx) {
|
||||
final ExpressionMetadata nullemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata nullemd = metadata.getExpressionMetadata(ctx);
|
||||
|
||||
execute.visitInsn(Opcodes.ACONST_NULL);
|
||||
checkWriteCast(nullemd);
|
||||
|
@ -874,7 +869,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitExternal(final ExternalContext ctx) {
|
||||
final ExpressionMetadata expremd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata expremd = metadata.getExpressionMetadata(ctx);
|
||||
visit(ctx.extstart());
|
||||
checkWriteCast(expremd);
|
||||
checkWriteBranch(ctx);
|
||||
|
@ -885,7 +880,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitPostinc(final PostincContext ctx) {
|
||||
final ExpressionMetadata expremd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata expremd = metadata.getExpressionMetadata(ctx);
|
||||
visit(ctx.extstart());
|
||||
checkWriteCast(expremd);
|
||||
checkWriteBranch(ctx);
|
||||
|
@ -895,7 +890,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitPreinc(final PreincContext ctx) {
|
||||
final ExpressionMetadata expremd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata expremd = metadata.getExpressionMetadata(ctx);
|
||||
visit(ctx.extstart());
|
||||
checkWriteCast(expremd);
|
||||
checkWriteBranch(ctx);
|
||||
|
@ -905,7 +900,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitUnary(final UnaryContext ctx) {
|
||||
final ExpressionMetadata unaryemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata unaryemd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = unaryemd.postConst;
|
||||
final Object preConst = unaryemd.preConst;
|
||||
final Branch branch = getBranch(ctx);
|
||||
|
@ -930,7 +925,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
writeConstant(ctx, preConst);
|
||||
checkWriteCast(unaryemd);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
} else {
|
||||
final ExpressionContext exprctx = ctx.expression();
|
||||
|
@ -972,7 +967,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
} else if (sort == Sort.LONG) {
|
||||
writeConstant(ctx, -1L);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
execute.math(GeneratorAdapter.XOR, type);
|
||||
|
@ -989,12 +984,12 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
} else if (sort == Sort.LONG) {
|
||||
execute.invokeStatic(definition.mathType.type, NEGATEEXACT_LONG);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (ctx.ADD() == null) {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
checkWriteCast(unaryemd);
|
||||
|
@ -1007,7 +1002,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitCast(final CastContext ctx) {
|
||||
final ExpressionMetadata castemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata castemd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = castemd.postConst;
|
||||
|
||||
if (postConst == null) {
|
||||
|
@ -1024,7 +1019,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitBinary(final BinaryContext ctx) {
|
||||
final ExpressionMetadata binaryemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata binaryemd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = binaryemd.postConst;
|
||||
final Object preConst = binaryemd.preConst;
|
||||
final Branch branch = getBranch(ctx);
|
||||
|
@ -1036,7 +1031,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
writeConstant(ctx, preConst);
|
||||
checkWriteCast(binaryemd);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
} else if (binaryemd.from.sort == Sort.STRING) {
|
||||
final boolean marked = strings.contains(ctx);
|
||||
|
@ -1046,7 +1041,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
}
|
||||
|
||||
final ExpressionContext exprctx0 = ctx.expression(0);
|
||||
final ExpressionMetadata expremd0 = metadata.getExpressionMetadata(exprctx0);
|
||||
final Metadata.ExpressionMetadata expremd0 = metadata.getExpressionMetadata(exprctx0);
|
||||
strings.add(exprctx0);
|
||||
visit(exprctx0);
|
||||
|
||||
|
@ -1056,7 +1051,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
}
|
||||
|
||||
final ExpressionContext exprctx1 = ctx.expression(1);
|
||||
final ExpressionMetadata expremd1 = metadata.getExpressionMetadata(exprctx1);
|
||||
final Metadata.ExpressionMetadata expremd1 = metadata.getExpressionMetadata(exprctx1);
|
||||
strings.add(exprctx1);
|
||||
visit(exprctx1);
|
||||
|
||||
|
@ -1093,7 +1088,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
else if (ctx.BWXOR() != null) writeBinaryInstruction(ctx, type, BWXOR);
|
||||
else if (ctx.BWOR() != null) writeBinaryInstruction(ctx, type, BWOR);
|
||||
else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
checkWriteCast(binaryemd);
|
||||
|
@ -1106,7 +1101,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitComp(final CompContext ctx) {
|
||||
final ExpressionMetadata compemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata compemd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = compemd.postConst;
|
||||
final Object preConst = compemd.preConst;
|
||||
final Branch branch = getBranch(ctx);
|
||||
|
@ -1126,14 +1121,14 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
writeConstant(ctx, preConst);
|
||||
checkWriteCast(compemd);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
} else {
|
||||
final ExpressionContext exprctx0 = ctx.expression(0);
|
||||
final ExpressionMetadata expremd0 = metadata.getExpressionMetadata(exprctx0);
|
||||
final Metadata.ExpressionMetadata expremd0 = metadata.getExpressionMetadata(exprctx0);
|
||||
|
||||
final ExpressionContext exprctx1 = ctx.expression(1);
|
||||
final ExpressionMetadata expremd1 = metadata.getExpressionMetadata(exprctx1);
|
||||
final Metadata.ExpressionMetadata expremd1 = metadata.getExpressionMetadata(exprctx1);
|
||||
final org.objectweb.asm.Type type = expremd1.to.type;
|
||||
final Sort sort1 = expremd1.to.sort;
|
||||
|
||||
|
@ -1164,12 +1159,12 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
case BYTE:
|
||||
case SHORT:
|
||||
case CHAR:
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
case BOOL:
|
||||
if (eq) execute.ifZCmp(GeneratorAdapter.EQ, jump);
|
||||
else if (ne) execute.ifZCmp(GeneratorAdapter.NE, jump);
|
||||
else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1184,7 +1179,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
else if (gt) execute.ifCmp(type, GeneratorAdapter.GT, jump);
|
||||
else if (gte) execute.ifCmp(type, GeneratorAdapter.GE, jump);
|
||||
else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1215,7 +1210,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
} else if (gte) {
|
||||
execute.invokeStatic(definition.defobjType.type, DEF_GTE_CALL);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
writejump = expremd1.isNull || ne || ctx.EQR() != null;
|
||||
|
@ -1250,7 +1245,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
execute.ifCmp(type, GeneratorAdapter.NE, jump);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1272,7 +1267,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitBool(final BoolContext ctx) {
|
||||
final ExpressionMetadata boolemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata boolemd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = boolemd.postConst;
|
||||
final Object preConst = boolemd.preConst;
|
||||
final Branch branch = getBranch(ctx);
|
||||
|
@ -1292,7 +1287,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
writeConstant(ctx, preConst);
|
||||
checkWriteCast(boolemd);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
} else {
|
||||
final ExpressionContext exprctx0 = ctx.expression(0);
|
||||
|
@ -1329,7 +1324,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
execute.push(false);
|
||||
execute.mark(aend);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
checkWriteCast(boolemd);
|
||||
|
@ -1361,7 +1356,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
execute.mark(branch0.tru);
|
||||
}
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1371,7 +1366,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitConditional(final ConditionalContext ctx) {
|
||||
final ExpressionMetadata condemd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata condemd = metadata.getExpressionMetadata(ctx);
|
||||
final Branch branch = getBranch(ctx);
|
||||
|
||||
final ExpressionContext expr0 = ctx.expression(0);
|
||||
|
@ -1402,7 +1397,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitAssignment(final AssignmentContext ctx) {
|
||||
final ExpressionMetadata expremd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata expremd = metadata.getExpressionMetadata(ctx);
|
||||
visit(ctx.extstart());
|
||||
checkWriteCast(expremd);
|
||||
checkWriteBranch(ctx);
|
||||
|
@ -1412,10 +1407,10 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitExtstart(ExtstartContext ctx) {
|
||||
final ExternalMetadata startemd = metadata.getExternalMetadata(ctx);
|
||||
final Metadata.ExternalMetadata startemd = metadata.getExternalMetadata(ctx);
|
||||
|
||||
if (startemd.token == ADD) {
|
||||
final ExpressionMetadata storeemd = metadata.getExpressionMetadata(startemd.storeExpr);
|
||||
final Metadata.ExpressionMetadata storeemd = metadata.getExpressionMetadata(startemd.storeExpr);
|
||||
|
||||
if (startemd.current.sort == Sort.STRING || storeemd.from.sort == Sort.STRING) {
|
||||
writeNewStrings();
|
||||
|
@ -1471,7 +1466,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
} else if (stringctx != null) {
|
||||
visit(stringctx);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
final ExtdotContext dotctx = ctx.extdot();
|
||||
|
@ -1488,7 +1483,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitExtcast(final ExtcastContext ctx) {
|
||||
ExtNodeMetadata castenmd = metadata.getExtNodeMetadata(ctx);
|
||||
Metadata.ExtNodeMetadata castenmd = metadata.getExtNodeMetadata(ctx);
|
||||
|
||||
final ExtprecContext precctx = ctx.extprec();
|
||||
final ExtcastContext castctx = ctx.extcast();
|
||||
|
@ -1510,7 +1505,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
} else if (stringctx != null) {
|
||||
visit(stringctx);
|
||||
} else {
|
||||
throw new IllegalStateException(error(ctx) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
checkWriteCast(ctx, castenmd.castTo);
|
||||
|
@ -1624,7 +1619,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitExtstring(ExtstringContext ctx) {
|
||||
final ExtNodeMetadata stringenmd = metadata.getExtNodeMetadata(ctx);
|
||||
final Metadata.ExtNodeMetadata stringenmd = metadata.getExtNodeMetadata(ctx);
|
||||
|
||||
writeConstant(ctx, stringenmd.target);
|
||||
|
||||
|
@ -1642,12 +1637,12 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
@Override
|
||||
public Void visitArguments(final ArgumentsContext ctx) {
|
||||
throw new UnsupportedOperationException(error(ctx) + "Unexpected writer state.");
|
||||
throw new UnsupportedOperationException(Metadata.error(ctx) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void visitIncrement(IncrementContext ctx) {
|
||||
final ExpressionMetadata incremd = metadata.getExpressionMetadata(ctx);
|
||||
final Metadata.ExpressionMetadata incremd = metadata.getExpressionMetadata(ctx);
|
||||
final Object postConst = incremd.postConst;
|
||||
|
||||
if (postConst == null) {
|
||||
|
@ -1669,7 +1664,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
execute.visitVarInsn(Opcodes.ILOAD, metadata.loopCounterSlot);
|
||||
execute.push(0);
|
||||
execute.ifICmp(GeneratorAdapter.GT, end);
|
||||
execute.throwException(PLAN_A_ERROR_TYPE,
|
||||
execute.throwException(PAINLESS_ERROR_TYPE,
|
||||
"The maximum number of statements that can be executed in a loop has been reached.");
|
||||
execute.mark(end);
|
||||
}
|
||||
|
@ -1684,7 +1679,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
} else if (constant instanceof Boolean) {
|
||||
writeBoolean(source, constant);
|
||||
} else if (constant != null) {
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1698,7 +1693,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
} else if (numeric instanceof Number) {
|
||||
execute.push(((Number)numeric).intValue());
|
||||
} else {
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1706,7 +1701,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
if (string instanceof String) {
|
||||
execute.push((String)string);
|
||||
} else {
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1714,7 +1709,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
if (bool instanceof Boolean) {
|
||||
execute.push((boolean)bool);
|
||||
} else {
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1767,7 +1762,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
case ADD: execute.invokeStatic(definition.mathType.type, ADDEXACT_INT); break;
|
||||
case SUB: execute.invokeStatic(definition.mathType.type, SUBEXACT_INT); break;
|
||||
default:
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1778,7 +1773,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
case ADD: execute.invokeStatic(definition.mathType.type, ADDEXACT_LONG); break;
|
||||
case SUB: execute.invokeStatic(definition.mathType.type, SUBEXACT_LONG); break;
|
||||
default:
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1790,7 +1785,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
case ADD: execute.invokeStatic(definition.utilityType.type, ADDWOOVERLOW_FLOAT); break;
|
||||
case SUB: execute.invokeStatic(definition.utilityType.type, SUBWOOVERLOW_FLOAT); break;
|
||||
default:
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1802,17 +1797,17 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
case ADD: execute.invokeStatic(definition.utilityType.type, ADDWOOVERLOW_DOUBLE); break;
|
||||
case SUB: execute.invokeStatic(definition.utilityType.type, SUBWOOVERLOW_DOUBLE); break;
|
||||
default:
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
} else {
|
||||
if ((sort == Sort.FLOAT || sort == Sort.DOUBLE) &&
|
||||
(token == LSH || token == USH || token == RSH || token == BWAND || token == BWXOR || token == BWOR)) {
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
|
||||
if (sort == Sort.DEF) {
|
||||
|
@ -1829,7 +1824,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
case BWXOR: execute.invokeStatic(definition.defobjType.type, DEF_XOR_CALL); break;
|
||||
case BWOR: execute.invokeStatic(definition.defobjType.type, DEF_OR_CALL); break;
|
||||
default:
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
} else {
|
||||
switch (token) {
|
||||
|
@ -1845,7 +1840,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
case BWXOR: execute.math(GeneratorAdapter.XOR, type.type); break;
|
||||
case BWOR: execute.math(GeneratorAdapter.OR, type.type); break;
|
||||
default:
|
||||
throw new IllegalStateException(error(source) + "Unexpected writer state.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1973,8 +1968,8 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
}
|
||||
|
||||
private void writeLoadStoreExternal(final ParserRuleContext source) {
|
||||
final ExtNodeMetadata sourceenmd = metadata.getExtNodeMetadata(source);
|
||||
final ExternalMetadata parentemd = metadata.getExternalMetadata(sourceenmd.parent);
|
||||
final Metadata.ExtNodeMetadata sourceenmd = metadata.getExtNodeMetadata(source);
|
||||
final Metadata.ExternalMetadata parentemd = metadata.getExternalMetadata(sourceenmd.parent);
|
||||
|
||||
final boolean length = "#length".equals(sourceenmd.target);
|
||||
final boolean array = "#brace".equals(sourceenmd.target);
|
||||
|
@ -1984,7 +1979,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
final boolean shortcut = sourceenmd.target instanceof Object[];
|
||||
|
||||
if (!length && !variable && !field && !array && !name && !shortcut) {
|
||||
throw new IllegalStateException(error(source) + "Target not found for load/store.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Target not found for load/store.");
|
||||
}
|
||||
|
||||
final boolean maplist = shortcut && (boolean)((Object[])sourceenmd.target)[2];
|
||||
|
@ -1996,7 +1991,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
if (length) {
|
||||
execute.arrayLength();
|
||||
} else if (sourceenmd.last && parentemd.storeExpr != null) {
|
||||
final ExpressionMetadata expremd = metadata.getExpressionMetadata(parentemd.storeExpr);
|
||||
final Metadata.ExpressionMetadata expremd = metadata.getExpressionMetadata(parentemd.storeExpr);
|
||||
final boolean cat = strings.contains(parentemd.storeExpr);
|
||||
|
||||
if (cat) {
|
||||
|
@ -2101,7 +2096,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
final boolean store, final boolean variable,
|
||||
final boolean field, final boolean name,
|
||||
final boolean array, final boolean shortcut) {
|
||||
final ExtNodeMetadata sourceemd = metadata.getExtNodeMetadata(source);
|
||||
final Metadata.ExtNodeMetadata sourceemd = metadata.getExtNodeMetadata(source);
|
||||
|
||||
if (variable) {
|
||||
writeLoadStoreVariable(source, store, sourceemd.type, (int)sourceemd.target);
|
||||
|
@ -2115,14 +2110,14 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
Object[] targets = (Object[])sourceemd.target;
|
||||
writeLoadStoreShortcut(store, (Method)targets[0], (Method)targets[1]);
|
||||
} else {
|
||||
throw new IllegalStateException(error(source) + "Load/Store requires a variable, field, or array.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Load/Store requires a variable, field, or array.");
|
||||
}
|
||||
}
|
||||
|
||||
private void writeLoadStoreVariable(final ParserRuleContext source, final boolean store,
|
||||
final Type type, final int slot) {
|
||||
if (type.sort == Sort.VOID) {
|
||||
throw new IllegalStateException(error(source) + "Cannot load/store void type.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Cannot load/store void type.");
|
||||
}
|
||||
|
||||
if (store) {
|
||||
|
@ -2158,9 +2153,9 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
private void writeLoadStoreField(final ParserRuleContext source, final boolean store, final String name) {
|
||||
if (store) {
|
||||
final ExtNodeMetadata sourceemd = metadata.getExtNodeMetadata(source);
|
||||
final ExternalMetadata parentemd = metadata.getExternalMetadata(sourceemd.parent);
|
||||
final ExpressionMetadata expremd = metadata.getExpressionMetadata(parentemd.storeExpr);
|
||||
final Metadata.ExtNodeMetadata sourceemd = metadata.getExtNodeMetadata(source);
|
||||
final Metadata.ExternalMetadata parentemd = metadata.getExternalMetadata(sourceemd.parent);
|
||||
final Metadata.ExpressionMetadata expremd = metadata.getExpressionMetadata(parentemd.storeExpr);
|
||||
|
||||
execute.push(name);
|
||||
execute.loadThis();
|
||||
|
@ -2177,17 +2172,17 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
|
||||
private void writeLoadStoreArray(final ParserRuleContext source, final boolean store, final Type type) {
|
||||
if (type.sort == Sort.VOID) {
|
||||
throw new IllegalStateException(error(source) + "Cannot load/store void type.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Cannot load/store void type.");
|
||||
}
|
||||
|
||||
if (type.sort == Sort.DEF) {
|
||||
final ExtbraceContext bracectx = (ExtbraceContext)source;
|
||||
final ExpressionMetadata expremd0 = metadata.getExpressionMetadata(bracectx.expression());
|
||||
final Metadata.ExpressionMetadata expremd0 = metadata.getExpressionMetadata(bracectx.expression());
|
||||
|
||||
if (store) {
|
||||
final ExtNodeMetadata braceenmd = metadata.getExtNodeMetadata(bracectx);
|
||||
final ExternalMetadata parentemd = metadata.getExternalMetadata(braceenmd.parent);
|
||||
final ExpressionMetadata expremd1 = metadata.getExpressionMetadata(parentemd.storeExpr);
|
||||
final Metadata.ExtNodeMetadata braceenmd = metadata.getExtNodeMetadata(bracectx);
|
||||
final Metadata.ExternalMetadata parentemd = metadata.getExternalMetadata(braceenmd.parent);
|
||||
final Metadata.ExpressionMetadata expremd1 = metadata.getExpressionMetadata(parentemd.storeExpr);
|
||||
|
||||
execute.loadThis();
|
||||
execute.getField(CLASS_TYPE, "definition", DEFINITION_TYPE);
|
||||
|
@ -2246,14 +2241,14 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
}
|
||||
|
||||
private void writeNewExternal(final ExtnewContext source) {
|
||||
final ExtNodeMetadata sourceenmd = metadata.getExtNodeMetadata(source);
|
||||
final ExternalMetadata parentemd = metadata.getExternalMetadata(sourceenmd.parent);
|
||||
final Metadata.ExtNodeMetadata sourceenmd = metadata.getExtNodeMetadata(source);
|
||||
final Metadata.ExternalMetadata parentemd = metadata.getExternalMetadata(sourceenmd.parent);
|
||||
|
||||
final boolean makearray = "#makearray".equals(sourceenmd.target);
|
||||
final boolean constructor = sourceenmd.target instanceof Constructor;
|
||||
|
||||
if (!makearray && !constructor) {
|
||||
throw new IllegalStateException(error(source) + "Target not found for new call.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Target not found for new call.");
|
||||
}
|
||||
|
||||
if (makearray) {
|
||||
|
@ -2283,13 +2278,13 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
}
|
||||
|
||||
private void writeCallExternal(final ExtcallContext source) {
|
||||
final ExtNodeMetadata sourceenmd = metadata.getExtNodeMetadata(source);
|
||||
final Metadata.ExtNodeMetadata sourceenmd = metadata.getExtNodeMetadata(source);
|
||||
|
||||
final boolean method = sourceenmd.target instanceof Method;
|
||||
final boolean def = sourceenmd.target instanceof String;
|
||||
|
||||
if (!method && !def) {
|
||||
throw new IllegalStateException(error(source) + "Target not found for call.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Target not found for call.");
|
||||
}
|
||||
|
||||
final List<ExpressionContext> arguments = source.arguments().expression();
|
||||
|
@ -2349,7 +2344,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
}
|
||||
}
|
||||
|
||||
private void checkWriteCast(final ExpressionMetadata sort) {
|
||||
private void checkWriteCast(final Metadata.ExpressionMetadata sort) {
|
||||
checkWriteCast(sort.source, sort.cast);
|
||||
}
|
||||
|
||||
|
@ -2359,7 +2354,7 @@ class Writer extends PlanAParserBaseVisitor<Void> {
|
|||
} else if (cast != null) {
|
||||
writeCast(cast);
|
||||
} else {
|
||||
throw new IllegalStateException(error(source) + "Unexpected cast object.");
|
||||
throw new IllegalStateException(Metadata.error(source) + "Unexpected cast object.");
|
||||
}
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for addition operator across all types */
|
||||
//TODO: NaN/Inf/overflow/...
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for and operator across all types */
|
||||
public class AndTests extends ScriptTestCase {
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
public class BasicAPITests extends ScriptTestCase {
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.util.Collections;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/**
|
||||
* Tests binary operators across different types
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/**
|
||||
* Tests compound assignments (+=, etc) across all data types
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
public class DefTests extends ScriptTestCase {
|
||||
public void testNot() {
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for division operator across all types */
|
||||
//TODO: NaN/Inf/overflow/...
|
|
@ -1,4 +1,4 @@
|
|||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.junit.Before;
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for increment/decrement operators across all data types */
|
||||
public class IncrementTests extends ScriptTestCase {
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for multiplication operator across all types */
|
||||
//TODO: NaN/Inf/overflow/...
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for or operator across all types */
|
||||
public class OrTests extends ScriptTestCase {
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.Name;
|
||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
||||
|
@ -28,9 +28,9 @@ import org.elasticsearch.test.rest.parser.RestTestParseException;
|
|||
import java.io.IOException;
|
||||
|
||||
/** Runs yaml rest tests */
|
||||
public class PlanARestIT extends ESRestTestCase {
|
||||
public class PainlessRestIT extends ESRestTestCase {
|
||||
|
||||
public PlanARestIT(@Name("yaml") RestTestCandidate testCandidate) {
|
||||
public PainlessRestIT(@Name("yaml") RestTestCandidate testCandidate) {
|
||||
super(testCandidate);
|
||||
}
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for division operator across all types */
|
||||
//TODO: NaN/Inf/overflow/...
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.elasticsearch.script.CompiledScript;
|
||||
import org.elasticsearch.script.ExecutableScript;
|
||||
|
@ -83,7 +83,7 @@ public class ScriptEngineTests extends ScriptTestCase {
|
|||
|
||||
Object compiledScript = scriptEngine.compile("return ((Map<String, Object>)input.get(\"ctx\")).get(\"value\");", Collections.emptyMap());
|
||||
ExecutableScript script = scriptEngine.executable(new CompiledScript(ScriptService.ScriptType.INLINE,
|
||||
"testChangingVarsCrossExecution1", "plan-a", compiledScript), vars);
|
||||
"testChangingVarsCrossExecution1", "painless", compiledScript), vars);
|
||||
|
||||
ctx.put("value", 1);
|
||||
Object o = script.run();
|
||||
|
@ -99,7 +99,7 @@ public class ScriptEngineTests extends ScriptTestCase {
|
|||
Object compiledScript = scriptEngine.compile("return input.get(\"value\");", Collections.emptyMap());
|
||||
|
||||
ExecutableScript script = scriptEngine.executable(new CompiledScript(ScriptService.ScriptType.INLINE,
|
||||
"testChangingVarsCrossExecution2", "plan-a", compiledScript), vars);
|
||||
"testChangingVarsCrossExecution2", "painless", compiledScript), vars);
|
||||
|
||||
script.setNextVar("value", 1);
|
||||
Object value = script.run();
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.script.CompiledScript;
|
||||
|
@ -34,11 +34,11 @@ import java.util.Map;
|
|||
* Typically just asserts the output of {@code exec()}
|
||||
*/
|
||||
public abstract class ScriptTestCase extends ESTestCase {
|
||||
protected PlanAScriptEngineService scriptEngine;
|
||||
protected PainlessScriptEngineService scriptEngine;
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
scriptEngine = new PlanAScriptEngineService(Settings.EMPTY);
|
||||
scriptEngine = new PainlessScriptEngineService(Settings.EMPTY);
|
||||
}
|
||||
|
||||
/** Compiles and returns the result of {@code script} */
|
||||
|
@ -54,7 +54,7 @@ public abstract class ScriptTestCase extends ESTestCase {
|
|||
/** Compiles and returns the result of {@code script} with access to {@code vars} and compile-time parameters */
|
||||
public Object exec(String script, Map<String, Object> vars, Map<String,String> compileParams) {
|
||||
Object object = scriptEngine.compile(script, compileParams);
|
||||
CompiledScript compiled = new CompiledScript(ScriptService.ScriptType.INLINE, getTestName(), "plan-a", object);
|
||||
CompiledScript compiled = new CompiledScript(ScriptService.ScriptType.INLINE, getTestName(), "painless", object);
|
||||
return scriptEngine.executable(compiled, vars).run();
|
||||
}
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
public class StringTests extends ScriptTestCase {
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for subtraction operator across all types */
|
||||
//TODO: NaN/Inf/overflow/...
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for unary operators across different types */
|
||||
public class UnaryTests extends ScriptTestCase {
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
|
|
@ -17,9 +17,8 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.Collections;
|
||||
|
||||
public class WhenThingsGoWrongTests extends ScriptTestCase {
|
||||
|
@ -54,66 +53,66 @@ public class WhenThingsGoWrongTests extends ScriptTestCase {
|
|||
public void testInfiniteLoops() {
|
||||
try {
|
||||
exec("boolean x = true; while (x) {}");
|
||||
fail("should have hit PlanAError");
|
||||
} catch (PlanAError expected) {
|
||||
fail("should have hit PainlessError");
|
||||
} catch (PainlessError expected) {
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"The maximum number of statements that can be executed in a loop has been reached."));
|
||||
}
|
||||
|
||||
try {
|
||||
exec("while (true) {int y = 5}");
|
||||
fail("should have hit PlanAError");
|
||||
} catch (PlanAError expected) {
|
||||
fail("should have hit PainlessError");
|
||||
} catch (PainlessError expected) {
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"The maximum number of statements that can be executed in a loop has been reached."));
|
||||
}
|
||||
|
||||
try {
|
||||
exec("while (true) { boolean x = true; while (x) {} }");
|
||||
fail("should have hit PlanAError");
|
||||
} catch (PlanAError expected) {
|
||||
fail("should have hit PainlessError");
|
||||
} catch (PainlessError expected) {
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"The maximum number of statements that can be executed in a loop has been reached."));
|
||||
}
|
||||
|
||||
try {
|
||||
exec("while (true) { boolean x = false; while (x) {} }");
|
||||
fail("should have hit PlanAError");
|
||||
} catch (PlanAError expected) {
|
||||
fail("should have hit PainlessError");
|
||||
} catch (PainlessError expected) {
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"The maximum number of statements that can be executed in a loop has been reached."));
|
||||
}
|
||||
|
||||
try {
|
||||
exec("boolean x = true; for (;x;) {}");
|
||||
fail("should have hit PlanAError");
|
||||
} catch (PlanAError expected) {
|
||||
fail("should have hit PainlessError");
|
||||
} catch (PainlessError expected) {
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"The maximum number of statements that can be executed in a loop has been reached."));
|
||||
}
|
||||
|
||||
try {
|
||||
exec("for (;;) {int x = 5}");
|
||||
fail("should have hit PlanAError");
|
||||
} catch (PlanAError expected) {
|
||||
fail("should have hit PainlessError");
|
||||
} catch (PainlessError expected) {
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"The maximum number of statements that can be executed in a loop has been reached."));
|
||||
}
|
||||
|
||||
try {
|
||||
exec("def x = true; do {int y = 5;} while (x)");
|
||||
fail("should have hit PlanAError");
|
||||
} catch (PlanAError expected) {
|
||||
fail("should have hit PainlessError");
|
||||
} catch (PainlessError expected) {
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"The maximum number of statements that can be executed in a loop has been reached."));
|
||||
}
|
||||
|
||||
try {
|
||||
exec("try { int x } catch (PlanAError error) {}");
|
||||
exec("try { int x } catch (PainlessError error) {}");
|
||||
fail("should have hit ParseException");
|
||||
} catch (RuntimeException expected) {
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"unexpected token ['PlanAError'] was expecting one of [TYPE]."));
|
||||
"unexpected token ['PainlessError'] was expecting one of [TYPE]."));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -123,8 +122,8 @@ public class WhenThingsGoWrongTests extends ScriptTestCase {
|
|||
|
||||
try {
|
||||
exec("for (int x = 0; x < 10000; ++x) {}");
|
||||
fail("should have hit PlanAError");
|
||||
} catch (PlanAError expected) {
|
||||
fail("should have hit PainlessError");
|
||||
} catch (PainlessError expected) {
|
||||
assertTrue(expected.getMessage().contains(
|
||||
"The maximum number of statements that can be executed in a loop has been reached."));
|
||||
}
|
|
@ -17,7 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
package org.elasticsearch.plan.a;
|
||||
package org.elasticsearch.painless;
|
||||
|
||||
/** Tests for xor operator across all types */
|
||||
public class XorTests extends ScriptTestCase {
|
|
@ -1,6 +1,6 @@
|
|||
# Integration tests for Plan A Plugin
|
||||
# Integration tests for Painless Plugin
|
||||
#
|
||||
"Plan A plugin loaded":
|
||||
"Painless plugin loaded":
|
||||
- do:
|
||||
cluster.state: {}
|
||||
|
||||
|
@ -10,4 +10,4 @@
|
|||
- do:
|
||||
nodes.info: {}
|
||||
|
||||
- match: { nodes.$master.plugins.0.name: lang-plan-a }
|
||||
- match: { nodes.$master.plugins.0.name: lang-painless }
|
|
@ -20,7 +20,7 @@ setup:
|
|||
bar:
|
||||
script:
|
||||
inline: "input.doc.foo.0 + input.x;"
|
||||
lang: plan-a
|
||||
lang: painless
|
||||
params:
|
||||
x: "bbb"
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Integration tests for Plan-A search scripting
|
||||
# Integration tests for Painless search scripting
|
||||
#
|
||||
"Plan-A Query":
|
||||
"Painless Query":
|
||||
- do:
|
||||
index:
|
||||
index: test
|
||||
|
@ -30,12 +30,12 @@
|
|||
script:
|
||||
script:
|
||||
inline: "input.doc.num1.0 > 1;"
|
||||
lang: plan-a
|
||||
lang: painless
|
||||
script_fields:
|
||||
sNum1:
|
||||
script:
|
||||
inline: "input.doc.num1.0;"
|
||||
lang: plan-a
|
||||
lang: painless
|
||||
sort:
|
||||
num1:
|
||||
order: asc
|
||||
|
@ -52,7 +52,7 @@
|
|||
script:
|
||||
script:
|
||||
inline: "input.doc.num1.0 > input.param1;"
|
||||
lang: plan-a
|
||||
lang: painless
|
||||
params:
|
||||
param1: 1
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
|||
sNum1:
|
||||
script:
|
||||
inline: "return input.doc.num1.0;"
|
||||
lang: plan-a
|
||||
lang: painless
|
||||
sort:
|
||||
num1:
|
||||
order: asc
|
||||
|
@ -77,7 +77,7 @@
|
|||
script:
|
||||
script:
|
||||
inline: "input.doc.num1.0 > input.param1;"
|
||||
lang: plan-a
|
||||
lang: painless
|
||||
params:
|
||||
param1: -1
|
||||
|
||||
|
@ -85,7 +85,7 @@
|
|||
sNum1:
|
||||
script:
|
||||
inline: "input.doc.num1.0;"
|
||||
lang: plan-a
|
||||
lang: painless
|
||||
sort:
|
||||
num1:
|
||||
order: asc
|
|
@ -1,348 +0,0 @@
|
|||
// ANTLR GENERATED CODE: DO NOT EDIT
|
||||
package org.elasticsearch.plan.a;
|
||||
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
|
||||
|
||||
/**
|
||||
* This interface defines a complete generic visitor for a parse tree produced
|
||||
* by {@link PlanAParser}.
|
||||
*
|
||||
* @param <T> The return type of the visit operation. Use {@link Void} for
|
||||
* operations with no return type.
|
||||
*/
|
||||
interface PlanAParserVisitor<T> extends ParseTreeVisitor<T> {
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#source}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitSource(PlanAParser.SourceContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code if}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitIf(PlanAParser.IfContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code while}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitWhile(PlanAParser.WhileContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code do}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDo(PlanAParser.DoContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code for}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitFor(PlanAParser.ForContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code decl}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDecl(PlanAParser.DeclContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code continue}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitContinue(PlanAParser.ContinueContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code break}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitBreak(PlanAParser.BreakContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code return}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitReturn(PlanAParser.ReturnContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code try}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTry(PlanAParser.TryContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code throw}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitThrow(PlanAParser.ThrowContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code expr}
|
||||
* labeled alternative in {@link PlanAParser#statement}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExpr(PlanAParser.ExprContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code multiple}
|
||||
* labeled alternative in {@link PlanAParser#block}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitMultiple(PlanAParser.MultipleContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code single}
|
||||
* labeled alternative in {@link PlanAParser#block}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitSingle(PlanAParser.SingleContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#empty}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitEmpty(PlanAParser.EmptyContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#emptyscope}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitEmptyscope(PlanAParser.EmptyscopeContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#initializer}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitInitializer(PlanAParser.InitializerContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#afterthought}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitAfterthought(PlanAParser.AfterthoughtContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#declaration}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDeclaration(PlanAParser.DeclarationContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#decltype}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDecltype(PlanAParser.DecltypeContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#declvar}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDeclvar(PlanAParser.DeclvarContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#trap}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTrap(PlanAParser.TrapContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code comp}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitComp(PlanAParser.CompContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code bool}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitBool(PlanAParser.BoolContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code conditional}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitConditional(PlanAParser.ConditionalContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code assignment}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitAssignment(PlanAParser.AssignmentContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code false}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitFalse(PlanAParser.FalseContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code numeric}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitNumeric(PlanAParser.NumericContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code unary}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitUnary(PlanAParser.UnaryContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code precedence}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitPrecedence(PlanAParser.PrecedenceContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code preinc}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitPreinc(PlanAParser.PreincContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code postinc}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitPostinc(PlanAParser.PostincContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code cast}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitCast(PlanAParser.CastContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code external}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExternal(PlanAParser.ExternalContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code null}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitNull(PlanAParser.NullContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code binary}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitBinary(PlanAParser.BinaryContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code char}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitChar(PlanAParser.CharContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code true}
|
||||
* labeled alternative in {@link PlanAParser#expression}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTrue(PlanAParser.TrueContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extstart}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtstart(PlanAParser.ExtstartContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extprec}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtprec(PlanAParser.ExtprecContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extcast}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtcast(PlanAParser.ExtcastContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extbrace}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtbrace(PlanAParser.ExtbraceContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extdot}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtdot(PlanAParser.ExtdotContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#exttype}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExttype(PlanAParser.ExttypeContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extcall}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtcall(PlanAParser.ExtcallContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extvar}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtvar(PlanAParser.ExtvarContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extfield}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtfield(PlanAParser.ExtfieldContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extnew}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtnew(PlanAParser.ExtnewContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#extstring}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitExtstring(PlanAParser.ExtstringContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#arguments}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitArguments(PlanAParser.ArgumentsContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link PlanAParser#increment}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitIncrement(PlanAParser.IncrementContext ctx);
|
||||
}
|
|
@ -593,7 +593,7 @@ public class PluginManagerTests extends ESIntegTestCase {
|
|||
PluginManager.checkForOfficialPlugins("analysis-stempel");
|
||||
PluginManager.checkForOfficialPlugins("delete-by-query");
|
||||
PluginManager.checkForOfficialPlugins("lang-javascript");
|
||||
PluginManager.checkForOfficialPlugins("lang-plan-a");
|
||||
PluginManager.checkForOfficialPlugins("lang-painless");
|
||||
PluginManager.checkForOfficialPlugins("lang-python");
|
||||
PluginManager.checkForOfficialPlugins("mapper-attachments");
|
||||
PluginManager.checkForOfficialPlugins("mapper-murmur3");
|
||||
|
|
|
@ -231,8 +231,8 @@ fi
|
|||
install_and_check_plugin lang groovy
|
||||
}
|
||||
|
||||
@test "[$GROUP] install lang-plan-a plugin" {
|
||||
install_and_check_plugin lang plan-a
|
||||
@test "[$GROUP] install lang-painless plugin" {
|
||||
install_and_check_plugin lang painless
|
||||
}
|
||||
|
||||
@test "[$GROUP] install javascript plugin" {
|
||||
|
@ -337,8 +337,8 @@ fi
|
|||
remove_plugin lang-groovy
|
||||
}
|
||||
|
||||
@test "[$GROUP] remove lang-plan-a plugin" {
|
||||
remove_plugin lang-plan-a
|
||||
@test "[$GROUP] remove lang-painless plugin" {
|
||||
remove_plugin lang-painless
|
||||
}
|
||||
|
||||
@test "[$GROUP] remove javascript plugin" {
|
||||
|
|
|
@ -27,7 +27,7 @@ List projects = [
|
|||
'plugins:discovery-multicast',
|
||||
'plugins:ingest-geoip',
|
||||
'plugins:lang-javascript',
|
||||
'plugins:lang-plan-a',
|
||||
'plugins:lang-painless',
|
||||
'plugins:lang-python',
|
||||
'plugins:mapper-attachments',
|
||||
'plugins:mapper-murmur3',
|
||||
|
|
Loading…
Reference in New Issue