NodeWalker Struct Reference

Private and protected interface of class 'NodeWalker'. More...

#include <NodeWalker_private.h>

Public Member Functions

 INHERITS_FROM (EnvObject)

Data Fields

boolean can_handle_null
int low
MasterNodeWalker_ptr master
char * name
array_tnode_transformations
size_t num

Related Functions

(Note that these are not member functions.)



boolean node_walker_can_handle_null_node (const NodeWalker_ptr self)
 Returns true if the walker can handle the null case.
void node_walker_deinit (NodeWalker_ptr self)
 The NodeWalker class private deinitializer.
void node_walker_init (NodeWalker_ptr self, const NuSMVEnv_ptr env, const char *name, int low, size_t num, boolean can_handle_null)
 The NodeWalker class private initializer.
node_ptr node_walker_run_transformation_chain (const NodeWalker_ptr self, node_ptr node)
void node_walker_set_master (NodeWalker_ptr self, MasterNodeWalker_ptr master)
 This method is privately called by master while registering the walker.
int NodeWalker_add_node_transformation (NodeWalker_ptr self, const NodeTransformation *nt)
 Adds a node tranformation function that will be called at each step before printing.
boolean NodeWalker_can_handle (const NodeWalker_ptr self, node_ptr n)
 Returns true if the given node belongs to the partition associated to this walker.
boolean NodeWalker_collides (const NodeWalker_ptr self, const NodeWalker_ptr other)
 Checks if self collides with other in terms of their respective symbol sets.
NodeWalker_ptr NodeWalker_create (const NuSMVEnv_ptr env, const char *name, int low, size_t num, boolean can_handle_null)
 Creates and initializes a walker. To be usable, the walker will have to be registered to a MasterNodeWalker.
void NodeWalker_destroy (NodeWalker_ptr self)
 The NodeWalker class destructor.
const char * NodeWalker_get_name (const NodeWalker_ptr self)
 Returns the walker name as a string.
void NodeWalker_remove_node_transformation (NodeWalker_ptr self, int tranf_handle)

Detailed Description

Private and protected interface of class 'NodeWalker'.

Public interface of class 'NodeWalker'.

Author:
Roberto Cavada This file can be included only by derived and friend classes

NodeWalker class definition derived from class Object

See also:
Base class Object
Author:
Roberto Cavada A NodeWalker instance is used to traverse a parse tree. Depending on the purpose, the class must be specialized. For example a node printer, or a type checker would derive from this class. A node walker can handle a partition over the set of node's types, and one instance can live into a 'master' that is responsible for calling the right walker depending on the node it is traversing.

See for example classes node.printers.PrinterBase and compile.type_checking.checkers.CheckerBase

Definition of the public accessor for class NodeWalker


Member Function Documentation

NodeWalker::INHERITS_FROM ( EnvObject   ) 

Friends And Related Function Documentation

boolean node_walker_can_handle_null_node ( const NodeWalker_ptr  self  )  [related]

Returns true if the walker can handle the null case.

The null case is trasversal to the partitions set, so only the first registered walker that can handle null case will be called to handle the null node.

void node_walker_deinit ( NodeWalker_ptr  self  )  [related]

The NodeWalker class private deinitializer.

The NodeWalker class private deinitializer

See also:
NodeWalker_destroy
void node_walker_init ( NodeWalker_ptr  self,
const NuSMVEnv_ptr  env,
const char *  name,
int  low,
size_t  num,
boolean  can_handle_null 
) [related]

The NodeWalker class private initializer.

The NodeWalker class private initializer

See also:
NodeWalker_create
node_ptr node_walker_run_transformation_chain ( const NodeWalker_ptr  self,
node_ptr  node 
) [related]

Protected method to call the transformation chain of nodes iff the user has set a transformation chain.

See also:
NodeWalker_add_node_transformation
void node_walker_set_master ( NodeWalker_ptr  self,
MasterNodeWalker_ptr  master 
) [related]

This method is privately called by master while registering the walker.

If already assigned to a master, it unregisters itself from the old master before setting the new master

int NodeWalker_add_node_transformation ( NodeWalker_ptr  self,
const NodeTransformation nt 
) [related]

Adds a node tranformation function that will be called at each step before printing.

A shallow copy of the given structure will be done and kept internally. Returned handle can be used later to remove the transformation.

See also:
NodeWalker_remove_node_transformation
boolean NodeWalker_can_handle ( const NodeWalker_ptr  self,
node_ptr  n 
) [related]

Returns true if the given node belongs to the partition associated to this walker.

Returns true if the given node belongs to the partition associated to this walker. If n is Nil then the specific walker will be asked

boolean NodeWalker_collides ( const NodeWalker_ptr  self,
const NodeWalker_ptr  other 
) [related]

Checks if self collides with other in terms of their respective symbol sets.

Returns true if self and other's symbols set collide (i.e. are not partitions). Returns false if they are ok.

NodeWalker_ptr NodeWalker_create ( const NuSMVEnv_ptr  env,
const char *  name,
int  low,
size_t  num,
boolean  can_handle_null 
) [related]

Creates and initializes a walker. To be usable, the walker will have to be registered to a MasterNodeWalker.

To each walker is associated a partition of consecutive indices over the symbols set. The lowest index of the partition is given through the parameter low, while num is the partition size. Name is used to easily identify walker instances.

Constructor is private, as this class is a virtual base class.

can_handle_null must be set to true if the walker can handle the null case. The null case is trasversal to the partitions set, so only the first registered walker that can handle null case will be called to handle the null node.

See also:
NodeWalker_destroy
void NodeWalker_destroy ( NodeWalker_ptr  self  )  [related]

The NodeWalker class destructor.

The NodeWalker class destructor. If registerd to a master, it unregisters itself before finalizing.

See also:
NodeWalker_create
const char * NodeWalker_get_name ( const NodeWalker_ptr  self  )  [related]

Returns the walker name as a string.

The returned string belongs to self, do not deallocate or change it.

void NodeWalker_remove_node_transformation ( NodeWalker_ptr  self,
int  tranf_handle 
) [related]

Removes a previously registered node transformation.

See also:
NodeWalker_add_node_transformation

Field Documentation


The documentation for this struct was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 14 Oct 2015 for NuSMV Developers Manual by  doxygen 1.6.1