Package xtc.tree

Examples of xtc.tree.Printer.pln()


    printer.sep();
    printer.indent().p("// Generated by Rats!, version ").p(Constants.VERSION).
      p(", ").p(Constants.COPY).pln('.');
    printer.sep();
    printer.pln();

    printer.indent().p("/** AST structure for grammar ").p(m.name.name).
      pln(". */");

    // Ensure that all tuples are concrete and then print the result.
View Full Code Here


      // Flat AST definition.
      final VariantT node = ast.toVariant("Node", false);

      ast.concretizeTuples(node, UnitT.TYPE);
      printer.indent().p("module ").p(m.name.name).p("Tree").pln(';');
      printer.pln();
      ast.print(node, printer, true, false, null);
      printer.pln();

    } else {
      // Hierarchical AST definition.
View Full Code Here

      ast.concretizeTuples(node, UnitT.TYPE);
      printer.indent().p("module ").p(m.name.name).p("Tree").pln(';');
      printer.pln();
      ast.print(node, printer, true, false, null);
      printer.pln();

    } else {
      // Hierarchical AST definition.
      final VariantT     root      =
        analyzer.lookup((NonTerminal)m.getProperty(Properties.ROOT)).
View Full Code Here

      // Print variants...
      if (! meta.modularize) {
        // ... in a single module.
        printer.indent().p("module ").p(m.name.name).p("Tree").pln(';');
        printer.pln();

        for (Production p : m.productions) {
          if (AST.isStaticNode(p.type)) {
            final VariantT variant = p.type.resolve().toVariant();
            final String   name    = variant.getName();
View Full Code Here

            final String   name    = variant.getName();
           
            if (meta.reachable.contains(name) && ! processed.contains(name)) {
              processed.add(name);
              ast.print(variant, printer, true, false, null);
              printer.pln();
            }
          }
        }

      } else {
View Full Code Here

                    first = false;
                  } else {
                    printer.sep().pln();
                  }
                  printer.indent().p("module ").p(module).pln(';');
                  printer.pln();
                 
                } else if (! module.equals(qualifier)) {
                  continue;
                }
               
View Full Code Here

                  continue;
                }
               
                processed.add(name);
                ast.print(variant, printer, true, true, module);
                printer.pln();
              }
            }
          }
        } while (null != module);
      }
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.