Puma Reference Manual Puma: Puma::Tracing Class Reference



Puma::Tracing Class Reference

Implements tracing support for the parser. More...

#include <Puma/Tracing.h>

List of all members.

Public Member Functions

void trace (ostream &os, bool trace_tokens=false)
 Setup the tracer.

Protected Member Functions

 Tracing ()
 Constructor.
void trace (int token)
 Trace the given token.
void trace (const char *rule, int n=1, bool quote=false)
 Trace the given parser rule.
void trace (Token *token, const char *ok, const char *failed)
 Trace the given token.
int trace_mode () const
 Get the current tracing mode.
ostream & tos () const
 Get the tracing output stream.

Detailed Description

Implements tracing support for the parser.


Constructor & Destructor Documentation

Puma::Tracing::Tracing (  )  [inline, protected]

Constructor.


Member Function Documentation

ostream& Puma::Tracing::tos (  )  const [protected]

Get the tracing output stream.

void Puma::Tracing::trace ( Token token,
const char *  ok,
const char *  failed 
) [protected]

Trace the given token.

Parameters:
token The token to trace.
ok The message if the token is not NULL.
failed The message if the token is NULL.
void Puma::Tracing::trace ( const char *  rule,
int  n = 1,
bool  quote = false 
) [protected]

Trace the given parser rule.

Parameters:
rule The rule name.
n The indentation depth.
quote Quote the rule name.
void Puma::Tracing::trace ( int  token  )  [inline, protected]

Trace the given token.

Parameters:
token The token type.
void Puma::Tracing::trace ( ostream &  os,
bool  trace_tokens = false 
)

Setup the tracer.

Parameters:
os The output stream on which to write the tracing output.
trace_tokens Turn on/off token level tracing.
int Puma::Tracing::trace_mode (  )  const [inline, protected]

Get the current tracing mode.

0 means tracing is disabled, 1 means rule level tracing, 2 means token level tracing.




Puma Reference Manual. Created on 11 Sep 2009.