formula_tokenizer Namespace Reference


Classes

struct  token
struct  token_error

Typedefs

typedef std::string::const_iterator iterator

Enumerations

enum  TOKEN_TYPE {
  TOKEN_OPERATOR, TOKEN_STRING_LITERAL, TOKEN_IDENTIFIER, TOKEN_INTEGER,
  TOKEN_LPARENS, TOKEN_RPARENS, TOKEN_LSQUARE, TOKEN_RSQUARE,
  TOKEN_LBRACKET, TOKEN_RBRACKET, TOKEN_COMMA, TOKEN_SEMICOLON,
  TOKEN_WHITESPACE, TOKEN_KEYWORD, TOKEN_COMMENT, TOKEN_POINTER
}

Functions

token get_token (iterator &i1, iterator i2)

Variables

token_type token_types []


Typedef Documentation

typedef std::string::const_iterator formula_tokenizer::iterator

Definition at line 22 of file formula_tokenizer.hpp.


Enumeration Type Documentation

Enumerator:
TOKEN_OPERATOR 
TOKEN_STRING_LITERAL 
TOKEN_IDENTIFIER 
TOKEN_INTEGER 
TOKEN_LPARENS 
TOKEN_RPARENS 
TOKEN_LSQUARE 
TOKEN_RSQUARE 
TOKEN_LBRACKET 
TOKEN_RBRACKET 
TOKEN_COMMA 
TOKEN_SEMICOLON 
TOKEN_WHITESPACE 
TOKEN_KEYWORD 
TOKEN_COMMENT 
TOKEN_POINTER 

Definition at line 24 of file formula_tokenizer.hpp.


Function Documentation

token formula_tokenizer::get_token ( iterator &  i1,
iterator  i2 
)


Variable Documentation

token_type formula_tokenizer::token_types[] [static]

Initial value:

 { { regex("^(not\\b|and\\b|or\\b|where\\b|d(?=[^a-zA-Z])|\\*|\\+|-(?=[^>])|\\^|%|/|<=|>=|<|>|!=|=|\\.)"), TOKEN_OPERATOR },
                { regex("^functions\\b"),  TOKEN_KEYWORD },
                { regex("^def\\b"),        TOKEN_KEYWORD },
                { regex("^'[^']*'"),       TOKEN_STRING_LITERAL },
                { regex("^[a-zA-Z_]+"),    TOKEN_IDENTIFIER },
                { regex("^\\d+"),          TOKEN_INTEGER },
                { regex("^\\("),           TOKEN_LPARENS },
                { regex("^\\)"),           TOKEN_RPARENS },
                { regex("^\\["),           TOKEN_LSQUARE },
                { regex("^\\]"),           TOKEN_RSQUARE },
                { regex("^\\{"),           TOKEN_LBRACKET },
                { regex("^\\}"),           TOKEN_RBRACKET },
                { regex("^#.*?#"),     TOKEN_COMMENT },
                { regex("^,"),             TOKEN_COMMA },
                { regex("^;"),             TOKEN_SEMICOLON },
                { regex("^\\s+"),          TOKEN_WHITESPACE },
                { regex("^->"),          TOKEN_POINTER }
}

Definition at line 34 of file formula_tokenizer.cpp.

Referenced by get_token().


Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs