2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-06 08:55:13 +00:00
Files
kea/src/lib/eval/eval_context.h

48 lines
1.0 KiB
C
Raw Normal View History

#ifndef EVAL_CONTEXT_H
#define EVAL_CONTEXT_H
2015-10-28 20:13:59 +01:00
# include <string>
# include <map>
# include "parser.h"
// Tell Flex the lexer's prototype ...
# define YY_DECL \
2015-10-28 20:53:40 +01:00
isc::eval::EvalParser::symbol_type yylex (EvalContext& driver)
2015-10-28 20:13:59 +01:00
// ... and declare it for the parser's sake.
YY_DECL;
// Conducting the whole scanning and parsing of Calc++.
class EvalContext
2015-10-28 20:13:59 +01:00
{
public:
EvalContext ();
virtual ~EvalContext ();
2015-10-28 20:13:59 +01:00
std::map<std::string, int> variables;
int result;
// Handling the scanner.
void scan_begin ();
void scan_end ();
bool trace_scanning;
// Run the parser on file F.
// Return 0 on success.
int parseFile(const std::string& filename);
int parseString(const std::string& str);
2015-10-28 20:13:59 +01:00
// The name of the file being parsed.
// Used later to pass the file name to the location tracker.
std::string file;
// Whether parser traces should be generated.
bool trace_parsing;
// Error handling.
2015-10-28 20:53:40 +01:00
void error (const isc::eval::location& l, const std::string& m);
2015-10-28 20:13:59 +01:00
void error (const std::string& m);
};
#endif // ! EVALCONTEXT_HH