summaryrefslogtreecommitdiff
path: root/src/parser/cvc
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-04-01 19:55:45 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-04-01 19:55:45 +0000
commited25d7b7527691442ab48d02353e20c87ab8e2da (patch)
treeaf5aef20666cba7da52c74c57a8cadae5081ae92 /src/parser/cvc
parentbc05271730c9bbd096a6dbace366016529933246 (diff)
Parser tweaks to address review
Private members of Input moved to new class ParserState
Diffstat (limited to 'src/parser/cvc')
-rw-r--r--src/parser/cvc/Cvc.g23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/parser/cvc/Cvc.g b/src/parser/cvc/Cvc.g
index feb2e6d35..8b8f251ae 100644
--- a/src/parser/cvc/Cvc.g
+++ b/src/parser/cvc/Cvc.g
@@ -48,7 +48,7 @@ options {
@parser::includes {
#include "expr/command.h"
-#include "parser/input.h"
+#include "parser/parser_state.h"
namespace CVC4 {
class Expr;
@@ -60,6 +60,7 @@ namespace CVC4 {
#include "expr/kind.h"
#include "expr/type.h"
#include "parser/antlr_input.h"
+#include "parser/parser_state.h"
#include "util/output.h"
#include <vector>
@@ -68,10 +69,10 @@ using namespace CVC4::parser;
/* These need to be macros so they can refer to the PARSER macro, which will be defined
* by ANTLR *after* this section. (If they were functions, PARSER would be undefined.) */
-#undef ANTLR_INPUT
-#define ANTLR_INPUT ((Input*)PARSER->super)
+#undef PARSER_STATE
+#define PARSER_STATE ((ParserState*)PARSER->super)
#undef EXPR_MANAGER
-#define EXPR_MANAGER ANTLR_INPUT->getExprManager()
+#define EXPR_MANAGER PARSER_STATE->getExprManager()
#undef MK_EXPR
#define MK_EXPR EXPR_MANAGER->mkExpr
#undef MK_CONST
@@ -136,10 +137,10 @@ declType[CVC4::Type*& t, std::vector<std::string>& idList]
}
: /* A sort declaration (e.g., "T : TYPE") */
TYPE_TOK
- { ANTLR_INPUT->newSorts(idList);
+ { PARSER_STATE->newSorts(idList);
t = EXPR_MANAGER->kindType(); }
| /* A variable declaration */
- type[t] { ANTLR_INPUT->mkVars(idList,t); }
+ type[t] { PARSER_STATE->mkVars(idList,t); }
;
/**
@@ -190,7 +191,7 @@ identifier[std::string& id,
CVC4::parser::SymbolType type]
: IDENTIFIER
{ id = AntlrInput::tokenText($IDENTIFIER);
- ANTLR_INPUT->checkDeclaration(id, check, type); }
+ PARSER_STATE->checkDeclaration(id, check, type); }
;
/**
@@ -215,7 +216,7 @@ typeSymbol[CVC4::Type*& t]
Debug("parser-extra") << "type symbol: " << AntlrInput::tokenText(LT(1)) << std::endl;
}
: identifier[id,CHECK_DECLARED,SYM_SORT]
- { t = ANTLR_INPUT->getSort(id); }
+ { t = PARSER_STATE->getSort(id); }
;
/**
@@ -376,7 +377,7 @@ term[CVC4::Expr& f]
| /* variable */
identifier[name,CHECK_DECLARED,SYM_VARIABLE]
- { f = ANTLR_INPUT->getVariable(name); }
+ { f = PARSER_STATE->getVariable(name); }
;
/**
@@ -420,8 +421,8 @@ functionSymbol[CVC4::Expr& f]
std::string name;
}
: identifier[name,CHECK_DECLARED,SYM_VARIABLE]
- { ANTLR_INPUT->checkFunction(name);
- f = ANTLR_INPUT->getVariable(name); }
+ { PARSER_STATE->checkFunction(name);
+ f = PARSER_STATE->getVariable(name); }
;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback