Examples of NameBinding


Examples of wyvern.tools.typedAST.core.binding.NameBinding

    assert opExp.getArgument() == null;
   
    // the operation should exist
    String opName = opExp.getOperationName();

    NameBinding m = typeDeclEnv.get().lookup(opName);

    if (m == null)
      throw new RuntimeException("Invalid operation "+opName+" on type " + this);
   
    // TODO Auto-generated method stub
    return m.getType();
  }
View Full Code Here

Examples of wyvern.tools.typedAST.core.binding.NameBinding

   
    TypeBinding tb = typeDeclEnv.get().lookupType(name);
    if (tb == null) {
      // System.out.println("Maybe it is a name?");
     
      NameBinding nm = typeDeclEnv.get().lookup(name);
      // System.out.println(nm.getType());
     
      return new TypeBinding(nm.getName(), nm.getType());
    } else {
      return tb;
    }
  }
View Full Code Here

Examples of wyvern.tools.typedAST.core.binding.NameBinding

      throw new RuntimeException(opExp.getLocation().toString());
    assert opExp.getArgument() == null;
   
    // the operation should exist
    String opName = opExp.getOperationName();
    NameBinding m = declEnv.get().lookup(opName);

    if (m == null)
      reportError(OPERATOR_DOES_NOT_APPLY, opExp, opName, this.toString());
   
    // TODO Auto-generated method stub
    return m.getType();
  }
View Full Code Here

Examples of wyvern.tools.typedAST.core.binding.NameBinding

  Type resolvedType = null;
  @Override
  public Environment extendName(Environment env, Environment against) {
    for (int i = 0; i < argNames.size(); i++) {
      NameBinding oldBinding = argNames.get(i);
      argNames.set(i, new NameBindingImpl(oldBinding.getName(), TypeResolver.resolve(oldBinding.getType(), against)));
    }
    if (resolvedType == null)
      resolvedType = TypeResolver.resolve(type, against);
    return env.extend(new NameBindingImpl(name, resolvedType));
  }
View Full Code Here

Examples of wyvern.tools.typedAST.core.binding.NameBinding

      if (c.isDefault()) continue;
     
      String tagName = c.getTaggedTypeMatch();
     
      Optional<ClassType> type = env.lookupBinding(tagName, ClassType.class);
      NameBinding binding = env.lookup(tagName);
     
      if (binding == null) {
        // type wasn't declared...
        ToolError.reportError(ErrorMessage.UNKNOWN_TAG, matchingOver);
      }
     
      Type t = binding.getType();
     
      if (t instanceof ClassType) {
        ClassType classType = (ClassType) t;
       
        String name = classType.getName();
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.