xorp

policy_parser Namespace Reference

Minimises global namespace pollution of yacc/lex variables. More...

Functions

int policy_parse (vector< Node * > &outnodes, const Term::BLOCKS &block, const string &conf, string &outerr)
 Parser a policy.

Variables

vector< Node * > * _parser_nodes
unsigned _parser_lineno

Detailed Description

Minimises global namespace pollution of yacc/lex variables.

The nature of lex and yacc causes global variables / functions to be present. Here such methods and functions are grouped under one namespace.


Function Documentation

int policy_parser::policy_parse ( vector< Node * > &  outnodes,
const Term::BLOCKS &  block,
const string &  conf,
string &  outerr 
)

Parser a policy.

Caller is responsible for deleting nodes created from a partial parse due to errors.

Returns:
0 on success.
Parameters:
outnodeswhere parse tree will be stored.
blockthe policy block [source, action, dest] which is being parsed.
confconfiguration to parse.
outerron error, this buffer will be filled with an error message.
 All Classes Namespaces Functions Variables Typedefs Enumerations