Inherits: ITokenizer
Description
The AbstractTokenizer class defines a general tokenizer.
Fields
Properties
NextToken
Next token
publicToken NextToken()
Scanner
Scanner
publicIScanner Scanner { get; set; }
CommentState
Comment state
publicICommentState CommentState { get; set; }
DecodeStrings
Boolean that defines the option to decode strings or not.
publicbool DecodeStrings { get; set; }
MergeWhitespaces
Boolean that defines the option to unify white spaces.
publicbool MergeWhitespaces { get; set; }
NumberState
Number state
publicINumberState NumberState { get; set; }
QuoteState
Quote state
publicIQuoteState QuoteState { get; set; }
SkipComments
Boolean that defines the option to skip comments.
publicbool SkipComments { get; set; }
SkipEof
Boolean that defines the option to skip EOF.
publicbool SkipEof { get; set; }
SkipUnknown
Boolean that defines the option to skip unknowns.
publicbool SkipUnknown { get; set; }
SkipWhitespaces
Boolean that defines the option to skip white spaces.
publicbool SkipWhitespaces { get; set; }
SymbolState
Symbol state
publicISymbolState SymbolState { get; set; }
UnifyNumbers
Boolean that defines the option to unify numbers.
publicbool UnifyNumbers { get; set; }
WhitespaceState
White space state.
publicIWhitespaceState WhitespaceState { get; set; }
WordState
Word state.
publicIWordState WordState { get; set; }
Instance methods
ClearCharacterStates
Clears all character states.
publicvoid ClearCharacterStates()
GetCharacterState
Gest the state for a given character.
publicITokenizerState GetCharacterState(char symbol)
- symbol: char - symbol
- returns: ITokenizerState - tokenizer state
HasNextToken
Finds out if the tokenizer has a next token.
publicbool HasNextToken()
- returns: bool - true if it has a next token, false otherwise.
NextToken
Gets the next token.
publicToken NextToken()
- returns: Token - next token
ReadNextToken
Reads the next token.
protected virtualToken ReadNextToken()
- returns: Token - next token
SetCharacterState
Sets the characters' state.
publicvoid SetCharacterState(char fromSymbol, char toSymbol, ITokenizerState state)
- fromSymbol: char - first symbol
- toSymbol: char - last symbol
- state: ITokenizerState - tokenizer state
TokenizeBuffer
Provides a token for a string buffer.
publicIList<Token> TokenizeBuffer(string buffer)
- buffer: string - buffer
- returns: Token - token
TokenizeBufferToStrings
Creates a list of token values.
publicIList<string> TokenizeBufferToStrings(string buffer)
- buffer: string - buffer
- returns: IList<string> - list of token values
TokenizeStream
Creates a list of tokens
TokenizeStreamToStrings
Creates a list of token values.
publicIList<string> TokenizeStreamToStrings(IScanner scanner)
- scanner: IScanner - scanner
- returns: IList<string> - list of token values