Parser
- Added alias collection methods.
This commit is contained in:
@@ -187,6 +187,12 @@ Tree* Parser::parse ()
|
|||||||
return _tree;
|
return _tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
void Parser::alias (const std::string& name, const std::string& value)
|
||||||
|
{
|
||||||
|
_aliases.insert (std::pair <std::string, std::string> (name, value));
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
void Parser::entity (const std::string& name, const std::string& value)
|
void Parser::entity (const std::string& name, const std::string& value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public:
|
|||||||
void appendStdin ();
|
void appendStdin ();
|
||||||
Tree* tree ();
|
Tree* tree ();
|
||||||
Tree* parse ();
|
Tree* parse ();
|
||||||
|
void alias (const std::string&, const std::string&);
|
||||||
void entity (const std::string&, const std::string&);
|
void entity (const std::string&, const std::string&);
|
||||||
bool exactMatch (const std::string&, const std::string&) const;
|
bool exactMatch (const std::string&, const std::string&) const;
|
||||||
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
bool canonicalize (std::string&, const std::string&, const std::string&) const;
|
||||||
@@ -85,6 +86,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
Tree* _tree;
|
Tree* _tree;
|
||||||
std::multimap <std::string, std::string> _entities;
|
std::multimap <std::string, std::string> _entities;
|
||||||
|
std::map <std::string, std::string> _aliases;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user