Pegmatite
Public Member Functions | Friends | List of all members
pegmatite::Rule Class Reference

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.
 
Ruleoperator= (Rule &&)
 Assignment operator. More...
 

Friends

class Context
 Copying rules is not allowed.
 

Detailed Description

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.

Constructor & Destructor Documentation

pegmatite::Rule::Rule ( const ExprPtr  e)

Constructs a rule, owning a reference to an expression.

Expressions may be shared between rules.

pegmatite::Rule::Rule ( const Rule r)
inline

Copying rules is not allowed.

Attempting to do so creates a new rule referencing the old.

Member Function Documentation

Rule& pegmatite::Rule::operator= ( Rule &&  )

Assignment operator.

This is used when we want to replace a rule in a subclass.


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