Browse Source

minor updates of parsers

Former-commit-id: 0572366e05 [formerly 6c4c2e9154]
Former-commit-id: 5a2a185571
main
sjunges 9 years ago
parent
commit
2365f62f23
  1. 6
      src/parser/FormulaParser.cpp
  2. 5
      src/parser/FormulaParser.h
  3. 4
      src/parser/PgclParser.cpp
  4. 1
      src/parser/PrismParser.h

6
src/parser/FormulaParser.cpp

@ -17,6 +17,12 @@
namespace storm {
namespace parser {
FormulaParser::FormulaParser() : manager(new storm::expressions::ExpressionManager()), grammar(new FormulaParserGrammar(manager)) {
// Intentionally left empty.
}
FormulaParser::FormulaParser(std::shared_ptr<storm::expressions::ExpressionManager const> const& manager) : manager(manager), grammar(new FormulaParserGrammar(manager)) {
// Intentionally left empty.
}

5
src/parser/FormulaParser.h

@ -21,8 +21,9 @@ namespace storm {
class FormulaParser {
public:
FormulaParser(std::shared_ptr<storm::expressions::ExpressionManager const> const& manager);
FormulaParser(storm::prism::Program const& program);
FormulaParser();
explicit FormulaParser(std::shared_ptr<storm::expressions::ExpressionManager const> const& manager);
explicit FormulaParser(storm::prism::Program const& program);
FormulaParser(FormulaParser const& other);
FormulaParser& operator=(FormulaParser const& other);

4
src/parser/PgclParser.cpp

@ -80,9 +80,9 @@ namespace storm {
// Simple statements
doubleDeclaration = (qi::lit("double ") >> variableName)[qi::_val = phoenix::bind(&PgclParser::declareDoubleVariable, phoenix::ref(*this), qi::_1)];
integerDeclaration = (qi::lit("int ") >> variableName >> qi::lit(":=") >> expression >> qi::lit(";"))[qi::_val = phoenix::bind(&PgclParser::createIntegerDeclarationStatement, phoenix::ref(*this), qi::_1, qi::_2)];
integerDeclaration = (qi::lit("int ") > variableName > qi::lit(":=") > expression > qi::lit(";"))[qi::_val = phoenix::bind(&PgclParser::createIntegerDeclarationStatement, phoenix::ref(*this), qi::_1, qi::_2)];
integerDeclaration.name("integer declaration");
booleanDeclaration = (qi::lit("bool ") >> variableName >> qi::lit(":=") >> expression >> qi::lit(";"))[qi::_val = phoenix::bind(&PgclParser::createBooleanDeclarationStatement, phoenix::ref(*this), qi::_1, qi::_2)];
booleanDeclaration = (qi::lit("bool ") > variableName > qi::lit(":=") > expression > qi::lit(";"))[qi::_val = phoenix::bind(&PgclParser::createBooleanDeclarationStatement, phoenix::ref(*this), qi::_1, qi::_2)];
booleanDeclaration.name("boolean declaration");
assignmentStatement = (variableName > qi::lit(":=") > (expression | uniformExpression) > qi::lit(";"))[qi::_val = phoenix::bind(&PgclParser::createAssignmentStatement, phoenix::ref(*this), qi::_1, qi::_2)];

1
src/parser/PrismParser.h

@ -10,7 +10,6 @@
#include "src/parser/SpiritErrorHandler.h"
#include "src/storage/prism/Program.h"
#include "src/storage/expressions/Expression.h"
#include "src/storage/expressions/Expressions.h"
namespace storm {
namespace expressions {

Loading…
Cancel
Save