Creates a {@link GuardedByExpression} from a bound AST node, or returns {@code
Optional.empty()} if the AST node doesn't correspond to a 'simple' lock expression.
545942
public static Optional<GuardedByExpression> bindExpression(
      JCTree.JCExpression exp, VisitorState visitorState) {
    try {
      return Optional.of(
          bind(
              exp,
              BinderContext.of(
                  ALREADY_BOUND_RESOLVER,
                  ASTHelpers.getSymbol(visitorState.findEnclosing(ClassTree.class)),
                  visitorState.getTypes(),
                  Names.instance(visitorState.context))));
    } catch (IllegalGuardedBy expected) {
      return Optional.empty();
    }
  }
1203070
public final Optional<Expression> getSoyTypeAssertion(
      Expression value, String valueName, Generator codeGenerator) {
    Optional<Expression> typeAssertion = getTypeAssertion(value, codeGenerator);
    if (!typeAssertion.isPresent()) {
      return Optional.absent();
    }

    return Optional.of(
        SOY_ASSERTS_ASSERT_TYPE.call(
            typeAssertion.get(), stringLiteral(valueName), value, stringLiteral(typeExpr())));
  }
749970
private Optional<IRI> getPredicateIRI(DataRangeExpression expression) {
        if (expression instanceof Datatype) {
            return Optional.of(((Datatype) expression).getIRI());
        }
        if (expression instanceof DataPropertyRangeExpression) {
            return Optional.of(((DataPropertyRangeExpression) expression).getProperty().getIRI());
        }
        return Optional.empty();
    }
1124252
public final BaseDescr exclusiveOrExpression() throws RecognitionException {
		BaseDescr result = null;


		BaseDescr left =null;
		BaseDescr right =null;

		try {
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:274:3: (left= andExpression ( XOR right= andExpression )* )
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:274:5: left= andExpression ( XOR right= andExpression )*
			{
			pushFollow(FOLLOW_andExpression_in_exclusiveOrExpression1383);
			left=andExpression();
			state._fsp--;
			if (state.failed) return result;
			if ( state.backtracking==0 ) { if( buildDescr  ) { result = left; } }
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:275:3: ( XOR right= andExpression )*
			loop29:
			while (true) {
				int alt29=2;
				int LA29_0 = input.LA(1);
				if ( (LA29_0==XOR) ) {
					alt29=1;
				}

				switch (alt29) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:275:5: XOR right= andExpression
					{
					match(input,XOR,FOLLOW_XOR_in_exclusiveOrExpression1391); if (state.failed) return result;
					pushFollow(FOLLOW_andExpression_in_exclusiveOrExpression1395);
					right=andExpression();
					state._fsp--;
					if (state.failed) return result;
					if ( state.backtracking==0 ) { if( buildDescr  ) {
					               ConstraintConnectiveDescr descr = ConstraintConnectiveDescr.newXor();
					               descr.addOrMerge( result );
					               descr.addOrMerge( right );
					               result = descr;
					           }
					         }
					}
					break;

				default :
					break loop29;
				}
			}

			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
		return result;
	}
1236949
JCExpression innerCreator(int newpos, List<JCExpression> typeArgs, JCExpression encl) {
        List<JCAnnotation> newAnnotations = typeAnnotationsOpt();

        JCExpression t = toP(F.at(token.pos).Ident(ident()));

        if (newAnnotations.nonEmpty()) {
            t = toP(F.at(newAnnotations.head.pos).AnnotatedType(newAnnotations, t));
        }

        if (token.kind == LT) {
            int oldmode = mode;
            checkGenerics();
            t = typeArguments(t, true);
            mode = oldmode;
        }
        return classCreatorRest(newpos, encl, typeArgs, t);
    }
1232048
function(ASTnode, strict) {
      var property;
      var node = ASTnode;
      switch (node.type) {
        case 'ReturnStatement':
          property = 'argument';
          break;
        case 'ArrowFunctionExpression':
          property = 'body';
          break;
        default:
          node = utils.findReturnStatement(node);
          if (!node) {
            return false;
          }
          property = 'argument';
      }

      var returnsConditionalJSXConsequent =
        node[property] &&
        node[property].type === 'ConditionalExpression' &&
        node[property].consequent.type === 'JSXElement'
      ;
      var returnsConditionalJSXAlternate =
        node[property] &&
        node[property].type === 'ConditionalExpression' &&
        node[property].alternate.type === 'JSXElement'
      ;
      var returnsConditionalJSX =
        strict ? (returnsConditionalJSXConsequent && returnsConditionalJSXAlternate) :
        (returnsConditionalJSXConsequent || returnsConditionalJSXAlternate);

      var returnsJSX =
        node[property] &&
        node[property].type === 'JSXElement'
      ;
      var returnsReactCreateElement =
        node[property] &&
        node[property].callee &&
        node[property].callee.property &&
        node[property].callee.property.name === 'createElement'
      ;

      return Boolean(
        returnsConditionalJSX ||
        returnsJSX ||
        returnsReactCreateElement
      );
    }
418202
static Node getConditionExpression(Node n) {
    switch (n.getToken()) {
      case IF:
      case WHILE:
        return n.getFirstChild();
      case DO:
        return n.getLastChild();
      case FOR:
        return n.getSecondChild();
      case FOR_IN:
      case FOR_OF:
      case FOR_AWAIT_OF:
      case CASE:
        return null;
      default:
        break;
    }
    throw new IllegalArgumentException(n + " does not have a condition.");
  }
463548
@Pure
	public IExpressionBuilder getGuard() {
		IExpressionBuilder exprBuilder = this.expressionProvider.get();
		exprBuilder.eInit(getSarlBehaviorUnit(), new Procedures.Procedure1<XExpression>() {
				public void apply(XExpression expr) {
					getSarlBehaviorUnit().setGuard(expr);
				}
			}, getTypeResolutionContext());
		return exprBuilder;
	}
452813
static JbcSrcJavaValue of(Expression expr, Method method, JbcSrcValueErrorReporter reporter) {
    checkNotNull(method);
    if (expr instanceof SoyExpression) {
      return new JbcSrcJavaValue(
          expr,
          method,
          /* allowedType= */ ((SoyExpression) expr).soyType(),
          /* constantNull= */ false,
          /* error= */ false,
          reporter);
    }
    return new JbcSrcJavaValue(
        expr,
        method,
        /* allowedType= */ null,
        /* constantNull= */ false,
        /* error= */ false,
        reporter);
  }
707771
private Statement store(final Expression expr, final Optional<Label> firstVarInstruction) {
    expr.checkAssignableTo(resultType());
    return new Statement() {
      @Override
      protected void doGen(CodeBuilder adapter) {
        expr.gen(adapter);
        if (firstVarInstruction.isPresent()) {
          adapter.mark(firstVarInstruction.get());
        }
        adapter.visitVarInsn(resultType().getOpcode(Opcodes.ISTORE), index());
      }
    };
  }
740231
public static Matcher<AssertTree> assertionWithCondition(
      final Matcher<ExpressionTree> conditionMatcher) {
    return new Matcher<AssertTree>() {
      @Override
      public boolean matches(AssertTree tree, VisitorState state) {
        return conditionMatcher.matches(tree.getCondition(), state);
      }
    };
  }
266014
public BooleanExpression isNull() {
        if (isnull == null) {
            isnull = Expressions.booleanOperation(Ops.IS_NULL, mixin);
        }
        return isnull;
    }
964234
private boolean isEmptyExpressionStatement(AstNode astNode) {
    if (astNode.is(CxxGrammarImpl.expressionStatement) && ";".equals(astNode.getToken().getValue())) {
      AstNode statement = astNode.getFirstAncestor(CxxGrammarImpl.selectionStatement);
      if (statement != null) {
        return astNode.getTokenLine() == statement.getTokenLine();
      }

      return isGeneratedNodeExcluded(astNode);
    }
    return false;
  }
1338038
public Expression asCheap() {
    if (isCheap()) {
      return this;
    }
    return new Expression(resultType, features.plus(Feature.CHEAP)) {
      @Override
      protected void doGen(CodeBuilder adapter) {
        Expression.this.gen(adapter);
      }
    };
  }
1081578
final public void DeferredExpression() throws ParseException {
                                                 /*@bgen(jjtree) DeferredExpression */
  AstDeferredExpression jjtn000 = new AstDeferredExpression(JJTDEFERREDEXPRESSION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
    try {
      jj_consume_token(START_DEFERRED_EXPRESSION);
      Expression();
      jj_consume_token(RBRACE);
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }
562958
public static <T extends Comparable<?>> ComparableExpression<T> asComparable(Expression<T> expr) {
        Expression<T> underlyingMixin = ExpressionUtils.extract(expr);
        if (underlyingMixin instanceof PathImpl) {
            return new ComparablePath<T>((PathImpl<T>) underlyingMixin);
        } else if (underlyingMixin instanceof OperationImpl) {
            return new ComparableOperation<T>((OperationImpl<T>) underlyingMixin);
        } else if (underlyingMixin instanceof TemplateExpressionImpl) {
            return new ComparableTemplate<T>((TemplateExpressionImpl<T>) underlyingMixin);
        } else {
            return new ComparableExpression<T>(underlyingMixin) {

                private static final long serialVersionUID = 389920618099394430L;

                @Override
                public <R, C> R accept(Visitor<R, C> v, C context) {
                    return this.mixin.accept(v, context);
                }

            };
        }

    }
209901
Optional<SoyExpression> compileWithNoDetaches(ExprNode node) {
    checkNotNull(node);
    if (RequiresDetachVisitor.INSTANCE.exec(node)) {
      return Optional.absent();
    }
    Supplier<ExpressionDetacher> throwingSupplier =
        () -> {
          throw new AssertionError();
        };
    return Optional.of(
        new CompilerVisitor(parameters, varManager, throwingSupplier, reporter, registry)
            .exec(node));
  }