Package org.stringtemplate.v4.compiler

Examples of org.stringtemplate.v4.compiler.StringTable


  /** Used by group creation routine, not by users */
    protected ST() {
    if ( STGroup.trackCreationEvents ) {
      if ( debugState==null ) debugState = new ST.DebugState();
      debugState.newSTEvent = new ConstructionEvent();
    }
  }
View Full Code Here


    wr.setLineWidth(lineWidth);
    Interpreter interp =
      new Interpreter(groupThatCreatedThisInstance, locale, true);
    interp.exec(wr, this); // render and track events
    List<InterpEvent> events = interp.getEvents();
    EvalTemplateEvent overallTemplateEval =
      (EvalTemplateEvent)events.get(events.size()-1);
    STViz viz = new STViz(errMgr, overallTemplateEval, out.toString(), interp,
                interp.getExecutionTrace(), errors.errors);
    viz.open();
    return viz;
View Full Code Here

    viewFrame.ast.setModel(astModel);

    // highlight output text and, if {...} subtemplate, region in ST src
    // get last event for currentScope.st; it's the event that captures ST eval
    List<InterpEvent> events = currentScope.events;
    EvalTemplateEvent e = (EvalTemplateEvent)events.get(events.size() - 1);
    //m.output.moveCaretPosition(e.outputStartChar);
    highlight(m.output, e.outputStartChar, e.outputStopChar);
    try {
    m.output.scrollRectToVisible(m.output.modelToView(e.outputStartChar));
    }
View Full Code Here

    this.interp = interp;
    this.root = new Wrapper(root);
  }

  public Object getChild(Object parent, int index) {
    EvalTemplateEvent e = ((Wrapper)parent).event;
    return new Wrapper(e.scope.childEvalTemplateEvents.get(index));
  }
View Full Code Here

    EvalTemplateEvent e = ((Wrapper)parent).event;
    return new Wrapper(e.scope.childEvalTemplateEvents.get(index));
  }

  public int getChildCount(Object parent) {
    EvalTemplateEvent e = ((Wrapper)parent).event;
    return e.scope.childEvalTemplateEvents.size();
  }
View Full Code Here

    EvalTemplateEvent e = ((Wrapper)parent).event;
    return e.scope.childEvalTemplateEvents.size();
  }

  public int getIndexOfChild(Object parent, Object child) {
    EvalTemplateEvent p = ((Wrapper)parent).event;
    EvalTemplateEvent c = ((Wrapper)parent).event;
        int i = 0;
        for (EvalTemplateEvent e : p.scope.childEvalTemplateEvents) {
            if ( e.scope.st == c.scope.st ) {
//        System.out.println(i);
//        System.out.println("found "+e.self+" as child of "+parentST);
View Full Code Here

        viewFrame.trace.setText(Misc.join(trace.iterator(), "\n"));

        CaretListener caretListenerLabel = new CaretListener() {
            public void caretUpdate(CaretEvent e) {
                int dot = e.getDot();
                InterpEvent de = findEventAtOutputLocation(allEvents, dot);
                if ( de==null ) currentScope = tmodel.root.event.scope;
        else currentScope = de.scope;

        // update tree view of template hierarchy
        // compute path from root to currentST, create TreePath for tree widget
View Full Code Here

      new Interpreter(groupThatCreatedThisInstance, locale, true);
    interp.exec(wr, this); // render and track events
    List<InterpEvent> events = interp.getEvents();
    EvalTemplateEvent overallTemplateEval =
      (EvalTemplateEvent)events.get(events.size()-1);
    STViz viz = new STViz(errMgr, overallTemplateEval, out.toString(), interp,
                interp.getExecutionTrace(), errors.errors);
    viz.open();
    return viz;
  }
View Full Code Here

    gen.writeVocabFile();
  }

  protected void writeRecognizer(ST template, CodeGenerator gen) {
    if ( g.tool.launch_ST_inspector ) {
      STViz viz = template.inspect();
      if (g.tool.ST_inspector_wait_for_close) {
        try {
          viz.waitForClose();
        }
        catch (InterruptedException ex) {
          g.tool.errMgr.toolError(ErrorType.INTERNAL_ERROR, ex);
        }
      }
View Full Code Here

    {
      boolean can_break = false;
      Object tok = tokens.get(i);
      if( tok instanceof Aggregate )
      {
        Aggregate atok = (Aggregate) tok;
        for (Map.Entry<String, Object> pairs : atok.properties.entrySet()) {
          if( pairs.getValue().equals("EOF") )
          {
            tokens.remove(i);
            can_break = true;
View Full Code Here

TOP

Related Classes of org.stringtemplate.v4.compiler.StringTable

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.