![]() |
Home | Libraries | People | FAQ | More |
boost::parser::symbols
// In header: <boost/parser/parser.hpp> template<typename T> struct symbols : public { // public member functions (); (char const *); (T > >); (char const *, T > >); void (, T); void (); void (); template<typename Context> void (Context const &, , T); template<typename Context> void (Context const &, ); template<typename Context> void (Context const &); template<typename Context> (Context const &, ) ; template<typename Context> void (Context const &, , T) ; template<typename Context> void (Context const &, ) ; template<typename Context> void (Context const &) ; };
A symbols<T>
represents the initial state of a symbol table parser that produces attributes of type T
. The entries in the symbol table can be changed during parsing, but those mutations to not affect the symbols<T>
object itself; all mutations happen to a copy of the symbol table in the parse context. For table entries that should be used during every parse, add entries via add()
or operator()
. For mid-parse mutations, use insert()
and erase()
.
symbols
public member functions();
(char const * diagnostic_text);
(T > > il);
(char const * diagnostic_text, T > > il);
void ( str, T x);
Inserts an entry consisting of a UTF-8 string str
to match, and an associated attribute x
, to *this
. The entry is added for use in all subsequent top-level parses. Subsequent lookups during the current top-level parse will not necessarily match str
.
void ( str);
Erases the entry whose UTF-8 match string is str
, from *this
. The entry will no longer be available for use in all subsequent top-level parses. str
will not be removed from the symbols matched in the current top-level parse.
void ();
Erases all the entries from the copy of the symbol table inside the parse context context
.
template<typename Context> void (Context const & context, str, T x);
Inserts an entry consisting of a UTF-8 string str
to match, and an associated attribute x
, to *this
. The entry is added for use in all subsequent top-level parses. Subsequent lookups during the current top-level parse will not necessarily match str
.
template<typename Context> void (Context const & context, str);
Erases the entry whose UTF-8 match string is str
, from *this
. The entry will no longer be available for use in all subsequent top-level parses. str
will not be removed from the symbols matched in the current top-level parse.
template<typename Context> void (Context const & context);
Erases all the entries from the copy of the symbol table inside the parse context context
.
template<typename Context> (Context const & context, str) ;
Uses UTF-8 string str
to look up an attribute in the table during parsing, returning it as an optional reference. The lookup is done on the copy of the symbol table inside the parse context context
, not *this
.
template<typename Context> void (Context const & context, str, T x) ;
Inserts an entry consisting of a UTF-8 string to match str
, and an associtated attribute x
, to the copy of the symbol table inside the parse context context
.
template<typename Context> void (Context const & context, str) ;
Erases the entry whose UTF-8 match string is str
from the copy of the symbol table inside the parse context context
.
template<typename Context> void (Context const & context) ;
Erases all the entries from the copy of the symbol table inside the parse context context
.