summaryrefslogtreecommitdiff
path: root/impl/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'impl/main.cpp')
-rw-r--r--impl/main.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/impl/main.cpp b/impl/main.cpp
index b1d6984..6fbbda9 100644
--- a/impl/main.cpp
+++ b/impl/main.cpp
@@ -65,7 +65,8 @@ Expression<T>& treeToExpression(pANTLR3_BASE_TREE node, EquationSystem<T>& syste
} else if (name == "GUARD") {
op = new Guard<T>();
} else {
- throw "Parse error: Unknown operator";
+ std::cout << "throw exception" << *(char*)NULL;
+ //throw "Parse error: Unknown operator";
}
return system.expression(op, args);
}
@@ -75,8 +76,10 @@ template<typename T>
void treeToSystem(pANTLR3_BASE_TREE node, EquationSystem<T>& system) {
ANTLR3_UINT32 num = node->getChildCount(node);
- if (num % 2 == 1)
- throw "Big problem here.";
+ if (num % 2 == 1) {
+ std::cout << "throw exception" << *(char*)NULL;
+ //throw "Big problem here.";
+ }
pANTLR3_BASE_TREE varNode;
pANTLR3_BASE_TREE exprNode;
@@ -122,12 +125,12 @@ int main (int argc, char* argv[]) {
}
}
- auto input = antlr3FileStreamNew((pANTLR3_UINT8)argv[1], ANTLR3_ENC_8BIT);
- auto lex = EquationSystemLexerNew(input);
- auto tokens = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, TOKENSOURCE(lex));
- auto parser = EquationSystemParserNew(tokens);
+ pANTLR3_INPUT_STREAM input = antlr3FileStreamNew((pANTLR3_UINT8)argv[1], ANTLR3_ENC_8BIT);
+ pEquationSystemLexer lex = EquationSystemLexerNew(input);
+ pANTLR3_COMMON_TOKEN_STREAM tokens = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, TOKENSOURCE(lex));
+ pEquationSystemParser parser = EquationSystemParserNew(tokens);
- auto ret = parser -> equation_system(parser);
+ EquationSystemParser_equation_system_return ret = parser -> equation_system(parser);
EquationSystem<ZBar> system;
treeToSystem<ZBar>(ret.tree, system);