Usage:
SyntaxSeparation separation = new SyntaxSeparation(new Syntax(myRules)); LexerBuilder builder = new LexerBuilder(separation.getLexerSyntax(), separation.getIgnoredSymbols()); Lexer lexer = builder.getLexer(inputStream); lexer.setTerminals(separation.getTokenSymbols()); Token token; do { token = lexer.getNextToken(null); System.err.println("token.symbol="+token.symbol+", text >"+token.text+"<"); } while (token.symbol != null && Token.isEpsilon(token) == false); boolean error = token.symbol == null;@see fri.patterns.interpreter.parsergenerator.lexer.LexerImpl @author (c) 2000, Fritz Ritzberger
Given a file stream fp it returns a sequence of tokens. GetToken(fp) gets the next token UngetToken(fp) provides one level undo The tags include an attribute list: - linked list of attribute/value nodes - each node has 2 null-terminated strings. - entities are replaced in attribute values white space is compacted if not in preformatted mode If not in preformatted mode then leading white space is discarded and subsequent white space sequences compacted to single space chars. If XmlTags is no then Tag names are folded to upper case and attribute names to lower case. Not yet done: - Doctype subset and marked sections
@author Dave Raggett dsr@w3.org @author Andy Quick ac.quick@sympatico.ca (translation to Java) @author Fabrizio Giustina @version $Revision: 1.1.2.1 $ ($Author: alexsmirnov $)nextNode()
is called, another node is returned until the stream is exhausted, and null
is returned.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|