Examples of Expression


Examples of com.intellij.codeInsight.template.Expression

import org.jetbrains.annotations.NotNull;

public class ErlangUnitTestMethodAction extends CodeInsightAction implements CodeInsightActionHandler {
  private static void insertTestFunction(@NotNull Project project, @NotNull Editor editor, String name, boolean needNewline) {
    Template template = TemplateManager.getInstance(project).createTemplate("", "");
    Expression nameExpr = new ConstantNode(name);
    Expression expected = new ConstantNode("expected");
    Expression expr = new ConstantNode("expr");
    template.addTextSegment("\n" + (needNewline ? "\n" : ""));
    template.addVariable("name", nameExpr, nameExpr, true);
    template.addTextSegment("_test() ->\n");
    template.addTextSegment("?assertEqual(");
    template.addVariable(expected, true);
View Full Code Here

Examples of com.marakana.calculator.expressions.Expression

    default:
      return false;
    }

    // pop two numbers off the stack and push the result
    Expression rhs = stack.pop(), lhs = stack.pop();
    stack.push(new OperationExpression(operator, lhs, rhs));
    return true;
  }
View Full Code Here

Examples of com.meidusa.amoeba.parser.expression.Expression

public class Add extends AbstractFunction {

  @SuppressWarnings("unchecked")
  public Comparable evaluate(List<Expression> list,Object[] parameters) throws ParseException {
    if(list.size()==2){
      Expression e1 = list.get(0);
      Expression e2 = list.get(1);
      if(e1.canEvaluate() && e2.canEvaluate()){
        Comparable comparable = com.meidusa.amoeba.sqljep.function.Add.add(e1.evaluate(parameters),e2.evaluate(parameters));
        return comparable;
      }
    }
    return null;
  }
View Full Code Here

Examples of com.mysema.query.types.Expression

    @Test
    @SuppressWarnings("rawtypes")
    public void IndexOf() {       
        Path path = QCat.cat.name;
        Expression startIndex = Expressions.constant(0);
        Expression endIndex = NumberOperation.create(Integer.class, Ops.INDEX_OF, path, Expressions.constant("x"));
        Expression substr = StringOperation.create(Ops.SUBSTR_2ARGS, path, startIndex, endIndex);
        assertToString("substring(cat.name,1,locate(?1,cat.name)-1)", substr);
    }
View Full Code Here

Examples of com.neemsoft.jmep.Expression

    return res;
  }

  private float doEvaluateCalculation(String calculation) throws ParseException {
    try {
      Expression exp = new Expression(calculation, env);
      Object result = exp.evaluate();
      if (result instanceof Double) {
        return ((Double) result).floatValue();
      } else if (result instanceof Integer) {
        return ((Integer) result).floatValue();
      } else throw new ArgumentParseException("Parse exception: expected Double or Integer, but got:"
View Full Code Here

Examples of com.objfac.prebop.Expression

     * @param line the line containing the expression
     * @return <code>true</code> if the expression evaluates <code>true</code>, else
     *         <code>false</code>
     */
    private boolean evaluate(String line) {
      Expression exp;
      try {
        exp = new Expression(line.getBytes(), line.indexOf("if") + 2, vars);
      }
      catch (PreprocessorError e) {
        throw new RuntimeException("Failed to contruct expression: " + line, e);
      }
      try {
        return exp.eval();
      }
      catch (PreprocessorError e) {
        throw new RuntimeException("Failed to process expression: " + line, e);
      }
    }
View Full Code Here

Examples of com.opensymphony.workflow.query.Expression

  public String getCurrentState() {
    return ((Step) this.template.getCurrentSteps().get(0)).getStatus();
  }

  public List getUnderwayWorkflows() {
    Expression queryRight = new FieldExpression(FieldExpression.STATE,
            FieldExpression.ENTRY,
            FieldExpression.EQUALS,
            new Integer(WorkflowEntry.ACTIVATED));

    Expression queryLeft = new FieldExpression(FieldExpression.NAME,
            FieldExpression.ENTRY,
            FieldExpression.EQUALS,
            this.template.getWorkflowName());

    WorkflowExpressionQuery query = new WorkflowExpressionQuery(
View Full Code Here

Examples of com.pogofish.jadt.ast.Expression

        testExpression(_ClassReference(_Ref(_ClassType("foo.bar", NO_ACTUAL_TYPE_ARGUMENTS))), "foo.bar.class");
    }
   
    private void testExpression(Expression expected, String input) throws Exception {
        final ParserImpl p = parserImpl(input);
        final Expression expression = p.expression();
        assertEquals("[]", p.errors().toString());
        assertEquals(expected.toString(), expression.toString());
    }
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.Expression

  protected Boolean _eq(ExpressionTE e1, ExpressionTE e2) {
    return isEquivalent(e1.getExpression(), e2.getExpression());
  }

  protected Boolean _eq(ExpressionTE e1, String e2) {
    Expression tmp = e1.getExpression();
    tmp = ((ParenthesisedExpression) tmp).getExpr();
    return isEquivalent(tmp, e2);
    // // The various expr that can represent a variable
    // if(tmp instanceof LiteralName)
    // return isEquivalent(tmp, e2);
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.tree.Tree.Expression

                    // attribute is defined by a lazy expression ("=>" syntax)
                    gen.defineAttribute(gen.getNames().self(outer), gen.getNames().name(d));
                    gen.beginBlock();
                    gen.initSelf(that);
                    gen.out("return ");
                    Expression expr = that.getSpecifierOrInitializerExpression().getExpression();
                    if (!gen.isNaturalLiteral(expr.getTerm())) {
                        final int boxType = gen.boxStart(expr.getTerm());
                        expr.visit(gen);
                        gen.endLine(true);
                        if (boxType == 4) gen.out("/*TODO: callable targs 3*/");
                        gen.boxUnboxEnd(boxType);
                    }
                    gen.endBlock();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.