1 #ifndef COMPILER_PARSER_H_INCLUDED
2 #define COMPILER_PARSER_H_INCLUDED
41 static std::string
toLower (
const std::string&
name);
virtual bool parseFloat(float value, const TokenLoc &loc, Scanner &scanner)
Definition: parser.cpp:87
void message(CodeContainer &code, Literals &literals, const std::string &message, int buttons)
Definition: generator.cpp:537
virtual bool parseKeyword(int keyword, const TokenLoc &loc, Scanner &scanner)
Definition: parser.cpp:118
virtual void reset()
Reset parser to clean state.
Definition: parser.cpp:157
void setOptional(bool optional)
Definition: parser.cpp:163
Definition: context.hpp:10
Location of a token in a source file.
Definition: tokenloc.hpp:10
static std::string toLower(const std::string &name)
Definition: parser.cpp:52
Error handling.
Definition: errorhandler.hpp:14
void reportEOF()
Report an unexpected EOF condition.
Definition: parser.cpp:32
virtual void parseEOF(Scanner &scanner)
Definition: parser.cpp:152
virtual bool parseName(const std::string &name, const TokenLoc &loc, Scanner &scanner)
Definition: parser.cpp:102
bool mOptional
Definition: parser.hpp:21
ErrorHandler & getErrorHandler()
Return error handler.
Definition: parser.cpp:40
ErrorHandler & mErrorHandler
Definition: parser.hpp:19
virtual bool parseSpecial(int code, const TokenLoc &loc, Scanner &scanner)
Definition: parser.cpp:133
Parser(ErrorHandler &errorHandler, const Context &context)
constructor
Definition: parser.cpp:59
const Context & getContext() const
Return context.
Definition: parser.cpp:47
const Context & mContext
Definition: parser.hpp:20
virtual ~Parser()
destructor
Definition: parser.cpp:65
int code
Definition: crashcatcher.cpp:70
void reportSeriousError(const std::string &message, const TokenLoc &loc)
Report the error and throw a exception.
Definition: parser.cpp:17
virtual bool parseComment(const std::string &comment, const TokenLoc &loc, Scanner &scanner)
Definition: parser.cpp:143
virtual bool parseInt(int value, const TokenLoc &loc, Scanner &scanner)
Definition: parser.cpp:72
Parser base class.
Definition: parser.hpp:17
bool isEmpty() const
Has anything been parsed?
Definition: parser.cpp:173
bool mEmpty
Definition: parser.hpp:22
void reportWarning(const std::string &message, const TokenLoc &loc)
Report the warning without throwing an exception.
Definition: parser.cpp:25
void start()
Mark parser as non-empty (at least one token has been parser).
Definition: parser.cpp:168
Scanner.
Definition: scanner.hpp:21
const char * name
Definition: crashcatcher.cpp:59