Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
ParserJit< Iterator > Struct Template Reference
Inheritance diagram for ParserJit< Iterator >:
Collaboration diagram for ParserJit< Iterator >:

Public Member Functions

 ParserJit ()
 

Public Attributes

boost::spirit::qi::rule< Iterator, boost::spirit::ascii::space_type > expression
 
boost::spirit::qi::rule< Iterator, boost::spirit::ascii::space_type > term
 
boost::spirit::qi::rule< Iterator, boost::spirit::ascii::space_type > factor
 
Jit code_
 

Detailed Description

template<typename Iterator>
struct ParserJit< Iterator >

Definition at line 228 of file calc2.cpp.

Constructor & Destructor Documentation

◆ ParserJit()

template<typename Iterator >
ParserJit< Iterator >::ParserJit ( )
inline

Definition at line 231 of file calc2.cpp.

232 : ParserJit::base_type(expression)
233 {
234 namespace qi = boost::spirit::qi;
235 using namespace qi::labels;
236
237 using boost::phoenix::ref;
238 using boost::phoenix::push_back;
239 using boost::phoenix::bind;
240
241 expression = term >> *(('+' > term[bind(&Jit::genAdd, ref(code_))])
242 | ('-' > term[bind(&Jit::genSub, ref(code_))]));
243
244 term = factor >> *(('*' > factor[bind(&Jit::genMul, ref(code_))])
245 | ('/' > factor[bind(&Jit::genDiv, ref(code_))]));
246
247 factor = qi::double_[bind(&Jit::genPush, ref(code_), _1)]
248 | qi::lit('x')[bind(&Jit::genVarX, ref(code_))]
249 | ('(' > expression > ')')
250 | ('-' > factor[bind(&Jit::genNeg, ref(code_))])
251 | ('+' > factor);
252 }
void genAdd()
Definition calc2.cpp:162
void genVarX()
Definition calc2.cpp:152
void genPush(double n)
Definition calc2.cpp:144
void genMul()
Definition calc2.cpp:170
void genDiv()
Definition calc2.cpp:174
void genSub()
Definition calc2.cpp:166
void genNeg()
Definition calc2.cpp:178
Jit code_
Definition calc2.cpp:230
boost::spirit::qi::rule< Iterator, boost::spirit::ascii::space_type > factor
Definition calc2.cpp:229
boost::spirit::qi::rule< Iterator, boost::spirit::ascii::space_type > expression
Definition calc2.cpp:229
boost::spirit::qi::rule< Iterator, boost::spirit::ascii::space_type > term
Definition calc2.cpp:229
Here is the call graph for this function:

Member Data Documentation

◆ code_

template<typename Iterator >
Jit ParserJit< Iterator >::code_

Definition at line 230 of file calc2.cpp.

◆ expression

template<typename Iterator >
boost::spirit::qi::rule<Iterator, boost::spirit::ascii::space_type> ParserJit< Iterator >::expression

Definition at line 229 of file calc2.cpp.

◆ factor

template<typename Iterator >
boost::spirit::qi::rule<Iterator, boost::spirit::ascii::space_type> ParserJit< Iterator >::factor

Definition at line 229 of file calc2.cpp.

◆ term

template<typename Iterator >
boost::spirit::qi::rule<Iterator, boost::spirit::ascii::space_type> ParserJit< Iterator >::term

Definition at line 229 of file calc2.cpp.


The documentation for this struct was generated from the following file: