Defined in header <cparse/Parser.hh>

Parser();                              // (1)

Parser( Parser const& ) = delete;      // (2)
Parser( Parser&& ) = delete;           // (3)
  1. Default constructor. Initialises the error collector to empty, the return-point stack to empty, the open-scope counter to zero, and leaves the active cursor pointer null. The active cursor is installed by parse() at the start of each parse.
  2. Copy construction is deleted.
  3. Move construction is deleted.

Parameters

None.

Exceptions

= default-defined in the implementation. Does not throw.

Notes

The class is abstract — direct instantiation fails at compile time because getGrammarName() and start() are pure virtual. The default constructor is called from the derived class's constructor initialisation.

Copy and move are deleted because a Parser owns a stack of shared_ptr<Cursor> return points and an error vector — sharing or transferring these mid-parse has no meaningful semantics. Grammars that need multiple parsers construct multiple instances.

See also