|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xpath.compiler.Lexer
This class is in charge of lexical processing of the XPath expression into tokens.
Field Summary | |
private Compiler |
m_compiler
The target XPath. |
(package private) PrefixResolver |
m_namespaceContext
The prefix resolver to map prefixes to namespaces in the XPath. |
private int[] |
m_patternMap
Ignore this, it is going away. |
private int |
m_patternMapSize
Ignore this, it is going away. |
(package private) XPathParser |
m_processor
The XPath processor object. |
(package private) static int |
TARGETEXTRA
This value is added to each element name in the TARGETEXTRA that is a 'target' (right-most top-level element name). |
Constructor Summary | |
(package private) |
Lexer(Compiler compiler,
PrefixResolver resolver,
XPathParser xpathProcessor)
Create a Lexer object. |
Method Summary | |
private void |
addToTokenQueue(String s)
Add a token to the token queue. |
(package private) int |
getKeywordToken(String key)
Given a string, return the corresponding keyword token. |
private int |
getTokenQueuePosFromMap(int i)
Given a map pos, return the corresponding token queue pos. |
private int |
mapNSTokens(String pat,
int startSubstring,
int posOfNSSep,
int posOfScan)
When a seperator token is found, see if there's a element name or the like to map. |
private boolean |
mapPatternElemPos(int nesting,
boolean isStart,
boolean isAttrName)
Record the current position on the token queue as long as this is a top-level element. |
private void |
recordTokenString(Vector targetStrings)
Record the current token in the passed vector. |
private void |
resetTokenMark(int mark)
Reset token queue mark and m_token to a given position. |
(package private) void |
tokenize(String pat)
Walk through the expression and build a token queue, and a map of the top-level elements. |
(package private) void |
tokenize(String pat,
Vector targetStrings)
Walk through the expression and build a token queue, and a map of the top-level elements. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Compiler m_compiler
PrefixResolver m_namespaceContext
XPathParser m_processor
static final int TARGETEXTRA
private int[] m_patternMap
private int m_patternMapSize
Constructor Detail |
Lexer(Compiler compiler, PrefixResolver resolver, XPathParser xpathProcessor)
compiler
- The owning compiler for this lexer.resolver
- The prefix resolver for mapping qualified name prefixes
to namespace URIs.xpathProcessor
- The parser that is processing strings to opcodes.Method Detail |
void tokenize(String pat) throws javax.xml.transform.TransformerException
pat
- XSLT Expression.
javax.xml.transform.TransformerException
void tokenize(String pat, Vector targetStrings) throws javax.xml.transform.TransformerException
pat
- XSLT Expression.targetStrings
- Vector to hold Strings, may be null.
javax.xml.transform.TransformerException
private boolean mapPatternElemPos(int nesting, boolean isStart, boolean isAttrName)
nesting
- The nesting count for the pattern element.isStart
- true if this is the start of a pattern.isAttrName
- true if we have determined that this is an attribute name.
private int getTokenQueuePosFromMap(int i)
i
- The index in the m_patternMap.
private final void resetTokenMark(int mark)
mark
- The new position.final int getKeywordToken(String key)
key
- The keyword.
private void recordTokenString(Vector targetStrings)
targetStrings
- Vector of string.private final void addToTokenQueue(String s)
s
- The token.private int mapNSTokens(String pat, int startSubstring, int posOfNSSep, int posOfScan) throws javax.xml.transform.TransformerException
pat
- The XPath name string.startSubstring
- The start of the name string.posOfNSSep
- The position of the namespace seperator (':').posOfScan
- The end of the name index.
javax.xml.transform.TransformerException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |