Single argument token.
Single argument token.
All command arguments are split into tokens by the parser. Each token is returned as an Token instance.
|
Public Types
|
enum |
TokenType {
None = 0, PathSeparator = 0x0001, ArgumentGroupOpen = 0x0002, ArgumentGroupClose = 0x0004,
DirectoryGroupOpen = 0x0008, DirectoryGroupClose = 0x0010, CommandTerminator = 0x0020, OtherPunctuation = 0x0040,
BasicString = 0x0080, HexString = 0x0100, Word = 0x0200
} |
enum |
TokenGroup {
ArgumentGrouper, DirectoryGrouper, Punctuation, String,
SimpleArgument
} |
Public Member Functions
|
|
Token () |
|
Create empty token.
|
|
Token (TokenType type, std::string token) |
|
Create token with given type and value.
|
|
Token (TokenType type, std::string token, detail::FilePositionWithIndex const &pos) |
|
Create token with given type and value.
|
std::string const & |
value () const |
|
String value of token.
|
TokenType |
type () const |
|
Token type.
|
unsigned |
line () const |
|
Line number of token in source.
|
unsigned |
column () const |
|
Column number of token in source.
|
unsigned |
index () const |
|
Index (char count) of token in source.
|
bool |
is (unsigned tokens) const |
|
Check, whether tokens type matches tokens.
|
bool |
operator== (Token const &other) const |
bool |
operator!= (Token const &other) const |
Related Functions
|
(Note that these are not member functions.)
|
Token |
NoneToken () |
|
Create a None token.
|
Token |
PathSeparatorToken () |
|
Create a PathSeparator ['/'] token.
|
Token |
ArgumentGroupOpenToken () |
|
Create an ArgumentGroupOpen ['('] token.
|
Token |
ArgumentGroupCloseToken () |
|
Create a ArgumentGroupClose [')'] token.
|
Token |
DirectoryGroupOpenToken () |
|
Create a DirectoryGroupOpen ['{'] token.
|
Token |
DirectoryGroupCloseToken () |
|
Create a DirectoryGroupClose ['}'] token.
|
Token |
CommandTerminatorToken () |
|
Create a CommandTerminator [';'] token.
|
Token |
OtherPunctuationToken (std::string const &value) |
|
Create a OtherPunctuation ['=', ','] token with the given value.
|
Token |
BasicStringToken (std::string const &value) |
|
Create a BasicString token with the given value.
|
Token |
HexStringToken (std::string const &value) |
|
Create a HexString token with the given value.
|
Token |
WordToken (std::string const &value) |
|
Create a Word token with the given value.
|