No Matches
mcrl2::core::parser Struct Reference

Wrapper for D_Parser and its corresponding D_ParserTables. More...

#include <dparser.h>

Public Member Functions

 parser (D_ParserTables &tables, D_AmbiguityFn ambiguity_fn=nullptr, D_SyntaxErrorFn syntax_error_fn=nullptr, std::size_t max_error_message_count=1)
 ~parser ()
const parser_tablesymbol_table () const
unsigned int start_symbol_index (const std::string &name) const
parse_node parse (const std::string &text, unsigned int start_symbol_index=0, bool partial_parses=false)
 Parses a string. N.B. The user is responsible for destruction of the returned value by calling destroy_parse_node!!!
void print_symbol_table () const
std::string indent (unsigned int count) const
std::string truncate (const std::string &s, unsigned int max_size=20) const
void print_tree (const parse_node &node, unsigned int level=0) const
void destroy_parse_node (const parse_node &node)
void custom_parse_error (const std::string &message) const
void announce (D_ParseNode &node_ref)
 Callback function for nodes in the parse tree.
void print_node (std::ostream &out, const parse_node &node) const
std::string print_node (const parse_node &node) const

Public Attributes

parser_table m_table
D_Parser * m_parser
std::size_t m_max_error_message_count

Detailed Description

Wrapper for D_Parser and its corresponding D_ParserTables.

Definition at line 147 of file dparser.h.

Constructor & Destructor Documentation

◆ parser()

mcrl2::core::parser::parser ( D_ParserTables &  tables,
D_AmbiguityFn  ambiguity_fn = nullptr,
D_SyntaxErrorFn  syntax_error_fn = nullptr,
std::size_t  max_error_message_count = 1 

Definition at line 174 of file dparser.cpp.

◆ ~parser()

mcrl2::core::parser::~parser ( )

Definition at line 194 of file dparser.cpp.

Member Function Documentation

◆ announce()

void mcrl2::core::parser::announce ( D_ParseNode &  node_ref)

Callback function for nodes in the parse tree.

Definition at line 269 of file dparser.cpp.

◆ custom_parse_error()

void mcrl2::core::parser::custom_parse_error ( const std::string &  message) const

Definition at line 516 of file dparser.cpp.

◆ destroy_parse_node()

void mcrl2::core::parser::destroy_parse_node ( const parse_node node)

Definition at line 263 of file dparser.cpp.

◆ indent()

std::string mcrl2::core::parser::indent ( unsigned int  count) const

Definition at line 230 of file dparser.cpp.

◆ parse()

parse_node mcrl2::core::parser::parse ( const std::string &  text,
unsigned int  start_symbol_index = 0,
bool  partial_parses = false 

Parses a string. N.B. The user is responsible for destruction of the returned value by calling destroy_parse_node!!!

Definition at line 209 of file dparser.cpp.

◆ print_node() [1/2]

std::string mcrl2::core::parser::print_node ( const parse_node node) const

Definition at line 193 of file dparser.h.

◆ print_node() [2/2]

void mcrl2::core::parser::print_node ( std::ostream &  out,
const parse_node node 
) const

Definition at line 180 of file dparser.h.

◆ print_symbol_table()

void mcrl2::core::parser::print_symbol_table ( ) const

Definition at line 225 of file dparser.cpp.

◆ print_tree()

void mcrl2::core::parser::print_tree ( const parse_node node,
unsigned int  level = 0 
) const

Definition at line 249 of file dparser.cpp.

◆ start_symbol_index()

unsigned int mcrl2::core::parser::start_symbol_index ( const std::string &  name) const

Definition at line 204 of file dparser.cpp.

◆ symbol_table()

const parser_table & mcrl2::core::parser::symbol_table ( ) const

Definition at line 199 of file dparser.cpp.

◆ truncate()

std::string mcrl2::core::parser::truncate ( const std::string &  s,
unsigned int  max_size = 20 
) const

Definition at line 235 of file dparser.cpp.

Member Data Documentation

◆ m_max_error_message_count

std::size_t mcrl2::core::parser::m_max_error_message_count

Definition at line 151 of file dparser.h.

◆ m_parser

D_Parser* mcrl2::core::parser::m_parser

Definition at line 150 of file dparser.h.

◆ m_table

parser_table mcrl2::core::parser::m_table

Definition at line 149 of file dparser.h.

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