cpphoafparser library API
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cpphoafparser::HOAIntermediateTrace Class Reference

Traces the function calls to HOAConsumer, prints function name and arguments to stream. More...

#include <hoa_intermediate_trace.hh>

+ Inheritance diagram for cpphoafparser::HOAIntermediateTrace:
+ Collaboration diagram for cpphoafparser::HOAIntermediateTrace:

Public Member Functions

 HOAIntermediateTrace (HOAConsumer::ptr next)
 Constructor, providing the next HOAConsumer.
 
 HOAIntermediateTrace (HOAConsumer::ptr next, std::ostream &out)
 Constructor, providing the next HOAConsumer.
 
virtual bool parserResolvesAliases () override
 This function is called by the parser to query the consumer whether aliases should be resolved by the parser (return true or whether the consumer would like to see the aliases unresolved (return false). More...
 
virtual void notifyHeaderStart (const std::string &version) override
 Called by the parser for the "HOA: version" item [mandatory, once]. More...
 
virtual void setNumberOfStates (unsigned int numberOfStates) override
 Called by the parser for the "States: int(numberOfStates)" item [optional, once]. More...
 
virtual void addStartStates (const int_list &stateConjunction) override
 Called by the parser for each "Start: state-conj" item [optional, multiple]. More...
 
virtual void addAlias (const std::string &name, label_expr::ptr labelExpr) override
 Called by the parser for each "Alias: alias-def" item [optional, multiple]. More...
 
virtual void setAPs (const std::vector< std::string > &aps) override
 Called by the parser for the "AP: ap-def" item [optional, once]. More...
 
virtual void setAcceptanceCondition (unsigned int numberOfSets, acceptance_expr::ptr accExpr) override
 Called by the parser for the "Acceptance: acceptance-def" item [mandatory, once]. More...
 
virtual void provideAcceptanceName (const std::string &name, const std::vector< IntOrString > &extraInfo) override
 Called by the parser for each "acc-name: ..." item [optional, multiple]. More...
 
virtual void setName (const std::string &name) override
 Called by the parser for the "name: ..." item [optional, once].
 
virtual void setTool (const std::string &name, std::shared_ptr< std::string > version) override
 Called by the parser for the "tool: ..." item [optional, once]. More...
 
virtual void addProperties (const std::vector< std::string > &properties) override
 Called by the parser for the "properties: ..." item [optional, multiple]. More...
 
virtual void addMiscHeader (const std::string &name, const std::vector< IntOrString > &content) override
 Called by the parser for each unknown header item [optional, multiple]. More...
 
virtual void notifyBodyStart () override
 Called by the parser to notify that the BODY of the automaton has started [mandatory, once].
 
virtual void addState (unsigned int id, std::shared_ptr< std::string > info, label_expr::ptr labelExpr, std::shared_ptr< int_list > accSignature) override
 Called by the parser for each "State: ..." item [multiple]. More...
 
virtual void addEdgeImplicit (unsigned int stateId, const int_list &conjSuccessors, std::shared_ptr< int_list > accSignature) override
 Called by the parser for each implicit edge definition [multiple], i.e., where the edge label is deduced from the index of the edge. More...
 
virtual void addEdgeWithLabel (unsigned int stateId, label_expr::ptr labelExpr, const int_list &conjSuccessors, std::shared_ptr< int_list > accSignature) override
 Called by the parser for each explicit edge definition [optional, multiple], i.e., where the label is either specified for the edge or as a state-label. More...
 
virtual void notifyEndOfState (unsigned int stateId) override
 Called by the parser to notify the consumer that the definition for state stateId has ended [multiple].
 
virtual void notifyEnd () override
 Called by the parser to notify the consumer that the automata definition has ended [mandatory, once].
 
virtual void notifyAbort () override
 Called by the parser to notify the consumer that an "ABORT" message has been encountered (at any time, indicating error, the automaton should be discarded).
 
virtual void notifyWarning (const std::string &warning) override
 Is called whenever a condition is encountered that merits a (non-fatal) warning. More...
 
- Public Member Functions inherited from cpphoafparser::HOAIntermediate
 HOAIntermediate (HOAConsumer::ptr next)
 Constructor, providing the next HOAConsumer.
 
- Public Member Functions inherited from cpphoafparser::HOAConsumer
virtual ~HOAConsumer ()
 Destructor.
 

Protected Member Functions

void traceFunction (const std::string &function)
 Trace function call.
 
void traceArgument (const std::string &name, const std::string &value)
 Trace argument (string)
 
void traceArgument (const std::string &name, unsigned int value)
 Trace argument (int)
 
template<typename Atom >
void traceArgument (const std::string &name, const BooleanExpression< Atom > &expr)
 Trace argument (BooleanExpression)
 
template<typename T >
void traceArgument (const std::string &name, const std::vector< T > &list)
 Trace argument (vector)
 
template<typename O >
void traceArgument (const std::string &name, typename std::shared_ptr< O > o)
 Trace argument (shared_ptr)
 

Protected Attributes

std::ostream & out
 The output stream.
 
- Protected Attributes inherited from cpphoafparser::HOAIntermediate
HOAConsumer::ptr next
 The next consumer.
 

Additional Inherited Members

- Public Types inherited from cpphoafparser::HOAConsumer
typedef std::shared_ptr< HOAConsumerptr
 A shared_ptr wrapping a HOAConsumer.
 
typedef BooleanExpression< AtomLabellabel_expr
 A label expression.
 
typedef BooleanExpression< AtomAcceptanceacceptance_expr
 An acceptance expression.
 
typedef std::vector< unsigned int > int_list
 A list of integers.
 

Detailed Description

Traces the function calls to HOAConsumer, prints function name and arguments to stream.

Member Function Documentation

virtual void cpphoafparser::HOAIntermediateTrace::addAlias ( const std::string &  name,
label_expr::ptr  labelExpr 
)
inlineoverridevirtual

Called by the parser for each "Alias: alias-def" item [optional, multiple].

Will be called no matter the return value of parserResolvesAliases().

Parameters
namethe alias name (without @)
labelExpra boolean expression over labels

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::addEdgeImplicit ( unsigned int  stateId,
const int_list conjSuccessors,
std::shared_ptr< int_list accSignature 
)
inlineoverridevirtual

Called by the parser for each implicit edge definition [multiple], i.e., where the edge label is deduced from the index of the edge.

If the edges are provided in implicit form, after every addState() there should be 2^|AP| calls to addEdgeImplicit. The corresponding boolean expression over labels / BitSet can be obtained by calling BooleanExpression.fromImplicit(i-1) for the i-th call of this function per state.

Parameters
stateIdthe index of the 'from' state
conjSuccessorsa list of successor state indizes, interpreted as a conjunction
accSignaturean optional list of acceptance set indizes (transition-labeled acceptance) (empty pointer if not provided)

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::addEdgeWithLabel ( unsigned int  stateId,
label_expr::ptr  labelExpr,
const int_list conjSuccessors,
std::shared_ptr< int_list accSignature 
)
inlineoverridevirtual

Called by the parser for each explicit edge definition [optional, multiple], i.e., where the label is either specified for the edge or as a state-label.


Parameters
stateIdthe index of the 'from' state
labelExpra boolean expression over labels (empty pointer if none provided, only in case of state-labeled states)
conjSuccessorsa list of successors state indizes, interpreted as a conjunction
accSignaturean optional list of acceptance set indizes (transition-labeled acceptance) (empty pointer if none provided)

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::addMiscHeader ( const std::string &  name,
const std::vector< IntOrString > &  content 
)
inlineoverridevirtual

Called by the parser for each unknown header item [optional, multiple].

Parameters
namethe name of the header (without ':')
contenta list of extra information provided by the header

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::addProperties ( const std::vector< std::string > &  properties)
inlineoverridevirtual

Called by the parser for the "properties: ..." item [optional, multiple].

Parameters
propertiesa list of properties

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::addStartStates ( const int_list stateConjunction)
inlineoverridevirtual

Called by the parser for each "Start: state-conj" item [optional, multiple].

Parameters
stateConjunctiona list of state indizes, interpreted as a conjunction

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::addState ( unsigned int  id,
std::shared_ptr< std::string >  info,
label_expr::ptr  labelExpr,
std::shared_ptr< int_list accSignature 
)
inlineoverridevirtual

Called by the parser for each "State: ..." item [multiple].

Parameters
idthe identifier for this state
infoan optional string providing additional information about the state (empty pointer if not provided)
labelExpran optional boolean expression over labels (state-labeled) (empty pointer if not provided)
accSignaturean optional list of acceptance set indizes (state-labeled acceptance) (empty pointer if not provided)

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::notifyHeaderStart ( const std::string &  version)
inlineoverridevirtual

Called by the parser for the "HOA: version" item [mandatory, once].

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::notifyWarning ( const std::string &  warning)
inlineoverridevirtual

Is called whenever a condition is encountered that merits a (non-fatal) warning.

The consumer is free to handle this situation as it wishes.

Reimplemented from cpphoafparser::HOAIntermediate.

virtual bool cpphoafparser::HOAIntermediateTrace::parserResolvesAliases ( )
inlineoverridevirtual

This function is called by the parser to query the consumer whether aliases should be resolved by the parser (return true or whether the consumer would like to see the aliases unresolved (return false).

This function should always return a constant value.

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::provideAcceptanceName ( const std::string &  name,
const std::vector< IntOrString > &  extraInfo 
)
inlineoverridevirtual

Called by the parser for each "acc-name: ..." item [optional, multiple].

Parameters
namethe provided name
extraInfothe additional information for this item

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::setAcceptanceCondition ( unsigned int  numberOfSets,
acceptance_expr::ptr  accExpr 
)
inlineoverridevirtual

Called by the parser for the "Acceptance: acceptance-def" item [mandatory, once].

Parameters
numberOfSetsthe number of acceptance sets used to tag state / transition acceptance
accExpra boolean expression over acceptance atoms

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::setAPs ( const std::vector< std::string > &  aps)
inlineoverridevirtual

Called by the parser for the "AP: ap-def" item [optional, once].

Parameters
apsthe list of atomic propositions

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::setNumberOfStates ( unsigned int  numberOfStates)
inlineoverridevirtual

Called by the parser for the "States: int(numberOfStates)" item [optional, once].

Reimplemented from cpphoafparser::HOAIntermediate.

virtual void cpphoafparser::HOAIntermediateTrace::setTool ( const std::string &  name,
std::shared_ptr< std::string >  version 
)
inlineoverridevirtual

Called by the parser for the "tool: ..." item [optional, once].

Parameters
namethe tool name
versionthe tool version (option, empty pointer if not provided)

Reimplemented from cpphoafparser::HOAIntermediate.


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