Class Tokenizer
- java.lang.Object
- 
- com.inductiveautomation.snap.parse.Tokenizer
 
- 
- Direct Known Subclasses:
- JavaTokenizer
 
 public class Tokenizer extends java.lang.ObjectA class to extract tokens from a char sequence.
- 
- 
Field SummaryFields Modifier and Type Field Description protected int_charIndexprotected int_lineIndexprotected int_lineStart
 - 
Constructor SummaryConstructors Constructor Description Tokenizer()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPattern(java.lang.String aName, java.lang.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(java.lang.String aName, java.lang.String aPattern, int aStart, int anEnd, Token aSpclTkn)Creates a new token.chargetChar()Returns the current parse char.intgetCharIndex()Returns the current parse char location.intgetColumnIndex()Returns the current column index in the current line.intgetColumnNumber()Returns the current column number.java.lang.CharSequencegetInput()Returns the current tokenizer input.java.lang.CharSequencegetInput(int aStart, int anEnd)Returns the input subsequence for the given range of characters in input.intgetLineIndex()Returns the current line index.intgetLineNumber()Returns the current line number.intgetLineStart()Returns the current line start index.Regex[]getMatchers(char aChar)Returns list of matchers for a char.TokengetNextSpecialToken()Processes and returns next special token.TokengetNextToken()Returns the next token.protected Regex[]getRegexes()Returns the array of regexes (creating it if missing).protected voidgoobleWhiteSpace()Gobble input characters until next non-whitespace or input end.intlength()CharSequence method.voidsetInput(java.lang.CharSequence anInput)Sets the current tokenizer input.
 
- 
- 
- 
Method Detail- 
getInputpublic java.lang.CharSequence getInput() Returns the current tokenizer input.
 - 
setInputpublic void setInput(java.lang.CharSequence anInput) Sets the current tokenizer input.
 - 
getInputpublic java.lang.CharSequence getInput(int aStart, int anEnd)Returns the input subsequence for the given range of characters in input.
 - 
addPatternpublic void addPattern(java.lang.String aName, java.lang.String aPattern, boolean isLiteral)Adds a pattern.
 - 
addPatternspublic void addPatterns(ParseRule aRule) Adds patterns to this tokenizer for given rule.
 - 
getRegexesprotected Regex[] getRegexes() Returns 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.
 - 
getNextTokenpublic Token getNextToken() Returns the next token.
 - 
getMatcherspublic Regex[] getMatchers(char aChar) Returns list of matchers for a char.
 - 
createTokenprotected Token createToken(java.lang.String aName, java.lang.String aPattern, int aStart, int anEnd, Token aSpclTkn) Creates a new token.
 - 
getNextSpecialTokenpublic Token getNextSpecialToken() Processes and returns next special token.
 - 
goobleWhiteSpaceprotected void goobleWhiteSpace() Gobble input characters until next non-whitespace or input end.
 
- 
 
-