Class Tokenizer
java.lang.Object
com.inductiveautomation.snap.parse.Tokenizer
- Direct Known Subclasses:
- JavaTokenizer
A class to extract tokens from a char sequence.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected intprotected intprotected int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddPattern(String aName, String aPattern, boolean isLiteral) Adds a pattern.voidaddPatterns(ParseRule aRule) Adds patterns to this tokenizer for given rule.charcharAt(int anIndex) CharSequence method.protected TokencreateToken(String aName, String aPattern, int aStart, int anEnd, Token aSpclTkn) Creates a new token.chargetChar()Returns the current parse char.intReturns the current parse char location.intReturns the current column index in the current line.intReturns the current column number.getInput()Returns the current tokenizer input.getInput(int aStart, int anEnd) Returns the input subsequence for the given range of characters in input.intReturns the current line index.intReturns the current line number.intReturns the current line start index.Regex[]getMatchers(char aChar) Returns list of matchers for a char.Processes and returns next special token.Returns the next token.protected Regex[]Returns the array of regexes (creating it if missing).protected voidGobble input characters until next non-whitespace or input end.intlength()CharSequence method.voidsetInput(CharSequence anInput) Sets the current tokenizer input.
- 
Field Details- 
_charIndexprotected int _charIndex
- 
_lineIndexprotected int _lineIndex
- 
_lineStartprotected int _lineStart
 
- 
- 
Constructor Details- 
Tokenizerpublic Tokenizer()
 
- 
- 
Method Details- 
getInputReturns the current tokenizer input.
- 
setInputSets the current tokenizer input.
- 
getInputReturns the input subsequence for the given range of characters in input.
- 
addPatternAdds a pattern.
- 
addPatternsAdds patterns to this tokenizer for given rule.
- 
getRegexesReturns the array of regexes (creating it if missing).
- 
charAtpublic char charAt(int anIndex) CharSequence method.
- 
lengthpublic int length()CharSequence method.
- 
getCharpublic char getChar()Returns the current parse char.
- 
getCharIndexpublic int getCharIndex()Returns the current parse char location.
- 
getLineIndexpublic int getLineIndex()Returns the current line index.
- 
getLineStartpublic int getLineStart()Returns the current line start index.
- 
getColumnIndexpublic int getColumnIndex()Returns the current column index in the current line.
- 
getLineNumberpublic int getLineNumber()Returns the current line number.
- 
getColumnNumberpublic int getColumnNumber()Returns the current column number.
- 
getNextTokenReturns the next token.
- 
getMatchersReturns list of matchers for a char.
- 
createTokenCreates a new token.
- 
getNextSpecialTokenProcesses and returns next special token.
- 
goobleWhiteSpaceprotected void goobleWhiteSpace()Gobble input characters until next non-whitespace or input end.
 
-