/* Generated By:JJTree: Do not edit this line. OParenthesisExpression.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=O,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package com.orientechnologies.orient.core.sql.parser;

import java.util.Map;

public class OParenthesisExpression extends OMathExpression {

  protected OExpression expression;
  protected OStatement  statement;

  public OParenthesisExpression(int id) {
    super(id);
  }

  public OParenthesisExpression(OrientSql p, int id) {
    super(p, id);
  }

  /** Accept the visitor. **/
  public Object jjtAccept(OrientSqlVisitor visitor, Object data) {
    return visitor.visit(this, data);
  }

  public void toString(Map<Object, Object> params, StringBuilder builder) {
    builder.append("(");
    if (expression != null) {
      expression.toString(params, builder);
    } else if (statement != null) {
      statement.toString(params, builder);
    }
    builder.append(")");
  }

  @Override
  protected boolean supportsBasicCalculation() {
    if (expression != null) {
      return expression.supportsBasicCalculation();
    }
    return true;
  }

  @Override
  public boolean isEarlyCalculated() {
    // TODO implement query execution and early calculation;
    return expression != null && expression.isEarlyCalculated();
  }
}
/* JavaCC - OriginalChecksum=4656e5faf4f54dc3fc45a06d8e375c35 (do not edit this line) */

@@ -302,16 +302,149 @@
 arser;%0A%0A
+import com.orientechnologies.orient.core.command.OCommandContext;%0Aimport com.orientechnologies.orient.core.db.record.OIdentifiable;%0A%0A
 import j
@@ -865,32 +865,390 @@
 is, data);%0A  %7D%0A%0A
+  @Override public Object execute(OIdentifiable iCurrentRecord, OCommandContext ctx) %7B%0A    if(expression!=null)%7B%0A      return expression.execute(iCurrentRecord, ctx);%0A    %7D%0A    if(statement!=null)%7B%0A      throw new UnsupportedOperationException(%22Execution of select in parentheses is not supported%22);%0A    %7D%0A    return super.execute(iCurrentRecord, ctx);%0A  %7D%0A%0A
   public void to

Fix parenthesis expressions in RETURN statement of MATCH statements