Ejemplo n.º 1
0
    @Override
    public String toString() {
      String pv = "null";
      if (previous != null) {
        pv = previous.getNodeName();
        if (previous.isNodeType(AstNode.NT_TEXT)) {
          pv = ((Text) previous).getContent();
          if (pv.length() > 16) {
            pv = pv.substring(pv.length() - (16 - 4));
            pv = "... " + pv;
          }
        }
        pv = '"' + pv + '"';
      }

      String pf = "-";
      if (prefix != null) pf = '"' + prefix.getContent() + '"';

      return String.format("LineEntry(%s, %s, %d)", pv, pf, tickCount);
    }
Ejemplo n.º 2
0
 public void visit(Text text) {
   write(text.getContent());
 }