www.mooseframework.org
Public Member Functions | Public Attributes | Private Attributes | List of all members
DupParamWalker Class Reference

#include <Parser.h>

Inheritance diagram for DupParamWalker:
[legend]

Public Member Functions

virtual void walk (const std::string &fullpath, const std::string &, hit::Node *n) override
 

Public Attributes

std::vector< std::string > errors
 

Private Attributes

std::set< std::string > _duplicates
 
std::map< std::string, hit::Node * > _have
 

Detailed Description

Definition at line 48 of file Parser.h.

Member Function Documentation

◆ walk()

void DupParamWalker::walk ( const std::string &  fullpath,
const std::string &  ,
hit::Node *  n 
)
overridevirtual

Definition at line 171 of file Parser.C.

172 {
173  std::string prefix = n->type() == hit::NodeType::Field ? "parameter" : "section";
174 
175  if (_have.count(fullpath) > 0)
176  {
177  auto existing = _have[fullpath];
178  if (_duplicates.count(fullpath) == 0)
179  {
180  errors.push_back(
181  hit::errormsg(existing, prefix, " '", fullpath, "' supplied multiple times"));
182  _duplicates.insert(fullpath);
183  }
184  errors.push_back(hit::errormsg(n, prefix, " '", fullpath, "' supplied multiple times"));
185  }
186  _have[fullpath] = n;
187 }
std::set< std::string > _duplicates
Definition: Parser.h:57
std::map< std::string, hit::Node * > _have
Definition: Parser.h:58
std::vector< std::string > errors
Definition: Parser.h:54

Member Data Documentation

◆ _duplicates

std::set<std::string> DupParamWalker::_duplicates
private

Definition at line 57 of file Parser.h.

Referenced by walk().

◆ _have

std::map<std::string, hit::Node *> DupParamWalker::_have
private

Definition at line 58 of file Parser.h.

Referenced by walk().

◆ errors

std::vector<std::string> DupParamWalker::errors

Definition at line 54 of file Parser.h.

Referenced by Moose::Builder::build(), and walk().


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