amath
1.8.5
Simple command line calculator
|
Tokens are created by the Lexical Analyzer and provides an intermediate state for input consumed by the parser. More...
#include <token.h>
Public Member Functions | |
Token (Token *last, Symbol symbol, int pos) | |
Token (Token *last, Symbol symbol, const char *text, int pos) | |
~Token () | |
int | GetPos () const |
char * | GetText () const |
Token * | GetLastToken () const |
Token * | GetNextToken () |
Public Attributes | |
Symbol | symbol |
Private Attributes | |
int | pos |
char * | text |
Token * | last |
Token * | next |
Friends | |
class | Lexer |
Tokens are created by the Lexical Analyzer and provides an intermediate state for input consumed by the parser.
Definition at line 37 of file token.cpp.
References last, next, pos, symbol, and text.
Referenced by Lexer::GetLiteral(), GetNextToken(), Lexer::GetNextToken(), and Lexer::GetOperator().
Definition at line 46 of file token.cpp.
References AllocAndCopy(), last, next, pos, symbol, and text.
Referenced by Lexer::GetDigitValue(), Lexer::GetLiteral(), and Lexer::GetQuotedIdent().
Token * Token::GetLastToken | ( | ) | const |
Definition at line 68 of file token.cpp.
References last.
Referenced by Parser::PutToken().
Token * Token::GetNextToken | ( | ) |
Definition at line 73 of file token.cpp.
References next, pos, symend, and Token().
Referenced by Parser::GetToken(), and Parser::Peek().
int Token::GetPos | ( | ) | const |
Definition at line 89 of file token.cpp.
References pos.
Referenced by Parser::Expect(), Parser::Parse(), Parser::ParseAtomic(), Parser::ParseDeleteStatement(), Parser::ParseDigistStatement(), Parser::ParseFileStatement(), Parser::ParseFunctionDef(), Parser::ParseIdent(), Parser::ParseListStatement(), and Parser::ParseNumeralStatement().
char * Token::GetText | ( | ) | const |
Definition at line 84 of file token.cpp.
References text.
Referenced by Parser::ParseDeleteStatement(), Parser::ParseDigistStatement(), Parser::ParseDrawStatement(), Parser::ParseFileStatement(), Parser::ParseFunctionDef(), Parser::ParseHelpStatement(), Parser::ParseIdent(), Parser::ParseListStatement(), Parser::ParseNumber(), Parser::ParseNumeralStatement(), and Parser::ParsePromptStatement().
|
private |
Definition at line 62 of file token.h.
Referenced by GetLastToken(), and Token().
|
private |
Definition at line 63 of file token.h.
Referenced by GetNextToken(), Token(), Lexer::Tokenize(), and ~Token().
|
private |
Definition at line 60 of file token.h.
Referenced by GetNextToken(), GetPos(), and Token().
Symbol Token::symbol |
Definition at line 53 of file token.h.
Referenced by Parser::Expect(), Parser::Parse(), Parser::ParseAddSubstract(), Parser::ParseAtomic(), Parser::ParseDeleteStatement(), Parser::ParseDigistStatement(), Parser::ParseDrawStatement(), Parser::ParseFactor(), Parser::ParseFileStatement(), Parser::ParseHelpStatement(), Parser::ParseIdent(), Parser::ParseListStatement(), Parser::ParseNumber(), Parser::ParseNumeralStatement(), Parser::ParsePower(), Parser::ParsePrefsStatement(), Parser::ParsePromptStatement(), Parser::ParseStatement(), Parser::ParseUnary(), Token(), Lexer::Tokenize(), and Parser::TryParseStatement().
|
private |