コード例 #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);
    }
コード例 #2
0
 public void visit(Text text) {
   write(text.getContent());
 }