com.opensymphony.module.sitemesh.html.tokenizer
Class Parser
java.lang.Object
Lexer
com.opensymphony.module.sitemesh.html.tokenizer.Parser
public class Parser
- extends Lexer
Looks for patterns of tokens in the Lexer and translates these to calls to pass to the TokenHandler.
- Author:
- Joe Walnes
- See Also:
TagTokenizer
Method Summary |
private void |
parseAttribute()
|
protected void |
parsedAttribute(String name,
String value,
boolean quoted)
|
protected void |
parsedTag(int type,
String name,
int start,
int length)
|
protected void |
parsedText(int position,
int length)
|
private void |
parseFullTag(int type,
String name,
int start)
|
private void |
parseTag(int type)
|
private void |
pushBack(int next)
|
protected void |
reportError(String message,
int line,
int column)
|
private void |
skipWhiteSpace()
|
void |
start()
|
private String |
text()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
attributeBuffer
private final CharArray attributeBuffer
reusableToken
private final Parser.ReusableToken reusableToken
pushbackToken
private int pushbackToken
pushbackText
private String pushbackText
SLASH
public static final short SLASH
- See Also:
- Constant Field Values
WHITESPACE
public static final short WHITESPACE
- See Also:
- Constant Field Values
EQUALS
public static final short EQUALS
- See Also:
- Constant Field Values
QUOTE
public static final short QUOTE
- See Also:
- Constant Field Values
WORD
public static final short WORD
- See Also:
- Constant Field Values
TEXT
public static final short TEXT
- See Also:
- Constant Field Values
QUOTED
public static final short QUOTED
- See Also:
- Constant Field Values
LT
public static final short LT
- See Also:
- Constant Field Values
GT
public static final short GT
- See Also:
- Constant Field Values
LT_OPEN_MAGIC_COMMENT
public static final short LT_OPEN_MAGIC_COMMENT
- See Also:
- Constant Field Values
LT_CLOSE_MAGIC_COMMENT
public static final short LT_CLOSE_MAGIC_COMMENT
- See Also:
- Constant Field Values
input
private final char[] input
handler
private TokenHandler handler
position
private int position
length
private int length
name
private String name
type
private int type
Parser
public Parser(char[] input,
TokenHandler handler)
text
private String text()
skipWhiteSpace
private void skipWhiteSpace()
throws IOException
- Throws:
IOException
pushBack
private void pushBack(int next)
start
public void start()
parseTag
private void parseTag(int type)
throws IOException
- Throws:
IOException
parseFullTag
private void parseFullTag(int type,
String name,
int start)
throws IOException
- Throws:
IOException
parseAttribute
private void parseAttribute()
throws IOException
- Throws:
IOException
parsedText
protected void parsedText(int position,
int length)
parsedTag
protected void parsedTag(int type,
String name,
int start,
int length)
parsedAttribute
protected void parsedAttribute(String name,
String value,
boolean quoted)
reportError
protected void reportError(String message,
int line,
int column)