Pegmatite
Public Member Functions | List of all members
pegmatite::Expr Class Referenceabstract

Abstract base class for expressions. More...

#include <parser.hh>

Public Member Functions

virtual ~Expr ()
 Virtual destructor for safe overloading. More...
 
virtual bool parse_non_term (Context &con) const =0
 Parse this expression as a non-terminal. More...
 
virtual bool parse_term (Context &con) const =0
 Parse this expression as a terminal. More...
 
virtual void dump () const =0
 Dump the current rule. More...
 

Detailed Description

Abstract base class for expressions.

Constructor & Destructor Documentation

virtual pegmatite::Expr::~Expr ( )
virtual

Virtual destructor for safe overloading.

Note that generally expression objects are not meant to be deallocated, as they can be used by multiple parsers.

Defined out-of-line to avoid emitting vtables in every translation unit that includes this header.

Member Function Documentation

virtual void pegmatite::Expr::dump ( ) const
pure virtual

Dump the current rule.

Used for debugging.

virtual bool pegmatite::Expr::parse_non_term ( Context &  con) const
pure virtual

Parse this expression as a non-terminal.

Non-terminals are permitted to contain whitespace around compound expressions, as defined by the whitespace rule in the context.

virtual bool pegmatite::Expr::parse_term ( Context &  con) const
pure virtual

Parse this expression as a terminal.

Terminals are exact matches for the specified expression, without any whitespace.


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