gnu.kawa.xslt

Class XslTranslator

Implemented Interfaces:
Consumer

public class XslTranslator
extends Lexer
implements Consumer

Translate an XSLT stylesheet to a Kawa Expression tree.

Field Summary

Fields inherited from class gnu.text.Lexer

interactive, nesting, port, tokenBuffer, tokenBufferLength

Method Summary

void
beginAttribute(String attrName, Object attrType)
Write a attribute for the current group.
void
beginDocument()
void
beginDocument(ModuleExp mexp)
void
beginGroup(String typeName, Object type)
void
endAttribute()
void
endDocument()
void
endGroup(String typeName)
void
error(char kind, String message)
Expression
getExpression()
boolean
ignoring()
True if consumer is ignoring rest of group.
static String
isXslTag(Object type)
void
parse(Compilation comp)
String
popMatchingAttribute(String ns, String name, int start)
void
write(char[] buf, int off, int len)
void
writeBoolean(boolean v)
void
writeChar(int v)
void
writeChars(String str)
void
writeDouble(double v)
void
writeFloat(float v)
void
writeInt(int v)
void
writeLong(long v)
void
writeObject(Object v)

Methods inherited from class gnu.text.Lexer

checkErrors, checkNext, clearErrors, close, eofError, eofError, error, error, error, fatal, getColumnNumber, getErrors, getLineNumber, getMessages, getName, getPort, isInteractive, mark, peek, popNesting, pushNesting, read, read, readDigitsInBuffer, readOptionalExponent, reset, seenErrors, setInteractive, setMessages, skip, skip_quick, tokenBufferAppend, unread, unread, unread_quick

Method Details

beginAttribute

public void beginAttribute(String attrName,
                           Object attrType)
Write a attribute for the current group. This is only allowed immediately after a beginGroup.
Specified by:
beginAttribute in interface Consumer

beginDocument

public void beginDocument()
Specified by:
beginDocument in interface Consumer

beginDocument

public void beginDocument(ModuleExp mexp)

beginGroup

public void beginGroup(String typeName,
                       Object type)
Specified by:
beginGroup in interface Consumer

endAttribute

public void endAttribute()
Specified by:
endAttribute in interface Consumer

endDocument

public void endDocument()
Specified by:
endDocument in interface Consumer

endGroup

public void endGroup(String typeName)
Specified by:
endGroup in interface Consumer

error

public void error(char kind,
                  String message)
Overrides:
error in interface Lexer

getExpression

public Expression getExpression()

ignoring

public boolean ignoring()
True if consumer is ignoring rest of group. The producer can use this information to skip ahead.
Specified by:
ignoring in interface Consumer

isXslTag

public static String isXslTag(Object type)

parse

public void parse(Compilation comp)

popMatchingAttribute

public String popMatchingAttribute(String ns,
                                   String name,
                                   int start)

write

public void write(char[] buf,
                  int off,
                  int len)
Specified by:
write in interface Consumer

writeBoolean

public void writeBoolean(boolean v)
Specified by:
writeBoolean in interface Consumer

writeChar

public void writeChar(int v)
Specified by:
writeChar in interface Consumer

writeChars

public void writeChars(String str)
Specified by:
writeChars in interface Consumer

writeDouble

public void writeDouble(double v)
Specified by:
writeDouble in interface Consumer

writeFloat

public void writeFloat(float v)
Specified by:
writeFloat in interface Consumer

writeInt

public void writeInt(int v)
Specified by:
writeInt in interface Consumer

writeLong

public void writeLong(long v)
Specified by:
writeLong in interface Consumer

writeObject

public void writeObject(Object v)
Specified by:
writeObject in interface Consumer