summaryrefslogtreecommitdiff
path: root/src/parser/antlr_parser.h
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-02-16 19:35:34 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-02-16 19:35:34 +0000
commit421446830d238e4a82fb0407621b2876b6e46a74 (patch)
tree29badf8de1a2603bbc9e4af6da45ee113f46bfa8 /src/parser/antlr_parser.h
parentbe1edc45cd31ea61ebb80641ae90c96c46a532ea (diff)
Moving parser error checking into AntlrParser
Diffstat (limited to 'src/parser/antlr_parser.h')
-rw-r--r--src/parser/antlr_parser.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/parser/antlr_parser.h b/src/parser/antlr_parser.h
index eec444af9..52b4b4490 100644
--- a/src/parser/antlr_parser.h
+++ b/src/parser/antlr_parser.h
@@ -147,14 +147,32 @@ protected:
* Return true if the the declaration policy we want to enforce holds
* for the given symbol.
* @param name the symbol to check
- * @oaram check the kind of check to perform
+ * @param check the kind of check to perform
* @param type the type of the symbol
* @return true if the check holds
+ * @throws SemanticException if the check fails
*/
bool checkDeclaration(std::string name,
DeclarationCheck check,
- SymbolType type = SYM_VARIABLE);
+ SymbolType type = SYM_VARIABLE)
+ throw (antlr::SemanticException);
+ /**
+ * Returns true if the given name is bound to a function.
+ * @param name the name to check
+ * @return true if name is bound to a function
+ * @throws SemanticException if name is not bound to a function
+ */
+ bool checkFunction(std::string name) throw (antlr::SemanticException);
+
+ /**
+ * Check that <code>kind</code> can accept <code>numArgs</codes> arguments.
+ * @param kind the built-in operator to check
+ * @param numArgs the number of actual arguments
+ * @throws SemanticException if the operator <code>kind</code> cannot be
+ * applied to <code>numArgs</code> arguments.
+ */
+ bool checkArity(Kind kind, unsigned int numArgs) throw (antlr::SemanticException);
/**
* Returns the type for the variable with the given name.
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback