#include <SyntaxTree.h>
Classes | |
class | TreeNode |
This class represents a single node in our tree. More... | |
Public Member Functions | |
SyntaxTree (bool use_long_names=false) | |
virtual | ~SyntaxTree () |
void | insertNode (std::string syntax, const std::string &action, bool is_action_params=true, InputParameters *params=NULL) |
std::string | print (const std::string &search_string) |
void | seenIt (const std::string &prefix, const std::string &item) |
bool | haveSeenIt (const std::string &prefix, const std::string &item) const |
virtual std::string | preamble () const |
This method is called once at the beginning of the tree traversal and can be used to build up header information. More... | |
virtual std::string | postscript () const |
This method is called once at the end of the tree traversal and can be used to add any necessary trailing information to the final formatted string. More... | |
virtual std::string | preTraverse (short) const |
This method is called once at each node in the syntax tree before traversing child nodes. More... | |
virtual std::string | printBlockOpen (const std::string &name, short depth, const std::string &doc)=0 |
This method is called at the beginning of each Node in the tree. More... | |
virtual std::string | printBlockClose (const std::string &name, short depth) const =0 |
This method is called at the end of of each Node in the tree. More... | |
virtual std::string | printParams (const std::string &prefix, const std::string &fully_qualified_name, InputParameters ¶ms, short depth, const std::string &search_string, bool &found)=0 |
This function is called for each InputParameters object stored at a particular node. More... | |
Protected Member Functions | |
bool | isLongNames () const |
Protected Attributes | |
std::unique_ptr< TreeNode > | _root |
bool | _use_long_names |
Private Attributes | |
std::set< std::string > | _params_printed |
Definition at line 23 of file SyntaxTree.h.
SyntaxTree::SyntaxTree | ( | bool | use_long_names = false | ) |
Definition at line 19 of file SyntaxTree.C.
|
virtualdefault |
bool SyntaxTree::haveSeenIt | ( | const std::string & | prefix, |
const std::string & | item | ||
) | const |
Definition at line 63 of file SyntaxTree.C.
Referenced by InputFileFormatter::printParams(), and YAMLFormatter::printParams().
void SyntaxTree::insertNode | ( | std::string | syntax, |
const std::string & | action, | ||
bool | is_action_params = true , |
||
InputParameters * | params = NULL |
||
) |
|
protected |
Definition at line 227 of file SyntaxTree.C.
|
inlinevirtualinherited |
This method is called once at the end of the tree traversal and can be used to add any necessary trailing information to the final formatted string.
Reimplemented in YAMLFormatter.
Definition at line 41 of file SyntaxFormatterInterface.h.
Referenced by print().
|
inlinevirtualinherited |
This method is called once at the beginning of the tree traversal and can be used to build up header information.
Reimplemented in YAMLFormatter.
Definition at line 33 of file SyntaxFormatterInterface.h.
Referenced by print().
|
inlinevirtualinherited |
This method is called once at each node in the syntax tree before traversing child nodes.
Reimplemented in YAMLFormatter.
Definition at line 47 of file SyntaxFormatterInterface.h.
std::string SyntaxTree::print | ( | const std::string & | search_string | ) |
Definition at line 39 of file SyntaxTree.C.
Referenced by ActionWarehouse::printInputFile().
|
pure virtualinherited |
This method is called at the end of of each Node in the tree.
It is typically used to provide formatting necessary when closing blocks.
Implemented in YAMLFormatter, and InputFileFormatter.
|
pure virtualinherited |
This method is called at the beginning of each Node in the tree.
It is typically used to provide formatting necessary when opening new blocks.
Implemented in YAMLFormatter, and InputFileFormatter.
|
pure virtualinherited |
This function is called for each InputParameters object stored at a particular node.
It is responsible for formatting the parameters for the current node.
Implemented in YAMLFormatter, and InputFileFormatter.
void SyntaxTree::seenIt | ( | const std::string & | prefix, |
const std::string & | item | ||
) |
Definition at line 57 of file SyntaxTree.C.
Referenced by InputFileFormatter::printParams(), and YAMLFormatter::printParams().
|
private |
Definition at line 80 of file SyntaxTree.h.
Referenced by haveSeenIt(), print(), and seenIt().
|
protected |
Definition at line 76 of file SyntaxTree.h.
Referenced by insertNode(), and print().
|
protected |
Definition at line 77 of file SyntaxTree.h.
Referenced by isLongNames().