| java.lang.Object simple.util.parse.ParseBuffer simple.page.translate.Parser
All known Subclasses: simple.page.translate.Target, simple.page.translate.Token,
Parser | final class Parser extends ParseBuffer (Code) | | The Parser object is used to digest the tokens emitted
from the lexer. This will delegate the token parsing to objects
implementing the Token class. Each token emitted from
the lexical analysis phase is classified using a classification
object. Once classified a specific token type processes the text.
author: Niall Gallagher |
Method Summary | |
public void | begin(Lexer lexer) Each parser implementation must specify the boundaries of the
tokens it is prepared to classify and digest. | public void | finish() Once lexical analysis has finished this method is invoked. | public void | parse(char[] text) This method is invoked by the lexer and is used to process an
array of characters, which signifies the full text for a token. | public void | parse(char[] text, int off, int len) This method is invoked by the lexer and is used to process an
array of characters, which signifies the full text for a token. |
Parser | public Parser(Definition source, Builder builder)(Code) | | Constructor for the Parser object. This requires
the document definition to be constructed as well as the builder
driving the process, the builder is required for the recursive
evaluation of included JSP sources via the include directive.
Parameters: source - this is the document definition to populate Parameters: builder - this is the object that builds the definition |
begin | public void begin(Lexer lexer)(Code) | | Each parser implementation must specify the boundaries of the
tokens it is prepared to classify and digest. This implementation
uses the standard JSP tags "<%" and "%>", however it can
just as easily use the PHP tag "<?" and "?>".
Parameters: lexer - this is the lexer that emits the required tokens |
finish | public void finish()(Code) | | Once lexical analysis has finished this method is invoked. This
will force any buffered plain text to be processed so that the
full JSP source is processed and used in the document definition.
|
parse | public void parse(char[] text)(Code) | | This method is invoked by the lexer and is used to process an
array of characters, which signifies the full text for a token.
The text provided to this method is guaranteed to contain either
a complete token, or plain text which is not a parsable token.
Parameters: text - this contains only a single token or plain text |
parse | public void parse(char[] text, int off, int len)(Code) | | This method is invoked by the lexer and is used to process an
array of characters, which signifies the full text for a token.
The text provided to this method is guaranteed to contain either
a complete token, or plain text which is not a parsable token.
Parameters: text - this contains only a single token or plain text Parameters: off - this is the offset within the buffer to read from Parameters: len - the number of characters in the buffer to evaluate |
|
|