aboutsummaryrefslogtreecommitdiff
path: root/src/exceptions.h
diff options
context:
space:
mode:
authorAdrian Kummerländer2013-10-20 00:10:54 +0200
committerAdrian Kummerländer2013-10-20 00:10:54 +0200
commitcf2aa4c9d70fc8ed658c213b2c46bb48ee10e6f7 (patch)
tree02eda2354acb6462977cf9c6babcbd62b446d0e2 /src/exceptions.h
parent2b5ed18ae11439897a64708a434e5d7a6edac91e (diff)
downloadSimpleParser-cf2aa4c9d70fc8ed658c213b2c46bb48ee10e6f7.tar
SimpleParser-cf2aa4c9d70fc8ed658c213b2c46bb48ee10e6f7.tar.gz
SimpleParser-cf2aa4c9d70fc8ed658c213b2c46bb48ee10e6f7.tar.bz2
SimpleParser-cf2aa4c9d70fc8ed658c213b2c46bb48ee10e6f7.tar.lz
SimpleParser-cf2aa4c9d70fc8ed658c213b2c46bb48ee10e6f7.tar.xz
SimpleParser-cf2aa4c9d70fc8ed658c213b2c46bb48ee10e6f7.tar.zst
SimpleParser-cf2aa4c9d70fc8ed658c213b2c46bb48ee10e6f7.zip
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
Diffstat (limited to 'src/exceptions.h')
-rw-r--r--src/exceptions.h7
1 files changed, 7 insertions, 0 deletions
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_