9 #include <spicy/ast/types/unit.h> 10 #include <spicy/compiler/detail/codegen/production.h> 11 #include <spicy/compiler/detail/codegen/productions/look-ahead.h> 39 const auto&
body()
const {
return _body; }
57 assert(_body_for_grammar);
62 std::vector<std::vector<Production>> rhss()
const {
return {{(_body_for_grammar ? *_body_for_grammar : _body)}}; }
63 std::optional<spicy::Type> type()
const {
return {}; }
64 bool nullable()
const {
return production::nullable(rhss()); }
65 bool eodOk()
const {
return nullable(); }
66 bool atomic()
const {
return false; }
67 bool supportsSynchronize()
const {
return hasSize() || _body.supportsSynchronize(); }
68 std::string render()
const;
72 std::optional<Expression> _expression;
73 std::optional<Production> _body_for_grammar;
Definition: look-ahead.h:24
While(const std::string &symbol, Expression e, Production body, const Location &l=location::None)
Definition: while.h:24
Definition: production.h:24
const production::LookAhead & lookAheadProduction() const
Definition: while.h:56
Definition: production.h:120
Definition: optional.h:79
const std::string & symbol() const
Definition: production.h:196
bool hasSize() const
Definition: production.h:185
Definition: production.h:170
void preprocessLookAhead(Grammar *grammar)
Definition: while.cc:25
Definition: location.h:17
const auto & expression() const
Definition: while.h:36
const auto & body() const
Definition: while.h:39