2 #define _CSDBG_PARSER 1
49 static void on_lib_load() __attribute((constructor));
57 friend std::ostream& operator<<(std::ostream&, const
parser&);
64 parser(const parser&);
68 virtual parser*
clone() const;
80 virtual parser& operator=(const parser&);
110 virtual style*
get_style(const i8*) const;
117 virtual
chain<
string>*
parse(const i8* = NULL,
bool = false) const;
119 virtual
string*
highlight(const i8* = NULL,
bool = false) const;
121 virtual
bool lookup(const
string&, const i8*,
bool = false) const;
123 virtual const i8*
lookup(const
string&,
bool = false) const;
static style * get_fallback_style()
Get the shared fallback style.
virtual chain< string > * get_style_names() const
Get all the registered style names.
virtual parser & remove_dictionary(const i8 *)
Remove a dictionary, indexed by name.
chain< dictionary > * m_dictionaries
Dictionary collection.
Lightweight, templated, doubly-linked list (using XOR linking)
A named collection of words (for syntax highlighters)
char i8
8-bit signed integer
static parser * get_default()
Get the default (stack trace) parser.
virtual chain< string > * get_dictionary_names() const
Get all the registered dictionary names.
virtual parser * clone() const
Object virtual copy constructor.
virtual string * highlight(const i8 *=NULL, bool=false) const
Highlight (escape) the current buffer using a custom syntax.
Class csdbg::style definition.
virtual chain< string > * parse(const i8 *=NULL, bool=false) const
Parse the current buffer using a custom syntax.
static parser * m_default
Default parser.
Stack trace parser and syntax highlighter for VT100 terminals.
virtual parser & remove_style(const i8 *)
Remove a style, indexed by name.
A set of formatting attributes for VT100 (and compatible) terminals.
u8 color_t
VT100 terminal color.
virtual style * add_style(const i8 *, color_t, color_t, attrset_t)
Add a style to the parser/highlighter.
Class csdbg::dictionary definition.
static void on_lib_unload() __attribute((destructor))
Library destructor.
static void on_lib_load() __attribute((constructor))
Library constructor.
Lightweight string buffer class (for ISO-8859-1 text)
virtual style * get_style(const i8 *) const
Get a style, indexed by name.
virtual dictionary * add_dictionary(const i8 *, const i8 *, bool)
Add a dictionary to the parser.
virtual dictionary * get_dictionary(const i8 *) const
Get a dictionary, indexed by name.
virtual parser & remove_all_styles()
Remove all styles.
virtual bool lookup(const string &, const i8 *, bool=false) const
Lookup an expression in one of the parser dictionaries.
u16 attrset_t
VT100 attribute bitmask.
virtual parser & remove_all_dictionaries()
Remove all dictionaries.
static style * m_fallback
Shared fallback style.
chain< style > * m_styles
VT100 style collection.