xorp

VisitorSemantic Class Reference

A policy semantic checker. More...

#include <visitor_semantic.hh>

Inheritance diagram for VisitorSemantic:
NONCOPYABLE Visitor

List of all members.

Classes

class  sem_error
 Exception thrown on a semantic error. More...

Public Types

enum  PolicyType { IMPORT, EXPORT }

Public Member Functions

 VisitorSemantic (SemanticVarRW &varrw, VarMap &varmap, SetMap &setmap, PolicyMap &pmap, const string &protocol, PolicyType ptype)
const Elementvisit (PolicyStatement &policy)
const Elementvisit (Term &term)
const Elementvisit (NodeUn &node)
const Elementvisit (NodeBin &node)
const Elementvisit (NodeAssign &node)
const Elementvisit (NodeVar &node)
const Elementvisit (NodeSet &node)
const Elementvisit (NodeElem &node)
const Elementvisit (NodeAccept &node)
const Elementvisit (NodeReject &node)
const Elementvisit (NodeProto &node)
const Elementvisit (NodeNext &node)
const Elementvisit (NodeSubr &node)
const set< string > & sets () const

Private Member Functions

void change_protocol (const string &proto)
const string & semantic_protocol ()
const Elementdo_bin (const Element &left, const Element &right, const BinOper &op, const Node &from)
void do_policy_statement (PolicyStatement &ps)

Private Attributes

SemanticVarRW_varrw
VarMap_varmap
SetMap_setmap
PolicyMap_pmap
Dispatcher _disp
set< string > _sets
string _protocol
string _current_protocol
string _semantic_protocol
PolicyType _ptype
set< Element * > _trash
bool _reject

Detailed Description

A policy semantic checker.

A policy is instantiated by a protocol and policytype. Thus, semantic checking must be performed realtive to the instantiation. [Generic semantic checking may be accomplished too, but it is not done.]


Constructor & Destructor Documentation

VisitorSemantic::VisitorSemantic ( SemanticVarRW varrw,
VarMap varmap,
SetMap setmap,
PolicyMap pmap,
const string &  protocol,
PolicyType  ptype 
)
Parameters:
varrwsemantic VarRW used to simulate a protocol.
varmapthe varmap.
setmapthe SetMap to check if sets exist.
pmapthe policy map to check subroutines.
protocolthe protocol which instantiates the policy.
ptypethe type of policy [import/export].

Member Function Documentation

const set<string>& VisitorSemantic::sets ( ) const [inline]
Returns:
sets used by the policy.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations