d2_parser.h 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606
  1. // A Bison parser, made by GNU Bison 3.0.4.
  2. // Skeleton interface for Bison LALR(1) parsers in C++
  3. // Copyright (C) 2002-2015 Free Software Foundation, Inc.
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. // This program is distributed in the hope that it will be useful,
  9. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. // GNU General Public License for more details.
  12. // You should have received a copy of the GNU General Public License
  13. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. // As a special exception, you may create a larger work that contains
  15. // part or all of the Bison parser skeleton and distribute that work
  16. // under terms of your choice, so long as that work isn't itself a
  17. // parser generator using the skeleton or a modified version thereof
  18. // as a parser skeleton. Alternatively, if you modify or redistribute
  19. // the parser skeleton itself, you may (at your option) remove this
  20. // special exception, which will cause the skeleton and the resulting
  21. // Bison output files to be licensed under the GNU General Public
  22. // License without this special exception.
  23. // This special exception was added by the Free Software Foundation in
  24. // version 2.2 of Bison.
  25. /**
  26. ** \file d2_parser.h
  27. ** Define the isc::d2::parser class.
  28. */
  29. // C++ LALR(1) parser skeleton written by Akim Demaille.
  30. #ifndef YY_D2_PARSER_D2_PARSER_H_INCLUDED
  31. # define YY_D2_PARSER_D2_PARSER_H_INCLUDED
  32. // // "%code requires" blocks.
  33. #line 17 "d2_parser.yy" // lalr1.cc:377
  34. #include <string>
  35. #include <cc/data.h>
  36. #include <d2/d2_config.h>
  37. #include <boost/lexical_cast.hpp>
  38. #include <d2/parser_context_decl.h>
  39. using namespace isc::d2;
  40. using namespace isc::data;
  41. using namespace std;
  42. #line 56 "d2_parser.h" // lalr1.cc:377
  43. # include <cassert>
  44. # include <cstdlib> // std::abort
  45. # include <iostream>
  46. # include <stdexcept>
  47. # include <string>
  48. # include <vector>
  49. # include "stack.hh"
  50. # include "location.hh"
  51. #include <typeinfo>
  52. #ifndef YYASSERT
  53. # include <cassert>
  54. # define YYASSERT assert
  55. #endif
  56. #ifndef YY_ATTRIBUTE
  57. # if (defined __GNUC__ \
  58. && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
  59. || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
  60. # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
  61. # else
  62. # define YY_ATTRIBUTE(Spec) /* empty */
  63. # endif
  64. #endif
  65. #ifndef YY_ATTRIBUTE_PURE
  66. # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
  67. #endif
  68. #ifndef YY_ATTRIBUTE_UNUSED
  69. # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
  70. #endif
  71. #if !defined _Noreturn \
  72. && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
  73. # if defined _MSC_VER && 1200 <= _MSC_VER
  74. # define _Noreturn __declspec (noreturn)
  75. # else
  76. # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
  77. # endif
  78. #endif
  79. /* Suppress unused-variable warnings by "using" E. */
  80. #if ! defined lint || defined __GNUC__
  81. # define YYUSE(E) ((void) (E))
  82. #else
  83. # define YYUSE(E) /* empty */
  84. #endif
  85. #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
  86. /* Suppress an incorrect diagnostic about yylval being uninitialized. */
  87. # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
  88. _Pragma ("GCC diagnostic push") \
  89. _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
  90. _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
  91. # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
  92. _Pragma ("GCC diagnostic pop")
  93. #else
  94. # define YY_INITIAL_VALUE(Value) Value
  95. #endif
  96. #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  97. # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  98. # define YY_IGNORE_MAYBE_UNINITIALIZED_END
  99. #endif
  100. #ifndef YY_INITIAL_VALUE
  101. # define YY_INITIAL_VALUE(Value) /* Nothing. */
  102. #endif
  103. /* Debug traces. */
  104. #ifndef D2_PARSER_DEBUG
  105. # if defined YYDEBUG
  106. #if YYDEBUG
  107. # define D2_PARSER_DEBUG 1
  108. # else
  109. # define D2_PARSER_DEBUG 0
  110. # endif
  111. # else /* ! defined YYDEBUG */
  112. # define D2_PARSER_DEBUG 1
  113. # endif /* ! defined YYDEBUG */
  114. #endif /* ! defined D2_PARSER_DEBUG */
  115. #line 14 "d2_parser.yy" // lalr1.cc:377
  116. namespace isc { namespace d2 {
  117. #line 141 "d2_parser.h" // lalr1.cc:377
  118. /// A char[S] buffer to store and retrieve objects.
  119. ///
  120. /// Sort of a variant, but does not keep track of the nature
  121. /// of the stored data, since that knowledge is available
  122. /// via the current state.
  123. template <size_t S>
  124. struct variant
  125. {
  126. /// Type of *this.
  127. typedef variant<S> self_type;
  128. /// Empty construction.
  129. variant ()
  130. : yytypeid_ (YY_NULLPTR)
  131. {}
  132. /// Construct and fill.
  133. template <typename T>
  134. variant (const T& t)
  135. : yytypeid_ (&typeid (T))
  136. {
  137. YYASSERT (sizeof (T) <= S);
  138. new (yyas_<T> ()) T (t);
  139. }
  140. /// Destruction, allowed only if empty.
  141. ~variant ()
  142. {
  143. YYASSERT (!yytypeid_);
  144. }
  145. /// Instantiate an empty \a T in here.
  146. template <typename T>
  147. T&
  148. build ()
  149. {
  150. YYASSERT (!yytypeid_);
  151. YYASSERT (sizeof (T) <= S);
  152. yytypeid_ = & typeid (T);
  153. return *new (yyas_<T> ()) T;
  154. }
  155. /// Instantiate a \a T in here from \a t.
  156. template <typename T>
  157. T&
  158. build (const T& t)
  159. {
  160. YYASSERT (!yytypeid_);
  161. YYASSERT (sizeof (T) <= S);
  162. yytypeid_ = & typeid (T);
  163. return *new (yyas_<T> ()) T (t);
  164. }
  165. /// Accessor to a built \a T.
  166. template <typename T>
  167. T&
  168. as ()
  169. {
  170. YYASSERT (*yytypeid_ == typeid (T));
  171. YYASSERT (sizeof (T) <= S);
  172. return *yyas_<T> ();
  173. }
  174. /// Const accessor to a built \a T (for %printer).
  175. template <typename T>
  176. const T&
  177. as () const
  178. {
  179. YYASSERT (*yytypeid_ == typeid (T));
  180. YYASSERT (sizeof (T) <= S);
  181. return *yyas_<T> ();
  182. }
  183. /// Swap the content with \a other, of same type.
  184. ///
  185. /// Both variants must be built beforehand, because swapping the actual
  186. /// data requires reading it (with as()), and this is not possible on
  187. /// unconstructed variants: it would require some dynamic testing, which
  188. /// should not be the variant's responsibility.
  189. /// Swapping between built and (possibly) non-built is done with
  190. /// variant::move ().
  191. template <typename T>
  192. void
  193. swap (self_type& other)
  194. {
  195. YYASSERT (yytypeid_);
  196. YYASSERT (*yytypeid_ == *other.yytypeid_);
  197. std::swap (as<T> (), other.as<T> ());
  198. }
  199. /// Move the content of \a other to this.
  200. ///
  201. /// Destroys \a other.
  202. template <typename T>
  203. void
  204. move (self_type& other)
  205. {
  206. build<T> ();
  207. swap<T> (other);
  208. other.destroy<T> ();
  209. }
  210. /// Copy the content of \a other to this.
  211. template <typename T>
  212. void
  213. copy (const self_type& other)
  214. {
  215. build<T> (other.as<T> ());
  216. }
  217. /// Destroy the stored \a T.
  218. template <typename T>
  219. void
  220. destroy ()
  221. {
  222. as<T> ().~T ();
  223. yytypeid_ = YY_NULLPTR;
  224. }
  225. private:
  226. /// Prohibit blind copies.
  227. self_type& operator=(const self_type&);
  228. variant (const self_type&);
  229. /// Accessor to raw memory as \a T.
  230. template <typename T>
  231. T*
  232. yyas_ ()
  233. {
  234. void *yyp = yybuffer_.yyraw;
  235. return static_cast<T*> (yyp);
  236. }
  237. /// Const accessor to raw memory as \a T.
  238. template <typename T>
  239. const T*
  240. yyas_ () const
  241. {
  242. const void *yyp = yybuffer_.yyraw;
  243. return static_cast<const T*> (yyp);
  244. }
  245. union
  246. {
  247. /// Strongest alignment constraints.
  248. long double yyalign_me;
  249. /// A buffer large enough to store any of the semantic values.
  250. char yyraw[S];
  251. } yybuffer_;
  252. /// Whether the content is built: if defined, the name of the stored type.
  253. const std::type_info *yytypeid_;
  254. };
  255. /// A Bison parser.
  256. class D2Parser
  257. {
  258. public:
  259. #ifndef D2_PARSER_STYPE
  260. /// An auxiliary type to compute the largest semantic type.
  261. union union_type
  262. {
  263. // value
  264. // ncr_protocol_value
  265. char dummy1[sizeof(ElementPtr)];
  266. // "boolean"
  267. char dummy2[sizeof(bool)];
  268. // "floating point"
  269. char dummy3[sizeof(double)];
  270. // "integer"
  271. char dummy4[sizeof(int64_t)];
  272. // "constant string"
  273. char dummy5[sizeof(std::string)];
  274. };
  275. /// Symbol semantic values.
  276. typedef variant<sizeof(union_type)> semantic_type;
  277. #else
  278. typedef D2_PARSER_STYPE semantic_type;
  279. #endif
  280. /// Symbol locations.
  281. typedef location location_type;
  282. /// Syntax errors thrown from user actions.
  283. struct syntax_error : std::runtime_error
  284. {
  285. syntax_error (const location_type& l, const std::string& m);
  286. location_type location;
  287. };
  288. /// Tokens.
  289. struct token
  290. {
  291. enum yytokentype
  292. {
  293. TOKEN_END = 0,
  294. TOKEN_COMMA = 258,
  295. TOKEN_COLON = 259,
  296. TOKEN_LSQUARE_BRACKET = 260,
  297. TOKEN_RSQUARE_BRACKET = 261,
  298. TOKEN_LCURLY_BRACKET = 262,
  299. TOKEN_RCURLY_BRACKET = 263,
  300. TOKEN_NULL_TYPE = 264,
  301. TOKEN_DHCP6 = 265,
  302. TOKEN_DHCP4 = 266,
  303. TOKEN_CONTROL_AGENT = 267,
  304. TOKEN_DHCPDDNS = 268,
  305. TOKEN_IP_ADDRESS = 269,
  306. TOKEN_PORT = 270,
  307. TOKEN_DNS_SERVER_TIMEOUT = 271,
  308. TOKEN_NCR_PROTOCOL = 272,
  309. TOKEN_UDP = 273,
  310. TOKEN_TCP = 274,
  311. TOKEN_NCR_FORMAT = 275,
  312. TOKEN_JSON = 276,
  313. TOKEN_FORWARD_DDNS = 277,
  314. TOKEN_REVERSE_DDNS = 278,
  315. TOKEN_DDNS_DOMAINS = 279,
  316. TOKEN_KEY_NAME = 280,
  317. TOKEN_DNS_SERVERS = 281,
  318. TOKEN_HOSTNAME = 282,
  319. TOKEN_TSIG_KEYS = 283,
  320. TOKEN_ALGORITHM = 284,
  321. TOKEN_DIGEST_BITS = 285,
  322. TOKEN_SECRET = 286,
  323. TOKEN_LOGGING = 287,
  324. TOKEN_LOGGERS = 288,
  325. TOKEN_NAME = 289,
  326. TOKEN_OUTPUT_OPTIONS = 290,
  327. TOKEN_OUTPUT = 291,
  328. TOKEN_DEBUGLEVEL = 292,
  329. TOKEN_SEVERITY = 293,
  330. TOKEN_FLUSH = 294,
  331. TOKEN_MAXSIZE = 295,
  332. TOKEN_MAXVER = 296,
  333. TOKEN_TOPLEVEL_JSON = 297,
  334. TOKEN_TOPLEVEL_DHCPDDNS = 298,
  335. TOKEN_SUB_DHCPDDNS = 299,
  336. TOKEN_SUB_TSIG_KEY = 300,
  337. TOKEN_SUB_TSIG_KEYS = 301,
  338. TOKEN_SUB_DDNS_DOMAIN = 302,
  339. TOKEN_SUB_DDNS_DOMAINS = 303,
  340. TOKEN_SUB_DNS_SERVER = 304,
  341. TOKEN_SUB_DNS_SERVERS = 305,
  342. TOKEN_STRING = 306,
  343. TOKEN_INTEGER = 307,
  344. TOKEN_FLOAT = 308,
  345. TOKEN_BOOLEAN = 309
  346. };
  347. };
  348. /// (External) token type, as returned by yylex.
  349. typedef token::yytokentype token_type;
  350. /// Symbol type: an internal symbol number.
  351. typedef int symbol_number_type;
  352. /// The symbol type number to denote an empty symbol.
  353. enum { empty_symbol = -2 };
  354. /// Internal symbol number for tokens (subsumed by symbol_number_type).
  355. typedef unsigned char token_number_type;
  356. /// A complete symbol.
  357. ///
  358. /// Expects its Base type to provide access to the symbol type
  359. /// via type_get().
  360. ///
  361. /// Provide access to semantic value and location.
  362. template <typename Base>
  363. struct basic_symbol : Base
  364. {
  365. /// Alias to Base.
  366. typedef Base super_type;
  367. /// Default constructor.
  368. basic_symbol ();
  369. /// Copy constructor.
  370. basic_symbol (const basic_symbol& other);
  371. /// Constructor for valueless symbols, and symbols from each type.
  372. basic_symbol (typename Base::kind_type t, const location_type& l);
  373. basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l);
  374. basic_symbol (typename Base::kind_type t, const bool v, const location_type& l);
  375. basic_symbol (typename Base::kind_type t, const double v, const location_type& l);
  376. basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l);
  377. basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l);
  378. /// Constructor for symbols with semantic value.
  379. basic_symbol (typename Base::kind_type t,
  380. const semantic_type& v,
  381. const location_type& l);
  382. /// Destroy the symbol.
  383. ~basic_symbol ();
  384. /// Destroy contents, and record that is empty.
  385. void clear ();
  386. /// Whether empty.
  387. bool empty () const;
  388. /// Destructive move, \a s is emptied into this.
  389. void move (basic_symbol& s);
  390. /// The semantic value.
  391. semantic_type value;
  392. /// The location.
  393. location_type location;
  394. private:
  395. /// Assignment operator.
  396. basic_symbol& operator= (const basic_symbol& other);
  397. };
  398. /// Type access provider for token (enum) based symbols.
  399. struct by_type
  400. {
  401. /// Default constructor.
  402. by_type ();
  403. /// Copy constructor.
  404. by_type (const by_type& other);
  405. /// The symbol type as needed by the constructor.
  406. typedef token_type kind_type;
  407. /// Constructor from (external) token numbers.
  408. by_type (kind_type t);
  409. /// Record that this symbol is empty.
  410. void clear ();
  411. /// Steal the symbol type from \a that.
  412. void move (by_type& that);
  413. /// The (internal) type number (corresponding to \a type).
  414. /// \a empty when empty.
  415. symbol_number_type type_get () const;
  416. /// The token.
  417. token_type token () const;
  418. /// The symbol type.
  419. /// \a empty_symbol when empty.
  420. /// An int, not token_number_type, to be able to store empty_symbol.
  421. int type;
  422. };
  423. /// "External" symbols: returned by the scanner.
  424. typedef basic_symbol<by_type> symbol_type;
  425. // Symbol constructors declarations.
  426. static inline
  427. symbol_type
  428. make_END (const location_type& l);
  429. static inline
  430. symbol_type
  431. make_COMMA (const location_type& l);
  432. static inline
  433. symbol_type
  434. make_COLON (const location_type& l);
  435. static inline
  436. symbol_type
  437. make_LSQUARE_BRACKET (const location_type& l);
  438. static inline
  439. symbol_type
  440. make_RSQUARE_BRACKET (const location_type& l);
  441. static inline
  442. symbol_type
  443. make_LCURLY_BRACKET (const location_type& l);
  444. static inline
  445. symbol_type
  446. make_RCURLY_BRACKET (const location_type& l);
  447. static inline
  448. symbol_type
  449. make_NULL_TYPE (const location_type& l);
  450. static inline
  451. symbol_type
  452. make_DHCP6 (const location_type& l);
  453. static inline
  454. symbol_type
  455. make_DHCP4 (const location_type& l);
  456. static inline
  457. symbol_type
  458. make_CONTROL_AGENT (const location_type& l);
  459. static inline
  460. symbol_type
  461. make_DHCPDDNS (const location_type& l);
  462. static inline
  463. symbol_type
  464. make_IP_ADDRESS (const location_type& l);
  465. static inline
  466. symbol_type
  467. make_PORT (const location_type& l);
  468. static inline
  469. symbol_type
  470. make_DNS_SERVER_TIMEOUT (const location_type& l);
  471. static inline
  472. symbol_type
  473. make_NCR_PROTOCOL (const location_type& l);
  474. static inline
  475. symbol_type
  476. make_UDP (const location_type& l);
  477. static inline
  478. symbol_type
  479. make_TCP (const location_type& l);
  480. static inline
  481. symbol_type
  482. make_NCR_FORMAT (const location_type& l);
  483. static inline
  484. symbol_type
  485. make_JSON (const location_type& l);
  486. static inline
  487. symbol_type
  488. make_FORWARD_DDNS (const location_type& l);
  489. static inline
  490. symbol_type
  491. make_REVERSE_DDNS (const location_type& l);
  492. static inline
  493. symbol_type
  494. make_DDNS_DOMAINS (const location_type& l);
  495. static inline
  496. symbol_type
  497. make_KEY_NAME (const location_type& l);
  498. static inline
  499. symbol_type
  500. make_DNS_SERVERS (const location_type& l);
  501. static inline
  502. symbol_type
  503. make_HOSTNAME (const location_type& l);
  504. static inline
  505. symbol_type
  506. make_TSIG_KEYS (const location_type& l);
  507. static inline
  508. symbol_type
  509. make_ALGORITHM (const location_type& l);
  510. static inline
  511. symbol_type
  512. make_DIGEST_BITS (const location_type& l);
  513. static inline
  514. symbol_type
  515. make_SECRET (const location_type& l);
  516. static inline
  517. symbol_type
  518. make_LOGGING (const location_type& l);
  519. static inline
  520. symbol_type
  521. make_LOGGERS (const location_type& l);
  522. static inline
  523. symbol_type
  524. make_NAME (const location_type& l);
  525. static inline
  526. symbol_type
  527. make_OUTPUT_OPTIONS (const location_type& l);
  528. static inline
  529. symbol_type
  530. make_OUTPUT (const location_type& l);
  531. static inline
  532. symbol_type
  533. make_DEBUGLEVEL (const location_type& l);
  534. static inline
  535. symbol_type
  536. make_SEVERITY (const location_type& l);
  537. static inline
  538. symbol_type
  539. make_FLUSH (const location_type& l);
  540. static inline
  541. symbol_type
  542. make_MAXSIZE (const location_type& l);
  543. static inline
  544. symbol_type
  545. make_MAXVER (const location_type& l);
  546. static inline
  547. symbol_type
  548. make_TOPLEVEL_JSON (const location_type& l);
  549. static inline
  550. symbol_type
  551. make_TOPLEVEL_DHCPDDNS (const location_type& l);
  552. static inline
  553. symbol_type
  554. make_SUB_DHCPDDNS (const location_type& l);
  555. static inline
  556. symbol_type
  557. make_SUB_TSIG_KEY (const location_type& l);
  558. static inline
  559. symbol_type
  560. make_SUB_TSIG_KEYS (const location_type& l);
  561. static inline
  562. symbol_type
  563. make_SUB_DDNS_DOMAIN (const location_type& l);
  564. static inline
  565. symbol_type
  566. make_SUB_DDNS_DOMAINS (const location_type& l);
  567. static inline
  568. symbol_type
  569. make_SUB_DNS_SERVER (const location_type& l);
  570. static inline
  571. symbol_type
  572. make_SUB_DNS_SERVERS (const location_type& l);
  573. static inline
  574. symbol_type
  575. make_STRING (const std::string& v, const location_type& l);
  576. static inline
  577. symbol_type
  578. make_INTEGER (const int64_t& v, const location_type& l);
  579. static inline
  580. symbol_type
  581. make_FLOAT (const double& v, const location_type& l);
  582. static inline
  583. symbol_type
  584. make_BOOLEAN (const bool& v, const location_type& l);
  585. /// Build a parser object.
  586. D2Parser (isc::d2::D2ParserContext& ctx_yyarg);
  587. virtual ~D2Parser ();
  588. /// Parse.
  589. /// \returns 0 iff parsing succeeded.
  590. virtual int parse ();
  591. #if D2_PARSER_DEBUG
  592. /// The current debugging stream.
  593. std::ostream& debug_stream () const YY_ATTRIBUTE_PURE;
  594. /// Set the current debugging stream.
  595. void set_debug_stream (std::ostream &);
  596. /// Type for debugging levels.
  597. typedef int debug_level_type;
  598. /// The current debugging level.
  599. debug_level_type debug_level () const YY_ATTRIBUTE_PURE;
  600. /// Set the current debugging level.
  601. void set_debug_level (debug_level_type l);
  602. #endif
  603. /// Report a syntax error.
  604. /// \param loc where the syntax error is found.
  605. /// \param msg a description of the syntax error.
  606. virtual void error (const location_type& loc, const std::string& msg);
  607. /// Report a syntax error.
  608. void error (const syntax_error& err);
  609. private:
  610. /// This class is not copyable.
  611. D2Parser (const D2Parser&);
  612. D2Parser& operator= (const D2Parser&);
  613. /// State numbers.
  614. typedef int state_type;
  615. /// Generate an error message.
  616. /// \param yystate the state where the error occurred.
  617. /// \param yyla the lookahead token.
  618. virtual std::string yysyntax_error_ (state_type yystate,
  619. const symbol_type& yyla) const;
  620. /// Compute post-reduction state.
  621. /// \param yystate the current state
  622. /// \param yysym the nonterminal to push on the stack
  623. state_type yy_lr_goto_state_ (state_type yystate, int yysym);
  624. /// Whether the given \c yypact_ value indicates a defaulted state.
  625. /// \param yyvalue the value to check
  626. static bool yy_pact_value_is_default_ (int yyvalue);
  627. /// Whether the given \c yytable_ value indicates a syntax error.
  628. /// \param yyvalue the value to check
  629. static bool yy_table_value_is_error_ (int yyvalue);
  630. static const signed char yypact_ninf_;
  631. static const signed char yytable_ninf_;
  632. /// Convert a scanner token number \a t to a symbol number.
  633. static token_number_type yytranslate_ (token_type t);
  634. // Tables.
  635. // YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  636. // STATE-NUM.
  637. static const short int yypact_[];
  638. // YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
  639. // Performed when YYTABLE does not specify something else to do. Zero
  640. // means the default is an error.
  641. static const unsigned char yydefact_[];
  642. // YYPGOTO[NTERM-NUM].
  643. static const signed char yypgoto_[];
  644. // YYDEFGOTO[NTERM-NUM].
  645. static const short int yydefgoto_[];
  646. // YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
  647. // positive, shift that token. If negative, reduce the rule whose
  648. // number is the opposite. If YYTABLE_NINF, syntax error.
  649. static const unsigned short int yytable_[];
  650. static const short int yycheck_[];
  651. // YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  652. // symbol of state STATE-NUM.
  653. static const unsigned char yystos_[];
  654. // YYR1[YYN] -- Symbol number of symbol that rule YYN derives.
  655. static const unsigned char yyr1_[];
  656. // YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.
  657. static const unsigned char yyr2_[];
  658. /// Convert the symbol name \a n to a form suitable for a diagnostic.
  659. static std::string yytnamerr_ (const char *n);
  660. /// For a symbol, its name in clear.
  661. static const char* const yytname_[];
  662. #if D2_PARSER_DEBUG
  663. // YYRLINE[YYN] -- Source line where rule number YYN was defined.
  664. static const unsigned short int yyrline_[];
  665. /// Report on the debug stream that the rule \a r is going to be reduced.
  666. virtual void yy_reduce_print_ (int r);
  667. /// Print the state stack on the debug stream.
  668. virtual void yystack_print_ ();
  669. // Debugging.
  670. int yydebug_;
  671. std::ostream* yycdebug_;
  672. /// \brief Display a symbol type, value and location.
  673. /// \param yyo The output stream.
  674. /// \param yysym The symbol.
  675. template <typename Base>
  676. void yy_print_ (std::ostream& yyo, const basic_symbol<Base>& yysym) const;
  677. #endif
  678. /// \brief Reclaim the memory associated to a symbol.
  679. /// \param yymsg Why this token is reclaimed.
  680. /// If null, print nothing.
  681. /// \param yysym The symbol.
  682. template <typename Base>
  683. void yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const;
  684. private:
  685. /// Type access provider for state based symbols.
  686. struct by_state
  687. {
  688. /// Default constructor.
  689. by_state ();
  690. /// The symbol type as needed by the constructor.
  691. typedef state_type kind_type;
  692. /// Constructor.
  693. by_state (kind_type s);
  694. /// Copy constructor.
  695. by_state (const by_state& other);
  696. /// Record that this symbol is empty.
  697. void clear ();
  698. /// Steal the symbol type from \a that.
  699. void move (by_state& that);
  700. /// The (internal) type number (corresponding to \a state).
  701. /// \a empty_symbol when empty.
  702. symbol_number_type type_get () const;
  703. /// The state number used to denote an empty symbol.
  704. enum { empty_state = -1 };
  705. /// The state.
  706. /// \a empty when empty.
  707. state_type state;
  708. };
  709. /// "Internal" symbol: element of the stack.
  710. struct stack_symbol_type : basic_symbol<by_state>
  711. {
  712. /// Superclass.
  713. typedef basic_symbol<by_state> super_type;
  714. /// Construct an empty symbol.
  715. stack_symbol_type ();
  716. /// Steal the contents from \a sym to build this.
  717. stack_symbol_type (state_type s, symbol_type& sym);
  718. /// Assignment, needed by push_back.
  719. stack_symbol_type& operator= (const stack_symbol_type& that);
  720. };
  721. /// Stack type.
  722. typedef stack<stack_symbol_type> stack_type;
  723. /// The stack.
  724. stack_type yystack_;
  725. /// Push a new state on the stack.
  726. /// \param m a debug message to display
  727. /// if null, no trace is output.
  728. /// \param s the symbol
  729. /// \warning the contents of \a s.value is stolen.
  730. void yypush_ (const char* m, stack_symbol_type& s);
  731. /// Push a new look ahead token on the state on the stack.
  732. /// \param m a debug message to display
  733. /// if null, no trace is output.
  734. /// \param s the state
  735. /// \param sym the symbol (for its value and location).
  736. /// \warning the contents of \a s.value is stolen.
  737. void yypush_ (const char* m, state_type s, symbol_type& sym);
  738. /// Pop \a n symbols the three stacks.
  739. void yypop_ (unsigned int n = 1);
  740. /// Constants.
  741. enum
  742. {
  743. yyeof_ = 0,
  744. yylast_ = 252, ///< Last index in yytable_.
  745. yynnts_ = 133, ///< Number of nonterminal symbols.
  746. yyfinal_ = 20, ///< Termination state number.
  747. yyterror_ = 1,
  748. yyerrcode_ = 256,
  749. yyntokens_ = 55 ///< Number of tokens.
  750. };
  751. // User arguments.
  752. isc::d2::D2ParserContext& ctx;
  753. };
  754. // Symbol number corresponding to token number t.
  755. inline
  756. D2Parser::token_number_type
  757. D2Parser::yytranslate_ (token_type t)
  758. {
  759. static
  760. const token_number_type
  761. translate_table[] =
  762. {
  763. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  764. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  765. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  766. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  767. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  768. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  769. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  770. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  771. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  772. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  773. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  774. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  775. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  776. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  777. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  778. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  779. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  780. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  781. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  782. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  783. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  784. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  785. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  786. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  787. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  788. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  789. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  790. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  791. 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  792. 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
  793. 45, 46, 47, 48, 49, 50, 51, 52, 53, 54
  794. };
  795. const unsigned int user_token_number_max_ = 309;
  796. const token_number_type undef_token_ = 2;
  797. if (static_cast<int>(t) <= yyeof_)
  798. return yyeof_;
  799. else if (static_cast<unsigned int> (t) <= user_token_number_max_)
  800. return translate_table[t];
  801. else
  802. return undef_token_;
  803. }
  804. inline
  805. D2Parser::syntax_error::syntax_error (const location_type& l, const std::string& m)
  806. : std::runtime_error (m)
  807. , location (l)
  808. {}
  809. // basic_symbol.
  810. template <typename Base>
  811. inline
  812. D2Parser::basic_symbol<Base>::basic_symbol ()
  813. : value ()
  814. {}
  815. template <typename Base>
  816. inline
  817. D2Parser::basic_symbol<Base>::basic_symbol (const basic_symbol& other)
  818. : Base (other)
  819. , value ()
  820. , location (other.location)
  821. {
  822. switch (other.type_get ())
  823. {
  824. case 66: // value
  825. case 93: // ncr_protocol_value
  826. value.copy< ElementPtr > (other.value);
  827. break;
  828. case 54: // "boolean"
  829. value.copy< bool > (other.value);
  830. break;
  831. case 53: // "floating point"
  832. value.copy< double > (other.value);
  833. break;
  834. case 52: // "integer"
  835. value.copy< int64_t > (other.value);
  836. break;
  837. case 51: // "constant string"
  838. value.copy< std::string > (other.value);
  839. break;
  840. default:
  841. break;
  842. }
  843. }
  844. template <typename Base>
  845. inline
  846. D2Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const semantic_type& v, const location_type& l)
  847. : Base (t)
  848. , value ()
  849. , location (l)
  850. {
  851. (void) v;
  852. switch (this->type_get ())
  853. {
  854. case 66: // value
  855. case 93: // ncr_protocol_value
  856. value.copy< ElementPtr > (v);
  857. break;
  858. case 54: // "boolean"
  859. value.copy< bool > (v);
  860. break;
  861. case 53: // "floating point"
  862. value.copy< double > (v);
  863. break;
  864. case 52: // "integer"
  865. value.copy< int64_t > (v);
  866. break;
  867. case 51: // "constant string"
  868. value.copy< std::string > (v);
  869. break;
  870. default:
  871. break;
  872. }
  873. }
  874. // Implementation of basic_symbol constructor for each type.
  875. template <typename Base>
  876. D2Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const location_type& l)
  877. : Base (t)
  878. , value ()
  879. , location (l)
  880. {}
  881. template <typename Base>
  882. D2Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const ElementPtr v, const location_type& l)
  883. : Base (t)
  884. , value (v)
  885. , location (l)
  886. {}
  887. template <typename Base>
  888. D2Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const bool v, const location_type& l)
  889. : Base (t)
  890. , value (v)
  891. , location (l)
  892. {}
  893. template <typename Base>
  894. D2Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const double v, const location_type& l)
  895. : Base (t)
  896. , value (v)
  897. , location (l)
  898. {}
  899. template <typename Base>
  900. D2Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const int64_t v, const location_type& l)
  901. : Base (t)
  902. , value (v)
  903. , location (l)
  904. {}
  905. template <typename Base>
  906. D2Parser::basic_symbol<Base>::basic_symbol (typename Base::kind_type t, const std::string v, const location_type& l)
  907. : Base (t)
  908. , value (v)
  909. , location (l)
  910. {}
  911. template <typename Base>
  912. inline
  913. D2Parser::basic_symbol<Base>::~basic_symbol ()
  914. {
  915. clear ();
  916. }
  917. template <typename Base>
  918. inline
  919. void
  920. D2Parser::basic_symbol<Base>::clear ()
  921. {
  922. // User destructor.
  923. symbol_number_type yytype = this->type_get ();
  924. basic_symbol<Base>& yysym = *this;
  925. (void) yysym;
  926. switch (yytype)
  927. {
  928. default:
  929. break;
  930. }
  931. // Type destructor.
  932. switch (yytype)
  933. {
  934. case 66: // value
  935. case 93: // ncr_protocol_value
  936. value.template destroy< ElementPtr > ();
  937. break;
  938. case 54: // "boolean"
  939. value.template destroy< bool > ();
  940. break;
  941. case 53: // "floating point"
  942. value.template destroy< double > ();
  943. break;
  944. case 52: // "integer"
  945. value.template destroy< int64_t > ();
  946. break;
  947. case 51: // "constant string"
  948. value.template destroy< std::string > ();
  949. break;
  950. default:
  951. break;
  952. }
  953. Base::clear ();
  954. }
  955. template <typename Base>
  956. inline
  957. bool
  958. D2Parser::basic_symbol<Base>::empty () const
  959. {
  960. return Base::type_get () == empty_symbol;
  961. }
  962. template <typename Base>
  963. inline
  964. void
  965. D2Parser::basic_symbol<Base>::move (basic_symbol& s)
  966. {
  967. super_type::move(s);
  968. switch (this->type_get ())
  969. {
  970. case 66: // value
  971. case 93: // ncr_protocol_value
  972. value.move< ElementPtr > (s.value);
  973. break;
  974. case 54: // "boolean"
  975. value.move< bool > (s.value);
  976. break;
  977. case 53: // "floating point"
  978. value.move< double > (s.value);
  979. break;
  980. case 52: // "integer"
  981. value.move< int64_t > (s.value);
  982. break;
  983. case 51: // "constant string"
  984. value.move< std::string > (s.value);
  985. break;
  986. default:
  987. break;
  988. }
  989. location = s.location;
  990. }
  991. // by_type.
  992. inline
  993. D2Parser::by_type::by_type ()
  994. : type (empty_symbol)
  995. {}
  996. inline
  997. D2Parser::by_type::by_type (const by_type& other)
  998. : type (other.type)
  999. {}
  1000. inline
  1001. D2Parser::by_type::by_type (token_type t)
  1002. : type (yytranslate_ (t))
  1003. {}
  1004. inline
  1005. void
  1006. D2Parser::by_type::clear ()
  1007. {
  1008. type = empty_symbol;
  1009. }
  1010. inline
  1011. void
  1012. D2Parser::by_type::move (by_type& that)
  1013. {
  1014. type = that.type;
  1015. that.clear ();
  1016. }
  1017. inline
  1018. int
  1019. D2Parser::by_type::type_get () const
  1020. {
  1021. return type;
  1022. }
  1023. inline
  1024. D2Parser::token_type
  1025. D2Parser::by_type::token () const
  1026. {
  1027. // YYTOKNUM[NUM] -- (External) token number corresponding to the
  1028. // (internal) symbol number NUM (which must be that of a token). */
  1029. static
  1030. const unsigned short int
  1031. yytoken_number_[] =
  1032. {
  1033. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  1034. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  1035. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
  1036. 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
  1037. 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
  1038. 305, 306, 307, 308, 309
  1039. };
  1040. return static_cast<token_type> (yytoken_number_[type]);
  1041. }
  1042. // Implementation of make_symbol for each symbol type.
  1043. D2Parser::symbol_type
  1044. D2Parser::make_END (const location_type& l)
  1045. {
  1046. return symbol_type (token::TOKEN_END, l);
  1047. }
  1048. D2Parser::symbol_type
  1049. D2Parser::make_COMMA (const location_type& l)
  1050. {
  1051. return symbol_type (token::TOKEN_COMMA, l);
  1052. }
  1053. D2Parser::symbol_type
  1054. D2Parser::make_COLON (const location_type& l)
  1055. {
  1056. return symbol_type (token::TOKEN_COLON, l);
  1057. }
  1058. D2Parser::symbol_type
  1059. D2Parser::make_LSQUARE_BRACKET (const location_type& l)
  1060. {
  1061. return symbol_type (token::TOKEN_LSQUARE_BRACKET, l);
  1062. }
  1063. D2Parser::symbol_type
  1064. D2Parser::make_RSQUARE_BRACKET (const location_type& l)
  1065. {
  1066. return symbol_type (token::TOKEN_RSQUARE_BRACKET, l);
  1067. }
  1068. D2Parser::symbol_type
  1069. D2Parser::make_LCURLY_BRACKET (const location_type& l)
  1070. {
  1071. return symbol_type (token::TOKEN_LCURLY_BRACKET, l);
  1072. }
  1073. D2Parser::symbol_type
  1074. D2Parser::make_RCURLY_BRACKET (const location_type& l)
  1075. {
  1076. return symbol_type (token::TOKEN_RCURLY_BRACKET, l);
  1077. }
  1078. D2Parser::symbol_type
  1079. D2Parser::make_NULL_TYPE (const location_type& l)
  1080. {
  1081. return symbol_type (token::TOKEN_NULL_TYPE, l);
  1082. }
  1083. D2Parser::symbol_type
  1084. D2Parser::make_DHCP6 (const location_type& l)
  1085. {
  1086. return symbol_type (token::TOKEN_DHCP6, l);
  1087. }
  1088. D2Parser::symbol_type
  1089. D2Parser::make_DHCP4 (const location_type& l)
  1090. {
  1091. return symbol_type (token::TOKEN_DHCP4, l);
  1092. }
  1093. D2Parser::symbol_type
  1094. D2Parser::make_CONTROL_AGENT (const location_type& l)
  1095. {
  1096. return symbol_type (token::TOKEN_CONTROL_AGENT, l);
  1097. }
  1098. D2Parser::symbol_type
  1099. D2Parser::make_DHCPDDNS (const location_type& l)
  1100. {
  1101. return symbol_type (token::TOKEN_DHCPDDNS, l);
  1102. }
  1103. D2Parser::symbol_type
  1104. D2Parser::make_IP_ADDRESS (const location_type& l)
  1105. {
  1106. return symbol_type (token::TOKEN_IP_ADDRESS, l);
  1107. }
  1108. D2Parser::symbol_type
  1109. D2Parser::make_PORT (const location_type& l)
  1110. {
  1111. return symbol_type (token::TOKEN_PORT, l);
  1112. }
  1113. D2Parser::symbol_type
  1114. D2Parser::make_DNS_SERVER_TIMEOUT (const location_type& l)
  1115. {
  1116. return symbol_type (token::TOKEN_DNS_SERVER_TIMEOUT, l);
  1117. }
  1118. D2Parser::symbol_type
  1119. D2Parser::make_NCR_PROTOCOL (const location_type& l)
  1120. {
  1121. return symbol_type (token::TOKEN_NCR_PROTOCOL, l);
  1122. }
  1123. D2Parser::symbol_type
  1124. D2Parser::make_UDP (const location_type& l)
  1125. {
  1126. return symbol_type (token::TOKEN_UDP, l);
  1127. }
  1128. D2Parser::symbol_type
  1129. D2Parser::make_TCP (const location_type& l)
  1130. {
  1131. return symbol_type (token::TOKEN_TCP, l);
  1132. }
  1133. D2Parser::symbol_type
  1134. D2Parser::make_NCR_FORMAT (const location_type& l)
  1135. {
  1136. return symbol_type (token::TOKEN_NCR_FORMAT, l);
  1137. }
  1138. D2Parser::symbol_type
  1139. D2Parser::make_JSON (const location_type& l)
  1140. {
  1141. return symbol_type (token::TOKEN_JSON, l);
  1142. }
  1143. D2Parser::symbol_type
  1144. D2Parser::make_FORWARD_DDNS (const location_type& l)
  1145. {
  1146. return symbol_type (token::TOKEN_FORWARD_DDNS, l);
  1147. }
  1148. D2Parser::symbol_type
  1149. D2Parser::make_REVERSE_DDNS (const location_type& l)
  1150. {
  1151. return symbol_type (token::TOKEN_REVERSE_DDNS, l);
  1152. }
  1153. D2Parser::symbol_type
  1154. D2Parser::make_DDNS_DOMAINS (const location_type& l)
  1155. {
  1156. return symbol_type (token::TOKEN_DDNS_DOMAINS, l);
  1157. }
  1158. D2Parser::symbol_type
  1159. D2Parser::make_KEY_NAME (const location_type& l)
  1160. {
  1161. return symbol_type (token::TOKEN_KEY_NAME, l);
  1162. }
  1163. D2Parser::symbol_type
  1164. D2Parser::make_DNS_SERVERS (const location_type& l)
  1165. {
  1166. return symbol_type (token::TOKEN_DNS_SERVERS, l);
  1167. }
  1168. D2Parser::symbol_type
  1169. D2Parser::make_HOSTNAME (const location_type& l)
  1170. {
  1171. return symbol_type (token::TOKEN_HOSTNAME, l);
  1172. }
  1173. D2Parser::symbol_type
  1174. D2Parser::make_TSIG_KEYS (const location_type& l)
  1175. {
  1176. return symbol_type (token::TOKEN_TSIG_KEYS, l);
  1177. }
  1178. D2Parser::symbol_type
  1179. D2Parser::make_ALGORITHM (const location_type& l)
  1180. {
  1181. return symbol_type (token::TOKEN_ALGORITHM, l);
  1182. }
  1183. D2Parser::symbol_type
  1184. D2Parser::make_DIGEST_BITS (const location_type& l)
  1185. {
  1186. return symbol_type (token::TOKEN_DIGEST_BITS, l);
  1187. }
  1188. D2Parser::symbol_type
  1189. D2Parser::make_SECRET (const location_type& l)
  1190. {
  1191. return symbol_type (token::TOKEN_SECRET, l);
  1192. }
  1193. D2Parser::symbol_type
  1194. D2Parser::make_LOGGING (const location_type& l)
  1195. {
  1196. return symbol_type (token::TOKEN_LOGGING, l);
  1197. }
  1198. D2Parser::symbol_type
  1199. D2Parser::make_LOGGERS (const location_type& l)
  1200. {
  1201. return symbol_type (token::TOKEN_LOGGERS, l);
  1202. }
  1203. D2Parser::symbol_type
  1204. D2Parser::make_NAME (const location_type& l)
  1205. {
  1206. return symbol_type (token::TOKEN_NAME, l);
  1207. }
  1208. D2Parser::symbol_type
  1209. D2Parser::make_OUTPUT_OPTIONS (const location_type& l)
  1210. {
  1211. return symbol_type (token::TOKEN_OUTPUT_OPTIONS, l);
  1212. }
  1213. D2Parser::symbol_type
  1214. D2Parser::make_OUTPUT (const location_type& l)
  1215. {
  1216. return symbol_type (token::TOKEN_OUTPUT, l);
  1217. }
  1218. D2Parser::symbol_type
  1219. D2Parser::make_DEBUGLEVEL (const location_type& l)
  1220. {
  1221. return symbol_type (token::TOKEN_DEBUGLEVEL, l);
  1222. }
  1223. D2Parser::symbol_type
  1224. D2Parser::make_SEVERITY (const location_type& l)
  1225. {
  1226. return symbol_type (token::TOKEN_SEVERITY, l);
  1227. }
  1228. D2Parser::symbol_type
  1229. D2Parser::make_FLUSH (const location_type& l)
  1230. {
  1231. return symbol_type (token::TOKEN_FLUSH, l);
  1232. }
  1233. D2Parser::symbol_type
  1234. D2Parser::make_MAXSIZE (const location_type& l)
  1235. {
  1236. return symbol_type (token::TOKEN_MAXSIZE, l);
  1237. }
  1238. D2Parser::symbol_type
  1239. D2Parser::make_MAXVER (const location_type& l)
  1240. {
  1241. return symbol_type (token::TOKEN_MAXVER, l);
  1242. }
  1243. D2Parser::symbol_type
  1244. D2Parser::make_TOPLEVEL_JSON (const location_type& l)
  1245. {
  1246. return symbol_type (token::TOKEN_TOPLEVEL_JSON, l);
  1247. }
  1248. D2Parser::symbol_type
  1249. D2Parser::make_TOPLEVEL_DHCPDDNS (const location_type& l)
  1250. {
  1251. return symbol_type (token::TOKEN_TOPLEVEL_DHCPDDNS, l);
  1252. }
  1253. D2Parser::symbol_type
  1254. D2Parser::make_SUB_DHCPDDNS (const location_type& l)
  1255. {
  1256. return symbol_type (token::TOKEN_SUB_DHCPDDNS, l);
  1257. }
  1258. D2Parser::symbol_type
  1259. D2Parser::make_SUB_TSIG_KEY (const location_type& l)
  1260. {
  1261. return symbol_type (token::TOKEN_SUB_TSIG_KEY, l);
  1262. }
  1263. D2Parser::symbol_type
  1264. D2Parser::make_SUB_TSIG_KEYS (const location_type& l)
  1265. {
  1266. return symbol_type (token::TOKEN_SUB_TSIG_KEYS, l);
  1267. }
  1268. D2Parser::symbol_type
  1269. D2Parser::make_SUB_DDNS_DOMAIN (const location_type& l)
  1270. {
  1271. return symbol_type (token::TOKEN_SUB_DDNS_DOMAIN, l);
  1272. }
  1273. D2Parser::symbol_type
  1274. D2Parser::make_SUB_DDNS_DOMAINS (const location_type& l)
  1275. {
  1276. return symbol_type (token::TOKEN_SUB_DDNS_DOMAINS, l);
  1277. }
  1278. D2Parser::symbol_type
  1279. D2Parser::make_SUB_DNS_SERVER (const location_type& l)
  1280. {
  1281. return symbol_type (token::TOKEN_SUB_DNS_SERVER, l);
  1282. }
  1283. D2Parser::symbol_type
  1284. D2Parser::make_SUB_DNS_SERVERS (const location_type& l)
  1285. {
  1286. return symbol_type (token::TOKEN_SUB_DNS_SERVERS, l);
  1287. }
  1288. D2Parser::symbol_type
  1289. D2Parser::make_STRING (const std::string& v, const location_type& l)
  1290. {
  1291. return symbol_type (token::TOKEN_STRING, v, l);
  1292. }
  1293. D2Parser::symbol_type
  1294. D2Parser::make_INTEGER (const int64_t& v, const location_type& l)
  1295. {
  1296. return symbol_type (token::TOKEN_INTEGER, v, l);
  1297. }
  1298. D2Parser::symbol_type
  1299. D2Parser::make_FLOAT (const double& v, const location_type& l)
  1300. {
  1301. return symbol_type (token::TOKEN_FLOAT, v, l);
  1302. }
  1303. D2Parser::symbol_type
  1304. D2Parser::make_BOOLEAN (const bool& v, const location_type& l)
  1305. {
  1306. return symbol_type (token::TOKEN_BOOLEAN, v, l);
  1307. }
  1308. #line 14 "d2_parser.yy" // lalr1.cc:377
  1309. } } // isc::d2
  1310. #line 1602 "d2_parser.h" // lalr1.cc:377
  1311. #endif // !YY_D2_PARSER_D2_PARSER_H_INCLUDED