Package anvil.script

Examples of anvil.script.Type


  }


  public Type lookupDeclaration(String name)
  {
    Type type = (Type)_types.get(name);
    if (type == null) {
      return lookupInheritedDeclaration(name);
    } else {
      return type;
    }
View Full Code Here


  }
 

  public Type lookupInheritedDeclaration(String name)
  {
    Type type;
    InterfaceRef[] bases = _bases;
    InterfaceType interfacetype;
    int n = bases.length;
    for(int i=0; i<n; i++) {
      type = bases[i].getInterfaceType().lookupDeclaration(name);
View Full Code Here

  }


  public Type lookupDeclaration(String name)
  {
    Type type = (Type)_types.get(name);
    if (type == null) {
      type = lookupInheritedDeclaration(name);
    }
    return type;
  }
View Full Code Here

  }
 

  public Any getMethod(Context context, String name)
  {
    Type type = (Type)_types.get(name);
    if (type != null) {
      return new AnyType(type);
    }
    throw context.NoSuchEntity(_qname + '.' + name);
  }
View Full Code Here

  }
 

  public Type getDeclaration(Context context, String name)
  {
    Type type = (Type)_types.get(name);
    if (type != null) {
      return type;
    }
    throw context.NoSuchEntity(_qname + '.' + name);
  }
View Full Code Here

    IncrementalScope scope = this;   
    int i = 0;
    int n = name.size();
    while(i < n) {
      String s = name.get(i++);
      Type type = scope.lookupDeclaration(s);
      if (type == null) {
        if (i < n) {
          SyntheticNamespace ns = new SyntheticNamespace(scope, s);
          scope.addDeclaration(ns);
          scope = ns;
View Full Code Here

  final public NamespaceStatement NamespacePart(Location location, DefinitionStatement scope) throws ParseException {
  Token t;
    t = jj_consume_token(SYMBOL);
      NamespaceStatement namespace;
      String name = t.image;
      Type declared = scope.lookupDeclaration(name);
      if (declared == null) {
        namespace = new NamespaceStatement(location, scope, t.image, t.document);
        scope.declare(namespace);
      } else if (declared.getType() == Type.NAMESPACE) {
        namespace = (NamespaceStatement)declared;
      } else {
        error(location, "Entity '"+name+"' already declared");
        namespace = new NamespaceStatement(location, scope, t.image, t.document);
      }
View Full Code Here

  /// Returns the url where this type is declared.
  /// If it is located on a library, undefined.
  /// @synopsis URL getURL()
  public Any m_getURL()
  {
    Type type = _type;
    while(type != null) {
      if (type instanceof Module) {
        URL url = ((Module)type).getAddress().getURL();
        if (url != null) {
          return new AnyURL(url);
        }
      }
      type = type.getParent();
    }
    return UNDEFINED;
 
View Full Code Here

  /// @method getModule
  /// Returns the script where this type is declared.
  /// @synopsis Type getModule()
  public Any m_getModule()
  {
    Type type = _type;
    while(type != null) {
      if (type instanceof Module) {
        return new AnyType(type);
      }
      type = type.getParent();
    }
    return UNDEFINED;
  }
View Full Code Here

  /// @synopsis Configurable getZone()
  /// @throws AccessDenied If security policy denies this operation.
  public Any m_getZone(Context context)
  {
    context.checkAccess(anvil.core.system.AnyConfigurable.CAN_READ);
    Type type = _type;
    while(type != null) {
      if (type instanceof Module) {
        Module script = (Module)type;
        Address addr = script.getAddress();
        if (addr != null) {
          return new anvil.core.system.AnyConfigurable(addr.getZone());
        }
      }
      type = type.getParent();
    }
    return UNDEFINED;
  }
View Full Code Here

TOP

Related Classes of anvil.script.Type

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.