class CodeGenerator

Generic code generator. It is suitable for import filters. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods

Protected Methods

Protected Members


Detailed Description

This class visits a structure of Nodes and generates appropriate code.

CodeGeneratorErr (class)

CodeGeneratorErr

This may occur for example, if an import policy has a dest part. The semantic check should however get rid of all errors.

 CodeGenerator (const VarMap& varmap, PolicyMap& pmap)

CodeGenerator

 CodeGenerator (const string& proto, const filter::Filter& filter, const VarMap& varmap, PolicyMap& pmap)

CodeGenerator

Generate code for a specific protocol and filter [target]

This construct is mainly used by derived classes to set the code target.

Parameters:

prototarget protocol.
filtertarget filter type.
varmapvarmap.
 CodeGenerator (const string& proto, const VarMap& varmap, PolicyMap& pmap)

CodeGenerator

Initialize code generation for an import of a specific protocol.

Parameters:

prototarget protocol.
varmapvarmap.
 ~CodeGenerator ()

~CodeGenerator

[virtual]

const Element*  visit (NodeUn& node)

visit

Reimplemented from Visitor.

const Element*  visit (NodeBin& node)

visit

Reimplemented from Visitor.

const Element*  visit (NodeAssign& node)

visit

Reimplemented from Visitor.

const Element*  visit (NodeElem& node)

visit

Reimplemented from Visitor.

const Element*  visit (NodeVar& node)

visit

Reimplemented from Visitor.

const Element*  visit (NodeSet& node)

visit

Reimplemented from Visitor.

const Element*  visit (NodeAccept& node)

visit

Reimplemented from Visitor.

const Element*  visit (NodeReject& node)

visit

Reimplemented from Visitor.

const Element*  visit (PolicyStatement& policy)

visit

Reimplemented from Visitor.

const Element*  visit (Term& policy)

visit

Reimplemented from Visitor.

const Element*  visit (NodeProto& policy)

visit

Reimplemented from Visitor.

const Element*  visit (NodeNext& node)

visit

Reimplemented from Visitor.

const Element*  visit (NodeSubr& node)

visit

Reimplemented from Visitor.

const Code&  code ()

code

Returns: code generated.

const Element*  visit_policy (PolicyStatement& policy)

visit_policy

[protected virtual]

const Element*  visit_term (Term& term)

visit_term

[protected virtual]

const Element*  visit_proto (NodeProto& node)

visit_proto

[protected virtual]

const string&  protocol ()

protocol

[protected virtual]

Code _code

_code

[protected]

ostringstream _os

_os

[protected]

const VarMap& _varmap

_varmap

[protected]

PolicyMap& _pmap

_pmap

[protected]

bool _subr

_subr

[protected]


Generated by: pavlin on kobe.xorp.net on Wed Jan 7 19:11:02 2009, using kdoc 2.0a54+XORP.