SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
SExpression.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Common.h"
4 #include "Lexicon.h"
5 
6 #include "theories/Theories.h"
7 
8 namespace smtrat {
9 namespace parser {
10 
11 struct SpecConstantParser: public qi::grammar<Iterator, types::ConstType(), Skipper> {
12  SpecConstantParser(): SpecConstantParser::base_type(main, "spec_constant") {
14  main = decimal | numeral | hexadecimal | binary | string | theoryConst;
15  }
21 
22  qi::symbols<char, types::ConstType> theoryConst;
23 
25 };
26 
27 struct SExpressionParser: public qi::grammar<Iterator, SExpression<types::ConstType>(), Skipper> {
28  SExpressionParser(): SExpressionParser::base_type(main, "sexpression") {
29  main =
30  specconstant[qi::_val = qi::_1]
31  | symbol[qi::_val = qi::_1]
32  | keyword[qi::_val = qi::_1]
33  | (qi::lit("(") >> *main >> qi::lit(")"))[qi::_val = px::construct<SExpressionSequence<types::ConstType>>(qi::_1)]
34  ;
35  }
39  qi::rule<Iterator, SExpression<types::ConstType>(), Skipper> main;
40 };
41 
42 }
43 }
carl::mpl_variant_of< ConstTypes >::type ConstType
Variant type for all constants.
Definition: TheoryTypes.h:118
PositionIteratorType Iterator
Definition: Common.h:49
Class to create the formulas for axioms.
Parses binaries: #b[01]+
Definition: Lexicon.h:51
Parses decimals: numeral.0*numeral
Definition: Lexicon.h:29
Parses hexadecimals: #x[0-9a-fA-F]+
Definition: Lexicon.h:34
Parses keywords: :simple_symbol
Definition: Lexicon.h:111
Parses numerals: (0 | [1-9][0-9]*)
Definition: Lexicon.h:24
qi::rule< Iterator, SExpression< types::ConstType >), Skipper > main
Definition: SExpression.h:39
SpecConstantParser specconstant
Definition: SExpression.h:36
qi::rule< Iterator, types::ConstType(), Skipper > main
Definition: SExpression.h:24
qi::symbols< char, types::ConstType > theoryConst
Definition: SExpression.h:22
Parses strings: ".+" with escape sequences \\" and \\\\
Definition: Lexicon.h:68
static void addConstants(qi::symbols< char, types::ConstType > &constants)
Collects constants from all theory modules.
Definition: Theories.h:82