Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
Grammar::definition< ScannerT > Struct Template Reference

Public Member Functions

 definition (const Grammar &self)
 
const boost::spirit::classic::rule< ScannerT > & start () const
 

Public Attributes

boost::spirit::classic::rule< ScannerT > poly0
 
boost::spirit::classic::rule< ScannerT > poly1
 
boost::spirit::classic::rule< ScannerT > poly2
 
boost::spirit::classic::rule< ScannerT > var
 

Detailed Description

template<typename ScannerT>
struct Grammar::definition< ScannerT >

Definition at line 135 of file calc.cpp.

Constructor & Destructor Documentation

◆ definition()

template<typename ScannerT >
Grammar::definition< ScannerT >::definition ( const Grammar & self)
inline

Definition at line 138 of file calc.cpp.

139 {
140 using namespace boost;
141 using namespace boost::spirit::classic;
142
143 poly0 = poly1 >> *(('+' >> poly1)[bind(&FuncGen::genAdd, ref(self.f_), _1, _2)]
144 | ('-' >> poly1)[bind(&FuncGen::genSub, ref(self.f_), _1, _2)]);
145 poly1 = poly2 >> *(('*' >> poly2)[bind(&FuncGen::genMul, ref(self.f_), _1, _2)]
146 | ('/' >> poly2)[bind(&FuncGen::genDiv, ref(self.f_), _1, _2)]);
147 var = (+alpha_p)[bind(&FuncGen::genVal, ref(self.f_), _1, _2)];
148 poly2 = real_p[bind(&FuncGen::genPush, ref(self.f_), _1)]
149 | var
150 | '(' >> poly0 >> ')';
151 }
void genDiv(const char *, const char *)
Definition calc.cpp:112
void genPush(double n)
Definition calc.cpp:84
void genMul(const char *, const char *)
Definition calc.cpp:108
void genAdd(const char *, const char *)
Definition calc.cpp:100
void genSub(const char *, const char *)
Definition calc.cpp:104
void genVal(const char *begin, const char *end)
Definition calc.cpp:93
@ self
the connection is to itself
Definition protocol.hpp:48
boost::spirit::classic::rule< ScannerT > poly0
Definition calc.cpp:136
boost::spirit::classic::rule< ScannerT > poly1
Definition calc.cpp:136
boost::spirit::classic::rule< ScannerT > var
Definition calc.cpp:136
boost::spirit::classic::rule< ScannerT > poly2
Definition calc.cpp:136
Here is the call graph for this function:

Member Function Documentation

◆ start()

template<typename ScannerT >
const boost::spirit::classic::rule< ScannerT > & Grammar::definition< ScannerT >::start ( ) const
inline

Definition at line 152 of file calc.cpp.

152{ return poly0; }

Member Data Documentation

◆ poly0

template<typename ScannerT >
boost::spirit::classic::rule<ScannerT> Grammar::definition< ScannerT >::poly0

Definition at line 136 of file calc.cpp.

◆ poly1

template<typename ScannerT >
boost::spirit::classic::rule<ScannerT> Grammar::definition< ScannerT >::poly1

Definition at line 136 of file calc.cpp.

◆ poly2

template<typename ScannerT >
boost::spirit::classic::rule<ScannerT> Grammar::definition< ScannerT >::poly2

Definition at line 136 of file calc.cpp.

◆ var

template<typename ScannerT >
boost::spirit::classic::rule<ScannerT> Grammar::definition< ScannerT >::var

Definition at line 136 of file calc.cpp.


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