summaryrefslogtreecommitdiff
path: root/src/parser/cvc/cvc_parser.g
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/cvc/cvc_parser.g
parentbe1edc45cd31ea61ebb80641ae90c96c46a532ea (diff)
Moving parser error checking into AntlrParser
Diffstat (limited to 'src/parser/cvc/cvc_parser.g')
-rw-r--r--src/parser/cvc/cvc_parser.g16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/parser/cvc/cvc_parser.g b/src/parser/cvc/cvc_parser.g
index 926430a5c..e953244df 100644
--- a/src/parser/cvc/cvc_parser.g
+++ b/src/parser/cvc/cvc_parser.g
@@ -153,15 +153,8 @@ identifier[DeclarationCheck check = CHECK_NONE,
SymbolType type = SYM_VARIABLE]
returns [std::string id]
: x:IDENTIFIER
- { id = x->getText(); }
- { checkDeclaration(id, check, type) }?
- exception catch [antlr::SemanticException& ex] {
- switch (check) {
- case CHECK_DECLARED: parseError("Symbol " + id + " not declared");
- case CHECK_UNDECLARED: parseError("Symbol " + id + " already declared");
- default: throw ex;
- }
- }
+ { id = x->getText();
+ AlwaysAssert( checkDeclaration(id, check, type) ); }
;
/**
@@ -388,9 +381,6 @@ functionSymbol[DeclarationCheck check = CHECK_NONE] returns [CVC4::Expr f]
std::string name;
}
: name = identifier[check,SYM_FUNCTION]
- { AlwaysAssert( isFunction(name) );
+ { AlwaysAssert( checkFunction(name) );
f = getFunction(name); }
- exception catch [CVC4::AssertionException& ex] {
- parseError("Expected function symbol, found: " + name);
- }
;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback