Kea 2.7.5
isc::eval::EvalParser Class Reference

A Bison parser. More...

#include <parser.h>

Classes

struct  basic_symbol
 A complete symbol. More...
 
struct  by_kind
 Type access provider for token (enum) based symbols. More...
 
class  context
 
struct  symbol_kind
 Symbol kinds. More...
 
struct  symbol_type
 "External" symbols: returned by the scanner. More...
 
struct  syntax_error
 Syntax errors thrown from user actions. More...
 
struct  token
 Token kinds. More...
 
class  value_type
 A buffer to store and retrieve objects. More...
 

Public Types

typedef by_kind by_type
 Backward compatibility for a private implementation detail (Bison 3.6).
 
typedef location location_type
 Symbol locations.
 
typedef value_type semantic_type
 Backward compatibility (Bison 3.8).
 
typedef symbol_kind::symbol_kind_type symbol_kind_type
 (Internal) symbol kind.
 
typedef token::token_kind_type token_kind_type
 Token kind, as returned by yylex.
 
typedef token_kind_type token_type
 Backward compatibility alias (Bison 3.6).
 

Public Member Functions

 EvalParser (EvalContext &ctx_yyarg)
 Build a parser object.
 
virtual ~EvalParser ()
 
virtual void error (const location_type &loc, const std::string &msg)
 Report a syntax error.
 
void error (const syntax_error &err)
 Report a syntax error.
 
int operator() ()
 Parse.
 
virtual int parse ()
 Parse.
 

Static Public Member Functions

static symbol_type make_ADDRTOTEXT (const location_type &l)
 
static symbol_type make_ALL (const location_type &l)
 
static symbol_type make_AND (const location_type &l)
 
static symbol_type make_ANY (const location_type &l)
 
static symbol_type make_CHADDR (const location_type &l)
 
static symbol_type make_CIADDR (const location_type &l)
 
static symbol_type make_COMA (const location_type &l)
 
static symbol_type make_CONCAT (const location_type &l)
 
static symbol_type make_DATA (const location_type &l)
 
static symbol_type make_DOT (const location_type &l)
 
static symbol_type make_DST (const location_type &l)
 
static symbol_type make_END (const location_type &l)
 
static symbol_type make_ENTERPRISE (const location_type &l)
 
static symbol_type make_EQUAL (const location_type &l)
 
static symbol_type make_EVALerror (const location_type &l)
 
static symbol_type make_EVALUNDEF (const location_type &l)
 
static symbol_type make_EXISTS (const location_type &l)
 
static symbol_type make_GIADDR (const location_type &l)
 
static symbol_type make_HEX (const location_type &l)
 
static symbol_type make_HEXSTRING (const std::string &v, const location_type &l)
 
static symbol_type make_HLEN (const location_type &l)
 
static symbol_type make_HTYPE (const location_type &l)
 
static symbol_type make_IFACE (const location_type &l)
 
static symbol_type make_IFELSE (const location_type &l)
 
static symbol_type make_INT16TOTEXT (const location_type &l)
 
static symbol_type make_INT32TOTEXT (const location_type &l)
 
static symbol_type make_INT8TOTEXT (const location_type &l)
 
static symbol_type make_INTEGER (const std::string &v, const location_type &l)
 
static symbol_type make_IP_ADDRESS (const std::string &v, const location_type &l)
 
static symbol_type make_LBRACKET (const location_type &l)
 
static symbol_type make_LCASE (const location_type &l)
 
static symbol_type make_LEN (const location_type &l)
 
static symbol_type make_LINKADDR (const location_type &l)
 
static symbol_type make_LPAREN (const location_type &l)
 
static symbol_type make_MATCH (const location_type &l)
 
static symbol_type make_MEMBER (const location_type &l)
 
static symbol_type make_MSGTYPE (const location_type &l)
 
static symbol_type make_NOT (const location_type &l)
 
static symbol_type make_OPTION (const location_type &l)
 
static symbol_type make_OPTION_NAME (const std::string &v, const location_type &l)
 
static symbol_type make_OR (const location_type &l)
 
static symbol_type make_PEERADDR (const location_type &l)
 
static symbol_type make_PKT (const location_type &l)
 
static symbol_type make_PKT4 (const location_type &l)
 
static symbol_type make_PKT6 (const location_type &l)
 
static symbol_type make_PLUS (const location_type &l)
 
static symbol_type make_RBRACKET (const location_type &l)
 
static symbol_type make_RELAY4 (const location_type &l)
 
static symbol_type make_RELAY6 (const location_type &l)
 
static symbol_type make_RPAREN (const location_type &l)
 
static symbol_type make_SAND (const location_type &l)
 
static symbol_type make_SIADDR (const location_type &l)
 
static symbol_type make_SIFELSE (const location_type &l)
 
static symbol_type make_SOR (const location_type &l)
 
static symbol_type make_SPLIT (const location_type &l)
 
static symbol_type make_SRC (const location_type &l)
 
static symbol_type make_STRING (const std::string &v, const location_type &l)
 
static symbol_type make_SUBSTRING (const location_type &l)
 
static symbol_type make_TEXT (const location_type &l)
 
static symbol_type make_TOHEXSTRING (const location_type &l)
 
static symbol_type make_TOPLEVEL_BOOL (const location_type &l)
 
static symbol_type make_TOPLEVEL_STRING (const location_type &l)
 
static symbol_type make_TRANSID (const location_type &l)
 
static symbol_type make_UCASE (const location_type &l)
 
static symbol_type make_UINT16TOTEXT (const location_type &l)
 
static symbol_type make_UINT32TOTEXT (const location_type &l)
 
static symbol_type make_UINT8TOTEXT (const location_type &l)
 
static symbol_type make_VENDOR (const location_type &l)
 
static symbol_type make_VENDOR_CLASS (const location_type &l)
 
static symbol_type make_YIADDR (const location_type &l)
 
static std::string symbol_name (symbol_kind_type yysymbol)
 The user-facing name of the symbol whose (internal) number is YYSYMBOL.
 

Static Public Attributes

static const symbol_kind_type YYNTOKENS = symbol_kind::YYNTOKENS
 The number of tokens.
 

Detailed Description

A Bison parser.

Definition at line 214 of file parser.h.

Member Typedef Documentation

◆ by_type

Backward compatibility for a private implementation detail (Bison 3.6).

Definition at line 1057 of file parser.h.

◆ location_type

Symbol locations.

Definition at line 482 of file parser.h.

◆ semantic_type

Backward compatibility (Bison 3.8).

Definition at line 479 of file parser.h.

◆ symbol_kind_type

(Internal) symbol kind.

Definition at line 692 of file parser.h.

◆ token_kind_type

Token kind, as returned by yylex.

Definition at line 584 of file parser.h.

◆ token_type

Backward compatibility alias (Bison 3.6).

Definition at line 587 of file parser.h.

Constructor & Destructor Documentation

◆ EvalParser()

isc::eval::EvalParser::EvalParser ( EvalContext & ctx_yyarg)

Build a parser object.

Definition at line 152 of file parser.cc.

◆ ~EvalParser()

isc::eval::EvalParser::~EvalParser ( )
virtual

Definition at line 162 of file parser.cc.

Member Function Documentation

◆ error() [1/2]

void isc::eval::EvalParser::error ( const location_type & loc,
const std::string & msg )
virtual

Report a syntax error.

Parameters
locwhere the syntax error is found.
msga description of the syntax error.

Definition at line 2363 of file parser.cc.

◆ error() [2/2]

void isc::eval::EvalParser::error ( const syntax_error & err)

Report a syntax error.

Definition at line 1879 of file parser.cc.

References isc::db::error.

◆ make_ADDRTOTEXT()

static symbol_type isc::eval::EvalParser::make_ADDRTOTEXT ( const location_type & l)
inlinestatic

Definition at line 1827 of file parser.h.

◆ make_ALL()

static symbol_type isc::eval::EvalParser::make_ALL ( const location_type & l)
inlinestatic

Definition at line 1722 of file parser.h.

◆ make_AND()

static symbol_type isc::eval::EvalParser::make_AND ( const location_type & l)
inlinestatic

Definition at line 1242 of file parser.h.

◆ make_ANY()

static symbol_type isc::eval::EvalParser::make_ANY ( const location_type & l)
inlinestatic

Definition at line 2037 of file parser.h.

◆ make_CHADDR()

static symbol_type isc::eval::EvalParser::make_CHADDR ( const location_type & l)
inlinestatic

Definition at line 1587 of file parser.h.

◆ make_CIADDR()

static symbol_type isc::eval::EvalParser::make_CIADDR ( const location_type & l)
inlinestatic

Definition at line 1632 of file parser.h.

◆ make_COMA()

static symbol_type isc::eval::EvalParser::make_COMA ( const location_type & l)
inlinestatic

Definition at line 1737 of file parser.h.

◆ make_CONCAT()

static symbol_type isc::eval::EvalParser::make_CONCAT ( const location_type & l)
inlinestatic

Definition at line 1752 of file parser.h.

◆ make_DATA()

static symbol_type isc::eval::EvalParser::make_DATA ( const location_type & l)
inlinestatic

Definition at line 2052 of file parser.h.

◆ make_DOT()

static symbol_type isc::eval::EvalParser::make_DOT ( const location_type & l)
inlinestatic

Definition at line 1437 of file parser.h.

◆ make_DST()

static symbol_type isc::eval::EvalParser::make_DST ( const location_type & l)
inlinestatic

Definition at line 1542 of file parser.h.

◆ make_END()

static symbol_type isc::eval::EvalParser::make_END ( const location_type & l)
inlinestatic

Definition at line 1152 of file parser.h.

◆ make_ENTERPRISE()

static symbol_type isc::eval::EvalParser::make_ENTERPRISE ( const location_type & l)
inlinestatic

Definition at line 2067 of file parser.h.

◆ make_EQUAL()

static symbol_type isc::eval::EvalParser::make_EQUAL ( const location_type & l)
inlinestatic

Definition at line 1302 of file parser.h.

◆ make_EVALerror()

static symbol_type isc::eval::EvalParser::make_EVALerror ( const location_type & l)
inlinestatic

Definition at line 1167 of file parser.h.

◆ make_EVALUNDEF()

static symbol_type isc::eval::EvalParser::make_EVALUNDEF ( const location_type & l)
inlinestatic

Definition at line 1182 of file parser.h.

◆ make_EXISTS()

static symbol_type isc::eval::EvalParser::make_EXISTS ( const location_type & l)
inlinestatic

Definition at line 1482 of file parser.h.

◆ make_GIADDR()

static symbol_type isc::eval::EvalParser::make_GIADDR ( const location_type & l)
inlinestatic

Definition at line 1647 of file parser.h.

◆ make_HEX()

static symbol_type isc::eval::EvalParser::make_HEX ( const location_type & l)
inlinestatic

Definition at line 1467 of file parser.h.

◆ make_HEXSTRING()

static symbol_type isc::eval::EvalParser::make_HEXSTRING ( const std::string & v,
const location_type & l )
inlinestatic

Definition at line 2157 of file parser.h.

◆ make_HLEN()

static symbol_type isc::eval::EvalParser::make_HLEN ( const location_type & l)
inlinestatic

Definition at line 1602 of file parser.h.

◆ make_HTYPE()

static symbol_type isc::eval::EvalParser::make_HTYPE ( const location_type & l)
inlinestatic

Definition at line 1617 of file parser.h.

◆ make_IFACE()

static symbol_type isc::eval::EvalParser::make_IFACE ( const location_type & l)
inlinestatic

Definition at line 1512 of file parser.h.

◆ make_IFELSE()

static symbol_type isc::eval::EvalParser::make_IFELSE ( const location_type & l)
inlinestatic

Definition at line 1782 of file parser.h.

◆ make_INT16TOTEXT()

static symbol_type isc::eval::EvalParser::make_INT16TOTEXT ( const location_type & l)
inlinestatic

Definition at line 1857 of file parser.h.

◆ make_INT32TOTEXT()

static symbol_type isc::eval::EvalParser::make_INT32TOTEXT ( const location_type & l)
inlinestatic

Definition at line 1872 of file parser.h.

◆ make_INT8TOTEXT()

static symbol_type isc::eval::EvalParser::make_INT8TOTEXT ( const location_type & l)
inlinestatic

Definition at line 1842 of file parser.h.

◆ make_INTEGER()

static symbol_type isc::eval::EvalParser::make_INTEGER ( const std::string & v,
const location_type & l )
inlinestatic

Definition at line 2142 of file parser.h.

◆ make_IP_ADDRESS()

static symbol_type isc::eval::EvalParser::make_IP_ADDRESS ( const std::string & v,
const location_type & l )
inlinestatic

Definition at line 2187 of file parser.h.

◆ make_LBRACKET()

static symbol_type isc::eval::EvalParser::make_LBRACKET ( const location_type & l)
inlinestatic

Definition at line 1407 of file parser.h.

◆ make_LCASE()

static symbol_type isc::eval::EvalParser::make_LCASE ( const location_type & l)
inlinestatic

Definition at line 1932 of file parser.h.

◆ make_LEN()

static symbol_type isc::eval::EvalParser::make_LEN ( const location_type & l)
inlinestatic

Definition at line 1557 of file parser.h.

◆ make_LINKADDR()

static symbol_type isc::eval::EvalParser::make_LINKADDR ( const location_type & l)
inlinestatic

Definition at line 1392 of file parser.h.

◆ make_LPAREN()

static symbol_type isc::eval::EvalParser::make_LPAREN ( const location_type & l)
inlinestatic

Definition at line 1197 of file parser.h.

◆ make_MATCH()

static symbol_type isc::eval::EvalParser::make_MATCH ( const location_type & l)
inlinestatic

Definition at line 2082 of file parser.h.

◆ make_MEMBER()

static symbol_type isc::eval::EvalParser::make_MEMBER ( const location_type & l)
inlinestatic

Definition at line 1362 of file parser.h.

◆ make_MSGTYPE()

static symbol_type isc::eval::EvalParser::make_MSGTYPE ( const location_type & l)
inlinestatic

Definition at line 1977 of file parser.h.

◆ make_NOT()

static symbol_type isc::eval::EvalParser::make_NOT ( const location_type & l)
inlinestatic

Definition at line 1227 of file parser.h.

◆ make_OPTION()

static symbol_type isc::eval::EvalParser::make_OPTION ( const location_type & l)
inlinestatic

Definition at line 1317 of file parser.h.

◆ make_OPTION_NAME()

static symbol_type isc::eval::EvalParser::make_OPTION_NAME ( const std::string & v,
const location_type & l )
inlinestatic

Definition at line 2172 of file parser.h.

◆ make_OR()

static symbol_type isc::eval::EvalParser::make_OR ( const location_type & l)
inlinestatic

Definition at line 1272 of file parser.h.

◆ make_PEERADDR()

static symbol_type isc::eval::EvalParser::make_PEERADDR ( const location_type & l)
inlinestatic

Definition at line 1377 of file parser.h.

◆ make_PKT()

static symbol_type isc::eval::EvalParser::make_PKT ( const location_type & l)
inlinestatic

Definition at line 1497 of file parser.h.

◆ make_PKT4()

static symbol_type isc::eval::EvalParser::make_PKT4 ( const location_type & l)
inlinestatic

Definition at line 1572 of file parser.h.

◆ make_PKT6()

static symbol_type isc::eval::EvalParser::make_PKT6 ( const location_type & l)
inlinestatic

Definition at line 1962 of file parser.h.

◆ make_PLUS()

static symbol_type isc::eval::EvalParser::make_PLUS ( const location_type & l)
inlinestatic

Definition at line 1767 of file parser.h.

◆ make_RBRACKET()

static symbol_type isc::eval::EvalParser::make_RBRACKET ( const location_type & l)
inlinestatic

Definition at line 1422 of file parser.h.

◆ make_RELAY4()

static symbol_type isc::eval::EvalParser::make_RELAY4 ( const location_type & l)
inlinestatic

Definition at line 1332 of file parser.h.

◆ make_RELAY6()

static symbol_type isc::eval::EvalParser::make_RELAY6 ( const location_type & l)
inlinestatic

Definition at line 1347 of file parser.h.

◆ make_RPAREN()

static symbol_type isc::eval::EvalParser::make_RPAREN ( const location_type & l)
inlinestatic

Definition at line 1212 of file parser.h.

◆ make_SAND()

static symbol_type isc::eval::EvalParser::make_SAND ( const location_type & l)
inlinestatic

Definition at line 1257 of file parser.h.

◆ make_SIADDR()

static symbol_type isc::eval::EvalParser::make_SIADDR ( const location_type & l)
inlinestatic

Definition at line 1677 of file parser.h.

◆ make_SIFELSE()

static symbol_type isc::eval::EvalParser::make_SIFELSE ( const location_type & l)
inlinestatic

Definition at line 1797 of file parser.h.

◆ make_SOR()

static symbol_type isc::eval::EvalParser::make_SOR ( const location_type & l)
inlinestatic

Definition at line 1287 of file parser.h.

◆ make_SPLIT()

static symbol_type isc::eval::EvalParser::make_SPLIT ( const location_type & l)
inlinestatic

Definition at line 1707 of file parser.h.

◆ make_SRC()

static symbol_type isc::eval::EvalParser::make_SRC ( const location_type & l)
inlinestatic

Definition at line 1527 of file parser.h.

◆ make_STRING()

static symbol_type isc::eval::EvalParser::make_STRING ( const std::string & v,
const location_type & l )
inlinestatic

Definition at line 2127 of file parser.h.

◆ make_SUBSTRING()

static symbol_type isc::eval::EvalParser::make_SUBSTRING ( const location_type & l)
inlinestatic

Definition at line 1692 of file parser.h.

◆ make_TEXT()

static symbol_type isc::eval::EvalParser::make_TEXT ( const location_type & l)
inlinestatic

Definition at line 1452 of file parser.h.

◆ make_TOHEXSTRING()

static symbol_type isc::eval::EvalParser::make_TOHEXSTRING ( const location_type & l)
inlinestatic

Definition at line 1812 of file parser.h.

◆ make_TOPLEVEL_BOOL()

static symbol_type isc::eval::EvalParser::make_TOPLEVEL_BOOL ( const location_type & l)
inlinestatic

Definition at line 2097 of file parser.h.

◆ make_TOPLEVEL_STRING()

static symbol_type isc::eval::EvalParser::make_TOPLEVEL_STRING ( const location_type & l)
inlinestatic

Definition at line 2112 of file parser.h.

◆ make_TRANSID()

static symbol_type isc::eval::EvalParser::make_TRANSID ( const location_type & l)
inlinestatic

Definition at line 1992 of file parser.h.

◆ make_UCASE()

static symbol_type isc::eval::EvalParser::make_UCASE ( const location_type & l)
inlinestatic

Definition at line 1947 of file parser.h.

◆ make_UINT16TOTEXT()

static symbol_type isc::eval::EvalParser::make_UINT16TOTEXT ( const location_type & l)
inlinestatic

Definition at line 1902 of file parser.h.

◆ make_UINT32TOTEXT()

static symbol_type isc::eval::EvalParser::make_UINT32TOTEXT ( const location_type & l)
inlinestatic

Definition at line 1917 of file parser.h.

◆ make_UINT8TOTEXT()

static symbol_type isc::eval::EvalParser::make_UINT8TOTEXT ( const location_type & l)
inlinestatic

Definition at line 1887 of file parser.h.

◆ make_VENDOR()

static symbol_type isc::eval::EvalParser::make_VENDOR ( const location_type & l)
inlinestatic

Definition at line 2022 of file parser.h.

◆ make_VENDOR_CLASS()

static symbol_type isc::eval::EvalParser::make_VENDOR_CLASS ( const location_type & l)
inlinestatic

Definition at line 2007 of file parser.h.

◆ make_YIADDR()

static symbol_type isc::eval::EvalParser::make_YIADDR ( const location_type & l)
inlinestatic

Definition at line 1662 of file parser.h.

◆ operator()()

int isc::eval::EvalParser::operator() ( )

Parse.

An alias for parse ().

Returns
0 iff parsing succeeded.

Definition at line 638 of file parser.cc.

References parse().

+ Here is the call graph for this function:

◆ parse()

int isc::eval::EvalParser::parse ( )
virtual

Parse.

Returns
0 iff parsing succeeded.

Length of the RHS of the rule being reduced.

The lookahead symbol.

The locations where the error started and ended.

The return value of parse ().

Definition at line 644 of file parser.cc.

References isc::dhcp::TokenPkt4::CHADDR, isc::dhcp::TokenPkt4::CIADDR, isc::eval::EvalContext::convertNestLevelNumber(), isc::eval::EvalContext::convertOptionCode(), isc::eval::EvalContext::convertOptionName(), isc::eval::EvalContext::convertUint32(), isc::eval::EvalContext::convertUint8(), isc::dhcp::TokenVendor::DATA, isc::dhcp::TokenPkt::DST, isc::dhcp::TokenVendor::ENTERPRISE_ID, isc::db::error, isc::dhcp::TokenOption::EXISTS, isc::eval::EvalContext::expression_, isc::eval::EvalContext::getUniverse(), isc::dhcp::TokenPkt4::GIADDR, isc::dhcp::TokenOption::HEXADECIMAL, isc::dhcp::TokenPkt4::HLEN, isc::dhcp::TokenPkt4::HTYPE, isc::dhcp::TokenPkt::IFACE, isc::eval::EvalContext::isClientClassDefined(), isc::eval::EvalContext::label_, isc::eval::EvalContext::labels_, isc::dhcp::TokenPkt::LEN, isc::dhcp::TokenRelay6Field::LINKADDR, isc::dhcp::TokenPkt4::MSGTYPE, isc::dhcp::TokenPkt6::MSGTYPE, isc::dhcp::TokenRelay6Field::PEERADDR, isc::eval::EvalParser::symbol_kind::S_enterprise_id, isc::eval::EvalParser::symbol_kind::S_HEXSTRING, isc::eval::EvalParser::symbol_kind::S_INTEGER, isc::eval::EvalParser::symbol_kind::S_integer_expr, isc::eval::EvalParser::symbol_kind::S_IP_ADDRESS, isc::eval::EvalParser::symbol_kind::S_nest_level, isc::eval::EvalParser::symbol_kind::S_option_code, isc::eval::EvalParser::symbol_kind::S_OPTION_NAME, isc::eval::EvalParser::symbol_kind::S_option_repr_type, isc::eval::EvalParser::symbol_kind::S_pkt4_field, isc::eval::EvalParser::symbol_kind::S_pkt6_field, isc::eval::EvalParser::symbol_kind::S_pkt_metadata, isc::eval::EvalParser::symbol_kind::S_relay6_field, isc::eval::EvalParser::symbol_kind::S_STRING, isc::eval::EvalParser::symbol_kind::S_sub_option_code, isc::eval::EvalParser::symbol_kind::S_YYEOF, isc::eval::EvalParser::symbol_kind::S_YYerror, isc::eval::EvalParser::symbol_kind::S_YYUNDEF, isc::dhcp::TokenPkt4::SIADDR, isc::dhcp::TokenPkt::SRC, isc::dhcp::TokenOption::TEXTUAL, isc::dhcp::TokenPkt4::TRANSID, isc::dhcp::TokenPkt6::TRANSID, isc::dhcp::Option::V4, isc::dhcp::Option::V6, isc::dhcp::TokenPkt4::YIADDR, YY_MOVE, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, YYCDEBUG, YYERROR, yylex, and YYLLOC_DEFAULT.

Referenced by operator()(), and isc::eval::EvalContext::parseString().

+ Here is the call graph for this function:

◆ symbol_name()

std::string isc::eval::EvalParser::symbol_name ( symbol_kind_type yysymbol)
static

The user-facing name of the symbol whose (internal) number is YYSYMBOL.

No bounds checking.

Definition at line 1925 of file parser.cc.

Referenced by isc::eval::EvalParser::basic_symbol< Base >::name().

Member Data Documentation

◆ YYNTOKENS

const symbol_kind_type isc::eval::EvalParser::YYNTOKENS = symbol_kind::YYNTOKENS
static

The number of tokens.

Definition at line 695 of file parser.h.

Referenced by isc::eval::EvalParser::context::expected_tokens().


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