Package xtc.type

Examples of xtc.type.Type


    ast.initialize(hasNode, hasToken, hasFormatting, hasAction);

    // Intern the types.
    for (Module m : g.modules) {
      for (Production p : m.productions) {
        Type t;

        try {
          t = ast.intern(p.dType);
        } catch (IllegalArgumentException x) {
          runtime.error(x.getMessage() + " for production '" + p.name + "'", p);
View Full Code Here


    }
    for (int i=0; i<md.options.size(); i++) {
      printer.indent().p(indexT()).align(align).p(OPTION).p(i+1).
        pln(';');

      Type t = md.options.get(i);
      if (null != t) {
        String s = extern(t);
        if (attributeRawTypes) s = rawT(s);
        printer.indent().p(s).align(align).p(OP_VALUE).p(i+1).pln(';');
      }
View Full Code Here

    }
    String  name        = bindingName;
    bindingName         = null;
    Element bound       = bindingElement;
    bindingElement      = null;
    Type type           = bindingType;
    bindingType         = null;

    boolean rep         = repeated;
    repeated            = true;
    boolean once        = repeatedOnce;
View Full Code Here

    }
    String name         = bindingName;
    bindingName         = null;
    Element bound       = bindingElement;
    bindingElement      = null;
    Type type           = bindingType;
    bindingType         = null;

    boolean opt         = optional;
    optional            = true;
    boolean rep         = repeated;
View Full Code Here

  /** Generate code for the specified binding. */
  public void visit(Binding b) {
    // Save old name and element.
    String  oldName    = bindingName;
    Element oldElement = bindingElement;
    Type    oldType    = bindingType;

    // Set up new name and element;
    bindingName    = b.name;
    bindingElement = b.element;
    bindingType    = null; // For now, this field is only used in options.
View Full Code Here

  /** Actually emit the code for the last visited binding. */
  protected void binding() {
    switch (bindingElement.tag()) {
    case NONTERMINAL: {
      Type type = VALUE.equals(bindingName) ? analyzer.current().type :
        analyzer.lookup((NonTerminal)bindingElement).type;
      Type cast = attributeRawTypes && ! AST.isAny(type) ? type : null;
      binding1(extern(type), bindingName, extern(cast),
               resultName + ".semanticValue()");
    } break;

    case ANY_CHAR:
View Full Code Here

    // If the location optimization is enabled and yyValue is declared
    // to be a node or token, then add the source location directly to
    // the just created node.  Otherwise, just record that the
    // alternative creates a node value.
    final Type type = analyzer.current().type;
    if (attributeWithLocation &&
        runtime.test("optimizeLocation") &&
        AST.isNode(type)) {
      printer.indent().p(VALUE).p(".setLocation(location(").p(ARG_INDEX).
        pln("));");
View Full Code Here

       
      } else {
        // Lift choice.
        NonTerminal nt = analyzer.choice();
       
        Type type;
        if (isTextOnly()) {
          type = AST.STRING;
        } else if (isToken()) {
          type = AST.TOKEN;
        } else if (bound || ((isGeneric() || isList()) &&
View Full Code Here

        return r;
      }

      NonTerminal nt = (r.once)? analyzer.plus() : analyzer.star();

      Type type;
      if (isTextOnly()) {
        type = AST.STRING;
      } else if (isToken()) {
        type = AST.TOKEN;
      } else if (bound || ((isGeneric() || isList()) &&
View Full Code Here

        return o;
      }

      NonTerminal nt = analyzer.option();

      Type type;
      if (isTextOnly()) {
        type = AST.STRING;
      } else if (isToken()) {
        type = AST.TOKEN;
      } else if (bound || ((isGeneric() || isList()) &&
View Full Code Here

TOP

Related Classes of xtc.type.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.