public void LT(int i, Object t) {
   int ID = adaptor.getUniqueID(t);
   String text = adaptor.getText(t);
   int type = adaptor.getType(t);
   StringBuffer buf = new StringBuffer(50);
   buf.append("LN\t"); // lookahead node; distinguish from LT in protocol
   buf.append(i);
   serializeNode(buf, t);
   transmit(buf.toString());
 }
 public void errorNode(Object t) {
   int ID = adaptor.getUniqueID(t);
   String text = t.toString();
   StringBuffer buf = new StringBuffer(50);
   buf.append("errorNode\t");
   buf.append(ID);
   buf.append("\t");
   buf.append(Token.INVALID_TOKEN_TYPE);
   serializeText(buf, text);
   transmit(buf.toString());
 }
 public void createNode(Object t) {
   int ID = adaptor.getUniqueID(t);
   String text = adaptor.getText(t);
   int type = adaptor.getType(t);
   StringBuffer buf = new StringBuffer(50);
   buf.append("createNodeFromTokenElements\t");
   buf.append(ID);
   buf.append("\t");
   buf.append(type);
   serializeText(buf, text);
   transmit(buf.toString());
 }
 protected void serializeNode(StringBuffer buf, Object t) {
   int ID = adaptor.getUniqueID(t);
   String text = adaptor.getText(t);
   int type = adaptor.getType(t);
   buf.append("\t");
   buf.append(ID);
   buf.append("\t");
   buf.append(type);
   Token token = adaptor.getToken(t);
   int line = -1;
   int pos = -1;
   if (token != null) {
     line = token.getLine();
     pos = token.getCharPositionInLine();
   }
   buf.append("\t");
   buf.append(line);
   buf.append("\t");
   buf.append(pos);
   int tokenIndex = adaptor.getTokenStartIndex(t);
   buf.append("\t");
   buf.append(tokenIndex);
   serializeText(buf, text);
 }
 public void setTokenBoundaries(Object t, int tokenStartIndex, int tokenStopIndex) {
   int ID = adaptor.getUniqueID(t);
   transmit("setTokenBoundaries\t" + ID + "\t" + tokenStartIndex + "\t" + tokenStopIndex);
 }
 public void addChild(Object root, Object child) {
   int rootID = adaptor.getUniqueID(root);
   int childID = adaptor.getUniqueID(child);
   transmit("addChild\t" + rootID + "\t" + childID);
 }
 public void becomeRoot(Object newRoot, Object oldRoot) {
   int newRootID = adaptor.getUniqueID(newRoot);
   int oldRootID = adaptor.getUniqueID(oldRoot);
   transmit("becomeRoot\t" + newRootID + "\t" + oldRootID);
 }
 public void createNode(Object node, Token token) {
   int ID = adaptor.getUniqueID(node);
   int tokenIndex = token.getTokenIndex();
   transmit("createNode\t" + ID + "\t" + tokenIndex);
 }
 public void nilNode(Object t) {
   int ID = adaptor.getUniqueID(t);
   transmit("nilNode\t" + ID);
 }