Examples of EvaluationContext


Examples of javarepl.EvaluationContext

                .toString()));
    }

    @Test
    public void rendersPreviousResultsMethodsAndImports() {
        EvaluationContext context = evaluationContext()
                .addResult(result("result1", "value1"))
                .addResult(result("result2", "value2"))
                .addExpression(new Import("import java.net.URL", "java.net.URL"))
                .addExpression(new Import("import java.io.File;", "java.io.File"))
                .addExpression(new Method("int method1(int i){\nreturn i;\n}", int.class, "method1", Sequences.<Class<?>>sequence(int.class)))
View Full Code Here

Examples of joust.utils.tree.evaluation.EvaluationContext

    @Override
    protected void visitArrayAccess(AJCArrayAccess that) {
        super.visitArrayAccess(that);

        // If the index is something we can evaluate at compile-time, we're okay.
        EvaluationContext context = new EvaluationContext();
        Value index = context.evaluate(that.index);

        if (index == Value.UNKNOWN) {
            failureInducing = true;
            return;
        }
View Full Code Here

Examples of net.sf.lapg.templates.api.EvaluationContext

    if (options.isUseDefaultTemplates()) {
      loaders.add(new ClassTemplateLoader(getClass().getClassLoader(), "net/sf/lapg/gen/templates", "utf8"));
    }

    TemplatesFacade env = new TemplatesFacadeExt(new GrammarNavigationFactory(options.getTemplateName()), loaders.toArray(new IBundleLoader[loaders.size()]), notifier);
    EvaluationContext context = new EvaluationContext(map);
    context.setVariable("util", new TemplateStaticMethods());
    context.setVariable("$", "lapg_gg.sym");
    env.executeTemplate(options.getTemplateName() + ".main", context, null, null);
  }
View Full Code Here

Examples of net.sf.lapg.templates.api.EvaluationContext

  }

  @Override
  public String toString() {
    ITemplate templ = (ITemplate) evaluationStrategy.loadEntity(templatePackage+".symbol", IBundleEntity.KIND_TEMPLATE, null);
    return evaluationStrategy.evaluate(templ, new EvaluationContext(this), null, null);
  }
View Full Code Here

Examples of net.sf.lapg.templates.api.EvaluationContext

    return templateId != null && templateId.indexOf('.') == -1 && !templateId.equals("base") ? context.getCurrent().getPackage() + "." + templateId : templateId;
  }

  @Override
  public Object evaluate(EvaluationContext context, IEvaluationStrategy env) throws EvaluationException {
    EvaluationContext callContext = selectExpr != null ? new EvaluationContext(env.evaluate(selectExpr, context, false), context) : context;
    String tid = templateId != null ? getTemplateId(context) : (String/* TODO */) env.evaluate(templateIdExpr, context, false);

    Object[] args = null;
    if (arguments != null) {
      args = new Object[arguments.length];
      for (int i = 0; i < arguments.length; i++) {
        args[i] = env.evaluate(arguments[i], context, false);
      }
    }

    IBundleEntity t = null;
    boolean isBase = false;
    IBundleEntity current = callContext.getCurrent();
    if (tid.equals("base")) {
      if (current != null) {
        isBase = true;
        t = current.getBase();
        if (t == null) {
View Full Code Here

Examples of net.sf.lapg.templates.api.EvaluationContext

  public String evaluate(ITemplate t, EvaluationContext context, Object[] arguments, ILocatedEntity referer) {
    if (t == null) {
      return "";
    }
    try {
      return t.apply(new EvaluationContext(context != null ? context.getThisObject() : null, context, t), this, arguments);
    } catch (EvaluationException ex) {
      fireError(t, ex.getMessage());
      return "";
    }
  }
View Full Code Here

Examples of org.apache.accumulo.examples.wikisearch.parser.QueryParser.EvaluationContext

    // Check to see if the child node is an AND or OR. If not, then
    // there must be just a single value in the query expression
    rootNode = new TreeNode();
    rootNode.setType(RootNode.class);
    currentNode = rootNode;
    EvaluationContext ctx = new EvaluationContext();
    script.childrenAccept(this, ctx);
  }
View Full Code Here

Examples of org.apache.el.lang.EvaluationContext

     */
    public MethodInfo getMethodInfo(ELContext context)
            throws PropertyNotFoundException, MethodNotFoundException,
            ELException {
        Node n = this.getNode();
        EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
                this.varMapper);
        return n.getMethodInfo(ctx, this.paramTypes);
    }
View Full Code Here

Examples of org.apache.el.lang.EvaluationContext

     *      java.lang.Object[])
     */
    public Object invoke(ELContext context, Object[] params)
            throws PropertyNotFoundException, MethodNotFoundException,
            ELException {
        EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
                this.varMapper);
        return this.getNode().invoke(ctx, this.paramTypes, params);
    }
View Full Code Here

Examples of org.apache.el.lang.EvaluationContext

     */
    public MethodInfo getMethodInfo(ELContext context)
            throws PropertyNotFoundException, MethodNotFoundException,
            ELException {
        Node n = this.getNode();
        EvaluationContext ctx = new EvaluationContext(context, this.fnMapper,
                this.varMapper);
        return n.getMethodInfo(ctx, this.paramTypes);
    }
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.