Package org.rascalmpl.ast

Examples of org.rascalmpl.ast.Name


      __eval.setCurrentAST(this);
      __eval.notifyAboutSuspension(this);   
      __eval.warning("Var* is deprecated, use *Var or *Type Var instead", this.getLocation());
      System.err.println(this.getLocation() + ": Var* is deprecated, use *Var instead");
     
      Name name = this.getName();
      Result<IValue> variable = __eval.getCurrentEnvt().getVariable(name);

      if (variable == null) {
        throw new UndeclaredVariable(
            org.rascalmpl.interpreter.utils.Names.name(name), name);
View Full Code Here


    public Result<IValue> interpret(IEvaluator<Result<IValue>> __eval) {
     
      __eval.setCurrentAST(this);
      __eval.notifyAboutSuspension(this);     

      Name name = this.getName();
      Result<IValue> variable = __eval.getCurrentEnvt().getVariable(name);

      if (variable == null) {
        throw new UndeclaredVariable(
            org.rascalmpl.interpreter.utils.Names.name(name), name);
View Full Code Here

   
    try {
      ModuleEnvironment modEnv = getHeap().getModule(module);
      setCurrentEnvt(modEnv);
     
      Name name = Names.toName(function, modEnv.getLocation());
      OverloadedFunction func = (OverloadedFunction) getCurrentEnvt().getVariable(name);
     
      if (func == null) {
        throw new UndeclaredVariable(function, name);
      }
View Full Code Here

  public StringTemplateConverter() {
    super();
  }
 
  private Statement surroundWithSingleIterForLoop(ISourceLocation loc, Name label, Statement body) {
    Name dummy = ASTBuilder.make("Name","Lexical",loc, "_");
    Expression var = ASTBuilder.make("Expression","QualifiedName",loc, ASTBuilder.make("QualifiedName", loc, Arrays.asList(dummy)));
    Expression truth = ASTBuilder.make("Expression","Literal",loc, ASTBuilder.make("Literal","Boolean",loc, ASTBuilder.make("BooleanLiteral","Lexical",loc, "true")));
    Expression list = ASTBuilder.make("Expression","List", loc, Arrays.asList(truth));
    Expression enumerator = ASTBuilder.make("Expression","Enumerator",loc, var, list);
    Statement stat = ASTBuilder.make("Statement","For",loc, ASTBuilder.make("Label","Default", loc, label), Arrays.asList(enumerator), body);
View Full Code Here

    return stat;
  }


  public Statement convert(org.rascalmpl.ast.StringLiteral str) {
    final Name label= ASTBuilder.make("Name","Lexical", str.getLocation(), "#" + labelCounter);
    labelCounter++;
    Statement stat = str.accept(new Visitor(label));
    return surroundWithSingleIterForLoop(str.getLocation(), label, stat);
  }
View Full Code Here

TOP

Related Classes of org.rascalmpl.ast.Name

Copyright © 2018 www.massapicom. 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.