From cf2aa4c9d70fc8ed658c213b2c46bb48ee10e6f7 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Sun, 20 Oct 2013 00:10:54 +0200 Subject: Implemented constant identifier functionality * SimpleParser optionally acceps a pointer to an ConstantMap containing string keys mapping to values * Constants are handled in their own ConstantNode class derived from the standard Node class * Operator precedence is now determined separated from the TokenType using a new PrecedenceLevel enum ** Conversion between tokens and their PrecedenceLevel is possible using the new utility function getPrecedence * Added additional test cases for constant identifier resolutions --- src/exceptions.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/exceptions.h') diff --git a/src/exceptions.h b/src/exceptions.h index cd76368..b17f424 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -24,6 +24,13 @@ class divide_exception: public std::exception { } }; +class identifier_exception: public std::exception { + virtual const char* what() const throw() + { + return "Identifier could not be correctly resolved."; + } +}; + } #endif // PARSER_SRC_EXCEPTIONS_H_ -- cgit v1.2.3