46 template <
typename Iterator>
49 using boost::spirit::qi::double_;
50 using boost::spirit::qi::_1;
51 using boost::spirit::qi::phrase_parse;
52 using boost::spirit::ascii::space;
53 using boost::phoenix::ref;
58 bool r = phrase_parse(first, last,
63 if (!r || first != last)
85 std::string cleaned = input;
93 std::string::const_iterator iter = cleaned.begin();
94 std::string::const_iterator end = cleaned.end();
96 bool s = phrase_parse(iter, end, S,boost::spirit::ascii::space, sys);
100 std::string remaining(iter, end);
101 if (remaining.size() > 60)
102 remaining = remaining.substr(0, 60) +
"...";
103 if (remaining.empty())
104 remaining =
"<end of input>";
105 throw std::runtime_error(
106 "[SystemParser] parser did not consume entire input; "
107 "unparsed remainder: \"" + remaining +
"\"");
The fundamental polynomial system class for Bertini2.
Definition system.hpp:106
friend void swap(System &a, System &b)
The free swap function for systems.
System()
The default constructor for a system.
Definition system.hpp:117
Definition classic_utilities.hpp:41
void StripUTF8BOM(std::string &s)
Strip a leading UTF-8 byte-order mark (EF BB BF) from s in place, if present.
Definition qi_files.hpp:74
void StripClassicComments(std::string &s)
Remove Bertini 1 comments from s in place: everything from a % to the end of its line.
Definition qi_files.hpp:91
void StripClassicFileWrappers(std::string &s)
Unwrap a Bertini 1 classic input FILE down to the declarations the grammar reads.
Definition qi_files.hpp:125
bool parse(Iterator first, Iterator last, std::shared_ptr< bertini::node::Node > &func)
Parse a function expression from the iterator range into a node tree.
Definition function_parsers.hpp:46
Definition classic_utilities.hpp:40
Definition algorithm_builder.hpp:36
Qi Parser object for parsing text into the System class.
Definition system_rules.hpp:79
void EmitDeclaredFunctions(System &s) const
Emit the collected declared functions/constants/parameters to the System.
Definition system_rules.hpp:428
Provides the parsing rules for systems in bertini2.