if (cs.value!=null){ writer.writeStartElement("token"); writer.writeAttribute("name",cs.getName()); cs.getLeft().toXML(writer, "left"); writer.writeCharacters(cs.value+""); cs.getRight().toXML(writer, "right"); writer.writeEndElement(); } else writer.writeAttribute("left",cs.getLeft()+""); writer.writeAttribute("right",cs.getRight()+""); writer.writeCharacters(cs.getName()+""); writer.writeEndElement();
if (cs.value!=null){ writer.writeStartElement("token"); writer.writeAttribute("name",cs.getName()); cs.getLeft().toXML(writer, "left"); writer.writeCharacters(cs.value+""); cs.getRight().toXML(writer, "right"); writer.writeEndElement(); } else writer.writeAttribute("left",cs.getLeft()+""); writer.writeAttribute("right",cs.getRight()+""); writer.writeCharacters(cs.getName()+""); writer.writeEndElement();
if (cs.value!=null){ writer.writeStartElement("token"); writer.writeAttribute("name",cs.getName()); cs.getLeft().toXML(writer, "left"); writer.writeCharacters(cs.value+""); cs.getRight().toXML(writer, "right"); writer.writeEndElement(); } else writer.writeAttribute("left",cs.getLeft()+""); writer.writeAttribute("right",cs.getRight()+""); writer.writeCharacters(cs.getName()+""); writer.writeEndElement();
/** Report a non fatal error (or warning). This method takes a message * string and an additional object (to be used by specializations * implemented in subclasses). Here in the base class a very simple * implementation is provided which simply prints the message to * System.err. * * @param message an error message. * @param info an extra object reserved for use by specialized subclasses. */ public void report_error(String message, Object info) { if (info instanceof ComplexSymbol){ ComplexSymbol cs = (ComplexSymbol)info; System.err.println(message+" for input symbol \""+cs.getName()+"\" spanning from "+cs.getLeft() +" to "+cs.getRight()); return; } System.err.print(message); System.err.flush(); if (info instanceof Symbol) if (((Symbol)info).left != -1) System.err.println(" at character " + ((Symbol)info).left + " of input"); else System.err.println(""); }
/** Report a non fatal error (or warning). This method takes a message * string and an additional object (to be used by specializations * implemented in subclasses). Here in the base class a very simple * implementation is provided which simply prints the message to * System.err. * * @param message an error message. * @param info an extra object reserved for use by specialized subclasses. */ public void report_error(String message, Object info) { if (info instanceof ComplexSymbol){ ComplexSymbol cs = (ComplexSymbol)info; System.err.println(message+" for input symbol \""+cs.getName()+"\" spanning from "+cs.getLeft() +" to "+cs.getRight()); return; } System.err.print(message); System.err.flush(); if (info instanceof Symbol) if (((Symbol)info).left != -1) System.err.println(" at character " + ((Symbol)info).left + " of input"); else System.err.println(""); }
/** Report a non fatal error (or warning). This method takes a message * string and an additional object (to be used by specializations * implemented in subclasses). Here in the base class a very simple * implementation is provided which simply prints the message to * System.err. * * @param message an error message. * @param info an extra object reserved for use by specialized subclasses. */ public void report_error(String message, Object info) { if (info instanceof ComplexSymbol){ ComplexSymbol cs = (ComplexSymbol)info; System.err.println(message+" for input symbol \""+cs.getName()+"\" spanning from "+cs.getLeft() +" to "+cs.getRight()); return; } System.err.print(message); System.err.flush(); if (info instanceof Symbol) if (((Symbol)info).left != -1) System.err.println(" at character " + ((Symbol)info).left + " of input"); else System.err.println(""); }
public Symbol newSymbol(String name, int id, Object value){ return new ComplexSymbol(name,id,value); } public Symbol startSymbol(String name, int id, int state){
public Symbol newSymbol(String name, int id, Location left, Location right){ return new ComplexSymbol(name,id,left,right); } public Symbol newSymbol(String name, int id, Symbol left, Symbol right, Object value){
public Symbol startSymbol(String name, int id, int state){ return new ComplexSymbol(name,id,state); } }
public Symbol newSymbol(String name, int id, Object value){ return new ComplexSymbol(name,id,value); } public Symbol startSymbol(String name, int id, int state){
public Symbol newSymbol(String name, int id, Symbol left, Object value) { return new ComplexSymbol(name,id,left,value); } public Symbol newSymbol(String name, int id, Symbol left, Symbol right, Object value){
public Symbol newSymbol(String name, int id, Symbol left, Symbol right){ return new ComplexSymbol(name,id,left,right); } public Symbol newSymbol(String name, int id){
public Symbol newSymbol(String name, int id){ return new ComplexSymbol(name,id); } public Symbol newSymbol(String name, int id, Object value){
public Symbol newSymbol(String name, int id, Symbol left, Symbol right, Object value){ return new ComplexSymbol(name,id,left,right,value); } public Symbol newSymbol(String name, int id, Symbol left, Symbol right){
public Symbol newSymbol(String name, int id, Location left, Location right, Object value){ return new ComplexSymbol(name,id,left,right,value); } public Symbol newSymbol(String name, int id, Location left, Location right){
public Symbol startSymbol(String name, int id, int state){ return new ComplexSymbol(name,id,state); } }
public Symbol newSymbol(String name, int id, Object value){ return new ComplexSymbol(name,id,value); } public Symbol startSymbol(String name, int id, int state){
public Symbol newSymbol(String name, int id, Symbol left, Symbol right){ return new ComplexSymbol(name,id,left,right); } public Symbol newSymbol(String name, int id){
public Symbol newSymbol(String name, int id, Symbol left, Symbol right){ return new ComplexSymbol(name,id,left,right); } public Symbol newSymbol(String name, int id){
public Symbol newSymbol(String name, int id, Symbol left, Symbol right, Object value){ return new ComplexSymbol(name,id,left,right,value); } public Symbol newSymbol(String name, int id, Symbol left, Symbol right){