Package anvil.script

Examples of anvil.script.Name


  final public void Symbol(int role) throws ParseException {
  Token t;
  Token var = null;
  Location location;
  Parent args = null;
  Name name = new Name();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case MODULE:
    case SYMBOL:
    case FUNCTION:
    case SUPER:
    case STATIC:
    case CLASS:
    case VAR:
    case THIS:
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case SYMBOL:
      case VAR:
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case VAR:
          var = jj_consume_token(VAR);
          break;
        default:
          jj_la1[134] = jj_gen;
          ;
        }
        t = jj_consume_token(SYMBOL);
        break;
      case MODULE:
        t = jj_consume_token(MODULE);
        break;
      case CLASS:
        t = jj_consume_token(CLASS);
        break;
      case STATIC:
        t = jj_consume_token(STATIC);
        break;
      case THIS:
        t = jj_consume_token(THIS);
        break;
      case SUPER:
        t = jj_consume_token(SUPER);
        break;
      case FUNCTION:
        t = jj_consume_token(FUNCTION);
        break;
      default:
        jj_la1[135] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
        location = toLocation(var != null ? var : t);

        if (var != null) {
          Statement stmt = flowPeek();
          if (stmt.isStaticRegion() && stmt.getFunctionStatement() == null) {
            error(location, "Explicit variable declaration modifier 'var' cannot be used in static initialization");
          } else {
            switch(role) {
            case LinkNode.ASSIGN:
            case LinkNode.GET:
            case LinkNode.DECLARE:
              role = LinkNode.DECLARE;
              break;
            default:
              error(location, "Invalid use of explicit variable declaration modifier 'var'");
            }
          }
        }

        name.add(t);
      label_45:
      while (true) {
        if (jj_2_20(2147483647)) {
          ;
        } else {
          break label_45;
        }
        t = DotAndThisOrSymbol();
           name.add(t);
      }
      break;
    case DOT:
      t = jj_consume_token(DOT);
        location = toLocation(t);
        name.add(t);
      t = jj_consume_token(SYMBOL);
        name.add(t);
      label_46:
      while (true) {
        if (jj_2_21(2147483647)) {
          ;
        } else {
          break label_46;
        }
        t = DotAndThisOrSymbol();
        name.add(t);
      }
      break;
    default:
      jj_la1[136] = jj_gen;
      jj_consume_token(-1);
View Full Code Here


          } else if (decls != null) {
         
            if (type instanceof Scope) {
              int n = decls.length;
              for(int j=0; j<n; j++) {
                Name childname = decls[j];
                Type child = follow(type, childname);
                if (child != null) {
                  if (childname.hasStar()) {
                    switch(child.getType()) {
                    case MODULE:
                    case NAMESPACE:
                    case CLASS:
                    case INTERFACE:
                      addExternals(listener, location, source, (Scope)child);
                      break;
                    default:
                      listener.error(location, "Entity '"+child+"' does not contain any entities that may be imported");
                      break;
                    }
                  } else {
                    addExternal(listener, location, source, childname.as(), child);
                  }
                } else {
                  listener.error(location, "Entity '"+childname+"' not found from '"+source+"'");
                }
              }
View Full Code Here

    if (href != null) {
      href = href.trim();
      addHrefImport(parser, location, href, as, decls, star);
     
    } else if (from != null) {
      Name name = Grammar.parseDottedName(parser, location, from);
      if (as != null) {
        name.setAs(as);
      }
      addEntityImport(parser, location, name, decls, star);
     
    } else if (module != null) {
      Name name = Grammar.parseDottedName(parser, location, module);
      if (as != null) {
        name.setAs(as);
      }
      addEntityImport(parser, location, name, decls, star);

    }
    
View Full Code Here

      ns.setName("ns$"+ns.hashCode());
      parser.push(ns);
      ns.parse(parser, tag);
    } else {
      NamespaceStatement ns = null;
      Name name = Grammar.parseDottedName(parser, location, str);
      int n = name.size();
      DefinitionStatement scope = this;
      for(int i=0; i<n; i++) {
        String part = name.get(i);
        ns = new NamespaceStatement(location, scope);
        ns.setName(part);
        Type declared = scope.lookupDeclaration(part);
        if (declared == null) {
          ns = new NamespaceStatement(location, scope);
View Full Code Here

    }
    _name = s;
    _document = DocParser.parseClass(_name, parser.getDocument());
    s = tag.get("extends");
    if (s != null) {
      Name name = Grammar.parseDottedName(parser, location, s);
      if (name != null) {
        _base = new ClassRef(new LinkNode(this, location, name));
      } else {
        init = false;
      }
View Full Code Here

      }
    }

    String dottedname = tag.getValue("function");
    if (dottedname != null) {
      Name name = Grammar.parseDottedName(parser, location, dottedname);
      if (name != null) {
        _expression = new Expression(new LinkNode(this, location, name, parameters, LinkNode.GET), location);
      }
    } else {
      parser.error(location, "Attribute 'function' not given");
View Full Code Here

TOP

Related Classes of anvil.script.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.