www.mooseframework.org
SyntaxFormatterInterface.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include <string>
13 #include <ostream>
14 
15 #include "InputParameters.h"
16 #include "ActionWarehouse.h"
17 #include "MooseSyntax.h"
18 
27 {
28 public:
30  virtual ~SyntaxFormatterInterface() = default;
31 
37  virtual std::string preamble() const { return std::string(); }
38 
45  virtual std::string postscript() const { return std::string(); }
46 
51  virtual std::string preTraverse(short /*depth*/) const { return std::string(); }
52 
59  virtual std::string
60  printBlockOpen(const std::string & name, short depth, const std::string & doc) = 0;
61 
68  virtual std::string printBlockClose(const std::string & name, short depth) const = 0;
69 
76  virtual std::string printParams(const std::string & prefix,
77  const std::string & fully_qualified_name,
78  InputParameters & params,
79  short depth,
80  const std::string & search_string,
81  bool & found) = 0;
82 };
83 
This interface is for classes that want to be called to format InputFileParameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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.
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 ...
virtual std::string printParams(const std::string &prefix, const std::string &fully_qualified_name, InputParameters &params, short depth, const std::string &search_string, bool &found)=0
This function is called for each InputParameters object stored at a particular node.
virtual std::string preTraverse(short) const
This method is called once at each node in the syntax tree before traversing child nodes...
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.
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 trai...
virtual ~SyntaxFormatterInterface()=default