Pegmatite
|
Rule class, which represents a rule in a grammar. More...
#include <parser.hh>
Public Member Functions | |
Rule (const ExprPtr e) | |
Constructs a rule, owning a reference to an expression. More... | |
Rule (const CharacterExprPtr e) | |
Constructor for creating rules from character expressions. | |
Rule (const Rule &r) | |
Copying rules is not allowed. More... | |
Rule (const Rule &&r) | |
Move constructor for a rule, allows rulename = {some expression} initialisation without performing copying. | |
Rule & | operator= (Rule &&) |
Assignment operator. More... | |
Friends | |
class | Context |
Copying rules is not allowed. | |
Rule class, which represents a rule in a grammar.
Rules are distinct from expressions, in that they are expected to be top-level constructs that can have actions associated with them.
pegmatite::Rule::Rule | ( | const ExprPtr | e | ) |
Constructs a rule, owning a reference to an expression.
Expressions may be shared between rules.
|
inline |
Copying rules is not allowed.
Attempting to do so creates a new rule referencing the old.
Assignment operator.
This is used when we want to replace a rule in a subclass.