https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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< hit::ErrorMessage > errors
 

Private Attributes

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

Detailed Description

Definition at line 57 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 308 of file Parser.C.

309{
310 const auto it = _have.try_emplace(fullpath, n);
311 if (!it.second)
312 {
313 const std::string type = n->type() == hit::NodeType::Field ? "parameter" : "section";
314 const std::string error = type + " '" + fullpath + "' supplied multiple times";
315
316 // Don't warn multiple times (will happen if we find it three+ times)
317 const auto existing = it.first->second;
318 if (std::find_if(errors.begin(),
319 errors.end(),
320 [&existing](const auto & err)
321 { return err.node == existing; }) == errors.end())
322 errors.emplace_back(error, existing);
323
324 errors.emplace_back(error, n);
325 }
326}
std::map< std::string, hit::Node * > _have
Definition Parser.h:66
std::vector< hit::ErrorMessage > errors
Definition Parser.h:63

Referenced by Parser::parse().

Member Data Documentation

◆ _have

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

Definition at line 66 of file Parser.h.

Referenced by walk().

◆ errors

std::vector<hit::ErrorMessage> DupParamWalker::errors

Definition at line 63 of file Parser.h.

Referenced by Parser::parse(), and walk().


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