mirror of
https://github.com/boostorg/spirit.git
synced 2026-01-19 04:42:11 +00:00
Make calc4b actually compile
This commit is contained in:
@@ -188,27 +188,28 @@ namespace client
|
||||
x3::rule<class term, ast::program> const term("term");
|
||||
x3::rule<class factor, ast::operand> const factor("factor");
|
||||
|
||||
BOOST_SPIRIT_DEFINE(
|
||||
expression =
|
||||
auto const expression_def =
|
||||
term
|
||||
>> *( (char_('+') >> term)
|
||||
| (char_('-') >> term)
|
||||
)
|
||||
,
|
||||
;
|
||||
|
||||
term =
|
||||
auto const term_def =
|
||||
factor
|
||||
>> *( (char_('*') >> factor)
|
||||
| (char_('/') >> factor)
|
||||
)
|
||||
,
|
||||
;
|
||||
|
||||
factor =
|
||||
auto const factor_def =
|
||||
uint_
|
||||
| '(' >> expression >> ')'
|
||||
| (char_('-') >> factor)
|
||||
| (char_('+') >> factor)
|
||||
);
|
||||
;
|
||||
|
||||
BOOST_SPIRIT_DEFINE(expression, term, factor);
|
||||
|
||||
auto calculator = expression;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user