ModErn Text Analysis
META Enumerates Textual Applications
Classes | Public Member Functions | Private Attributes | List of all members
meta::parser::transition_finder Class Reference

This is a visitor that converts a parse tree into a list of transitions that a shift-reduce parser would have to take in order to generate it. More...

#include <transition_finder.h>

Inheritance diagram for meta::parser::transition_finder:
meta::parser::const_visitor< void >

Classes

class  exception
 

Public Member Functions

void operator() (const leaf_node &) override
 
void operator() (const internal_node &) override
 
std::vector< transitiontransitions ()
 Extracts the transitions out of the visitor. More...
 

Private Attributes

std::vector< transitiontransitions_
 Storage for the transitions.
 

Additional Inherited Members

- Public Types inherited from meta::parser::const_visitor< void >
using result_type = void
 The result of running the visitor over the tree.
 

Detailed Description

This is a visitor that converts a parse tree into a list of transitions that a shift-reduce parser would have to take in order to generate it.

The transitions are built up via side-effect on the visitor, so its visiting functions return void, but the visitor itself has a function to obtain the list of transitions after visiting has been completed.

Member Function Documentation

void meta::parser::transition_finder::operator() ( const leaf_node )
overridevirtual
Returns
the result of running the visitor on the supplied leaf node

Implements meta::parser::const_visitor< void >.

void meta::parser::transition_finder::operator() ( const internal_node )
overridevirtual
Returns
the result of running the visitor on the supplied internal node

Implements meta::parser::const_visitor< void >.

std::vector< transition > meta::parser::transition_finder::transitions ( )

Extracts the transitions out of the visitor.

This moves the transition vector from the visitor.

Returns
the transtions found when running the visitor on the tree

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