![]() |
KSquare Utilities
|
Class is meant to break down a stream into a set of logical tokens. More...
#include <Tokenizer.h>
Public Member Functions | |
| Tokenizer (TokenBufferPtr _in) | |
| Tokenizer (const KKStr &_str) | |
| Tokenizer (const KKStr &_fileName, bool &_fileOpened) | |
| ~Tokenizer () | |
| void | DefineOperatorChars (char *const _operatorChars) |
| bool | EndOfFile () |
| KKStrPtr | GetNextToken () |
| KKStrListPtr | GetNextTokens (const KKStr &delToken) |
| Returns a list of tokens up to and including the first occurrence of 'delToken'. More... | |
| KKStrConstPtr | operator[] (kkuint32 idx) |
| KKStrConstPtr | Peek (kkuint32 idx) |
| void | PushTokenOnFront (KKStrPtr t) |
Class is meant to break down a stream into a set of logical tokens.
This class was originally created while taking Non Linear Systems. It breaks up a source KKStr or text file into logical tokens. You can create your own source of characters by creating a Class derived from KKB::TokenBuffer.
Definition at line 23 of file Tokenizer.h.
| Tokenizer::Tokenizer | ( | TokenBufferPtr | _in | ) |
| Tokenizer::Tokenizer | ( | const KKStr & | _str | ) |
Definition at line 36 of file Tokenizer.cpp.
References KKB::TokenBufferStr::TokenBufferStr(), and Tokenizer().
Referenced by Tokenizer().
| Tokenizer::Tokenizer | ( | const KKStr & | _fileName, |
| bool & | _fileOpened | ||
| ) |
Definition at line 52 of file Tokenizer.cpp.
References KKB::TokenBufferStream::TokenBufferStream(), Tokenizer(), and KKB::TokenBuffer::Valid().
Referenced by Tokenizer().
| Tokenizer::~Tokenizer | ( | ) |
Definition at line 75 of file Tokenizer.cpp.
| void Tokenizer::DefineOperatorChars | ( | char *const | _operatorChars | ) |
| bool Tokenizer::EndOfFile | ( | ) |
Definition at line 175 of file Tokenizer.cpp.
| KKStrPtr Tokenizer::GetNextToken | ( | ) |
| KKStrListPtr Tokenizer::GetNextTokens | ( | const KKStr & | delToken | ) |
Returns a list of tokens up to and including the first occurrence of 'delToken'.
Will return a list of tokens up to and including the first occurrence if 'delToken'.
Caller will take ownership of the returned tokens, and be responsible for deleting them.
Definition at line 130 of file Tokenizer.cpp.
References KKB::KKStr::Empty(), GetNextToken(), KKB::KKStrList::KKStrList(), and KKB::KKStr::operator!=().
| KKStrConstPtr Tokenizer::operator[] | ( | kkuint32 | idx | ) |
Returns pointers to following Tokens in the stream where idx==0 indicates the next token.
Definition at line 419 of file Tokenizer.cpp.
References Peek().
| KKStrConstPtr Tokenizer::Peek | ( | kkuint32 | idx | ) |
| void Tokenizer::PushTokenOnFront | ( | KKStrPtr | t | ) |
Definition at line 154 of file Tokenizer.cpp.