Package wyvern.tools.types.extensions

Examples of wyvern.tools.types.extensions.TypeType


    typeEquivalentEnvironmentRef.set(TypeDeclUtils.getTypeEquivalentEnvironment(getDecls(), false));
  }

  public TypeType getEquivalentType() {
    if (equivalentType == null)
      equivalentType = new TypeType(TypeDeclUtils.getTypeEquivalentEnvironment(getDecls(), false));
    return equivalentType;
  }
View Full Code Here


        ToolError.reportError(ErrorMessage.TYPE_NOT_DECLARED, this, this.implementsName);
      }
     
      // since there is a valid implements, check that all methods are indeed present
      ClassType currentCT = (ClassType) this.nameBinding.getType();
            TypeType implementsTT = (TypeType)nameImplements.getType();
     
      if (!getEquivalentType().subtype(implementsTT)) {
        ToolError.reportError(ErrorMessage.NOT_SUBTYPE,
            this,
                        this.nameBinding.getName(),
                        nameImplements.getName());
      }
    }
   
    if (!this.implementsClassName.equals("")) {
      NameBinding nameImplementsClass = env.lookup(this.implementsClassName);
      if (nameImplementsClass == null) {
        ToolError.reportError(ErrorMessage.TYPE_NOT_DECLARED, this, this.implementsClassName);
      }

      // since there is a valid class implements, check that all methods are indeed present
      ClassType currentCT = (ClassType) this.nameBinding.getType();
            TypeType implementsCT = (TypeType) (
          ((ClassType)nameImplementsClass.getType())
              .getEnv()
              .lookupBinding("type", TypeDeclBinding.class)).get().getType();
     
      if (!getEquivalentClassType().subtype(implementsCT)) {
View Full Code Here

                if (d.isClassMember())
                    declsi.add(d);
                if (d.isClassMember())
                    declsi.add(d);
            }
      equivalentClassType = new TypeType(TypeDeclUtils.getTypeEquivalentEnvironment(new DeclSequence(declsi), true));
        }
    return equivalentClassType;
  }
View Full Code Here

    public TypeDeclaration(String name, DeclSequence decls, Reference<Value> metadata, FileLocation clsNameLine) {
      // System.out.println("Initialising TypeDeclaration ( " + name + "): decls" + decls);
    this.decls = decls;
    nameBinding = new NameBindingImpl(name, null);
    typeBinding = new TypeBinding(name, null, metadata);
    Type objectType = new TypeType(this);
    attrEnv.set(attrEnv.get().extend(new TypeDeclBinding("type", this)));
   
    Type classType = new ClassType(attrEnv, attrEnv, new LinkedList<String>(), getName()); // TODO set this to a class type that has the class members
    nameBinding = new LateNameBinding(nameBinding.getName(), () -> metadata.get().getType());
View Full Code Here

  private String getTypeName(Type type) {
    if (type instanceof ClassType) {
      ClassType matchingOverClass = (ClassType) matchingOver.getType();
      return matchingOverClass.getName();
    } else if (type instanceof TypeType) {
      TypeType matchingOverClass = (TypeType) matchingOver.getType();
      return matchingOverClass.getName();
    }
   
    return null;
  }
View Full Code Here

TOP

Related Classes of wyvern.tools.types.extensions.TypeType

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.