use of org.antlr.runtime.tree.CommonTree in project hive by apache.
the class DDLSemanticAnalyzer method getFullPartitionSpecs.
/**
* Get the partition specs from the tree. This stores the full specification
* with the comparator operator into the output list.
*
* @param ast Tree to extract partitions from.
* @param tab Table.
* @return Map of partitions by prefix length. Most of the time prefix length will
* be the same for all partition specs, so we can just OR the expressions.
*/
private Map<Integer, List<ExprNodeGenericFuncDesc>> getFullPartitionSpecs(CommonTree ast, Table tab, boolean canGroupExprs) throws SemanticException {
String defaultPartitionName = HiveConf.getVar(conf, HiveConf.ConfVars.DEFAULTPARTITIONNAME);
Map<String, String> colTypes = new HashMap<String, String>();
for (FieldSchema fs : tab.getPartitionKeys()) {
colTypes.put(fs.getName().toLowerCase(), fs.getType());
}
Map<Integer, List<ExprNodeGenericFuncDesc>> result = new HashMap<Integer, List<ExprNodeGenericFuncDesc>>();
for (int childIndex = 0; childIndex < ast.getChildCount(); childIndex++) {
Tree partSpecTree = ast.getChild(childIndex);
if (partSpecTree.getType() != HiveParser.TOK_PARTSPEC)
continue;
ExprNodeGenericFuncDesc expr = null;
HashSet<String> names = new HashSet<String>(partSpecTree.getChildCount());
for (int i = 0; i < partSpecTree.getChildCount(); ++i) {
CommonTree partSpecSingleKey = (CommonTree) partSpecTree.getChild(i);
assert (partSpecSingleKey.getType() == HiveParser.TOK_PARTVAL);
String key = stripIdentifierQuotes(partSpecSingleKey.getChild(0).getText()).toLowerCase();
String operator = partSpecSingleKey.getChild(1).getText();
ASTNode partValNode = (ASTNode) partSpecSingleKey.getChild(2);
TypeCheckCtx typeCheckCtx = new TypeCheckCtx(null);
ExprNodeConstantDesc valExpr = (ExprNodeConstantDesc) TypeCheckProcFactory.genExprNode(partValNode, typeCheckCtx).get(partValNode);
Object val = valExpr.getValue();
boolean isDefaultPartitionName = val.equals(defaultPartitionName);
String type = colTypes.get(key);
PrimitiveTypeInfo pti = TypeInfoFactory.getPrimitiveTypeInfo(type);
if (type == null) {
throw new SemanticException("Column " + key + " not found");
}
// Create the corresponding hive expression to filter on partition columns.
if (!isDefaultPartitionName) {
if (!valExpr.getTypeString().equals(type)) {
Converter converter = ObjectInspectorConverters.getConverter(TypeInfoUtils.getStandardJavaObjectInspectorFromTypeInfo(valExpr.getTypeInfo()), TypeInfoUtils.getStandardJavaObjectInspectorFromTypeInfo(pti));
val = converter.convert(valExpr.getValue());
}
}
ExprNodeColumnDesc column = new ExprNodeColumnDesc(pti, key, null, true);
ExprNodeGenericFuncDesc op = makeBinaryPredicate(operator, column, isDefaultPartitionName ? new ExprNodeConstantDefaultDesc(pti, defaultPartitionName) : new ExprNodeConstantDesc(pti, val));
// If it's multi-expr filter (e.g. a='5', b='2012-01-02'), AND with previous exprs.
expr = (expr == null) ? op : makeBinaryPredicate("and", expr, op);
names.add(key);
}
if (expr == null)
continue;
// We got the expr for one full partition spec. Determine the prefix length.
int prefixLength = calculatePartPrefix(tab, names);
List<ExprNodeGenericFuncDesc> orExpr = result.get(prefixLength);
// If we don't, create a new separate filter. In most cases there will only be one.
if (orExpr == null) {
result.put(prefixLength, Lists.newArrayList(expr));
} else if (canGroupExprs) {
orExpr.set(0, makeBinaryPredicate("or", expr, orExpr.get(0)));
} else {
orExpr.add(expr);
}
}
return result;
}
use of org.antlr.runtime.tree.CommonTree in project hive by apache.
the class ParseUtils method processSetColsNode.
/**
* Replaces a spurious TOK_SETCOLREF added by parser with column names referring to the query
* in e.g. a union. This is to maintain the expectations that some code, like order by position
* alias, might have about not having ALLCOLREF. If it cannot find the columns with confidence
* it will just replace SETCOLREF with ALLCOLREF. Most of the cases where that happens are
* easy to work around in the query (e.g. by adding column aliases in the union).
* @param setCols TOK_SETCOLREF ASTNode.
* @param searcher AST searcher to reuse.
*/
private static void processSetColsNode(ASTNode setCols, ASTSearcher searcher) {
searcher.reset();
CommonTree rootNode = setCols;
while (rootNode != null && rootNode.getType() != HiveParser.TOK_INSERT) {
rootNode = rootNode.parent;
}
if (rootNode == null || rootNode.parent == null) {
// Couldn't find the parent insert; replace with ALLCOLREF.
LOG.debug("Replacing SETCOLREF with ALLCOLREF because we couldn't find the root INSERT");
setCols.token.setType(HiveParser.TOK_ALLCOLREF);
return;
}
// TOK_QUERY above insert
rootNode = rootNode.parent;
Tree fromNode = null;
for (int j = 0; j < rootNode.getChildCount(); ++j) {
Tree child = rootNode.getChild(j);
if (child.getType() == HiveParser.TOK_FROM) {
fromNode = child;
break;
}
}
if (!(fromNode instanceof ASTNode)) {
// Couldn't find the from that contains subquery; replace with ALLCOLREF.
LOG.debug("Replacing SETCOLREF with ALLCOLREF because we couldn't find the FROM");
setCols.token.setType(HiveParser.TOK_ALLCOLREF);
return;
}
// We are making what we are trying to do more explicit if there's a union alias; so
// that if we do something we didn't expect to do, it'd be more likely to fail.
String alias = null;
if (fromNode.getChildCount() > 0) {
Tree fromWhat = fromNode.getChild(0);
if (fromWhat.getType() == HiveParser.TOK_SUBQUERY && fromWhat.getChildCount() > 1) {
Tree child = fromWhat.getChild(fromWhat.getChildCount() - 1);
if (child.getType() == HiveParser.Identifier) {
alias = child.getText();
}
}
}
// Note: we assume that this isn't an already malformed query;
// we don't check for that here - it will fail later anyway.
// First, we find the SELECT closest to the top.
ASTNode select = searcher.simpleBreadthFirstSearchAny((ASTNode) fromNode, HiveParser.TOK_SELECT, HiveParser.TOK_SELECTDI);
if (select == null) {
// Couldn't find the from that contains subquery; replace with ALLCOLREF.
LOG.debug("Replacing SETCOLREF with ALLCOLREF because we couldn't find the SELECT");
setCols.token.setType(HiveParser.TOK_ALLCOLREF);
return;
}
// Then, find the leftmost logical sibling select, because that's what Hive uses for aliases.
while (true) {
CommonTree queryOfSelect = select.parent;
while (queryOfSelect != null && queryOfSelect.getType() != HiveParser.TOK_QUERY) {
queryOfSelect = queryOfSelect.parent;
}
// We should have some QUERY; and also its parent because by supposition we are in subq.
if (queryOfSelect == null || queryOfSelect.parent == null) {
LOG.debug("Replacing SETCOLREF with ALLCOLREF because we couldn't find the QUERY");
setCols.token.setType(HiveParser.TOK_ALLCOLREF);
return;
}
// We are the left-most child.
if (queryOfSelect.childIndex == 0)
break;
Tree moreToTheLeft = queryOfSelect.parent.getChild(0);
Preconditions.checkState(moreToTheLeft != queryOfSelect);
ASTNode newSelect = searcher.simpleBreadthFirstSearchAny((ASTNode) moreToTheLeft, HiveParser.TOK_SELECT, HiveParser.TOK_SELECTDI);
Preconditions.checkState(newSelect != select);
select = newSelect;
// Repeat the procedure for the new select.
}
// Found the proper columns.
List<ASTNode> newChildren = new ArrayList<>(select.getChildCount());
HashSet<String> aliases = new HashSet<>();
for (int i = 0; i < select.getChildCount(); ++i) {
Tree selExpr = select.getChild(i);
assert selExpr.getType() == HiveParser.TOK_SELEXPR;
assert selExpr.getChildCount() > 0;
// Examine the last child. It could be an alias.
Tree child = selExpr.getChild(selExpr.getChildCount() - 1);
switch(child.getType()) {
case HiveParser.TOK_SETCOLREF:
// We have a nested setcolref. Process that and start from scratch TODO: use stack?
processSetColsNode((ASTNode) child, searcher);
processSetColsNode(setCols, searcher);
return;
case HiveParser.TOK_ALLCOLREF:
// We should find an alias of this insert and do (alias).*. This however won't fix e.g.
// positional order by alias case, cause we'd still have a star on the top level. Bail.
LOG.debug("Replacing SETCOLREF with ALLCOLREF because of nested ALLCOLREF");
setCols.token.setType(HiveParser.TOK_ALLCOLREF);
return;
case HiveParser.TOK_TABLE_OR_COL:
Tree idChild = child.getChild(0);
assert idChild.getType() == HiveParser.Identifier : idChild;
if (!createChildColumnRef(idChild, alias, newChildren, aliases)) {
setCols.token.setType(HiveParser.TOK_ALLCOLREF);
return;
}
break;
case HiveParser.Identifier:
if (!createChildColumnRef(child, alias, newChildren, aliases)) {
setCols.token.setType(HiveParser.TOK_ALLCOLREF);
return;
}
break;
case HiveParser.DOT:
{
Tree colChild = child.getChild(child.getChildCount() - 1);
assert colChild.getType() == HiveParser.Identifier : colChild;
if (!createChildColumnRef(colChild, alias, newChildren, aliases)) {
setCols.token.setType(HiveParser.TOK_ALLCOLREF);
return;
}
break;
}
default:
// Not really sure how to refer to this (or if we can).
// TODO: We could find a different from branch for the union, that might have an alias?
// Or we could add an alias here to refer to, but that might break other branches.
LOG.debug("Replacing SETCOLREF with ALLCOLREF because of the nested node " + child.getType() + " " + child.getText());
setCols.token.setType(HiveParser.TOK_ALLCOLREF);
return;
}
}
// Insert search in the beginning would have failed if these parents didn't exist.
ASTNode parent = (ASTNode) setCols.parent.parent;
int t = parent.getType();
assert t == HiveParser.TOK_SELECT || t == HiveParser.TOK_SELECTDI : t;
int ix = setCols.parent.childIndex;
parent.deleteChild(ix);
for (ASTNode node : newChildren) {
parent.insertChild(ix++, node);
}
}
use of org.antlr.runtime.tree.CommonTree in project che by eclipse.
the class JavaTreeParser method primaryExpression.
// $ANTLR start "primaryExpression"
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:789:1: primaryExpression returns [ExpressionValue value]
// : ( ^( DOT (e= primaryExpression ( IDENT | THIS | SUPER | innerNewExpression | CLASS ) | primitiveType CLASS | VOID CLASS ) ) |
// parenthesizedExpression | IDENT | ^( METHOD_CALL o= primaryExpression ( genericTypeArgumentList )? arguments ) |
// explicitConstructorCall | ^( ARRAY_ELEMENT_ACCESS arr= primaryExpression index= expression ) | literal | newExpression | THIS |
// arrayTypeDeclarator | SUPER );
public final JavaTreeParser.primaryExpression_return primaryExpression() throws RecognitionException {
JavaTreeParser.primaryExpression_return retval = new JavaTreeParser.primaryExpression_return();
retval.start = input.LT(1);
int primaryExpression_StartIndex = input.index();
CommonTree IDENT40 = null;
CommonTree IDENT42 = null;
JavaTreeParser.primaryExpression_return e = null;
JavaTreeParser.primaryExpression_return o = null;
JavaTreeParser.primaryExpression_return arr = null;
ExpressionValue index = null;
ExpressionValue parenthesizedExpression41 = null;
List<com.sun.jdi.Value> arguments43 = null;
ExpressionValue literal44 = null;
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 64)) {
return retval;
}
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:793:3: ( ^( DOT (e= primaryExpression ( IDENT |
// THIS | SUPER | innerNewExpression | CLASS ) | primitiveType CLASS | VOID CLASS ) ) | parenthesizedExpression | IDENT | ^(
// METHOD_CALL o= primaryExpression ( genericTypeArgumentList )? arguments ) | explicitConstructorCall | ^(
// ARRAY_ELEMENT_ACCESS arr= primaryExpression index= expression ) | literal | newExpression | THIS | arrayTypeDeclarator |
// SUPER )
int alt95 = 11;
switch(input.LA(1)) {
case DOT:
{
alt95 = 1;
}
break;
case PARENTESIZED_EXPR:
{
alt95 = 2;
}
break;
case IDENT:
{
alt95 = 3;
}
break;
case METHOD_CALL:
{
alt95 = 4;
}
break;
case SUPER_CONSTRUCTOR_CALL:
case THIS_CONSTRUCTOR_CALL:
{
alt95 = 5;
}
break;
case ARRAY_ELEMENT_ACCESS:
{
alt95 = 6;
}
break;
case FALSE:
case NULL:
case TRUE:
case HEX_LITERAL:
case OCTAL_LITERAL:
case DECIMAL_LITERAL:
case FLOATING_POINT_LITERAL:
case CHARACTER_LITERAL:
case STRING_LITERAL:
{
alt95 = 7;
}
break;
case CLASS_CONSTRUCTOR_CALL:
case STATIC_ARRAY_CREATOR:
{
alt95 = 8;
}
break;
case THIS:
{
alt95 = 9;
}
break;
case ARRAY_DECLARATOR:
{
alt95 = 10;
}
break;
case SUPER:
{
alt95 = 11;
}
break;
default:
if (state.backtracking > 0) {
state.failed = true;
return retval;
}
NoViableAltException nvae = new NoViableAltException("", 95, 0, input);
throw nvae;
}
switch(alt95) {
case 1:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:794:3: ^( DOT (e= primaryExpression (
// IDENT | THIS | SUPER | innerNewExpression | CLASS ) | primitiveType CLASS | VOID CLASS ) )
{
match(input, DOT, FOLLOW_DOT_in_primaryExpression4302);
if (state.failed)
return retval;
match(input, Token.DOWN, null);
if (state.failed)
return retval;
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:796:5: (e= primaryExpression ( IDENT |
// THIS | SUPER | innerNewExpression | CLASS ) | primitiveType CLASS | VOID CLASS )
int alt93 = 3;
switch(input.LA(1)) {
case DOT:
case FALSE:
case NULL:
case SUPER:
case THIS:
case TRUE:
case ARRAY_DECLARATOR:
case ARRAY_ELEMENT_ACCESS:
case CLASS_CONSTRUCTOR_CALL:
case METHOD_CALL:
case PARENTESIZED_EXPR:
case STATIC_ARRAY_CREATOR:
case SUPER_CONSTRUCTOR_CALL:
case THIS_CONSTRUCTOR_CALL:
case IDENT:
case HEX_LITERAL:
case OCTAL_LITERAL:
case DECIMAL_LITERAL:
case FLOATING_POINT_LITERAL:
case CHARACTER_LITERAL:
case STRING_LITERAL:
{
alt93 = 1;
}
break;
case BOOLEAN:
case BYTE:
case CHAR:
case DOUBLE:
case FLOAT:
case INT:
case LONG:
case SHORT:
{
alt93 = 2;
}
break;
case VOID:
{
alt93 = 3;
}
break;
default:
if (state.backtracking > 0) {
state.failed = true;
return retval;
}
NoViableAltException nvae = new NoViableAltException("", 93, 0, input);
throw nvae;
}
switch(alt93) {
case 1:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:797:7: e= primaryExpression (
// IDENT | THIS | SUPER | innerNewExpression | CLASS )
{
pushFollow(FOLLOW_primaryExpression_in_primaryExpression4318);
e = primaryExpression();
state._fsp--;
if (state.failed)
return retval;
if (state.backtracking == 0) {
retval.value = (e != null ? e.value : null);
}
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:801:7: ( IDENT | THIS | SUPER |
// innerNewExpression | CLASS )
int alt92 = 5;
switch(input.LA(1)) {
case IDENT:
{
alt92 = 1;
}
break;
case THIS:
{
alt92 = 2;
}
break;
case SUPER:
{
alt92 = 3;
}
break;
case CLASS_CONSTRUCTOR_CALL:
{
alt92 = 4;
}
break;
case CLASS:
{
alt92 = 5;
}
break;
default:
if (state.backtracking > 0) {
state.failed = true;
return retval;
}
NoViableAltException nvae = new NoViableAltException("", 92, 0, input);
throw nvae;
}
switch(alt92) {
case 1:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:802:9: IDENT
{
IDENT40 = (CommonTree) match(input, IDENT, FOLLOW_IDENT_in_primaryExpression4353);
if (state.failed)
return retval;
if (state.backtracking == 0) {
if (((CommonTree) retval.start).getParent().getType() != METHOD_CALL) {
retval.value = ev.getField(latest.getValue(), (IDENT40 != null ? IDENT40.getText() : null));
if (retval.value == null) {
throw new ExpressionException("Unknown field " + (IDENT40 != null ? IDENT40.getText() : null));
}
}
}
}
break;
case 2:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:811:11: THIS
{
match(input, THIS, FOLLOW_THIS_in_primaryExpression4383);
if (state.failed)
return retval;
if (state.backtracking == 0) {
retval.value = ev.getThisObject();
}
}
break;
case 3:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:815:11: SUPER
{
match(input, SUPER, FOLLOW_SUPER_in_primaryExpression4413);
if (state.failed)
return retval;
}
break;
case 4:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:816:11: innerNewExpression
{
pushFollow(FOLLOW_innerNewExpression_in_primaryExpression4425);
innerNewExpression();
state._fsp--;
if (state.failed)
return retval;
if (state.backtracking == 0) {
throw new ExpressionException("Unable create new instance. Operation not supported yet. ");
}
}
break;
case 5:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:820:11: CLASS
{
match(input, CLASS, FOLLOW_CLASS_in_primaryExpression4485);
if (state.failed)
return retval;
}
break;
}
}
break;
case 2:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:822:9: primitiveType CLASS
{
pushFollow(FOLLOW_primitiveType_in_primaryExpression4503);
primitiveType();
state._fsp--;
if (state.failed)
return retval;
match(input, CLASS, FOLLOW_CLASS_in_primaryExpression4505);
if (state.failed)
return retval;
}
break;
case 3:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:823:9: VOID CLASS
{
match(input, VOID, FOLLOW_VOID_in_primaryExpression4515);
if (state.failed)
return retval;
match(input, CLASS, FOLLOW_CLASS_in_primaryExpression4517);
if (state.failed)
return retval;
}
break;
}
match(input, Token.UP, null);
if (state.failed)
return retval;
}
break;
case 2:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:826:5: parenthesizedExpression
{
pushFollow(FOLLOW_parenthesizedExpression_in_primaryExpression4534);
parenthesizedExpression41 = parenthesizedExpression();
state._fsp--;
if (state.failed)
return retval;
if (state.backtracking == 0) {
retval.value = parenthesizedExpression41;
}
}
break;
case 3:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:830:5: IDENT
{
IDENT42 = (CommonTree) match(input, IDENT, FOLLOW_IDENT_in_primaryExpression4558);
if (state.failed)
return retval;
if (state.backtracking == 0) {
if (((CommonTree) retval.start).getParent().getType() != METHOD_CALL) {
retval.value = ev.getLocalVariable((IDENT42 != null ? IDENT42.getText() : null));
if (retval.value == null) {
retval.value = ev.getField(latest.getValue(), (IDENT42 != null ? IDENT42.getText() : null));
}
if (retval.value == null) {
throw new ExpressionException("Unknown local variable or field " + (IDENT42 != null ? IDENT42.getText() : null));
}
} else {
retval.value = ev.getThisObject();
}
}
}
break;
case 4:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:846:3: ^( METHOD_CALL o=
// primaryExpression ( genericTypeArgumentList )? arguments )
{
match(input, METHOD_CALL, FOLLOW_METHOD_CALL_in_primaryExpression4585);
if (state.failed)
return retval;
match(input, Token.DOWN, null);
if (state.failed)
return retval;
pushFollow(FOLLOW_primaryExpression_in_primaryExpression4589);
o = primaryExpression();
state._fsp--;
if (state.failed)
return retval;
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:846:37: ( genericTypeArgumentList )?
int alt94 = 2;
int LA94_0 = input.LA(1);
if ((LA94_0 == GENERIC_TYPE_ARG_LIST)) {
alt94 = 1;
}
switch(alt94) {
case 1:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:0:0: genericTypeArgumentList
{
pushFollow(FOLLOW_genericTypeArgumentList_in_primaryExpression4591);
genericTypeArgumentList();
state._fsp--;
if (state.failed)
return retval;
}
break;
}
pushFollow(FOLLOW_arguments_in_primaryExpression4594);
arguments43 = arguments();
state._fsp--;
if (state.failed)
return retval;
match(input, Token.UP, null);
if (state.failed)
return retval;
if (state.backtracking == 0) {
String name = (o != null ? ((CommonTree) o.start) : null).getChildCount() == 0 ? (o != null ? ((CommonTree) o.start) : null).getText() : (o != null ? ((CommonTree) o.start) : null).getChild(1).getText();
retval.value = ev.invokeMethod(o.value.getValue(), name, arguments43);
}
}
break;
case 5:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:853:5: explicitConstructorCall
{
pushFollow(FOLLOW_explicitConstructorCall_in_primaryExpression4618);
explicitConstructorCall();
state._fsp--;
if (state.failed)
return retval;
if (state.backtracking == 0) {
throw new ExpressionException("Unable create new instance. Operation not supported yet. ");
}
}
break;
case 6:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:858:3: ^( ARRAY_ELEMENT_ACCESS arr=
// primaryExpression index= expression )
{
match(input, ARRAY_ELEMENT_ACCESS, FOLLOW_ARRAY_ELEMENT_ACCESS_in_primaryExpression4645);
if (state.failed)
return retval;
match(input, Token.DOWN, null);
if (state.failed)
return retval;
pushFollow(FOLLOW_primaryExpression_in_primaryExpression4649);
arr = primaryExpression();
state._fsp--;
if (state.failed)
return retval;
pushFollow(FOLLOW_expression_in_primaryExpression4653);
index = expression();
state._fsp--;
if (state.failed)
return retval;
match(input, Token.UP, null);
if (state.failed)
return retval;
if (state.backtracking == 0) {
retval.value = ev.getArrayElement((arr != null ? arr.value : null).getValue(), index.getValue());
}
}
break;
case 7:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:862:5: literal
{
pushFollow(FOLLOW_literal_in_primaryExpression4677);
literal44 = literal();
state._fsp--;
if (state.failed)
return retval;
if (state.backtracking == 0) {
retval.value = literal44;
}
}
break;
case 8:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:866:5: newExpression
{
pushFollow(FOLLOW_newExpression_in_primaryExpression4701);
newExpression();
state._fsp--;
if (state.failed)
return retval;
if (state.backtracking == 0) {
throw new ExpressionException("Unable create new instance. Operation not supported yet. ");
}
}
break;
case 9:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:870:5: THIS
{
match(input, THIS, FOLLOW_THIS_in_primaryExpression4725);
if (state.failed)
return retval;
if (state.backtracking == 0) {
retval.value = ev.getThisObject();
}
}
break;
case 10:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:874:5: arrayTypeDeclarator
{
pushFollow(FOLLOW_arrayTypeDeclarator_in_primaryExpression4749);
arrayTypeDeclarator();
state._fsp--;
if (state.failed)
return retval;
}
break;
case 11:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:875:5: SUPER
{
match(input, SUPER, FOLLOW_SUPER_in_primaryExpression4755);
if (state.failed)
return retval;
if (state.backtracking == 0) {
retval.value = ev.getThisObject();
}
}
break;
}
if (state.backtracking == 0) {
latest = retval.value;
}
} catch (RecognitionException re) {
reportError(re);
recover(input, re);
} finally {
if (state.backtracking > 0) {
memoize(input, 64, primaryExpression_StartIndex);
}
}
return retval;
}
use of org.antlr.runtime.tree.CommonTree in project che by eclipse.
the class JavaTreeParser method literal.
// $ANTLR end "arguments"
// $ANTLR start "literal"
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:940:1: literal returns [ExpressionValue value] : (
// HEX_LITERAL | OCTAL_LITERAL | DECIMAL_LITERAL | FLOATING_POINT_LITERAL | CHARACTER_LITERAL | STRING_LITERAL | TRUE | FALSE | NULL );
public final ExpressionValue literal() throws RecognitionException {
ExpressionValue value = null;
int literal_StartIndex = input.index();
CommonTree HEX_LITERAL45 = null;
CommonTree OCTAL_LITERAL46 = null;
CommonTree DECIMAL_LITERAL47 = null;
CommonTree FLOATING_POINT_LITERAL48 = null;
CommonTree CHARACTER_LITERAL49 = null;
CommonTree STRING_LITERAL50 = null;
CommonTree TRUE51 = null;
CommonTree FALSE52 = null;
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 71)) {
return value;
}
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:941:3: ( HEX_LITERAL | OCTAL_LITERAL |
// DECIMAL_LITERAL | FLOATING_POINT_LITERAL | CHARACTER_LITERAL | STRING_LITERAL | TRUE | FALSE | NULL )
int alt112 = 9;
switch(input.LA(1)) {
case HEX_LITERAL:
{
alt112 = 1;
}
break;
case OCTAL_LITERAL:
{
alt112 = 2;
}
break;
case DECIMAL_LITERAL:
{
alt112 = 3;
}
break;
case FLOATING_POINT_LITERAL:
{
alt112 = 4;
}
break;
case CHARACTER_LITERAL:
{
alt112 = 5;
}
break;
case STRING_LITERAL:
{
alt112 = 6;
}
break;
case TRUE:
{
alt112 = 7;
}
break;
case FALSE:
{
alt112 = 8;
}
break;
case NULL:
{
alt112 = 9;
}
break;
default:
if (state.backtracking > 0) {
state.failed = true;
return value;
}
NoViableAltException nvae = new NoViableAltException("", 112, 0, input);
throw nvae;
}
switch(alt112) {
case 1:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:942:3: HEX_LITERAL
{
HEX_LITERAL45 = (CommonTree) match(input, HEX_LITERAL, FOLLOW_HEX_LITERAL_in_literal5125);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.hexValue((HEX_LITERAL45 != null ? HEX_LITERAL45.getText() : null));
}
}
break;
case 2:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:946:5: OCTAL_LITERAL
{
OCTAL_LITERAL46 = (CommonTree) match(input, OCTAL_LITERAL, FOLLOW_OCTAL_LITERAL_in_literal5149);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.octalValue((OCTAL_LITERAL46 != null ? OCTAL_LITERAL46.getText() : null));
}
}
break;
case 3:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:950:5: DECIMAL_LITERAL
{
DECIMAL_LITERAL47 = (CommonTree) match(input, DECIMAL_LITERAL, FOLLOW_DECIMAL_LITERAL_in_literal5173);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.decimalValue((DECIMAL_LITERAL47 != null ? DECIMAL_LITERAL47.getText() : null));
}
}
break;
case 4:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:954:5: FLOATING_POINT_LITERAL
{
FLOATING_POINT_LITERAL48 = (CommonTree) match(input, FLOATING_POINT_LITERAL, FOLLOW_FLOATING_POINT_LITERAL_in_literal5197);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.floating_pointValue((FLOATING_POINT_LITERAL48 != null ? FLOATING_POINT_LITERAL48.getText() : null));
}
}
break;
case 5:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:958:5: CHARACTER_LITERAL
{
CHARACTER_LITERAL49 = (CommonTree) match(input, CHARACTER_LITERAL, FOLLOW_CHARACTER_LITERAL_in_literal5221);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.charValue((CHARACTER_LITERAL49 != null ? CHARACTER_LITERAL49.getText() : null));
}
}
break;
case 6:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:962:5: STRING_LITERAL
{
STRING_LITERAL50 = (CommonTree) match(input, STRING_LITERAL, FOLLOW_STRING_LITERAL_in_literal5245);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.stringValue((STRING_LITERAL50 != null ? STRING_LITERAL50.getText() : null));
}
}
break;
case 7:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:966:5: TRUE
{
TRUE51 = (CommonTree) match(input, TRUE, FOLLOW_TRUE_in_literal5269);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.booleanValue((TRUE51 != null ? TRUE51.getText() : null));
}
}
break;
case 8:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:970:5: FALSE
{
FALSE52 = (CommonTree) match(input, FALSE, FOLLOW_FALSE_in_literal5293);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.booleanValue((FALSE52 != null ? FALSE52.getText() : null));
}
}
break;
case 9:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:974:5: NULL
{
match(input, NULL, FOLLOW_NULL_in_literal5317);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.nullValue();
}
}
break;
}
} catch (RecognitionException re) {
reportError(re);
recover(input, re);
} finally {
if (state.backtracking > 0) {
memoize(input, 71, literal_StartIndex);
}
}
return value;
}
use of org.antlr.runtime.tree.CommonTree in project che by eclipse.
the class JavaTreeParser method expr.
// $ANTLR end "expression"
// $ANTLR start "expr"
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:569:1: expr returns [ExpressionValue value] : ( ^(
// ASSIGN a= expr b= expr ) | ^( PLUS_ASSIGN a= expr b= expr ) | ^( MINUS_ASSIGN a= expr b= expr ) | ^( STAR_ASSIGN a= expr b= expr )
// | ^( DIV_ASSIGN a= expr b= expr ) | ^( AND_ASSIGN a= expr b= expr ) | ^( OR_ASSIGN a= expr b= expr ) | ^( XOR_ASSIGN a= expr b=
// expr ) | ^( MOD_ASSIGN a= expr b= expr ) | ^( BIT_SHIFT_RIGHT_ASSIGN a= expr b= expr ) | ^( SHIFT_RIGHT_ASSIGN a= expr b= expr ) |
// ^( SHIFT_LEFT_ASSIGN a= expr b= expr ) | ^( QUESTION test= expr a= expr b= expr ) | ^( LOGICAL_OR a= expr b= expr ) | ^(
// LOGICAL_AND a= expr b= expr ) | ^( OR a= expr b= expr ) | ^( XOR a= expr b= expr ) | ^( AND a= expr b= expr ) | ^( EQUAL a= expr
// b= expr ) | ^( NOT_EQUAL a= expr b= expr ) | ^( INSTANCEOF expr type ) | ^( LESS_OR_EQUAL a= expr b= expr ) | ^( GREATER_OR_EQUAL
// a= expr b= expr ) | ^( BIT_SHIFT_RIGHT a= expr b= expr ) | ^( SHIFT_RIGHT a= expr b= expr ) | ^( GREATER_THAN a= expr b= expr ) |
// ^( SHIFT_LEFT a= expr b= expr ) | ^( LESS_THAN a= expr b= expr ) | ^( PLUS a= expr b= expr ) | ^( MINUS a= expr b= expr ) | ^(
// STAR a= expr b= expr ) | ^( DIV a= expr b= expr ) | ^( MOD a= expr b= expr ) | ^( UNARY_PLUS a= expr ) | ^( UNARY_MINUS a= expr )
// | ^( PRE_INC a= expr ) | ^( PRE_DEC expr ) | ^( POST_INC a= expr ) | ^( POST_DEC expr ) | ^( NOT a= expr ) | ^( LOGICAL_NOT a=
// expr ) | ^( CAST_EXPR type expr ) | primaryExpression );
public final ExpressionValue expr() throws RecognitionException {
ExpressionValue value = null;
int expr_StartIndex = input.index();
CommonTree ASSIGN4 = null;
CommonTree PLUS_ASSIGN5 = null;
CommonTree MINUS_ASSIGN6 = null;
CommonTree STAR_ASSIGN7 = null;
CommonTree DIV_ASSIGN8 = null;
CommonTree AND_ASSIGN9 = null;
CommonTree OR_ASSIGN10 = null;
CommonTree XOR_ASSIGN11 = null;
CommonTree MOD_ASSIGN12 = null;
CommonTree BIT_SHIFT_RIGHT_ASSIGN13 = null;
CommonTree SHIFT_RIGHT_ASSIGN14 = null;
CommonTree SHIFT_LEFT_ASSIGN15 = null;
CommonTree LOGICAL_OR16 = null;
CommonTree LOGICAL_AND17 = null;
CommonTree OR18 = null;
CommonTree XOR19 = null;
CommonTree AND20 = null;
CommonTree EQUAL21 = null;
CommonTree NOT_EQUAL22 = null;
CommonTree LESS_OR_EQUAL23 = null;
CommonTree GREATER_OR_EQUAL24 = null;
CommonTree BIT_SHIFT_RIGHT25 = null;
CommonTree SHIFT_RIGHT26 = null;
CommonTree GREATER_THAN27 = null;
CommonTree SHIFT_LEFT28 = null;
CommonTree LESS_THAN29 = null;
CommonTree PLUS30 = null;
CommonTree MINUS31 = null;
CommonTree STAR32 = null;
CommonTree DIV33 = null;
CommonTree MOD34 = null;
CommonTree UNARY_PLUS35 = null;
CommonTree UNARY_MINUS36 = null;
CommonTree NOT37 = null;
CommonTree LOGICAL_NOT38 = null;
ExpressionValue a = null;
ExpressionValue b = null;
ExpressionValue test = null;
JavaTreeParser.primaryExpression_return primaryExpression39 = null;
latest = ev.getThisObject();
try {
if (state.backtracking > 0 && alreadyParsedRule(input, 63)) {
return value;
}
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:573:3: ( ^( ASSIGN a= expr b= expr ) | ^(
// PLUS_ASSIGN a= expr b= expr ) | ^( MINUS_ASSIGN a= expr b= expr ) | ^( STAR_ASSIGN a= expr b= expr ) | ^( DIV_ASSIGN a=
// expr b= expr ) | ^( AND_ASSIGN a= expr b= expr ) | ^( OR_ASSIGN a= expr b= expr ) | ^( XOR_ASSIGN a= expr b= expr ) | ^(
// MOD_ASSIGN a= expr b= expr ) | ^( BIT_SHIFT_RIGHT_ASSIGN a= expr b= expr ) | ^( SHIFT_RIGHT_ASSIGN a= expr b= expr ) | ^(
// SHIFT_LEFT_ASSIGN a= expr b= expr ) | ^( QUESTION test= expr a= expr b= expr ) | ^( LOGICAL_OR a= expr b= expr ) | ^(
// LOGICAL_AND a= expr b= expr ) | ^( OR a= expr b= expr ) | ^( XOR a= expr b= expr ) | ^( AND a= expr b= expr ) | ^( EQUAL
// a= expr b= expr ) | ^( NOT_EQUAL a= expr b= expr ) | ^( INSTANCEOF expr type ) | ^( LESS_OR_EQUAL a= expr b= expr ) | ^(
// GREATER_OR_EQUAL a= expr b= expr ) | ^( BIT_SHIFT_RIGHT a= expr b= expr ) | ^( SHIFT_RIGHT a= expr b= expr ) | ^(
// GREATER_THAN a= expr b= expr ) | ^( SHIFT_LEFT a= expr b= expr ) | ^( LESS_THAN a= expr b= expr ) | ^( PLUS a= expr b=
// expr ) | ^( MINUS a= expr b= expr ) | ^( STAR a= expr b= expr ) | ^( DIV a= expr b= expr ) | ^( MOD a= expr b= expr ) | ^(
// UNARY_PLUS a= expr ) | ^( UNARY_MINUS a= expr ) | ^( PRE_INC a= expr ) | ^( PRE_DEC expr ) | ^( POST_INC a= expr ) | ^(
// POST_DEC expr ) | ^( NOT a= expr ) | ^( LOGICAL_NOT a= expr ) | ^( CAST_EXPR type expr ) | primaryExpression )
int alt91 = 43;
switch(input.LA(1)) {
case ASSIGN:
{
alt91 = 1;
}
break;
case PLUS_ASSIGN:
{
alt91 = 2;
}
break;
case MINUS_ASSIGN:
{
alt91 = 3;
}
break;
case STAR_ASSIGN:
{
alt91 = 4;
}
break;
case DIV_ASSIGN:
{
alt91 = 5;
}
break;
case AND_ASSIGN:
{
alt91 = 6;
}
break;
case OR_ASSIGN:
{
alt91 = 7;
}
break;
case XOR_ASSIGN:
{
alt91 = 8;
}
break;
case MOD_ASSIGN:
{
alt91 = 9;
}
break;
case BIT_SHIFT_RIGHT_ASSIGN:
{
alt91 = 10;
}
break;
case SHIFT_RIGHT_ASSIGN:
{
alt91 = 11;
}
break;
case SHIFT_LEFT_ASSIGN:
{
alt91 = 12;
}
break;
case QUESTION:
{
alt91 = 13;
}
break;
case LOGICAL_OR:
{
alt91 = 14;
}
break;
case LOGICAL_AND:
{
alt91 = 15;
}
break;
case OR:
{
alt91 = 16;
}
break;
case XOR:
{
alt91 = 17;
}
break;
case AND:
{
alt91 = 18;
}
break;
case EQUAL:
{
alt91 = 19;
}
break;
case NOT_EQUAL:
{
alt91 = 20;
}
break;
case INSTANCEOF:
{
alt91 = 21;
}
break;
case LESS_OR_EQUAL:
{
alt91 = 22;
}
break;
case GREATER_OR_EQUAL:
{
alt91 = 23;
}
break;
case BIT_SHIFT_RIGHT:
{
alt91 = 24;
}
break;
case SHIFT_RIGHT:
{
alt91 = 25;
}
break;
case GREATER_THAN:
{
alt91 = 26;
}
break;
case SHIFT_LEFT:
{
alt91 = 27;
}
break;
case LESS_THAN:
{
alt91 = 28;
}
break;
case PLUS:
{
alt91 = 29;
}
break;
case MINUS:
{
alt91 = 30;
}
break;
case STAR:
{
alt91 = 31;
}
break;
case DIV:
{
alt91 = 32;
}
break;
case MOD:
{
alt91 = 33;
}
break;
case UNARY_PLUS:
{
alt91 = 34;
}
break;
case UNARY_MINUS:
{
alt91 = 35;
}
break;
case PRE_INC:
{
alt91 = 36;
}
break;
case PRE_DEC:
{
alt91 = 37;
}
break;
case POST_INC:
{
alt91 = 38;
}
break;
case POST_DEC:
{
alt91 = 39;
}
break;
case NOT:
{
alt91 = 40;
}
break;
case LOGICAL_NOT:
{
alt91 = 41;
}
break;
case CAST_EXPR:
{
alt91 = 42;
}
break;
case DOT:
case FALSE:
case NULL:
case SUPER:
case THIS:
case TRUE:
case ARRAY_DECLARATOR:
case ARRAY_ELEMENT_ACCESS:
case CLASS_CONSTRUCTOR_CALL:
case METHOD_CALL:
case PARENTESIZED_EXPR:
case STATIC_ARRAY_CREATOR:
case SUPER_CONSTRUCTOR_CALL:
case THIS_CONSTRUCTOR_CALL:
case IDENT:
case HEX_LITERAL:
case OCTAL_LITERAL:
case DECIMAL_LITERAL:
case FLOATING_POINT_LITERAL:
case CHARACTER_LITERAL:
case STRING_LITERAL:
{
alt91 = 43;
}
break;
default:
if (state.backtracking > 0) {
state.failed = true;
return value;
}
NoViableAltException nvae = new NoViableAltException("", 91, 0, input);
throw nvae;
}
switch(alt91) {
case 1:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:574:3: ^( ASSIGN a= expr b= expr )
{
ASSIGN4 = (CommonTree) match(input, ASSIGN, FOLLOW_ASSIGN_in_expr2207);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2211);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2215);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (ASSIGN4 != null ? ASSIGN4.getType() : 0));
}
}
break;
case 2:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:579:3: ^( PLUS_ASSIGN a= expr b= expr )
{
PLUS_ASSIGN5 = (CommonTree) match(input, PLUS_ASSIGN, FOLLOW_PLUS_ASSIGN_in_expr2271);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2275);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2279);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (PLUS_ASSIGN5 != null ? PLUS_ASSIGN5.getType() : 0));
}
}
break;
case 3:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:584:3: ^( MINUS_ASSIGN a= expr b= expr )
{
MINUS_ASSIGN6 = (CommonTree) match(input, MINUS_ASSIGN, FOLLOW_MINUS_ASSIGN_in_expr2307);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2311);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2315);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (MINUS_ASSIGN6 != null ? MINUS_ASSIGN6.getType() : 0));
}
}
break;
case 4:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:589:3: ^( STAR_ASSIGN a= expr b= expr )
{
STAR_ASSIGN7 = (CommonTree) match(input, STAR_ASSIGN, FOLLOW_STAR_ASSIGN_in_expr2343);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2347);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2351);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (STAR_ASSIGN7 != null ? STAR_ASSIGN7.getType() : 0));
}
}
break;
case 5:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:594:3: ^( DIV_ASSIGN a= expr b= expr )
{
DIV_ASSIGN8 = (CommonTree) match(input, DIV_ASSIGN, FOLLOW_DIV_ASSIGN_in_expr2379);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2383);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2387);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (DIV_ASSIGN8 != null ? DIV_ASSIGN8.getType() : 0));
}
}
break;
case 6:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:599:3: ^( AND_ASSIGN a= expr b= expr )
{
AND_ASSIGN9 = (CommonTree) match(input, AND_ASSIGN, FOLLOW_AND_ASSIGN_in_expr2415);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2419);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2423);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (AND_ASSIGN9 != null ? AND_ASSIGN9.getType() : 0));
}
}
break;
case 7:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:604:3: ^( OR_ASSIGN a= expr b= expr )
{
OR_ASSIGN10 = (CommonTree) match(input, OR_ASSIGN, FOLLOW_OR_ASSIGN_in_expr2479);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2483);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2487);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (OR_ASSIGN10 != null ? OR_ASSIGN10.getType() : 0));
}
}
break;
case 8:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:609:3: ^( XOR_ASSIGN a= expr b= expr )
{
XOR_ASSIGN11 = (CommonTree) match(input, XOR_ASSIGN, FOLLOW_XOR_ASSIGN_in_expr2543);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2547);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2551);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (XOR_ASSIGN11 != null ? XOR_ASSIGN11.getType() : 0));
}
}
break;
case 9:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:614:3: ^( MOD_ASSIGN a= expr b= expr )
{
MOD_ASSIGN12 = (CommonTree) match(input, MOD_ASSIGN, FOLLOW_MOD_ASSIGN_in_expr2607);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2611);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2615);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (MOD_ASSIGN12 != null ? MOD_ASSIGN12.getType() : 0));
}
}
break;
case 10:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:619:3: ^( BIT_SHIFT_RIGHT_ASSIGN a= expr
// b= expr )
{
BIT_SHIFT_RIGHT_ASSIGN13 = (CommonTree) match(input, BIT_SHIFT_RIGHT_ASSIGN, FOLLOW_BIT_SHIFT_RIGHT_ASSIGN_in_expr2671);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2675);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2679);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (BIT_SHIFT_RIGHT_ASSIGN13 != null ? BIT_SHIFT_RIGHT_ASSIGN13.getType() : 0));
}
}
break;
case 11:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:624:3: ^( SHIFT_RIGHT_ASSIGN a= expr b=
// expr )
{
SHIFT_RIGHT_ASSIGN14 = (CommonTree) match(input, SHIFT_RIGHT_ASSIGN, FOLLOW_SHIFT_RIGHT_ASSIGN_in_expr2735);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2739);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2743);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (SHIFT_RIGHT_ASSIGN14 != null ? SHIFT_RIGHT_ASSIGN14.getType() : 0));
}
}
break;
case 12:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:629:3: ^( SHIFT_LEFT_ASSIGN a= expr b=
// expr )
{
SHIFT_LEFT_ASSIGN15 = (CommonTree) match(input, SHIFT_LEFT_ASSIGN, FOLLOW_SHIFT_LEFT_ASSIGN_in_expr2799);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2803);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2807);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (SHIFT_LEFT_ASSIGN15 != null ? SHIFT_LEFT_ASSIGN15.getType() : 0));
}
}
break;
case 13:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:634:3: ^( QUESTION test= expr a= expr b=
// expr )
{
match(input, QUESTION, FOLLOW_QUESTION_in_expr2863);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2867);
test = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2871);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2875);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.ternaryOperator(test, a, b);
}
}
break;
case 14:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:639:3: ^( LOGICAL_OR a= expr b= expr )
{
LOGICAL_OR16 = (CommonTree) match(input, LOGICAL_OR, FOLLOW_LOGICAL_OR_in_expr2931);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2935);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2939);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (LOGICAL_OR16 != null ? LOGICAL_OR16.getType() : 0));
}
}
break;
case 15:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:644:3: ^( LOGICAL_AND a= expr b= expr )
{
LOGICAL_AND17 = (CommonTree) match(input, LOGICAL_AND, FOLLOW_LOGICAL_AND_in_expr2995);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr2999);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3003);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (LOGICAL_AND17 != null ? LOGICAL_AND17.getType() : 0));
}
}
break;
case 16:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:649:3: ^( OR a= expr b= expr )
{
OR18 = (CommonTree) match(input, OR, FOLLOW_OR_in_expr3059);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3063);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3067);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (OR18 != null ? OR18.getType() : 0));
}
}
break;
case 17:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:654:3: ^( XOR a= expr b= expr )
{
XOR19 = (CommonTree) match(input, XOR, FOLLOW_XOR_in_expr3123);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3127);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3131);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (XOR19 != null ? XOR19.getType() : 0));
}
}
break;
case 18:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:659:3: ^( AND a= expr b= expr )
{
AND20 = (CommonTree) match(input, AND, FOLLOW_AND_in_expr3187);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3191);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3195);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (AND20 != null ? AND20.getType() : 0));
}
}
break;
case 19:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:664:3: ^( EQUAL a= expr b= expr )
{
EQUAL21 = (CommonTree) match(input, EQUAL, FOLLOW_EQUAL_in_expr3251);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3255);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3259);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (EQUAL21 != null ? EQUAL21.getType() : 0));
}
}
break;
case 20:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:669:3: ^( NOT_EQUAL a= expr b= expr )
{
NOT_EQUAL22 = (CommonTree) match(input, NOT_EQUAL, FOLLOW_NOT_EQUAL_in_expr3315);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3319);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3323);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (NOT_EQUAL22 != null ? NOT_EQUAL22.getType() : 0));
}
}
break;
case 21:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:674:3: ^( INSTANCEOF expr type )
{
match(input, INSTANCEOF, FOLLOW_INSTANCEOF_in_expr3379);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3381);
expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_type_in_expr3383);
type();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
throw new ExpressionException("Operation 'instanceof' is not supported yet. ");
}
}
break;
case 22:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:679:3: ^( LESS_OR_EQUAL a= expr b= expr )
{
LESS_OR_EQUAL23 = (CommonTree) match(input, LESS_OR_EQUAL, FOLLOW_LESS_OR_EQUAL_in_expr3439);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3443);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3447);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (LESS_OR_EQUAL23 != null ? LESS_OR_EQUAL23.getType() : 0));
}
}
break;
case 23:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:684:3: ^( GREATER_OR_EQUAL a= expr b=
// expr )
{
GREATER_OR_EQUAL24 = (CommonTree) match(input, GREATER_OR_EQUAL, FOLLOW_GREATER_OR_EQUAL_in_expr3503);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3507);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3511);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (GREATER_OR_EQUAL24 != null ? GREATER_OR_EQUAL24.getType() : 0));
}
}
break;
case 24:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:689:3: ^( BIT_SHIFT_RIGHT a= expr b= expr )
{
BIT_SHIFT_RIGHT25 = (CommonTree) match(input, BIT_SHIFT_RIGHT, FOLLOW_BIT_SHIFT_RIGHT_in_expr3567);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3571);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3575);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (BIT_SHIFT_RIGHT25 != null ? BIT_SHIFT_RIGHT25.getType() : 0));
}
}
break;
case 25:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:694:3: ^( SHIFT_RIGHT a= expr b= expr )
{
SHIFT_RIGHT26 = (CommonTree) match(input, SHIFT_RIGHT, FOLLOW_SHIFT_RIGHT_in_expr3603);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3607);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3611);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (SHIFT_RIGHT26 != null ? SHIFT_RIGHT26.getType() : 0));
}
}
break;
case 26:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:699:3: ^( GREATER_THAN a= expr b= expr )
{
GREATER_THAN27 = (CommonTree) match(input, GREATER_THAN, FOLLOW_GREATER_THAN_in_expr3639);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3643);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3647);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (GREATER_THAN27 != null ? GREATER_THAN27.getType() : 0));
}
}
break;
case 27:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:704:3: ^( SHIFT_LEFT a= expr b= expr )
{
SHIFT_LEFT28 = (CommonTree) match(input, SHIFT_LEFT, FOLLOW_SHIFT_LEFT_in_expr3675);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3679);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3683);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (SHIFT_LEFT28 != null ? SHIFT_LEFT28.getType() : 0));
}
}
break;
case 28:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:709:3: ^( LESS_THAN a= expr b= expr )
{
LESS_THAN29 = (CommonTree) match(input, LESS_THAN, FOLLOW_LESS_THAN_in_expr3711);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3715);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3719);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (LESS_THAN29 != null ? LESS_THAN29.getType() : 0));
}
}
break;
case 29:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:714:3: ^( PLUS a= expr b= expr )
{
PLUS30 = (CommonTree) match(input, PLUS, FOLLOW_PLUS_in_expr3747);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3751);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3755);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (PLUS30 != null ? PLUS30.getType() : 0));
}
}
break;
case 30:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:719:3: ^( MINUS a= expr b= expr )
{
MINUS31 = (CommonTree) match(input, MINUS, FOLLOW_MINUS_in_expr3783);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3787);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3791);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (MINUS31 != null ? MINUS31.getType() : 0));
}
}
break;
case 31:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:724:3: ^( STAR a= expr b= expr )
{
STAR32 = (CommonTree) match(input, STAR, FOLLOW_STAR_in_expr3819);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3823);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3827);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (STAR32 != null ? STAR32.getType() : 0));
}
}
break;
case 32:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:729:3: ^( DIV a= expr b= expr )
{
DIV33 = (CommonTree) match(input, DIV, FOLLOW_DIV_in_expr3855);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3859);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3863);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (DIV33 != null ? DIV33.getType() : 0));
}
}
break;
case 33:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:734:3: ^( MOD a= expr b= expr )
{
MOD34 = (CommonTree) match(input, MOD, FOLLOW_MOD_in_expr3891);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3895);
a = expr();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3899);
b = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.operation(a, b, (MOD34 != null ? MOD34.getType() : 0));
}
}
break;
case 34:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:739:3: ^( UNARY_PLUS a= expr )
{
UNARY_PLUS35 = (CommonTree) match(input, UNARY_PLUS, FOLLOW_UNARY_PLUS_in_expr3927);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3931);
a = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.unaryOperation(a, (UNARY_PLUS35 != null ? UNARY_PLUS35.getType() : 0));
}
}
break;
case 35:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:744:3: ^( UNARY_MINUS a= expr )
{
UNARY_MINUS36 = (CommonTree) match(input, UNARY_MINUS, FOLLOW_UNARY_MINUS_in_expr3959);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3963);
a = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.unaryOperation(a, (UNARY_MINUS36 != null ? UNARY_MINUS36.getType() : 0));
}
}
break;
case 36:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:749:3: ^( PRE_INC a= expr )
{
match(input, PRE_INC, FOLLOW_PRE_INC_in_expr3991);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr3995);
a = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
throw new ExpressionException("Operation '++' is not supported yet. ");
}
}
break;
case 37:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:754:3: ^( PRE_DEC expr )
{
match(input, PRE_DEC, FOLLOW_PRE_DEC_in_expr4023);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr4025);
expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
throw new ExpressionException("Operation '--' is not supported yet. ");
}
}
break;
case 38:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:759:3: ^( POST_INC a= expr )
{
match(input, POST_INC, FOLLOW_POST_INC_in_expr4053);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr4057);
a = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
throw new ExpressionException("Operation '++' is not supported yet. ");
}
}
break;
case 39:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:764:3: ^( POST_DEC expr )
{
match(input, POST_DEC, FOLLOW_POST_DEC_in_expr4085);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr4087);
expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
throw new ExpressionException("Operation '--' is not supported yet. ");
}
}
break;
case 40:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:769:3: ^( NOT a= expr )
{
NOT37 = (CommonTree) match(input, NOT, FOLLOW_NOT_in_expr4115);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr4119);
a = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.unaryOperation(a, (NOT37 != null ? NOT37.getType() : 0));
}
}
break;
case 41:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:774:3: ^( LOGICAL_NOT a= expr )
{
LOGICAL_NOT38 = (CommonTree) match(input, LOGICAL_NOT, FOLLOW_LOGICAL_NOT_in_expr4147);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr4151);
a = expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
value = ev.unaryOperation(a, (LOGICAL_NOT38 != null ? LOGICAL_NOT38.getType() : 0));
}
}
break;
case 42:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:779:3: ^( CAST_EXPR type expr )
{
match(input, CAST_EXPR, FOLLOW_CAST_EXPR_in_expr4179);
if (state.failed)
return value;
match(input, Token.DOWN, null);
if (state.failed)
return value;
pushFollow(FOLLOW_type_in_expr4181);
type();
state._fsp--;
if (state.failed)
return value;
pushFollow(FOLLOW_expr_in_expr4183);
expr();
state._fsp--;
if (state.failed)
return value;
match(input, Token.UP, null);
if (state.failed)
return value;
if (state.backtracking == 0) {
throw new ExpressionException("Operation 'cast' is not supported yet. ");
}
}
break;
case 43:
// org/eclipse/che/ide/ext/java/jdi/server/expression/JavaTreeParser.g:783:5: primaryExpression
{
pushFollow(FOLLOW_primaryExpression_in_expr4208);
primaryExpression39 = primaryExpression();
state._fsp--;
if (state.failed)
return value;
if (state.backtracking == 0) {
value = (primaryExpression39 != null ? primaryExpression39.value : null);
}
}
break;
}
} catch (RecognitionException re) {
reportError(re);
recover(input, re);
} finally {
if (state.backtracking > 0) {
memoize(input, 63, expr_StartIndex);
}
}
return value;
}
Aggregations