OpenVAS Libraries  9.0.3
nasl_grammar.tab.c
Go to the documentation of this file.
1 /* A Bison parser, made by GNU Bison 3.0.5. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 
20 /* As a special exception, you may create a larger work that contains
21  part or all of the Bison parser skeleton and distribute that work
22  under terms of your choice, so long as that work isn't itself a
23  parser generator using the skeleton or a modified version thereof
24  as a parser skeleton. Alternatively, if you modify or redistribute
25  the parser skeleton itself, you may (at your option) remove this
26  special exception, which will cause the skeleton and the resulting
27  Bison output files to be licensed under the GNU General Public
28  License without this special exception.
29 
30  This special exception was added by the Free Software Foundation in
31  version 2.2 of Bison. */
32 
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34  simplifying the original so-called "semantic" parser. */
35 
36 /* All symbols defined below should begin with yy or YY, to avoid
37  infringing on user name space. This should be done even for local
38  variables, as they might otherwise be expanded by user macros.
39  There are some unavoidable exceptions within include files to
40  define necessary library symbols; they are noted "INFRINGES ON
41  USER NAME SPACE" below. */
42 
43 /* Identify Bison output. */
44 #define YYBISON 1
45 
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.5"
48 
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51 
52 /* Pure parsers. */
53 #define YYPURE 1
54 
55 /* Push parsers. */
56 #define YYPUSH 0
57 
58 /* Pull parsers. */
59 #define YYPULL 1
60 
61 
62 /* Substitute the variable and function names. */
63 #define yyparse naslparse
64 #define yylex nasllex
65 #define yyerror naslerror
66 #define yydebug nasldebug
67 #define yynerrs naslnerrs
68 
69 
70 /* Copy the first part of user declarations. */
71 #line 5 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:339 */
72 
73 /* Nessus Attack Scripting Language version 2
74  *
75  * Copyright (C) 2002 - 2004 Michel Arboi and Renaud Deraison
76  *
77  * This program is free software; you can redistribute it and/or modify
78  * it under the terms of the GNU General Public License version 2,
79  * as published by the Free Software Foundation
80  *
81  * This program is distributed in the hope that it will be useful,
82  * but WITHOUT ANY WARRANTY; without even the implied warranty of
83  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84  * GNU General Public License for more details.
85  *
86  * You should have received a copy of the GNU General Public License
87  * along with this program; if not, write to the Free Software
88  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
89  */
90 
91 #define YYPARSE_PARAM parm
92 #define YYLEX_PARAM parm
93 
94 #define LNB (((naslctxt*)parm)->line_nb)
95 
96 #include <ctype.h> /* for isalpha */
97 #include <pcap.h> /* for islocalhost */
98 #include <string.h> /* for strlen */
99 #include <sys/stat.h> /* for stat */
100 
101 #include "nasl_tree.h"
102 #include "nasl_global_ctxt.h"
103 #include "nasl_func.h"
104 #include "nasl_var.h"
105 #include "nasl_lex_ctxt.h"
106 #include "nasl_debug.h"
107 #include "nasl_signature.h"
108 
109 static void naslerror(naslctxt *, const char *);
110 
111 GHashTable *includes_hash = NULL;
112 
113 #define YYERROR_VERBOSE
114 
115 #line 116 "nasl_grammar.tab.c" /* yacc.c:339 */
116 
117 # ifndef YY_NULLPTR
118 # if defined __cplusplus && 201103L <= __cplusplus
119 # define YY_NULLPTR nullptr
120 # else
121 # define YY_NULLPTR 0
122 # endif
123 # endif
124 
125 /* Enabling verbose error messages. */
126 #ifdef YYERROR_VERBOSE
127 # undef YYERROR_VERBOSE
128 # define YYERROR_VERBOSE 1
129 #else
130 # define YYERROR_VERBOSE 0
131 #endif
132 
133 /* In a future release of Bison, this section will be replaced
134  by #include "nasl_grammar.tab.h". */
135 #ifndef YY_NASL_NASL_GRAMMAR_TAB_H_INCLUDED
136 # define YY_NASL_NASL_GRAMMAR_TAB_H_INCLUDED
137 /* Debug traces. */
138 #ifndef YYDEBUG
139 # define YYDEBUG 1
140 #endif
141 #if YYDEBUG
142 extern int nasldebug;
143 #endif
144 
145 /* Token type. */
146 #ifndef YYTOKENTYPE
147 # define YYTOKENTYPE
149  {
150  IF = 258,
151  ELSE = 259,
152  EQ = 260,
153  NEQ = 261,
154  SUPEQ = 262,
155  INFEQ = 263,
156  OR = 264,
157  AND = 265,
158  MATCH = 266,
159  NOMATCH = 267,
160  REP = 268,
161  FOR = 269,
162  REPEAT = 270,
163  UNTIL = 271,
164  FOREACH = 272,
165  WHILE = 273,
166  BREAK = 274,
167  CONTINUE = 275,
168  FUNCTION = 276,
169  RETURN = 277,
170  INCLUDE = 278,
171  LOCAL = 279,
172  GLOBAL = 280,
173  PLUS_PLUS = 281,
174  MINUS_MINUS = 282,
175  L_SHIFT = 283,
176  R_SHIFT = 284,
177  R_USHIFT = 285,
178  EXPO = 286,
179  PLUS_EQ = 287,
180  MINUS_EQ = 288,
181  MULT_EQ = 289,
182  DIV_EQ = 290,
183  MODULO_EQ = 291,
184  L_SHIFT_EQ = 292,
185  R_SHIFT_EQ = 293,
186  R_USHIFT_EQ = 294,
187  RE_MATCH = 295,
188  RE_NOMATCH = 296,
189  ARROW = 297,
190  IDENT = 298,
191  STRING1 = 299,
192  STRING2 = 300,
193  INTEGER = 301,
194  NOT = 302,
195  UMINUS = 303,
196  BIT_NOT = 304
197  };
198 #endif
199 
200 /* Value type. */
201 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
202 
203 union YYSTYPE
204 {
205 #line 49 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:355 */
206 
207  long int num;
208  char *str;
209  struct asciiz {
210  char *val;
211  int len;
212  } data;
214 
215 #line 216 "nasl_grammar.tab.c" /* yacc.c:355 */
216 };
217 
218 typedef union YYSTYPE YYSTYPE;
219 # define YYSTYPE_IS_TRIVIAL 1
220 # define YYSTYPE_IS_DECLARED 1
221 #endif
222 
223 
224 
225 int naslparse (naslctxt * parm);
226 
227 #endif /* !YY_NASL_NASL_GRAMMAR_TAB_H_INCLUDED */
228 
229 /* Copy the second part of user declarations. */
230 #line 59 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:358 */
231 
232 static int nasllex(YYSTYPE * lvalp, void * parm);
233 
234 #line 235 "nasl_grammar.tab.c" /* yacc.c:358 */
235 
236 #ifdef short
237 # undef short
238 #endif
239 
240 #ifdef YYTYPE_UINT8
241 typedef YYTYPE_UINT8 yytype_uint8;
242 #else
243 typedef unsigned char yytype_uint8;
244 #endif
245 
246 #ifdef YYTYPE_INT8
247 typedef YYTYPE_INT8 yytype_int8;
248 #else
249 typedef signed char yytype_int8;
250 #endif
251 
252 #ifdef YYTYPE_UINT16
253 typedef YYTYPE_UINT16 yytype_uint16;
254 #else
255 typedef unsigned short int yytype_uint16;
256 #endif
257 
258 #ifdef YYTYPE_INT16
259 typedef YYTYPE_INT16 yytype_int16;
260 #else
261 typedef short int yytype_int16;
262 #endif
263 
264 #ifndef YYSIZE_T
265 # ifdef __SIZE_TYPE__
266 # define YYSIZE_T __SIZE_TYPE__
267 # elif defined size_t
268 # define YYSIZE_T size_t
269 # elif ! defined YYSIZE_T
270 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
271 # define YYSIZE_T size_t
272 # else
273 # define YYSIZE_T unsigned int
274 # endif
275 #endif
276 
277 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
278 
279 #ifndef YY_
280 # if defined YYENABLE_NLS && YYENABLE_NLS
281 # if ENABLE_NLS
282 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
283 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
284 # endif
285 # endif
286 # ifndef YY_
287 # define YY_(Msgid) Msgid
288 # endif
289 #endif
290 
291 #ifndef YY_ATTRIBUTE
292 # if (defined __GNUC__ \
293  && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
294  || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
295 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
296 # else
297 # define YY_ATTRIBUTE(Spec) /* empty */
298 # endif
299 #endif
300 
301 #ifndef YY_ATTRIBUTE_PURE
302 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
303 #endif
304 
305 #ifndef YY_ATTRIBUTE_UNUSED
306 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
307 #endif
308 
309 #if !defined _Noreturn \
310  && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
311 # if defined _MSC_VER && 1200 <= _MSC_VER
312 # define _Noreturn __declspec (noreturn)
313 # else
314 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
315 # endif
316 #endif
317 
318 /* Suppress unused-variable warnings by "using" E. */
319 #if ! defined lint || defined __GNUC__
320 # define YYUSE(E) ((void) (E))
321 #else
322 # define YYUSE(E) /* empty */
323 #endif
324 
325 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
326 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
327 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
328  _Pragma ("GCC diagnostic push") \
329  _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
330  _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
331 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
332  _Pragma ("GCC diagnostic pop")
333 #else
334 # define YY_INITIAL_VALUE(Value) Value
335 #endif
336 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
337 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
338 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
339 #endif
340 #ifndef YY_INITIAL_VALUE
341 # define YY_INITIAL_VALUE(Value) /* Nothing. */
342 #endif
343 
344 
345 #if ! defined yyoverflow || YYERROR_VERBOSE
346 
347 /* The parser invokes alloca or malloc; define the necessary symbols. */
348 
349 # ifdef YYSTACK_USE_ALLOCA
350 # if YYSTACK_USE_ALLOCA
351 # ifdef __GNUC__
352 # define YYSTACK_ALLOC __builtin_alloca
353 # elif defined __BUILTIN_VA_ARG_INCR
354 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
355 # elif defined _AIX
356 # define YYSTACK_ALLOC __alloca
357 # elif defined _MSC_VER
358 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
359 # define alloca _alloca
360 # else
361 # define YYSTACK_ALLOC alloca
362 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
363 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
364  /* Use EXIT_SUCCESS as a witness for stdlib.h. */
365 # ifndef EXIT_SUCCESS
366 # define EXIT_SUCCESS 0
367 # endif
368 # endif
369 # endif
370 # endif
371 # endif
372 
373 # ifdef YYSTACK_ALLOC
374  /* Pacify GCC's 'empty if-body' warning. */
375 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
376 # ifndef YYSTACK_ALLOC_MAXIMUM
377  /* The OS might guarantee only one guard page at the bottom of the stack,
378  and a page size can be as small as 4096 bytes. So we cannot safely
379  invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
380  to allow for a few compiler-allocated temporary stack slots. */
381 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
382 # endif
383 # else
384 # define YYSTACK_ALLOC YYMALLOC
385 # define YYSTACK_FREE YYFREE
386 # ifndef YYSTACK_ALLOC_MAXIMUM
387 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
388 # endif
389 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
390  && ! ((defined YYMALLOC || defined malloc) \
391  && (defined YYFREE || defined free)))
392 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
393 # ifndef EXIT_SUCCESS
394 # define EXIT_SUCCESS 0
395 # endif
396 # endif
397 # ifndef YYMALLOC
398 # define YYMALLOC malloc
399 # if ! defined malloc && ! defined EXIT_SUCCESS
400 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
401 # endif
402 # endif
403 # ifndef YYFREE
404 # define YYFREE free
405 # if ! defined free && ! defined EXIT_SUCCESS
406 void free (void *); /* INFRINGES ON USER NAME SPACE */
407 # endif
408 # endif
409 # endif
410 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
411 
412 
413 #if (! defined yyoverflow \
414  && (! defined __cplusplus \
415  || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
416 
417 /* A type that is properly aligned for any stack member. */
418 union yyalloc
419 {
422 };
423 
424 /* The size of the maximum gap between one aligned stack and the next. */
425 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
426 
427 /* The size of an array large to enough to hold all stacks, each with
428  N elements. */
429 # define YYSTACK_BYTES(N) \
430  ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
431  + YYSTACK_GAP_MAXIMUM)
432 
433 # define YYCOPY_NEEDED 1
434 
435 /* Relocate STACK from its old location to the new one. The
436  local variables YYSIZE and YYSTACKSIZE give the old and new number of
437  elements in the stack, and YYPTR gives the new location of the
438  stack. Advance YYPTR to a properly aligned location for the next
439  stack. */
440 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
441  do \
442  { \
443  YYSIZE_T yynewbytes; \
444  YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
445  Stack = &yyptr->Stack_alloc; \
446  yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
447  yyptr += yynewbytes / sizeof (*yyptr); \
448  } \
449  while (0)
450 
451 #endif
452 
453 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
454 /* Copy COUNT objects from SRC to DST. The source and destination do
455  not overlap. */
456 # ifndef YYCOPY
457 # if defined __GNUC__ && 1 < __GNUC__
458 # define YYCOPY(Dst, Src, Count) \
459  __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
460 # else
461 # define YYCOPY(Dst, Src, Count) \
462  do \
463  { \
464  YYSIZE_T yyi; \
465  for (yyi = 0; yyi < (Count); yyi++) \
466  (Dst)[yyi] = (Src)[yyi]; \
467  } \
468  while (0)
469 # endif
470 # endif
471 #endif /* !YYCOPY_NEEDED */
472 
473 /* YYFINAL -- State number of the termination state. */
474 #define YYFINAL 78
475 /* YYLAST -- Last index in YYTABLE. */
476 #define YYLAST 1029
477 
478 /* YYNTOKENS -- Number of terminals. */
479 #define YYNTOKENS 73
480 /* YYNNTS -- Number of nonterminals. */
481 #define YYNNTS 43
482 /* YYNRULES -- Number of rules. */
483 #define YYNRULES 126
484 /* YYNSTATES -- Number of states. */
485 #define YYNSTATES 227
486 
487 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
488  by yylex, with out-of-bounds checking. */
489 #define YYUNDEFTOK 2
490 #define YYMAXUTOK 304
491 
492 #define YYTRANSLATE(YYX) \
493  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
494 
495 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
496  as returned by yylex, without out-of-bounds checking. */
497 static const yytype_uint8 yytranslate[] =
498 {
499  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502  2, 2, 2, 70, 2, 2, 2, 57, 52, 2,
503  61, 62, 55, 53, 63, 54, 72, 56, 2, 2,
504  2, 2, 2, 2, 2, 2, 2, 2, 67, 66,
505  48, 47, 49, 2, 2, 2, 2, 2, 2, 2,
506  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
507  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508  2, 68, 2, 69, 51, 2, 2, 2, 2, 2,
509  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511  2, 2, 2, 64, 50, 65, 71, 2, 2, 2,
512  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
525  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
526  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
527  25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
528  35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
529  45, 46, 58, 59, 60
530 };
531 
532 #if YYDEBUG
533  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
534 static const yytype_uint16 yyrline[] =
535 {
536  0, 144, 144, 149, 155, 162, 162, 165, 174, 174,
537  175, 176, 184, 184, 185, 186, 200, 200, 200, 200,
538  203, 203, 203, 204, 204, 204, 204, 204, 205, 209,
539  213, 216, 222, 229, 235, 243, 243, 243, 243, 244,
540  254, 261, 269, 278, 278, 278, 278, 281, 289, 289,
541  292, 345, 352, 352, 353, 353, 359, 365, 373, 377,
542  378, 379, 380, 381, 382, 383, 384, 387, 387, 389,
543  389, 391, 398, 401, 402, 403, 404, 408, 409, 410,
544  411, 412, 413, 414, 415, 416, 417, 418, 419, 420,
545  421, 422, 423, 424, 425, 426, 427, 428, 429, 430,
546  431, 432, 433, 434, 435, 436, 437, 437, 437, 437,
547  437, 440, 442, 443, 447, 450, 456, 457, 461, 466,
548  468, 469, 469, 471, 473, 482, 490
549 };
550 #endif
551 
552 #if YYDEBUG || YYERROR_VERBOSE || 0
553 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
554  First, the terminals, then, starting at YYNTOKENS, nonterminals. */
555 static const char *const yytname[] =
556 {
557  "$end", "error", "$undefined", "IF", "ELSE", "EQ", "NEQ", "SUPEQ",
558  "INFEQ", "OR", "AND", "MATCH", "NOMATCH", "REP", "FOR", "REPEAT",
559  "UNTIL", "FOREACH", "WHILE", "BREAK", "CONTINUE", "FUNCTION", "RETURN",
560  "INCLUDE", "LOCAL", "GLOBAL", "PLUS_PLUS", "MINUS_MINUS", "L_SHIFT",
561  "R_SHIFT", "R_USHIFT", "EXPO", "PLUS_EQ", "MINUS_EQ", "MULT_EQ",
562  "DIV_EQ", "MODULO_EQ", "L_SHIFT_EQ", "R_SHIFT_EQ", "R_USHIFT_EQ",
563  "RE_MATCH", "RE_NOMATCH", "ARROW", "IDENT", "STRING1", "STRING2",
564  "INTEGER", "'='", "'<'", "'>'", "'|'", "'^'", "'&'", "'+'", "'-'", "'*'",
565  "'/'", "'%'", "NOT", "UMINUS", "BIT_NOT", "'('", "')'", "','", "'{'",
566  "'}'", "';'", "':'", "'['", "']'", "'!'", "'~'", "'.'", "$accept",
567  "tiptop", "instr_decl_list", "instr_decl", "func_decl", "arg_decl",
568  "arg_decl_1", "block", "instr_list", "instr", "simple_instr", "ret",
569  "if_block", "loop", "for_loop", "while_loop", "repeat_loop",
570  "foreach_loop", "aff_func", "rep", "string", "inc", "func_call",
571  "arg_list", "arg_list_1", "arg", "aff", "lvalue", "identifier",
572  "array_elem", "array_index", "post_pre_incr", "expr", "const_array",
573  "list_array_data", "array_data", "atom", "simple_array_data", "var",
574  "var_name", "ipaddr", "loc", "glob", YY_NULLPTR
575 };
576 #endif
577 
578 # ifdef YYPRINT
579 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
580  (internal) symbol number NUM (which must be that of a token). */
581 static const yytype_uint16 yytoknum[] =
582 {
583  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
584  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
585  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
586  285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
587  295, 296, 297, 298, 299, 300, 301, 61, 60, 62,
588  124, 94, 38, 43, 45, 42, 47, 37, 302, 303,
589  304, 40, 41, 44, 123, 125, 59, 58, 91, 93,
590  33, 126, 46
591 };
592 # endif
593 
594 #define YYPACT_NINF -91
595 
596 #define yypact_value_is_default(Yystate) \
597  (!!((Yystate) == (-91)))
598 
599 #define YYTABLE_NINF -69
600 
601 #define yytable_value_is_error(Yytable_value) \
602  (!!((Yytable_value) == (-69)))
603 
604  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
605  STATE-NUM. */
606 static const yytype_int16 yypact[] =
607 {
608  464, -53, -91, -50, 491, -6, -42, -91, -91, -6,
609  499, -40, -6, -6, -6, -6, -91, 259, 25, -91,
610  91, -91, -91, -91, -39, -91, -91, -91, -91, -91,
611  -91, -91, -91, -91, 23, -91, 553, -13, -91, -91,
612  -91, -91, 499, 26, 29, -30, 499, -21, -91, -91,
613  -18, 499, 499, 13, 499, 499, -91, -91, 961, 611,
614  -91, 798, -91, -91, -91, -91, -91, 19, -91, -91,
615  -12, -91, -91, -26, -91, -91, -9, 123, -91, -91,
616  -91, 499, -91, -91, 499, 499, 499, 499, 499, 499,
617  499, 499, 499, 499, 499, 566, -4, -91, -91, -91,
618  499, 499, 624, -6, 14, 37, 682, 39, 40, -91,
619  42, 7, 22, -91, -91, 37, 37, 499, 499, 499,
620  499, 499, 499, 499, 499, 499, 499, 499, 499, 19,
621  19, 499, 499, 499, 499, 499, 499, 499, 499, 499,
622  499, -91, -91, 28, -6, -91, -91, 798, 798, 798,
623  798, 798, 798, 798, 798, 798, 798, 35, -91, 33,
624  945, 798, 17, 798, 491, 499, 347, 740, 491, 36,
625  16, -91, 34, -91, 13, 882, 882, 882, 882, 851,
626  913, 882, 882, 398, 398, 398, 37, -91, -91, 882,
627  882, 354, 337, 415, 15, 15, 37, 37, 37, -91,
628  -91, -91, 499, 499, -91, 83, 409, -91, 491, -91,
629  27, 53, -91, -91, -91, 798, 491, 26, -91, -91,
630  47, -91, 38, 56, 491, -91, -91
631 };
632 
633  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
634  Performed when YYTABLE does not specify something else to do. Zero
635  means the default is an error. */
636 static const yytype_uint8 yydefact[] =
637 {
638  30, 0, 70, 0, 30, 0, 0, 28, 29, 0,
639  32, 0, 8, 8, 0, 0, 69, 30, 0, 2,
640  3, 6, 17, 5, 0, 24, 18, 19, 35, 36,
641  37, 38, 22, 25, 23, 20, 0, 67, 68, 21,
642  26, 27, 0, 46, 0, 0, 0, 0, 118, 117,
643  116, 0, 0, 0, 0, 0, 122, 107, 123, 121,
644  95, 31, 110, 109, 106, 120, 108, 0, 125, 9,
645  10, 126, 73, 67, 74, 13, 0, 14, 1, 4,
646  16, 0, 75, 76, 0, 0, 0, 0, 0, 0,
647  0, 0, 0, 53, 0, 0, 0, 45, 43, 44,
648  0, 0, 0, 8, 0, 83, 0, 118, 117, 116,
649  0, 0, 112, 119, 114, 79, 84, 0, 0, 0,
650  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
651  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
652  0, 48, 49, 0, 0, 12, 15, 47, 59, 60,
653  61, 62, 63, 66, 64, 65, 58, 0, 52, 54,
654  123, 56, 0, 72, 30, 0, 0, 0, 30, 0,
655  0, 77, 0, 111, 0, 102, 103, 104, 105, 80,
656  78, 96, 97, 94, 92, 93, 86, 98, 99, 100,
657  101, 91, 90, 89, 81, 82, 85, 87, 88, 50,
658  11, 51, 0, 0, 71, 33, 0, 41, 30, 40,
659  0, 0, 115, 113, 55, 57, 30, 46, 42, 7,
660  0, 34, 0, 0, 30, 124, 39
661 };
662 
663  /* YYPGOTO[NTERM-NUM]. */
664 static const yytype_int16 yypgoto[] =
665 {
666  -91, -91, 101, -91, -91, -11, -20, -87, 48, 12,
667  -91, -91, -91, -91, -91, -91, -91, -91, -90, -91,
668  -64, -91, 6, -91, -74, -91, 24, 60, 0, 18,
669  -91, 30, 209, -91, -45, -91, -52, -41, -91, -91,
670  -91, -91, -91
671 };
672 
673  /* YYDEFGOTO[NTERM-NUM]. */
674 static const yytype_int16 yydefgoto[] =
675 {
676  -1, 18, 19, 20, 21, 68, 69, 22, 76, 23,
677  24, 25, 26, 27, 28, 29, 30, 31, 96, 32,
678  110, 33, 56, 157, 158, 159, 57, 36, 58, 59,
679  162, 60, 161, 62, 111, 112, 63, 114, 64, 65,
680  66, 40, 41
681 };
682 
683  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
684  positive, shift that token. If negative, reduce the rule whose
685  number is the opposite. If YYTABLE_NINF, syntax error. */
686 static const yytype_int16 yytable[] =
687 {
688  37, 113, 71, 143, 37, 45, 34, 2, 42, 47,
689  34, 43, 70, 70, 73, 73, 44, 37, 38, 46,
690  37, 67, 38, 34, 35, 78, 34, 80, 35, 77,
691  39, 101, 38, 38, 39, 38, 81, 16, 38, 2,
692  103, 35, 94, 37, 35, 100, 128, 39, 93, 97,
693  39, 144, 14, 15, 104, 94, 145, 107, 108, 109,
694  170, 38, 165, 141, 142, 187, 188, 98, 128, 16,
695  138, 139, 140, 99, 72, 74, 173, 37, 48, 49,
696  109, -48, -49, 34, 172, 174, 204, 216, 211, 77,
697  199, 17, 169, 160, 1, 38, 202, 201, 210, 220,
698  224, 35, 225, 70, 2, 3, 4, 39, 5, 6,
699  7, 8, 9, 10, 11, 12, 13, 14, 15, 223,
700  113, 79, 113, 219, 200, 146, 1, 222, 214, 213,
701  0, 212, 0, 0, 16, 0, 2, 3, 4, 0,
702  5, 6, 7, 8, 70, 10, 11, 12, 13, 14,
703  15, 0, 0, 0, 0, 17, 0, -30, 0, 0,
704  0, 0, 0, 0, 37, 0, 16, 0, 37, 0,
705  34, 0, 0, 0, 34, 0, 205, 0, 0, 0,
706  209, 0, 38, 0, 0, 0, 38, 17, 35, -30,
707  0, 0, 35, 0, 39, 0, 0, 0, 39, 0,
708  0, 0, 160, 0, 0, 0, 0, 0, 37, 0,
709  0, 0, 0, 0, 34, 0, 37, 37, 0, 61,
710  218, 0, 34, 97, 37, 0, 38, 0, 221, 0,
711  34, 0, 35, 0, 38, 38, 226, 0, 39, 0,
712  35, 98, 38, 0, 0, 0, 39, 99, 35, 0,
713  0, 95, 0, 0, 39, 102, 0, 0, 0, 0,
714  105, 106, 1, 115, 116, 0, 0, 0, 0, 0,
715  0, 0, 2, 3, 4, 0, 5, 6, 7, 8,
716  0, 10, 11, 12, 13, 14, 15, 0, 0, 0,
717  147, 0, 0, 148, 149, 150, 151, 152, 153, 154,
718  155, 156, 16, 163, 0, 0, 0, 0, 0, 166,
719  167, 0, 0, 0, 0, 0, 0, 0, 0, 0,
720  0, 0, 0, 17, 75, 0, 175, 176, 177, 178,
721  179, 180, 181, 182, 183, 184, 185, 186, 0, 0,
722  189, 190, 191, 192, 193, 194, 195, 196, 197, 198,
723  0, 0, 117, 118, 119, 120, 121, 122, 123, 124,
724  0, 0, 0, 0, 0, 125, 126, 127, 128, 0,
725  0, 0, 0, 0, 206, 125, 126, 127, 128, 0,
726  0, 0, 125, 126, 127, 128, 0, 129, 130, 135,
727  136, 137, 138, 139, 140, 131, 132, 133, 134, 135,
728  136, 137, 138, 139, 140, 134, 135, 136, 137, 138,
729  139, 140, 215, 207, 117, 118, 119, 120, 121, 122,
730  123, 124, 0, 0, 0, 0, -69, -69, -69, 128,
731  0, 0, 0, 0, 0, 0, 0, 125, 126, 127,
732  128, 0, 0, 125, 126, 127, 128, 0, 0, 129,
733  130, 136, 137, 138, 139, 140, 0, 131, 132, 133,
734  134, 135, 136, 137, 138, 139, 140, 1, 136, 137,
735  138, 139, 140, 0, 0, 217, 0, 2, 3, 4,
736  0, 5, 6, 7, 8, 9, 10, 11, 12, 13,
737  14, 15, 0, 0, 1, 0, 0, 0, 0, 0,
738  0, 0, 0, 0, 2, 3, 4, 16, 5, 6,
739  7, 8, 2, 10, 11, 12, 13, 14, 15, 0,
740  0, 0, 0, 0, 0, 14, 15, 0, 17, 0,
741  0, 0, 0, 0, 16, 0, 0, 0, 0, 0,
742  0, 0, 16, 48, 49, 50, 0, 0, 0, 0,
743  0, 0, 0, 51, 0, 17, 0, 0, 0, 0,
744  52, 0, 0, 0, 0, 0, 0, 53, 0, 54,
745  55, 117, 118, 119, 120, 121, 122, 123, 124, 82,
746  83, 0, 0, 0, 0, 84, 85, 86, 87, 88,
747  89, 90, 91, 0, 125, 126, 127, 128, 0, 0,
748  92, 0, 0, 0, 0, 0, 129, 130, 0, 0,
749  0, 0, 0, 0, 131, 132, 133, 134, 135, 136,
750  137, 138, 139, 140, 0, 0, 0, 0, 164, 117,
751  118, 119, 120, 121, 122, 123, 124, -68, -68, 0,
752  0, 0, 0, -68, -68, -68, -68, -68, -68, -68,
753  -68, 0, 125, 126, 127, 128, 0, 0, -68, 0,
754  0, 0, 0, 0, 129, 130, 0, 0, 0, 0,
755  0, 0, 131, 132, 133, 134, 135, 136, 137, 138,
756  139, 140, 0, 0, 0, 0, 168, 117, 118, 119,
757  120, 121, 122, 123, 124, 0, 0, 0, 0, 0,
758  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
759  125, 126, 127, 128, 0, 0, 0, 0, 0, 0,
760  0, 0, 129, 130, 0, 0, 0, 0, 0, 0,
761  131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
762  0, 0, 0, 0, 171, 117, 118, 119, 120, 121,
763  122, 123, 124, 0, 0, 0, 0, 0, 0, 0,
764  0, 0, 0, 0, 0, 0, 0, 0, 125, 126,
765  127, 128, 0, 0, 0, 0, 0, 0, 0, 0,
766  129, 130, 0, 0, 0, 0, 0, 0, 131, 132,
767  133, 134, 135, 136, 137, 138, 139, 140, 0, 0,
768  0, 0, 208, 117, 118, 119, 120, 121, 122, 123,
769  124, 0, 0, 0, 0, 0, 0, 0, 0, 0,
770  0, 0, 0, 0, 0, 0, 125, 126, 127, 128,
771  0, 0, 0, 0, 0, 0, 0, 0, 129, 130,
772  0, 0, 0, 0, 0, 0, 131, 132, 133, 134,
773  135, 136, 137, 138, 139, 140, 117, 118, 119, 120,
774  0, 122, 123, 124, 0, 0, 0, 0, 0, 0,
775  0, 0, 0, 0, 0, 0, 0, 0, 0, 125,
776  126, 127, 128, 0, 0, 0, 0, -69, -69, -69,
777  -69, 129, 130, -69, -69, 0, 0, 0, 0, 131,
778  132, 133, 134, 135, 136, 137, 138, 139, 140, 0,
779  125, 126, 127, 128, 0, 0, 0, 0, 117, 118,
780  119, 120, -69, -69, 123, 124, 0, 0, 0, 0,
781  -69, -69, 133, 134, 135, 136, 137, 138, 139, 140,
782  0, 125, 126, 127, 128, 0, 0, 0, 0, 0,
783  0, 0, 0, 129, 130, 0, 0, 0, 0, 0,
784  0, 131, 132, 133, 134, 135, 136, 137, 138, 139,
785  140, -67, -67, 0, 0, 0, 0, -67, -67, -67,
786  -67, -67, -67, -67, -67, 0, 0, -67, -67, 0,
787  0, 0, -67, -67, -67, -67, -67, -67, -67, -67,
788  -67, 0, 0, 0, 0, 0, 93, 0, -67, 0,
789  0, 0, 203, 94, 0, 0, 0, 0, 0, 0,
790  0, 0, 93, 0, 0, 0, 0, 0, 0, 94
791 };
792 
793 static const yytype_int16 yycheck[] =
794 {
795  0, 53, 13, 67, 4, 5, 0, 13, 61, 9,
796  4, 61, 12, 13, 14, 15, 4, 17, 0, 61,
797  20, 61, 4, 17, 0, 0, 20, 66, 4, 17,
798  0, 61, 14, 15, 4, 17, 13, 43, 20, 13,
799  61, 17, 68, 43, 20, 16, 31, 17, 61, 43,
800  20, 63, 26, 27, 72, 68, 65, 44, 45, 46,
801  46, 43, 66, 44, 45, 129, 130, 43, 31, 43,
802  55, 56, 57, 43, 14, 15, 69, 77, 44, 45,
803  46, 42, 42, 77, 42, 63, 69, 4, 72, 77,
804  62, 64, 103, 93, 3, 77, 63, 62, 62, 46,
805  62, 77, 46, 103, 13, 14, 15, 77, 17, 18,
806  19, 20, 21, 22, 23, 24, 25, 26, 27, 72,
807  172, 20, 174, 210, 144, 77, 3, 217, 202, 174,
808  -1, 172, -1, -1, 43, -1, 13, 14, 15, -1,
809  17, 18, 19, 20, 144, 22, 23, 24, 25, 26,
810  27, -1, -1, -1, -1, 64, -1, 66, -1, -1,
811  -1, -1, -1, -1, 164, -1, 43, -1, 168, -1,
812  164, -1, -1, -1, 168, -1, 164, -1, -1, -1,
813  168, -1, 164, -1, -1, -1, 168, 64, 164, 66,
814  -1, -1, 168, -1, 164, -1, -1, -1, 168, -1,
815  -1, -1, 202, -1, -1, -1, -1, -1, 208, -1,
816  -1, -1, -1, -1, 208, -1, 216, 217, -1, 10,
817  208, -1, 216, 217, 224, -1, 208, -1, 216, -1,
818  224, -1, 208, -1, 216, 217, 224, -1, 208, -1,
819  216, 217, 224, -1, -1, -1, 216, 217, 224, -1,
820  -1, 42, -1, -1, 224, 46, -1, -1, -1, -1,
821  51, 52, 3, 54, 55, -1, -1, -1, -1, -1,
822  -1, -1, 13, 14, 15, -1, 17, 18, 19, 20,
823  -1, 22, 23, 24, 25, 26, 27, -1, -1, -1,
824  81, -1, -1, 84, 85, 86, 87, 88, 89, 90,
825  91, 92, 43, 94, -1, -1, -1, -1, -1, 100,
826  101, -1, -1, -1, -1, -1, -1, -1, -1, -1,
827  -1, -1, -1, 64, 65, -1, 117, 118, 119, 120,
828  121, 122, 123, 124, 125, 126, 127, 128, -1, -1,
829  131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
830  -1, -1, 5, 6, 7, 8, 9, 10, 11, 12,
831  -1, -1, -1, -1, -1, 28, 29, 30, 31, -1,
832  -1, -1, -1, -1, 165, 28, 29, 30, 31, -1,
833  -1, -1, 28, 29, 30, 31, -1, 40, 41, 52,
834  53, 54, 55, 56, 57, 48, 49, 50, 51, 52,
835  53, 54, 55, 56, 57, 51, 52, 53, 54, 55,
836  56, 57, 203, 66, 5, 6, 7, 8, 9, 10,
837  11, 12, -1, -1, -1, -1, 28, 29, 30, 31,
838  -1, -1, -1, -1, -1, -1, -1, 28, 29, 30,
839  31, -1, -1, 28, 29, 30, 31, -1, -1, 40,
840  41, 53, 54, 55, 56, 57, -1, 48, 49, 50,
841  51, 52, 53, 54, 55, 56, 57, 3, 53, 54,
842  55, 56, 57, -1, -1, 66, -1, 13, 14, 15,
843  -1, 17, 18, 19, 20, 21, 22, 23, 24, 25,
844  26, 27, -1, -1, 3, -1, -1, -1, -1, -1,
845  -1, -1, -1, -1, 13, 14, 15, 43, 17, 18,
846  19, 20, 13, 22, 23, 24, 25, 26, 27, -1,
847  -1, -1, -1, -1, -1, 26, 27, -1, 64, -1,
848  -1, -1, -1, -1, 43, -1, -1, -1, -1, -1,
849  -1, -1, 43, 44, 45, 46, -1, -1, -1, -1,
850  -1, -1, -1, 54, -1, 64, -1, -1, -1, -1,
851  61, -1, -1, -1, -1, -1, -1, 68, -1, 70,
852  71, 5, 6, 7, 8, 9, 10, 11, 12, 26,
853  27, -1, -1, -1, -1, 32, 33, 34, 35, 36,
854  37, 38, 39, -1, 28, 29, 30, 31, -1, -1,
855  47, -1, -1, -1, -1, -1, 40, 41, -1, -1,
856  -1, -1, -1, -1, 48, 49, 50, 51, 52, 53,
857  54, 55, 56, 57, -1, -1, -1, -1, 62, 5,
858  6, 7, 8, 9, 10, 11, 12, 26, 27, -1,
859  -1, -1, -1, 32, 33, 34, 35, 36, 37, 38,
860  39, -1, 28, 29, 30, 31, -1, -1, 47, -1,
861  -1, -1, -1, -1, 40, 41, -1, -1, -1, -1,
862  -1, -1, 48, 49, 50, 51, 52, 53, 54, 55,
863  56, 57, -1, -1, -1, -1, 62, 5, 6, 7,
864  8, 9, 10, 11, 12, -1, -1, -1, -1, -1,
865  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
866  28, 29, 30, 31, -1, -1, -1, -1, -1, -1,
867  -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
868  48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
869  -1, -1, -1, -1, 62, 5, 6, 7, 8, 9,
870  10, 11, 12, -1, -1, -1, -1, -1, -1, -1,
871  -1, -1, -1, -1, -1, -1, -1, -1, 28, 29,
872  30, 31, -1, -1, -1, -1, -1, -1, -1, -1,
873  40, 41, -1, -1, -1, -1, -1, -1, 48, 49,
874  50, 51, 52, 53, 54, 55, 56, 57, -1, -1,
875  -1, -1, 62, 5, 6, 7, 8, 9, 10, 11,
876  12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
877  -1, -1, -1, -1, -1, -1, 28, 29, 30, 31,
878  -1, -1, -1, -1, -1, -1, -1, -1, 40, 41,
879  -1, -1, -1, -1, -1, -1, 48, 49, 50, 51,
880  52, 53, 54, 55, 56, 57, 5, 6, 7, 8,
881  -1, 10, 11, 12, -1, -1, -1, -1, -1, -1,
882  -1, -1, -1, -1, -1, -1, -1, -1, -1, 28,
883  29, 30, 31, -1, -1, -1, -1, 5, 6, 7,
884  8, 40, 41, 11, 12, -1, -1, -1, -1, 48,
885  49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
886  28, 29, 30, 31, -1, -1, -1, -1, 5, 6,
887  7, 8, 40, 41, 11, 12, -1, -1, -1, -1,
888  48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
889  -1, 28, 29, 30, 31, -1, -1, -1, -1, -1,
890  -1, -1, -1, 40, 41, -1, -1, -1, -1, -1,
891  -1, 48, 49, 50, 51, 52, 53, 54, 55, 56,
892  57, 26, 27, -1, -1, -1, -1, 32, 33, 34,
893  35, 36, 37, 38, 39, -1, -1, 26, 27, -1,
894  -1, -1, 47, 32, 33, 34, 35, 36, 37, 38,
895  39, -1, -1, -1, -1, -1, 61, -1, 47, -1,
896  -1, -1, 67, 68, -1, -1, -1, -1, -1, -1,
897  -1, -1, 61, -1, -1, -1, -1, -1, -1, 68
898 };
899 
900  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
901  symbol of state STATE-NUM. */
902 static const yytype_uint8 yystos[] =
903 {
904  0, 3, 13, 14, 15, 17, 18, 19, 20, 21,
905  22, 23, 24, 25, 26, 27, 43, 64, 74, 75,
906  76, 77, 80, 82, 83, 84, 85, 86, 87, 88,
907  89, 90, 92, 94, 95, 99, 100, 101, 102, 104,
908  114, 115, 61, 61, 82, 101, 61, 101, 44, 45,
909  46, 54, 61, 68, 70, 71, 95, 99, 101, 102,
910  104, 105, 106, 109, 111, 112, 113, 61, 78, 79,
911  101, 78, 100, 101, 100, 65, 81, 82, 0, 75,
912  66, 13, 26, 27, 32, 33, 34, 35, 36, 37,
913  38, 39, 47, 61, 68, 105, 91, 95, 99, 104,
914  16, 61, 105, 61, 72, 105, 105, 44, 45, 46,
915  93, 107, 108, 109, 110, 105, 105, 5, 6, 7,
916  8, 9, 10, 11, 12, 28, 29, 30, 31, 40,
917  41, 48, 49, 50, 51, 52, 53, 54, 55, 56,
918  57, 44, 45, 93, 63, 65, 81, 105, 105, 105,
919  105, 105, 105, 105, 105, 105, 105, 96, 97, 98,
920  101, 105, 103, 105, 62, 66, 105, 105, 62, 78,
921  46, 62, 42, 69, 63, 105, 105, 105, 105, 105,
922  105, 105, 105, 105, 105, 105, 105, 93, 93, 105,
923  105, 105, 105, 105, 105, 105, 105, 105, 105, 62,
924  79, 62, 63, 67, 69, 82, 105, 66, 62, 82,
925  62, 72, 110, 107, 97, 105, 4, 66, 82, 80,
926  46, 82, 91, 72, 62, 46, 82
927 };
928 
929  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
930 static const yytype_uint8 yyr1[] =
931 {
932  0, 73, 74, 75, 75, 76, 76, 77, 78, 78,
933  79, 79, 80, 80, 81, 81, 82, 82, 82, 82,
934  83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
935  83, 84, 84, 85, 85, 86, 86, 86, 86, 87,
936  88, 89, 90, 91, 91, 91, 91, 92, 93, 93,
937  94, 95, 96, 96, 97, 97, 98, 98, 99, 99,
938  99, 99, 99, 99, 99, 99, 99, 100, 100, 101,
939  101, 102, 103, 104, 104, 104, 104, 105, 105, 105,
940  105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
941  105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
942  105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
943  105, 106, 107, 107, 108, 108, 109, 109, 109, 110,
944  111, 111, 111, 112, 113, 114, 115
945 };
946 
947  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
948 static const yytype_uint8 yyr2[] =
949 {
950  0, 2, 1, 1, 2, 1, 1, 6, 0, 1,
951  1, 3, 3, 2, 1, 2, 2, 1, 1, 1,
952  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
953  0, 2, 1, 5, 7, 1, 1, 1, 1, 9,
954  5, 5, 6, 1, 1, 1, 0, 3, 1, 1,
955  4, 4, 1, 0, 1, 3, 1, 3, 3, 3,
956  3, 3, 3, 3, 3, 3, 3, 1, 1, 1,
957  1, 4, 1, 2, 2, 2, 2, 3, 3, 2,
958  3, 3, 3, 2, 2, 3, 3, 3, 3, 3,
959  3, 3, 3, 3, 3, 1, 3, 3, 3, 3,
960  3, 3, 3, 3, 3, 3, 1, 1, 1, 1,
961  1, 3, 1, 3, 1, 3, 1, 1, 1, 1,
962  1, 1, 1, 1, 7, 2, 2
963 };
964 
965 
966 #define yyerrok (yyerrstatus = 0)
967 #define yyclearin (yychar = YYEMPTY)
968 #define YYEMPTY (-2)
969 #define YYEOF 0
970 
971 #define YYACCEPT goto yyacceptlab
972 #define YYABORT goto yyabortlab
973 #define YYERROR goto yyerrorlab
974 
975 
976 #define YYRECOVERING() (!!yyerrstatus)
977 
978 #define YYBACKUP(Token, Value) \
979 do \
980  if (yychar == YYEMPTY) \
981  { \
982  yychar = (Token); \
983  yylval = (Value); \
984  YYPOPSTACK (yylen); \
985  yystate = *yyssp; \
986  goto yybackup; \
987  } \
988  else \
989  { \
990  yyerror (parm, YY_("syntax error: cannot back up")); \
991  YYERROR; \
992  } \
993 while (0)
994 
995 /* Error token number */
996 #define YYTERROR 1
997 #define YYERRCODE 256
998 
999 
1000 
1001 /* Enable debugging if requested. */
1002 #if YYDEBUG
1003 
1004 # ifndef YYFPRINTF
1005 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1006 # define YYFPRINTF fprintf
1007 # endif
1008 
1009 # define YYDPRINTF(Args) \
1010 do { \
1011  if (yydebug) \
1012  YYFPRINTF Args; \
1013 } while (0)
1014 
1015 /* This macro is provided for backward compatibility. */
1016 #ifndef YY_LOCATION_PRINT
1017 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1018 #endif
1019 
1020 
1021 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1022 do { \
1023  if (yydebug) \
1024  { \
1025  YYFPRINTF (stderr, "%s ", Title); \
1026  yy_symbol_print (stderr, \
1027  Type, Value, parm); \
1028  YYFPRINTF (stderr, "\n"); \
1029  } \
1030 } while (0)
1031 
1032 
1033 /*----------------------------------------.
1034 | Print this symbol's value on YYOUTPUT. |
1035 `----------------------------------------*/
1036 
1037 static void
1038 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, naslctxt * parm)
1039 {
1040  FILE *yyo = yyoutput;
1041  YYUSE (yyo);
1042  YYUSE (parm);
1043  if (!yyvaluep)
1044  return;
1045 # ifdef YYPRINT
1046  if (yytype < YYNTOKENS)
1047  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1048 # endif
1049  YYUSE (yytype);
1050 }
1051 
1052 
1053 /*--------------------------------.
1054 | Print this symbol on YYOUTPUT. |
1055 `--------------------------------*/
1056 
1057 static void
1058 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, naslctxt * parm)
1059 {
1060  YYFPRINTF (yyoutput, "%s %s (",
1061  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1062 
1063  yy_symbol_value_print (yyoutput, yytype, yyvaluep, parm);
1064  YYFPRINTF (yyoutput, ")");
1065 }
1066 
1067 /*------------------------------------------------------------------.
1068 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1069 | TOP (included). |
1070 `------------------------------------------------------------------*/
1071 
1072 static void
1073 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1074 {
1075  YYFPRINTF (stderr, "Stack now");
1076  for (; yybottom <= yytop; yybottom++)
1077  {
1078  int yybot = *yybottom;
1079  YYFPRINTF (stderr, " %d", yybot);
1080  }
1081  YYFPRINTF (stderr, "\n");
1082 }
1083 
1084 # define YY_STACK_PRINT(Bottom, Top) \
1085 do { \
1086  if (yydebug) \
1087  yy_stack_print ((Bottom), (Top)); \
1088 } while (0)
1089 
1090 
1091 /*------------------------------------------------.
1092 | Report that the YYRULE is going to be reduced. |
1093 `------------------------------------------------*/
1094 
1095 static void
1096 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, naslctxt * parm)
1097 {
1098  unsigned long int yylno = yyrline[yyrule];
1099  int yynrhs = yyr2[yyrule];
1100  int yyi;
1101  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1102  yyrule - 1, yylno);
1103  /* The symbols being reduced. */
1104  for (yyi = 0; yyi < yynrhs; yyi++)
1105  {
1106  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1107  yy_symbol_print (stderr,
1108  yystos[yyssp[yyi + 1 - yynrhs]],
1109  &(yyvsp[(yyi + 1) - (yynrhs)])
1110  , parm);
1111  YYFPRINTF (stderr, "\n");
1112  }
1113 }
1114 
1115 # define YY_REDUCE_PRINT(Rule) \
1116 do { \
1117  if (yydebug) \
1118  yy_reduce_print (yyssp, yyvsp, Rule, parm); \
1119 } while (0)
1120 
1121 /* Nonzero means print parse trace. It is left uninitialized so that
1122  multiple parsers can coexist. */
1124 #else /* !YYDEBUG */
1125 # define YYDPRINTF(Args)
1126 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1127 # define YY_STACK_PRINT(Bottom, Top)
1128 # define YY_REDUCE_PRINT(Rule)
1129 #endif /* !YYDEBUG */
1130 
1131 
1132 /* YYINITDEPTH -- initial size of the parser's stacks. */
1133 #ifndef YYINITDEPTH
1134 # define YYINITDEPTH 200
1135 #endif
1136 
1137 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1138  if the built-in stack extension method is used).
1139 
1140  Do not make this value too large; the results are undefined if
1141  YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1142  evaluated with infinite-precision integer arithmetic. */
1143 
1144 #ifndef YYMAXDEPTH
1145 # define YYMAXDEPTH 10000
1146 #endif
1147 
1148 
1149 #if YYERROR_VERBOSE
1150 
1151 # ifndef yystrlen
1152 # if defined __GLIBC__ && defined _STRING_H
1153 # define yystrlen strlen
1154 # else
1155 /* Return the length of YYSTR. */
1156 static YYSIZE_T
1157 yystrlen (const char *yystr)
1158 {
1159  YYSIZE_T yylen;
1160  for (yylen = 0; yystr[yylen]; yylen++)
1161  continue;
1162  return yylen;
1163 }
1164 # endif
1165 # endif
1166 
1167 # ifndef yystpcpy
1168 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1169 # define yystpcpy stpcpy
1170 # else
1171 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1172  YYDEST. */
1173 static char *
1174 yystpcpy (char *yydest, const char *yysrc)
1175 {
1176  char *yyd = yydest;
1177  const char *yys = yysrc;
1178 
1179  while ((*yyd++ = *yys++) != '\0')
1180  continue;
1181 
1182  return yyd - 1;
1183 }
1184 # endif
1185 # endif
1186 
1187 # ifndef yytnamerr
1188 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1189  quotes and backslashes, so that it's suitable for yyerror. The
1190  heuristic is that double-quoting is unnecessary unless the string
1191  contains an apostrophe, a comma, or backslash (other than
1192  backslash-backslash). YYSTR is taken from yytname. If YYRES is
1193  null, do not copy; instead, return the length of what the result
1194  would have been. */
1195 static YYSIZE_T
1196 yytnamerr (char *yyres, const char *yystr)
1197 {
1198  if (*yystr == '"')
1199  {
1200  YYSIZE_T yyn = 0;
1201  char const *yyp = yystr;
1202 
1203  for (;;)
1204  switch (*++yyp)
1205  {
1206  case '\'':
1207  case ',':
1208  goto do_not_strip_quotes;
1209 
1210  case '\\':
1211  if (*++yyp != '\\')
1212  goto do_not_strip_quotes;
1213  /* Fall through. */
1214  default:
1215  if (yyres)
1216  yyres[yyn] = *yyp;
1217  yyn++;
1218  break;
1219 
1220  case '"':
1221  if (yyres)
1222  yyres[yyn] = '\0';
1223  return yyn;
1224  }
1225  do_not_strip_quotes: ;
1226  }
1227 
1228  if (! yyres)
1229  return yystrlen (yystr);
1230 
1231  return yystpcpy (yyres, yystr) - yyres;
1232 }
1233 # endif
1234 
1235 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1236  about the unexpected token YYTOKEN for the state stack whose top is
1237  YYSSP.
1238 
1239  Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1240  not large enough to hold the message. In that case, also set
1241  *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1242  required number of bytes is too large to store. */
1243 static int
1244 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1245  yytype_int16 *yyssp, int yytoken)
1246 {
1247  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1248  YYSIZE_T yysize = yysize0;
1249  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1250  /* Internationalized format string. */
1251  const char *yyformat = YY_NULLPTR;
1252  /* Arguments of yyformat. */
1253  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1254  /* Number of reported tokens (one for the "unexpected", one per
1255  "expected"). */
1256  int yycount = 0;
1257 
1258  /* There are many possibilities here to consider:
1259  - If this state is a consistent state with a default action, then
1260  the only way this function was invoked is if the default action
1261  is an error action. In that case, don't check for expected
1262  tokens because there are none.
1263  - The only way there can be no lookahead present (in yychar) is if
1264  this state is a consistent state with a default action. Thus,
1265  detecting the absence of a lookahead is sufficient to determine
1266  that there is no unexpected or expected token to report. In that
1267  case, just report a simple "syntax error".
1268  - Don't assume there isn't a lookahead just because this state is a
1269  consistent state with a default action. There might have been a
1270  previous inconsistent state, consistent state with a non-default
1271  action, or user semantic action that manipulated yychar.
1272  - Of course, the expected token list depends on states to have
1273  correct lookahead information, and it depends on the parser not
1274  to perform extra reductions after fetching a lookahead from the
1275  scanner and before detecting a syntax error. Thus, state merging
1276  (from LALR or IELR) and default reductions corrupt the expected
1277  token list. However, the list is correct for canonical LR with
1278  one exception: it will still contain any token that will not be
1279  accepted due to an error action in a later state.
1280  */
1281  if (yytoken != YYEMPTY)
1282  {
1283  int yyn = yypact[*yyssp];
1284  yyarg[yycount++] = yytname[yytoken];
1285  if (!yypact_value_is_default (yyn))
1286  {
1287  /* Start YYX at -YYN if negative to avoid negative indexes in
1288  YYCHECK. In other words, skip the first -YYN actions for
1289  this state because they are default actions. */
1290  int yyxbegin = yyn < 0 ? -yyn : 0;
1291  /* Stay within bounds of both yycheck and yytname. */
1292  int yychecklim = YYLAST - yyn + 1;
1293  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1294  int yyx;
1295 
1296  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1297  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1298  && !yytable_value_is_error (yytable[yyx + yyn]))
1299  {
1300  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1301  {
1302  yycount = 1;
1303  yysize = yysize0;
1304  break;
1305  }
1306  yyarg[yycount++] = yytname[yyx];
1307  {
1308  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1309  if (! (yysize <= yysize1
1310  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1311  return 2;
1312  yysize = yysize1;
1313  }
1314  }
1315  }
1316  }
1317 
1318  switch (yycount)
1319  {
1320 # define YYCASE_(N, S) \
1321  case N: \
1322  yyformat = S; \
1323  break
1324  default: /* Avoid compiler warnings. */
1325  YYCASE_(0, YY_("syntax error"));
1326  YYCASE_(1, YY_("syntax error, unexpected %s"));
1327  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1328  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1329  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1330  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1331 # undef YYCASE_
1332  }
1333 
1334  {
1335  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1336  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1337  return 2;
1338  yysize = yysize1;
1339  }
1340 
1341  if (*yymsg_alloc < yysize)
1342  {
1343  *yymsg_alloc = 2 * yysize;
1344  if (! (yysize <= *yymsg_alloc
1345  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1346  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1347  return 1;
1348  }
1349 
1350  /* Avoid sprintf, as that infringes on the user's name space.
1351  Don't have undefined behavior even if the translation
1352  produced a string with the wrong number of "%s"s. */
1353  {
1354  char *yyp = *yymsg;
1355  int yyi = 0;
1356  while ((*yyp = *yyformat) != '\0')
1357  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1358  {
1359  yyp += yytnamerr (yyp, yyarg[yyi++]);
1360  yyformat += 2;
1361  }
1362  else
1363  {
1364  yyp++;
1365  yyformat++;
1366  }
1367  }
1368  return 0;
1369 }
1370 #endif /* YYERROR_VERBOSE */
1371 
1372 /*-----------------------------------------------.
1373 | Release the memory associated to this symbol. |
1374 `-----------------------------------------------*/
1375 
1376 static void
1377 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, naslctxt * parm)
1378 {
1379  YYUSE (yyvaluep);
1380  YYUSE (parm);
1381  if (!yymsg)
1382  yymsg = "Deleting";
1383  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1384 
1386  YYUSE (yytype);
1388 }
1389 
1390 
1391 
1392 
1393 /*----------.
1394 | yyparse. |
1395 `----------*/
1396 
1397 int
1399 {
1400 /* The lookahead symbol. */
1401 int yychar;
1402 
1403 
1404 /* The semantic value of the lookahead symbol. */
1405 /* Default value used for initialization, for pacifying older GCCs
1406  or non-GCC compilers. */
1407 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1408 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1409 
1410  /* Number of syntax errors so far. */
1411  int yynerrs;
1412 
1413  int yystate;
1414  /* Number of tokens to shift before error messages enabled. */
1415  int yyerrstatus;
1416 
1417  /* The stacks and their tools:
1418  'yyss': related to states.
1419  'yyvs': related to semantic values.
1420 
1421  Refer to the stacks through separate pointers, to allow yyoverflow
1422  to reallocate them elsewhere. */
1423 
1424  /* The state stack. */
1425  yytype_int16 yyssa[YYINITDEPTH];
1426  yytype_int16 *yyss;
1427  yytype_int16 *yyssp;
1428 
1429  /* The semantic value stack. */
1430  YYSTYPE yyvsa[YYINITDEPTH];
1431  YYSTYPE *yyvs;
1432  YYSTYPE *yyvsp;
1433 
1434  YYSIZE_T yystacksize;
1435 
1436  int yyn;
1437  int yyresult;
1438  /* Lookahead token as an internal (translated) token number. */
1439  int yytoken = 0;
1440  /* The variables used to return semantic value and location from the
1441  action routines. */
1442  YYSTYPE yyval;
1443 
1444 #if YYERROR_VERBOSE
1445  /* Buffer for error messages, and its allocated size. */
1446  char yymsgbuf[128];
1447  char *yymsg = yymsgbuf;
1448  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1449 #endif
1450 
1451 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1452 
1453  /* The number of symbols on the RHS of the reduced rule.
1454  Keep to zero when no symbol should be popped. */
1455  int yylen = 0;
1456 
1457  yyssp = yyss = yyssa;
1458  yyvsp = yyvs = yyvsa;
1459  yystacksize = YYINITDEPTH;
1460 
1461  YYDPRINTF ((stderr, "Starting parse\n"));
1462 
1463  yystate = 0;
1464  yyerrstatus = 0;
1465  yynerrs = 0;
1466  yychar = YYEMPTY; /* Cause a token to be read. */
1467  goto yysetstate;
1468 
1469 /*------------------------------------------------------------.
1470 | yynewstate -- Push a new state, which is found in yystate. |
1471 `------------------------------------------------------------*/
1472  yynewstate:
1473  /* In all cases, when you get here, the value and location stacks
1474  have just been pushed. So pushing a state here evens the stacks. */
1475  yyssp++;
1476 
1477  yysetstate:
1478  *yyssp = yystate;
1479 
1480  if (yyss + yystacksize - 1 <= yyssp)
1481  {
1482  /* Get the current used size of the three stacks, in elements. */
1483  YYSIZE_T yysize = yyssp - yyss + 1;
1484 
1485 #ifdef yyoverflow
1486  {
1487  /* Give user a chance to reallocate the stack. Use copies of
1488  these so that the &'s don't force the real ones into
1489  memory. */
1490  YYSTYPE *yyvs1 = yyvs;
1491  yytype_int16 *yyss1 = yyss;
1492 
1493  /* Each stack pointer address is followed by the size of the
1494  data in use in that stack, in bytes. This used to be a
1495  conditional around just the two extra args, but that might
1496  be undefined if yyoverflow is a macro. */
1497  yyoverflow (YY_("memory exhausted"),
1498  &yyss1, yysize * sizeof (*yyssp),
1499  &yyvs1, yysize * sizeof (*yyvsp),
1500  &yystacksize);
1501 
1502  yyss = yyss1;
1503  yyvs = yyvs1;
1504  }
1505 #else /* no yyoverflow */
1506 # ifndef YYSTACK_RELOCATE
1507  goto yyexhaustedlab;
1508 # else
1509  /* Extend the stack our own way. */
1510  if (YYMAXDEPTH <= yystacksize)
1511  goto yyexhaustedlab;
1512  yystacksize *= 2;
1513  if (YYMAXDEPTH < yystacksize)
1514  yystacksize = YYMAXDEPTH;
1515 
1516  {
1517  yytype_int16 *yyss1 = yyss;
1518  union yyalloc *yyptr =
1519  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1520  if (! yyptr)
1521  goto yyexhaustedlab;
1522  YYSTACK_RELOCATE (yyss_alloc, yyss);
1523  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1524 # undef YYSTACK_RELOCATE
1525  if (yyss1 != yyssa)
1526  YYSTACK_FREE (yyss1);
1527  }
1528 # endif
1529 #endif /* no yyoverflow */
1530 
1531  yyssp = yyss + yysize - 1;
1532  yyvsp = yyvs + yysize - 1;
1533 
1534  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1535  (unsigned long int) yystacksize));
1536 
1537  if (yyss + yystacksize - 1 <= yyssp)
1538  YYABORT;
1539  }
1540 
1541  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1542 
1543  if (yystate == YYFINAL)
1544  YYACCEPT;
1545 
1546  goto yybackup;
1547 
1548 /*-----------.
1549 | yybackup. |
1550 `-----------*/
1551 yybackup:
1552 
1553  /* Do appropriate processing given the current state. Read a
1554  lookahead token if we need one and don't already have one. */
1555 
1556  /* First try to decide what to do without reference to lookahead token. */
1557  yyn = yypact[yystate];
1558  if (yypact_value_is_default (yyn))
1559  goto yydefault;
1560 
1561  /* Not known => get a lookahead token if don't already have one. */
1562 
1563  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1564  if (yychar == YYEMPTY)
1565  {
1566  YYDPRINTF ((stderr, "Reading a token: "));
1567  yychar = yylex (&yylval, parm);
1568  }
1569 
1570  if (yychar <= YYEOF)
1571  {
1572  yychar = yytoken = YYEOF;
1573  YYDPRINTF ((stderr, "Now at end of input.\n"));
1574  }
1575  else
1576  {
1577  yytoken = YYTRANSLATE (yychar);
1578  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1579  }
1580 
1581  /* If the proper action on seeing token YYTOKEN is to reduce or to
1582  detect an error, take that action. */
1583  yyn += yytoken;
1584  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1585  goto yydefault;
1586  yyn = yytable[yyn];
1587  if (yyn <= 0)
1588  {
1589  if (yytable_value_is_error (yyn))
1590  goto yyerrlab;
1591  yyn = -yyn;
1592  goto yyreduce;
1593  }
1594 
1595  /* Count tokens shifted since error; after three, turn off error
1596  status. */
1597  if (yyerrstatus)
1598  yyerrstatus--;
1599 
1600  /* Shift the lookahead token. */
1601  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1602 
1603  /* Discard the shifted token. */
1604  yychar = YYEMPTY;
1605 
1606  yystate = yyn;
1608  *++yyvsp = yylval;
1610 
1611  goto yynewstate;
1612 
1613 
1614 /*-----------------------------------------------------------.
1615 | yydefault -- do the default action for the current state. |
1616 `-----------------------------------------------------------*/
1617 yydefault:
1618  yyn = yydefact[yystate];
1619  if (yyn == 0)
1620  goto yyerrlab;
1621  goto yyreduce;
1622 
1623 
1624 /*-----------------------------.
1625 | yyreduce -- Do a reduction. |
1626 `-----------------------------*/
1627 yyreduce:
1628  /* yyn is the number of a rule to reduce with. */
1629  yylen = yyr2[yyn];
1630 
1631  /* If YYLEN is nonzero, implement the default value of the action:
1632  '$$ = $1'.
1633 
1634  Otherwise, the following line sets YYVAL to garbage.
1635  This behavior is undocumented and Bison
1636  users should not rely upon it. Assigning to YYVAL
1637  unconditionally makes the parser a bit smaller, and it avoids a
1638  GCC warning that YYVAL may be used uninitialized. */
1639  yyval = yyvsp[1-yylen];
1640 
1641 
1642  YY_REDUCE_PRINT (yyn);
1643  switch (yyn)
1644  {
1645  case 2:
1646 #line 145 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1647  {
1648  ((naslctxt*)parm)->tree = (yyvsp[0].node);
1649  }
1650 #line 1651 "nasl_grammar.tab.c" /* yacc.c:1648 */
1651  break;
1652 
1653  case 3:
1654 #line 150 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1655  {
1656  (yyval.node) = alloc_tree_cell(LNB, NULL);
1657  (yyval.node)->type = NODE_INSTR_L;
1658  (yyval.node)->link[0] = (yyvsp[0].node);
1659  }
1660 #line 1661 "nasl_grammar.tab.c" /* yacc.c:1648 */
1661  break;
1662 
1663  case 4:
1664 #line 156 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1665  {
1666  (yyval.node) = alloc_tree_cell(LNB, NULL);
1667  (yyval.node)->type = NODE_INSTR_L;
1668  (yyval.node)->link[0] = (yyvsp[-1].node);
1669  (yyval.node)->link[1] = (yyvsp[0].node);
1670  }
1671 #line 1672 "nasl_grammar.tab.c" /* yacc.c:1648 */
1672  break;
1673 
1674  case 7:
1675 #line 166 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1676  {
1677  nasl_set_function_filename ((yyvsp[-4].str));
1678  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-4].str));
1679  (yyval.node)->type = NODE_FUN_DEF;
1680  (yyval.node)->link[0] = (yyvsp[-2].node);
1681  (yyval.node)->link[1] = (yyvsp[0].node);
1682  }
1683 #line 1684 "nasl_grammar.tab.c" /* yacc.c:1648 */
1684  break;
1685 
1686  case 8:
1687 #line 174 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1688  { (yyval.node) = NULL; }
1689 #line 1690 "nasl_grammar.tab.c" /* yacc.c:1648 */
1690  break;
1691 
1692  case 9:
1693 #line 174 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1694  { (yyval.node) = (yyvsp[0].node); }
1695 #line 1696 "nasl_grammar.tab.c" /* yacc.c:1648 */
1696  break;
1697 
1698  case 10:
1699 #line 175 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1700  { (yyval.node) = alloc_tree_cell(LNB, (yyvsp[0].str)); (yyval.node)->type = NODE_DECL; }
1701 #line 1702 "nasl_grammar.tab.c" /* yacc.c:1648 */
1702  break;
1703 
1704  case 11:
1705 #line 177 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1706  {
1707  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-2].str));
1708  (yyval.node)->type = NODE_DECL;
1709  (yyval.node)->link[0] = (yyvsp[0].node);
1710  }
1711 #line 1712 "nasl_grammar.tab.c" /* yacc.c:1648 */
1712  break;
1713 
1714  case 12:
1715 #line 184 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1716  { (yyval.node) = (yyvsp[-1].node); }
1717 #line 1718 "nasl_grammar.tab.c" /* yacc.c:1648 */
1718  break;
1719 
1720  case 13:
1721 #line 184 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1722  { (yyval.node) = NULL; }
1723 #line 1724 "nasl_grammar.tab.c" /* yacc.c:1648 */
1724  break;
1725 
1726  case 15:
1727 #line 187 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1728  {
1729  if ((yyvsp[-1].node) == NULL)
1730  (yyval.node) = (yyvsp[0].node);
1731  else
1732  {
1733  (yyval.node) = alloc_tree_cell(LNB, NULL);
1734  (yyval.node)->type = NODE_INSTR_L;
1735  (yyval.node)->link[0] = (yyvsp[-1].node);
1736  (yyval.node)->link[1] = (yyvsp[0].node);
1737  }
1738  }
1739 #line 1740 "nasl_grammar.tab.c" /* yacc.c:1648 */
1740  break;
1741 
1742  case 16:
1743 #line 200 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1744  { (yyval.node) = (yyvsp[-1].node); }
1745 #line 1746 "nasl_grammar.tab.c" /* yacc.c:1648 */
1746  break;
1747 
1748  case 28:
1749 #line 205 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1750  {
1751  (yyval.node) = alloc_tree_cell(LNB, NULL);
1752  (yyval.node)->type = NODE_BREAK;
1753  }
1754 #line 1755 "nasl_grammar.tab.c" /* yacc.c:1648 */
1755  break;
1756 
1757  case 29:
1758 #line 209 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1759  {
1760  (yyval.node) = alloc_tree_cell(LNB, NULL);
1761  (yyval.node)->type = NODE_CONTINUE;
1762  }
1763 #line 1764 "nasl_grammar.tab.c" /* yacc.c:1648 */
1764  break;
1765 
1766  case 30:
1767 #line 213 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1768  { (yyval.node) = NULL; }
1769 #line 1770 "nasl_grammar.tab.c" /* yacc.c:1648 */
1770  break;
1771 
1772  case 31:
1773 #line 217 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1774  {
1775  (yyval.node) = alloc_tree_cell(LNB, NULL);
1776  (yyval.node)->type = NODE_RETURN;
1777  (yyval.node)->link[0] = (yyvsp[0].node);
1778  }
1779 #line 1780 "nasl_grammar.tab.c" /* yacc.c:1648 */
1780  break;
1781 
1782  case 32:
1783 #line 223 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1784  {
1785  (yyval.node) = alloc_tree_cell(LNB, NULL);
1786  (yyval.node)->type = NODE_RETURN;
1787  }
1788 #line 1789 "nasl_grammar.tab.c" /* yacc.c:1648 */
1789  break;
1790 
1791  case 33:
1792 #line 230 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1793  {
1794  (yyval.node) = alloc_tree_cell(LNB, NULL);
1795  (yyval.node)->type = NODE_IF_ELSE;
1796  (yyval.node)->link[0] = (yyvsp[-2].node); (yyval.node)->link[1] = (yyvsp[0].node);
1797  }
1798 #line 1799 "nasl_grammar.tab.c" /* yacc.c:1648 */
1799  break;
1800 
1801  case 34:
1802 #line 236 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1803  {
1804  (yyval.node) = alloc_tree_cell(LNB, NULL);
1805  (yyval.node)->type = NODE_IF_ELSE;
1806  (yyval.node)->link[0] = (yyvsp[-4].node); (yyval.node)->link[1] = (yyvsp[-2].node); (yyval.node)->link[2] = (yyvsp[0].node);
1807  }
1808 #line 1809 "nasl_grammar.tab.c" /* yacc.c:1648 */
1809  break;
1810 
1811  case 39:
1812 #line 245 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1813  {
1814  (yyval.node) = alloc_tree_cell(LNB, NULL);
1815  (yyval.node)->type = NODE_FOR;
1816  (yyval.node)->link[0] = (yyvsp[-6].node);
1817  (yyval.node)->link[1] = (yyvsp[-4].node);
1818  (yyval.node)->link[2] = (yyvsp[-2].node);
1819  (yyval.node)->link[3] = (yyvsp[0].node);
1820  }
1821 #line 1822 "nasl_grammar.tab.c" /* yacc.c:1648 */
1822  break;
1823 
1824  case 40:
1825 #line 255 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1826  {
1827  (yyval.node) = alloc_tree_cell(LNB, NULL);
1828  (yyval.node)->type = NODE_WHILE;
1829  (yyval.node)->link[0] = (yyvsp[-2].node);
1830  (yyval.node)->link[1] = (yyvsp[0].node);
1831  }
1832 #line 1833 "nasl_grammar.tab.c" /* yacc.c:1648 */
1833  break;
1834 
1835  case 41:
1836 #line 262 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1837  {
1838  (yyval.node) = alloc_tree_cell(LNB, NULL);
1839  (yyval.node)->type = NODE_REPEAT_UNTIL;
1840  (yyval.node)->link[0] = (yyvsp[-3].node);
1841  (yyval.node)->link[1] = (yyvsp[-1].node);
1842  }
1843 #line 1844 "nasl_grammar.tab.c" /* yacc.c:1648 */
1844  break;
1845 
1846  case 42:
1847 #line 270 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1848  {
1849  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-4].str));
1850  (yyval.node)->type = NODE_FOREACH;
1851  (yyval.node)->link[0] = (yyvsp[-2].node);
1852  (yyval.node)->link[1] = (yyvsp[0].node);
1853  }
1854 #line 1855 "nasl_grammar.tab.c" /* yacc.c:1648 */
1855  break;
1856 
1857  case 46:
1858 #line 278 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1859  { (yyval.node) = NULL; }
1860 #line 1861 "nasl_grammar.tab.c" /* yacc.c:1648 */
1861  break;
1862 
1863  case 47:
1864 #line 282 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1865  {
1866  (yyval.node) = alloc_tree_cell(LNB, NULL);
1867  (yyval.node)->type = NODE_REPEATED;
1868  (yyval.node)->link[0] = (yyvsp[-2].node);
1869  (yyval.node)->link[1] = (yyvsp[0].node);
1870  }
1871 #line 1872 "nasl_grammar.tab.c" /* yacc.c:1648 */
1872  break;
1873 
1874  case 48:
1875 #line 289 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1876  { (yyval.str) = (yyvsp[0].data).val; }
1877 #line 1878 "nasl_grammar.tab.c" /* yacc.c:1648 */
1878  break;
1879 
1880  case 50:
1881 #line 293 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1882  {
1883  char *tmp;
1884  naslctxt subctx;
1885 
1886  bzero (&subctx, sizeof (subctx));
1887  subctx.always_authenticated = ((naslctxt*)parm)->always_authenticated;
1888  subctx.kb = ((naslctxt *) parm)->kb;
1889  subctx.tree = ((naslctxt *) parm)->tree;
1890  (yyval.node) = NULL;
1891  tmp = g_strdup (nasl_get_filename (NULL));
1892  nasl_set_filename ((yyvsp[-1].str));
1893  if (!includes_hash)
1894  includes_hash = g_hash_table_new_full
1895  (g_str_hash, g_str_equal, g_free,
1896  (GDestroyNotify) deref_cell);
1897 
1898  if ((subctx.tree = g_hash_table_lookup (includes_hash, (yyvsp[-1].str))))
1899  {
1900  (yyval.node) = subctx.tree;
1901  ref_cell ((yyval.node));
1902  g_free ((yyvsp[-1].str));
1903  }
1904  else if (init_nasl_ctx (&subctx, (yyvsp[-1].str)) >= 0)
1905  {
1906  if (!naslparse (&subctx))
1907  {
1908  (yyval.node) = subctx.tree;
1909  g_hash_table_insert (includes_hash, (yyvsp[-1].str), (yyval.node));
1910  ref_cell ((yyval.node));
1911  }
1912  else
1913  {
1914  nasl_perror (NULL, "%s: Parse error at or near line %d\n",
1915  (yyvsp[-1].str), subctx.line_nb);
1916  g_free ((yyvsp[-1].str));
1917  }
1918  g_free(subctx.buffer);
1919  subctx.buffer = NULL;
1920  fclose(subctx.fp);
1921  subctx.fp = NULL;
1922  }
1923  else
1924  {
1925  g_free((yyvsp[-1].str));
1926  g_free (tmp);
1927  return -2;
1928  }
1929  nasl_set_filename (tmp);
1930  g_free (tmp);
1931  }
1932 #line 1933 "nasl_grammar.tab.c" /* yacc.c:1648 */
1933  break;
1934 
1935  case 51:
1936 #line 346 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1937  {
1938  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-3].str));
1939  (yyval.node)->type = NODE_FUN_CALL;
1940  (yyval.node)->link[0] = (yyvsp[-1].node);
1941  }
1942 #line 1943 "nasl_grammar.tab.c" /* yacc.c:1648 */
1943  break;
1944 
1945  case 53:
1946 #line 352 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1947  { (yyval.node) = NULL; }
1948 #line 1949 "nasl_grammar.tab.c" /* yacc.c:1648 */
1949  break;
1950 
1951  case 55:
1952 #line 354 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1953  {
1954  (yyvsp[-2].node)->link[1] = (yyvsp[0].node);
1955  (yyval.node) = (yyvsp[-2].node);
1956  }
1957 #line 1958 "nasl_grammar.tab.c" /* yacc.c:1648 */
1958  break;
1959 
1960  case 56:
1961 #line 360 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1962  {
1963  (yyval.node) = alloc_tree_cell(LNB, NULL);
1964  (yyval.node)->type = NODE_ARG;
1965  (yyval.node)->link[0] = (yyvsp[0].node);
1966  }
1967 #line 1968 "nasl_grammar.tab.c" /* yacc.c:1648 */
1968  break;
1969 
1970  case 57:
1971 #line 366 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1972  {
1973  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-2].str));
1974  (yyval.node)->type = NODE_ARG;
1975  (yyval.node)->link[0] = (yyvsp[0].node);
1976  }
1977 #line 1978 "nasl_grammar.tab.c" /* yacc.c:1648 */
1978  break;
1979 
1980  case 58:
1981 #line 374 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1982  {
1983  (yyval.node) = alloc_expr_cell(LNB, NODE_AFF, (yyvsp[-2].node), (yyvsp[0].node));
1984  }
1985 #line 1986 "nasl_grammar.tab.c" /* yacc.c:1648 */
1986  break;
1987 
1988  case 59:
1989 #line 377 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1990  { (yyval.node) = alloc_expr_cell(LNB, NODE_PLUS_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1991 #line 1992 "nasl_grammar.tab.c" /* yacc.c:1648 */
1992  break;
1993 
1994  case 60:
1995 #line 378 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
1996  { (yyval.node) = alloc_expr_cell(LNB, NODE_MINUS_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1997 #line 1998 "nasl_grammar.tab.c" /* yacc.c:1648 */
1998  break;
1999 
2000  case 61:
2001 #line 379 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2002  { (yyval.node) = alloc_expr_cell(LNB, NODE_MULT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2003 #line 2004 "nasl_grammar.tab.c" /* yacc.c:1648 */
2004  break;
2005 
2006  case 62:
2007 #line 380 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2008  { (yyval.node) = alloc_expr_cell(LNB, NODE_DIV_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2009 #line 2010 "nasl_grammar.tab.c" /* yacc.c:1648 */
2010  break;
2011 
2012  case 63:
2013 #line 381 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2014  { (yyval.node) = alloc_expr_cell(LNB, NODE_MODULO_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2015 #line 2016 "nasl_grammar.tab.c" /* yacc.c:1648 */
2016  break;
2017 
2018  case 64:
2019 #line 382 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2020  { (yyval.node) = alloc_expr_cell(LNB, NODE_R_SHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2021 #line 2022 "nasl_grammar.tab.c" /* yacc.c:1648 */
2022  break;
2023 
2024  case 65:
2025 #line 383 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2026  { (yyval.node) = alloc_expr_cell(LNB, NODE_R_USHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2027 #line 2028 "nasl_grammar.tab.c" /* yacc.c:1648 */
2028  break;
2029 
2030  case 66:
2031 #line 384 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2032  { (yyval.node) = alloc_expr_cell(LNB, NODE_L_SHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2033 #line 2034 "nasl_grammar.tab.c" /* yacc.c:1648 */
2034  break;
2035 
2036  case 67:
2037 #line 387 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2038  { (yyval.node) = alloc_tree_cell(LNB, (yyvsp[0].str)); (yyval.node)->type = NODE_VAR; }
2039 #line 2040 "nasl_grammar.tab.c" /* yacc.c:1648 */
2040  break;
2041 
2042  case 70:
2043 #line 389 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2044  { (yyval.str) = strdup("x"); }
2045 #line 2046 "nasl_grammar.tab.c" /* yacc.c:1648 */
2046  break;
2047 
2048  case 71:
2049 #line 392 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2050  {
2051  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-3].str));
2052  (yyval.node)->type = NODE_ARRAY_EL;
2053  (yyval.node)->link[0] = (yyvsp[-1].node);
2054  }
2055 #line 2056 "nasl_grammar.tab.c" /* yacc.c:1648 */
2056  break;
2057 
2058  case 73:
2059 #line 401 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2060  { (yyval.node) = alloc_expr_cell(LNB, EXPR_INCR, NULL, (yyvsp[0].node)); }
2061 #line 2062 "nasl_grammar.tab.c" /* yacc.c:1648 */
2062  break;
2063 
2064  case 74:
2065 #line 402 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2066  {(yyval.node) = alloc_expr_cell(LNB, EXPR_DECR, NULL, (yyvsp[0].node)); }
2067 #line 2068 "nasl_grammar.tab.c" /* yacc.c:1648 */
2068  break;
2069 
2070  case 75:
2071 #line 403 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2072  { (yyval.node)= alloc_expr_cell(LNB, EXPR_INCR, (yyvsp[-1].node), NULL); }
2073 #line 2074 "nasl_grammar.tab.c" /* yacc.c:1648 */
2074  break;
2075 
2076  case 76:
2077 #line 404 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2078  { (yyval.node)= alloc_expr_cell(LNB, EXPR_DECR, (yyvsp[-1].node), NULL); }
2079 #line 2080 "nasl_grammar.tab.c" /* yacc.c:1648 */
2080  break;
2081 
2082  case 77:
2083 #line 408 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2084  { (yyval.node) = (yyvsp[-1].node); }
2085 #line 2086 "nasl_grammar.tab.c" /* yacc.c:1648 */
2086  break;
2087 
2088  case 78:
2089 #line 409 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2090  { (yyval.node) = alloc_expr_cell(LNB, EXPR_AND, (yyvsp[-2].node), (yyvsp[0].node)); }
2091 #line 2092 "nasl_grammar.tab.c" /* yacc.c:1648 */
2092  break;
2093 
2094  case 79:
2095 #line 410 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2096  { (yyval.node) = alloc_expr_cell(LNB, EXPR_NOT, (yyvsp[0].node), NULL); }
2097 #line 2098 "nasl_grammar.tab.c" /* yacc.c:1648 */
2098  break;
2099 
2100  case 80:
2101 #line 411 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2102  { (yyval.node) = alloc_expr_cell(LNB, EXPR_OR, (yyvsp[-2].node), (yyvsp[0].node)); }
2103 #line 2104 "nasl_grammar.tab.c" /* yacc.c:1648 */
2104  break;
2105 
2106  case 81:
2107 #line 412 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2108  { (yyval.node) = alloc_expr_cell(LNB, EXPR_PLUS, (yyvsp[-2].node), (yyvsp[0].node)); }
2109 #line 2110 "nasl_grammar.tab.c" /* yacc.c:1648 */
2110  break;
2111 
2112  case 82:
2113 #line 413 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2114  { (yyval.node) = alloc_expr_cell(LNB, EXPR_MINUS, (yyvsp[-2].node), (yyvsp[0].node)); }
2115 #line 2116 "nasl_grammar.tab.c" /* yacc.c:1648 */
2116  break;
2117 
2118  case 83:
2119 #line 414 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2120  { (yyval.node) = alloc_expr_cell(LNB, EXPR_U_MINUS, (yyvsp[0].node), NULL);}
2121 #line 2122 "nasl_grammar.tab.c" /* yacc.c:1648 */
2122  break;
2123 
2124  case 84:
2125 #line 415 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2126  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_NOT, (yyvsp[0].node), NULL);}
2127 #line 2128 "nasl_grammar.tab.c" /* yacc.c:1648 */
2128  break;
2129 
2130  case 85:
2131 #line 416 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2132  { (yyval.node) = alloc_expr_cell(LNB, EXPR_MULT, (yyvsp[-2].node), (yyvsp[0].node)); }
2133 #line 2134 "nasl_grammar.tab.c" /* yacc.c:1648 */
2134  break;
2135 
2136  case 86:
2137 #line 417 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2138  { (yyval.node) = alloc_expr_cell(LNB, EXPR_EXPO, (yyvsp[-2].node), (yyvsp[0].node)); }
2139 #line 2140 "nasl_grammar.tab.c" /* yacc.c:1648 */
2140  break;
2141 
2142  case 87:
2143 #line 418 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2144  { (yyval.node) = alloc_expr_cell(LNB, EXPR_DIV, (yyvsp[-2].node), (yyvsp[0].node)); }
2145 #line 2146 "nasl_grammar.tab.c" /* yacc.c:1648 */
2146  break;
2147 
2148  case 88:
2149 #line 419 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2150  { (yyval.node) = alloc_expr_cell(LNB, EXPR_MODULO, (yyvsp[-2].node), (yyvsp[0].node)); }
2151 #line 2152 "nasl_grammar.tab.c" /* yacc.c:1648 */
2152  break;
2153 
2154  case 89:
2155 #line 420 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2156  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_AND, (yyvsp[-2].node), (yyvsp[0].node)); }
2157 #line 2158 "nasl_grammar.tab.c" /* yacc.c:1648 */
2158  break;
2159 
2160  case 90:
2161 #line 421 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2162  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_XOR, (yyvsp[-2].node), (yyvsp[0].node)); }
2163 #line 2164 "nasl_grammar.tab.c" /* yacc.c:1648 */
2164  break;
2165 
2166  case 91:
2167 #line 422 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2168  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_OR, (yyvsp[-2].node), (yyvsp[0].node)); }
2169 #line 2170 "nasl_grammar.tab.c" /* yacc.c:1648 */
2170  break;
2171 
2172  case 92:
2173 #line 423 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2174  { (yyval.node) = alloc_expr_cell(LNB, EXPR_R_SHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2175 #line 2176 "nasl_grammar.tab.c" /* yacc.c:1648 */
2176  break;
2177 
2178  case 93:
2179 #line 424 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2180  { (yyval.node) = alloc_expr_cell(LNB, EXPR_R_USHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2181 #line 2182 "nasl_grammar.tab.c" /* yacc.c:1648 */
2182  break;
2183 
2184  case 94:
2185 #line 425 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2186  { (yyval.node) = alloc_expr_cell(LNB, EXPR_L_SHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2187 #line 2188 "nasl_grammar.tab.c" /* yacc.c:1648 */
2188  break;
2189 
2190  case 96:
2191 #line 427 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2192  { (yyval.node) = alloc_expr_cell(LNB, COMP_MATCH, (yyvsp[-2].node), (yyvsp[0].node)); }
2193 #line 2194 "nasl_grammar.tab.c" /* yacc.c:1648 */
2194  break;
2195 
2196  case 97:
2197 #line 428 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2198  { (yyval.node) = alloc_expr_cell(LNB, COMP_NOMATCH, (yyvsp[-2].node), (yyvsp[0].node)); }
2199 #line 2200 "nasl_grammar.tab.c" /* yacc.c:1648 */
2200  break;
2201 
2202  case 98:
2203 #line 429 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2204  { (yyval.node) = alloc_RE_cell(LNB, COMP_RE_MATCH, (yyvsp[-2].node), (yyvsp[0].str)); }
2205 #line 2206 "nasl_grammar.tab.c" /* yacc.c:1648 */
2206  break;
2207 
2208  case 99:
2209 #line 430 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2210  { (yyval.node) = alloc_RE_cell(LNB, COMP_RE_NOMATCH, (yyvsp[-2].node), (yyvsp[0].str)); }
2211 #line 2212 "nasl_grammar.tab.c" /* yacc.c:1648 */
2212  break;
2213 
2214  case 100:
2215 #line 431 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2216  { (yyval.node) = alloc_expr_cell(LNB, COMP_LT, (yyvsp[-2].node), (yyvsp[0].node)); }
2217 #line 2218 "nasl_grammar.tab.c" /* yacc.c:1648 */
2218  break;
2219 
2220  case 101:
2221 #line 432 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2222  { (yyval.node) = alloc_expr_cell(LNB, COMP_GT, (yyvsp[-2].node), (yyvsp[0].node)); }
2223 #line 2224 "nasl_grammar.tab.c" /* yacc.c:1648 */
2224  break;
2225 
2226  case 102:
2227 #line 433 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2228  { (yyval.node) = alloc_expr_cell(LNB, COMP_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2229 #line 2230 "nasl_grammar.tab.c" /* yacc.c:1648 */
2230  break;
2231 
2232  case 103:
2233 #line 434 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2234  { (yyval.node) = alloc_expr_cell(LNB, COMP_NE, (yyvsp[-2].node), (yyvsp[0].node)); }
2235 #line 2236 "nasl_grammar.tab.c" /* yacc.c:1648 */
2236  break;
2237 
2238  case 104:
2239 #line 435 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2240  { (yyval.node) = alloc_expr_cell(LNB, COMP_GE, (yyvsp[-2].node), (yyvsp[0].node)); }
2241 #line 2242 "nasl_grammar.tab.c" /* yacc.c:1648 */
2242  break;
2243 
2244  case 105:
2245 #line 436 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2246  { (yyval.node) = alloc_expr_cell(LNB, COMP_LE, (yyvsp[-2].node), (yyvsp[0].node)); }
2247 #line 2248 "nasl_grammar.tab.c" /* yacc.c:1648 */
2248  break;
2249 
2250  case 111:
2251 #line 440 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2252  { (yyval.node) = make_array_from_elems((yyvsp[-1].node)); }
2253 #line 2254 "nasl_grammar.tab.c" /* yacc.c:1648 */
2254  break;
2255 
2256  case 112:
2257 #line 442 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2258  { (yyval.node) = (yyvsp[0].node); }
2259 #line 2260 "nasl_grammar.tab.c" /* yacc.c:1648 */
2260  break;
2261 
2262  case 113:
2263 #line 443 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2264  {
2265  (yyvsp[-2].node)->link[1] = (yyvsp[0].node); (yyval.node) = (yyvsp[-2].node);
2266  }
2267 #line 2268 "nasl_grammar.tab.c" /* yacc.c:1648 */
2268  break;
2269 
2270  case 114:
2271 #line 447 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2272  {
2273  (yyval.node) = alloc_typed_cell(ARRAY_ELEM);
2274  (yyval.node)->link[0] = (yyvsp[0].node);
2275  }
2276 #line 2277 "nasl_grammar.tab.c" /* yacc.c:1648 */
2277  break;
2278 
2279  case 115:
2280 #line 450 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2281  {
2282  (yyval.node) = alloc_typed_cell(ARRAY_ELEM);
2283  (yyval.node)->link[0] = (yyvsp[0].node);
2284  (yyval.node)->x.str_val = (yyvsp[-2].str);
2285  }
2286 #line 2287 "nasl_grammar.tab.c" /* yacc.c:1648 */
2287  break;
2288 
2289  case 116:
2290 #line 456 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2291  { (yyval.node) = alloc_typed_cell(CONST_INT); (yyval.node)->x.i_val = (yyvsp[0].num); }
2292 #line 2293 "nasl_grammar.tab.c" /* yacc.c:1648 */
2293  break;
2294 
2295  case 117:
2296 #line 457 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2297  {
2298  (yyval.node) = alloc_typed_cell(CONST_STR); (yyval.node)->x.str_val = (yyvsp[0].str);
2299  (yyval.node)->size = strlen((yyvsp[0].str));
2300  }
2301 #line 2302 "nasl_grammar.tab.c" /* yacc.c:1648 */
2302  break;
2303 
2304  case 118:
2305 #line 461 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2306  {
2307  (yyval.node) = alloc_typed_cell(CONST_DATA); (yyval.node)->x.str_val = (yyvsp[0].data).val;
2308  (yyval.node)->size = (yyvsp[0].data).len;
2309  }
2310 #line 2311 "nasl_grammar.tab.c" /* yacc.c:1648 */
2311  break;
2312 
2313  case 120:
2314 #line 468 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2315  { (yyval.node) = alloc_tree_cell(LNB, (yyvsp[0].str)); (yyval.node)->type = NODE_VAR; }
2316 #line 2317 "nasl_grammar.tab.c" /* yacc.c:1648 */
2317  break;
2318 
2319  case 124:
2320 #line 474 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2321  {
2322  char *s = g_strdup_printf ("%ld.%ld.%ld.%ld", (yyvsp[-6].num), (yyvsp[-4].num), (yyvsp[-2].num), (yyvsp[0].num));
2323  (yyval.node) = alloc_tree_cell(LNB, s);
2324  (yyval.node)->type = CONST_STR;
2325  (yyval.node)->size = strlen(s);
2326  }
2327 #line 2328 "nasl_grammar.tab.c" /* yacc.c:1648 */
2328  break;
2329 
2330  case 125:
2331 #line 483 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2332  {
2333  (yyval.node) = alloc_tree_cell(LNB, NULL);
2334  (yyval.node)->type = NODE_LOCAL;
2335  (yyval.node)->link[0] = (yyvsp[0].node);
2336  }
2337 #line 2338 "nasl_grammar.tab.c" /* yacc.c:1648 */
2338  break;
2339 
2340  case 126:
2341 #line 491 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1648 */
2342  {
2343  (yyval.node) = alloc_tree_cell(LNB, NULL);
2344  (yyval.node)->type = NODE_GLOBAL;
2345  (yyval.node)->link[0] = (yyvsp[0].node);
2346  }
2347 #line 2348 "nasl_grammar.tab.c" /* yacc.c:1648 */
2348  break;
2349 
2350 
2351 #line 2352 "nasl_grammar.tab.c" /* yacc.c:1648 */
2352  default: break;
2353  }
2354  /* User semantic actions sometimes alter yychar, and that requires
2355  that yytoken be updated with the new translation. We take the
2356  approach of translating immediately before every use of yytoken.
2357  One alternative is translating here after every semantic action,
2358  but that translation would be missed if the semantic action invokes
2359  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2360  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2361  incorrect destructor might then be invoked immediately. In the
2362  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2363  to an incorrect destructor call or verbose syntax error message
2364  before the lookahead is translated. */
2365  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2366 
2367  YYPOPSTACK (yylen);
2368  yylen = 0;
2369  YY_STACK_PRINT (yyss, yyssp);
2370 
2371  *++yyvsp = yyval;
2372 
2373  /* Now 'shift' the result of the reduction. Determine what state
2374  that goes to, based on the state we popped back to and the rule
2375  number reduced by. */
2376 
2377  yyn = yyr1[yyn];
2378 
2379  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2380  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2381  yystate = yytable[yystate];
2382  else
2383  yystate = yydefgoto[yyn - YYNTOKENS];
2384 
2385  goto yynewstate;
2386 
2387 
2388 /*--------------------------------------.
2389 | yyerrlab -- here on detecting error. |
2390 `--------------------------------------*/
2391 yyerrlab:
2392  /* Make sure we have latest lookahead translation. See comments at
2393  user semantic actions for why this is necessary. */
2394  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2395 
2396  /* If not already recovering from an error, report this error. */
2397  if (!yyerrstatus)
2398  {
2399  ++yynerrs;
2400 #if ! YYERROR_VERBOSE
2401  yyerror (parm, YY_("syntax error"));
2402 #else
2403 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2404  yyssp, yytoken)
2405  {
2406  char const *yymsgp = YY_("syntax error");
2407  int yysyntax_error_status;
2408  yysyntax_error_status = YYSYNTAX_ERROR;
2409  if (yysyntax_error_status == 0)
2410  yymsgp = yymsg;
2411  else if (yysyntax_error_status == 1)
2412  {
2413  if (yymsg != yymsgbuf)
2414  YYSTACK_FREE (yymsg);
2415  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2416  if (!yymsg)
2417  {
2418  yymsg = yymsgbuf;
2419  yymsg_alloc = sizeof yymsgbuf;
2420  yysyntax_error_status = 2;
2421  }
2422  else
2423  {
2424  yysyntax_error_status = YYSYNTAX_ERROR;
2425  yymsgp = yymsg;
2426  }
2427  }
2428  yyerror (parm, yymsgp);
2429  if (yysyntax_error_status == 2)
2430  goto yyexhaustedlab;
2431  }
2432 # undef YYSYNTAX_ERROR
2433 #endif
2434  }
2435 
2436 
2437 
2438  if (yyerrstatus == 3)
2439  {
2440  /* If just tried and failed to reuse lookahead token after an
2441  error, discard it. */
2442 
2443  if (yychar <= YYEOF)
2444  {
2445  /* Return failure if at end of input. */
2446  if (yychar == YYEOF)
2447  YYABORT;
2448  }
2449  else
2450  {
2451  yydestruct ("Error: discarding",
2452  yytoken, &yylval, parm);
2453  yychar = YYEMPTY;
2454  }
2455  }
2456 
2457  /* Else will try to reuse lookahead token after shifting the error
2458  token. */
2459  goto yyerrlab1;
2460 
2461 
2462 /*---------------------------------------------------.
2463 | yyerrorlab -- error raised explicitly by YYERROR. |
2464 `---------------------------------------------------*/
2465 yyerrorlab:
2466 
2467  /* Pacify compilers like GCC when the user code never invokes
2468  YYERROR and the label yyerrorlab therefore never appears in user
2469  code. */
2470  if (/*CONSTCOND*/ 0)
2471  goto yyerrorlab;
2472 
2473  /* Do not reclaim the symbols of the rule whose action triggered
2474  this YYERROR. */
2475  YYPOPSTACK (yylen);
2476  yylen = 0;
2477  YY_STACK_PRINT (yyss, yyssp);
2478  yystate = *yyssp;
2479  goto yyerrlab1;
2480 
2481 
2482 /*-------------------------------------------------------------.
2483 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2484 `-------------------------------------------------------------*/
2485 yyerrlab1:
2486  yyerrstatus = 3; /* Each real token shifted decrements this. */
2487 
2488  for (;;)
2489  {
2490  yyn = yypact[yystate];
2491  if (!yypact_value_is_default (yyn))
2492  {
2493  yyn += YYTERROR;
2494  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2495  {
2496  yyn = yytable[yyn];
2497  if (0 < yyn)
2498  break;
2499  }
2500  }
2501 
2502  /* Pop the current state because it cannot handle the error token. */
2503  if (yyssp == yyss)
2504  YYABORT;
2505 
2506 
2507  yydestruct ("Error: popping",
2508  yystos[yystate], yyvsp, parm);
2509  YYPOPSTACK (1);
2510  yystate = *yyssp;
2511  YY_STACK_PRINT (yyss, yyssp);
2512  }
2513 
2515  *++yyvsp = yylval;
2517 
2518 
2519  /* Shift the error token. */
2520  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2521 
2522  yystate = yyn;
2523  goto yynewstate;
2524 
2525 
2526 /*-------------------------------------.
2527 | yyacceptlab -- YYACCEPT comes here. |
2528 `-------------------------------------*/
2529 yyacceptlab:
2530  yyresult = 0;
2531  goto yyreturn;
2532 
2533 /*-----------------------------------.
2534 | yyabortlab -- YYABORT comes here. |
2535 `-----------------------------------*/
2536 yyabortlab:
2537  yyresult = 1;
2538  goto yyreturn;
2539 
2540 #if !defined yyoverflow || YYERROR_VERBOSE
2541 /*-------------------------------------------------.
2542 | yyexhaustedlab -- memory exhaustion comes here. |
2543 `-------------------------------------------------*/
2544 yyexhaustedlab:
2545  yyerror (parm, YY_("memory exhausted"));
2546  yyresult = 2;
2547  /* Fall through. */
2548 #endif
2549 
2550 yyreturn:
2551  if (yychar != YYEMPTY)
2552  {
2553  /* Make sure we have latest lookahead translation. See comments at
2554  user semantic actions for why this is necessary. */
2555  yytoken = YYTRANSLATE (yychar);
2556  yydestruct ("Cleanup: discarding lookahead",
2557  yytoken, &yylval, parm);
2558  }
2559  /* Do not reclaim the symbols of the rule whose action triggered
2560  this YYABORT or YYACCEPT. */
2561  YYPOPSTACK (yylen);
2562  YY_STACK_PRINT (yyss, yyssp);
2563  while (yyssp != yyss)
2564  {
2565  yydestruct ("Cleanup: popping",
2566  yystos[*yyssp], yyvsp, parm);
2567  YYPOPSTACK (1);
2568  }
2569 #ifndef yyoverflow
2570  if (yyss != yyssa)
2571  YYSTACK_FREE (yyss);
2572 #endif
2573 #if YYERROR_VERBOSE
2574  if (yymsg != yymsgbuf)
2575  YYSTACK_FREE (yymsg);
2576 #endif
2577  return yyresult;
2578 }
2579 #line 497 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1907 */
2580 
2581 
2582 #include <stdio.h>
2583 #include <stdlib.h>
2584 #include "../misc/openvas_logging.h"
2585 #include "../misc/prefs.h"
2586 #include "../base/openvas_file.h"
2587 #include <libgen.h>
2588 #include <gcrypt.h>
2589 
2590 static void
2591 naslerror(naslctxt *parm, const char *s)
2592 {
2593  fputs(s, stderr);
2594 }
2595 
2596 static GSList * inc_dirs = NULL;
2597 
2609 int
2610 add_nasl_inc_dir (const char * dir)
2611 {
2612  if (dir == NULL)
2613  {
2614  return 0;
2615  }
2616 
2617  // Allow initialization with empty element
2618  if (*dir == '\0')
2619  {
2620  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2621  return 0;
2622  }
2623 
2624  struct stat stat_buf;
2625 
2626  if (stat (dir, &stat_buf) != 0)
2627  return -1;
2628 
2629  if (S_ISDIR(stat_buf.st_mode) != 0)
2630  {
2631  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2632  return 0;
2633  }
2634  else
2635  return -2;
2636 }
2637 
2646 static char *
2647 file_checksum (const char *filename, int algorithm)
2648 {
2649  char *content = NULL, digest[128], *result;
2650  size_t len = 0, i, alglen;
2651 
2652  assert (algorithm == GCRY_MD_MD5 || algorithm == GCRY_MD_SHA256);
2653  if (!filename || !g_file_get_contents (filename, &content, &len, NULL))
2654  return NULL;
2655 
2656  gcry_md_hash_buffer (algorithm, digest, content, len);
2657  alglen = gcry_md_get_algo_dlen (algorithm);
2658  result = g_malloc0 (alglen * 2 + 1);
2659  for (i = 0; i < alglen; i++)
2660  snprintf (result + 2 * i, 3, "%02x", (unsigned char) digest[i]);
2661  g_free (content);
2662 
2663  return result;
2664 }
2665 
2666 static int checksum_algorithm = GCRY_MD_NONE;
2667 
2668 static char checksum_file[2048];
2669 
2670 static void
2671 init_checksum_algorithm (void)
2672 {
2673  const char *base = prefs_get ("plugins_folder");
2674 
2675  checksum_algorithm = GCRY_MD_SHA256;
2676  snprintf (checksum_file, sizeof (checksum_file), "%s/sha256sums", base);
2677  if (g_file_test (checksum_file, G_FILE_TEST_EXISTS))
2678  return;
2679  checksum_algorithm = GCRY_MD_MD5;
2680  snprintf (checksum_file, sizeof (checksum_file), "%s/md5sums", base);
2681  if (g_file_test (checksum_file, G_FILE_TEST_EXISTS))
2682  return;
2683  if (checksum_algorithm == GCRY_MD_NONE)
2684  {
2685  log_legacy_write ("No plugins checksums file");
2686  return;
2687  }
2688 }
2689 
2690 static void
2691 load_checksums (kb_t kb)
2692 {
2693  static int loaded = 0;
2694  const char *base, *prefix;
2695  FILE *file;
2696 
2697  if (loaded)
2698  return;
2699  loaded = 1;
2700  /* Verify checksum */
2701  base = prefs_get ("plugins_folder");
2702  if (nasl_verify_signature (checksum_file) != 0)
2703  {
2704  log_legacy_write ("Erroneous or missing signature for checksums file %s",
2705  checksum_file);
2706  return;
2707  }
2708 
2709  /* Insert content into KB */
2710  file = fopen (checksum_file, "r");
2711  if (!file)
2712  {
2713  log_legacy_write ("%s: Couldn't read file %s", __FUNCTION__,
2714  checksum_file);
2715  return;
2716  }
2717  if (checksum_algorithm == GCRY_MD_MD5)
2718  {
2719  kb_del_items (kb, "md5sums:*");
2720  prefix = "md5sums";
2721  }
2722  else
2723  {
2724  kb_del_items (kb, "sha256sums:*");
2725  prefix = "sha256sums";
2726  }
2727  while (1)
2728  {
2729  char buffer[2048], **splits;
2730  if (!fgets (buffer, sizeof (buffer), file))
2731  break;
2732  if (strstr (buffer, ".asc")
2733  || (!strstr (buffer, ".inc") && !strstr (buffer, ".nasl")))
2734  continue;
2735  splits = g_strsplit (buffer, " ", -1);
2736  if (g_strv_length (splits) != 2)
2737  {
2738  log_legacy_write ("%s: Erroneous checksum entry %s", __FUNCTION__,
2739  buffer);
2740  g_strfreev (splits);
2741  break;
2742  }
2743  splits[1][strlen (splits[1]) - 1] = '\0';
2744  if (strstr (splits[1], ".inc"))
2745  g_snprintf (buffer, sizeof (buffer), "%s:%s", prefix,
2746  basename (splits[1]));
2747  else
2748  g_snprintf (buffer, sizeof (buffer), "%s:%s/%s", prefix, base,
2749  splits[1]);
2750  kb_item_set_str (kb, buffer, splits[0]);
2751  g_strfreev (splits);
2752  }
2753  fclose (file);
2754 }
2755 
2772 int
2773 init_nasl_ctx(naslctxt* pc, const char* name)
2774 {
2775  char *full_name = NULL, key_path[2048], *checksum, *filename, *check = NULL;
2776  GSList * inc_dir = inc_dirs; // iterator for include directories
2777 
2778  // initialize if not yet done (for openvas-server < 2.0.1)
2779  if (! inc_dirs) add_nasl_inc_dir("");
2780 
2781  pc->line_nb = 1;
2782  pc->tree = NULL;
2783  pc->buffer = g_malloc0 (80);
2784  pc->maxlen = 80;
2785  pc->fp = NULL;
2787  while (inc_dir != NULL) {
2788  if (full_name)
2789  g_free (full_name);
2790  full_name = g_build_filename(inc_dir->data, name, NULL);
2791 
2792  if ((pc->fp = fopen(full_name, "r")) != NULL)
2793  break;
2794 
2795  inc_dir = g_slist_next(inc_dir);
2796  }
2797 
2798  if (! pc->fp) {
2799  log_legacy_write ("%s: Not able to open nor to locate it in include paths",
2800  name);
2801  g_free(full_name);
2802  return -1;
2803  }
2804 
2805  if (pc->always_authenticated)
2806  {
2807  g_free(full_name);
2808  return 0;
2809  }
2810  /* Cache the checksum of signature verified files, so that commonly included
2811  * files are not verified multiple times per scan. */
2812 
2813  filename = full_name;
2814  if (strstr (full_name, ".inc"))
2815  filename = basename (full_name);
2816  init_checksum_algorithm ();
2817  if (checksum_algorithm == GCRY_MD_NONE)
2818  return -1;
2819 
2820  snprintf (key_path, sizeof (key_path), "checksum:%s", filename);
2821  checksum = kb_item_get_str (pc->kb, key_path);
2822  if (checksum)
2823  {
2824  int ret;
2825  check = file_checksum (full_name, checksum_algorithm);
2826  ret = strcmp (check, checksum);
2827  if (!ret)
2828  {
2829  /* Already checked. No need to check again. */
2830  g_free (full_name);
2831  g_free (checksum);
2832  g_free (check);
2833  return 0;
2834  }
2835  g_free (checksum);
2836  g_free (check);
2837  }
2838 
2839  load_checksums (pc->kb);
2840  if (checksum_algorithm == GCRY_MD_MD5)
2841  snprintf (key_path, sizeof (key_path), "md5sums:%s", filename);
2842  else if (checksum_algorithm == GCRY_MD_SHA256)
2843  snprintf (key_path, sizeof (key_path), "sha256sums:%s", filename);
2844  else
2845  abort ();
2846  checksum = kb_item_get_str (pc->kb, key_path);
2847  if (!checksum)
2848  {
2849  log_legacy_write ("No checksum for %s", full_name);
2850  g_free (full_name);
2851  return -1;
2852  }
2853  else
2854  {
2855  int ret;
2856 
2857  check = file_checksum (full_name, checksum_algorithm);
2858  ret = strcmp (check, checksum);
2859  if (ret)
2860  log_legacy_write ("checksum for %s not matching", full_name);
2861  else
2862  {
2863  snprintf (key_path, sizeof (key_path), "checksum:%s", filename);
2864  kb_item_set_str (pc->kb, key_path, check);
2865  }
2866  g_free (full_name);
2867  g_free (checksum);
2868  g_free (check);
2869  return ret;
2870  }
2871 }
2872 
2873 void
2875 {
2876 #if 0
2877  nasl_dump_tree(c->tree);
2878 #endif
2879  deref_cell(c->tree);
2880  g_free(c->buffer);
2881  c->buffer = NULL;
2882  if (c->fp)
2883  {
2884  fclose(c->fp);
2885  c->fp = NULL;
2886  }
2887 }
2888 
2889 void
2891 {
2892  if (!includes_hash)
2893  return;
2894  g_hash_table_destroy (includes_hash);
2895  includes_hash = NULL;
2896 }
2897 
2926 
2927 static int
2928 mylex(lvalp, parm)
2929  YYSTYPE *lvalp;
2930  void *parm;
2931 {
2932  char *p;
2933  naslctxt *ctx = parm;
2934  FILE *fp;
2935  int c, st = ST_START, len, r;
2936  long int x, i;
2937 
2938  if (!ctx)
2939  return -1;
2940 
2941  fp = ctx->fp;
2942  p = ctx->buffer;
2943  len = 0;
2944 
2945  while ((c = getc(fp)) != EOF)
2946  {
2947  if (c == '\n')
2948  ctx->line_nb ++;
2949 
2950  switch(st)
2951  {
2952  case ST_START:
2953  if (c == '#')
2954  st = ST_COMMENT;
2955  else if (isalpha(c) || c == '_')
2956  {
2957  st = ST_IDENT;
2958  *p++ = c;
2959  len ++;
2960  }
2961  else if (isspace(c))
2962  st = ST_SPACE;
2963  else if (c == '0')
2964  st = ST_ZERO;
2965  else if (isdigit(c))
2966  {
2967  st = ST_DEC;
2968  *p++ = c;
2969  len ++;
2970  }
2971  else if (c == '\'')
2972  st = ST_STRING1;
2973  else if (c == '"')
2974  st = ST_STRING2;
2975  else if (c == '+')
2976  st = ST_PLUS;
2977  else if (c == '-')
2978  st = ST_MINUS;
2979  else if (c == '*')
2980  st = ST_MULT;
2981  else if (c == '/')
2982  st = ST_DIV;
2983  else if (c == '%')
2984  st = ST_MODULO;
2985  else if (c == '>')
2986  st = ST_SUP;
2987  else if (c == '<')
2988  st = ST_INF;
2989  else if (c == '=')
2990  st = ST_EQ;
2991  else if (c == '|')
2992  st = ST_OR;
2993  else if (c == '!')
2994  st = ST_NOT;
2995  else if (c == '&')
2996  st = ST_AND;
2997  else
2998  {
2999  return c;
3000  }
3001  break;
3002 
3003  case ST_STRING2:
3004  if (c == '"')
3005  goto exit_loop;
3006  *p++ = c;
3007  len ++;
3008  break;
3009 
3010  case ST_STRING1:
3011  if (c == '\'')
3012  goto exit_loop;
3013  else if (c == '\\')
3014  {
3015  c = getc(fp);
3016  switch (c)
3017  {
3018  case EOF:
3019  nasl_perror(NULL, "Unfinished string\n");
3020  goto exit_loop; /* parse error? */
3021 
3022  case '\n': /* escaped end of line */
3023  ctx->line_nb ++;
3024  break;
3025  case '\\':
3026  *p++ ='\\'; len ++;
3027  break;
3028  case 'n':
3029  *p++ = '\n'; len++;
3030  break;
3031  case 'f':
3032  *p++ = '\f'; len ++;
3033  break;
3034  case 't':
3035  *p++ = '\t'; len ++;
3036  break;
3037  case 'r':
3038  *p++ = '\r'; len++;
3039  break;
3040  case 'v':
3041  *p++ = '\v'; len ++;
3042  break;
3043  case '"':
3044  *p ++ = '"'; len ++;
3045  break;
3046  /* Not yet, as we do not return the length of the string */
3047  case '0':
3048  *p++ = '\0'; len++;
3049  break;
3050  case '\'':
3051  *p++ = '\''; len++;
3052  break;
3053 
3054  case 'x':
3055  x = 0;
3056  for (i = 0; i < 2; i ++)
3057  {
3058  c = getc(fp);
3059  if (c == EOF)
3060  {
3061  nasl_perror(NULL, "Unfinished \\x escape sequence (EOF)\n");
3062  goto exit_loop;
3063  }
3064  if (c == '\n')
3065  ctx->line_nb ++;
3066 
3067  c = tolower(c);
3068  if (c >= '0' && c <= '9')
3069  x = x * 16 + (c - '0');
3070  else if (c >= 'a' && c <= 'f')
3071  x = x * 16 + 10 + (c - 'a');
3072  else
3073  {
3074  nasl_perror(NULL, "Unfinished \\x escape sequence\n");
3075  ungetc(c, fp);
3076  if (c == '\n')
3077  ctx->line_nb --;
3078  break;
3079  }
3080  }
3081  *p++ = x; len ++;
3082  break;
3083 
3084  default:
3085  nasl_perror(NULL, "Unknown escape sequence \\%c\n", c);
3086  ungetc(c, fp);
3087  if (c == '\n')
3088  ctx->line_nb --;
3089  goto exit_loop;
3090  }
3091  }
3092  else
3093  {
3094  *p++ = c;
3095  len ++;
3096  }
3097  break;
3098 
3099  case ST_IDENT:
3100  if (isalnum(c) || c == '_')
3101  {
3102  st = ST_IDENT;
3103  *p++ = c;
3104  len ++;
3105  }
3106  else
3107  {
3108  ungetc(c, fp);
3109  if (c == '\n')
3110  ctx->line_nb --;
3111  goto exit_loop;
3112  }
3113  break;
3114 
3115  case ST_ZERO:
3116  if (c == 'x' || c == 'X')
3117  st = ST_ZEROX;
3118  else if (isdigit(c))
3119  {
3120  if (c <= '7')
3121  st = ST_OCT;
3122  else
3123  st = ST_DEC;
3124  *p ++ = c;
3125  len ++;
3126  }
3127  else
3128  {
3129  ungetc(c, fp);
3130  if (c == '\n')
3131  ctx->line_nb --;
3132  goto exit_loop;
3133  }
3134  break;
3135 
3136  case ST_ZEROX:
3137  if (isxdigit(c))
3138  {
3139  st = ST_HEX;
3140  *p++ = c;
3141  len ++;
3142  }
3143  else
3144  {
3145  /* This should be a parse error */
3146  ungetc(c, fp);
3147  if (c == '\n')
3148  ctx->line_nb --;
3149  goto exit_loop;
3150  }
3151  break;
3152 
3153  case ST_OCT:
3154  if (c >= '0')
3155  {
3156  if (c <= '7')
3157  {
3158  *p++ = c;
3159  len ++;
3160  break;
3161  }
3162  else if (c <= '9')
3163  {
3164  *p++ = c;
3165  len ++;
3166  st = ST_DEC;
3167  break;
3168  }
3169  }
3170  ungetc(c, fp);
3171  if (c == '\n')
3172  ctx->line_nb --;
3173  goto exit_loop;
3174 
3175  case ST_DEC:
3176  if (isdigit(c))
3177  {
3178  *p++ = c;
3179  len ++;
3180  }
3181  else
3182  {
3183  ungetc(c, fp);
3184  if (c == '\n')
3185  ctx->line_nb --;
3186  goto exit_loop;
3187  }
3188  break;
3189 
3190  case ST_HEX:
3191  if (isxdigit(c))
3192  {
3193  *p++ = c;
3194  len ++;
3195  }
3196  else
3197  {
3198  ungetc(c, fp);
3199  if (c == '\n')
3200  ctx->line_nb --;
3201  goto exit_loop;
3202  }
3203  break;
3204 
3205  case ST_SPACE:
3206  if (! isspace(c))
3207  {
3208  ungetc(c, fp);
3209  if (c == '\n')
3210  ctx->line_nb --;
3211  st = ST_START;
3212  }
3213  break;
3214 
3215  case ST_COMMENT:
3216  if (c == '\n')
3217  st = ST_START;
3218  break;
3219 
3220  case ST_SUP_EXCL:
3221  if (c == '<')
3222  return NOMATCH;
3223  else
3224  {
3225  ungetc(c, fp);
3226  if (c == '\n')
3227  ctx->line_nb --;
3228  if (! isprint(c)) c = '.';
3229  log_legacy_write ("lexer error: invalid token >!%c "
3230  "parsed as >!< %c", c, c);
3231  return NOMATCH;
3232  }
3233  break;
3234 
3235  case ST_SUP:
3236  if (c == '=')
3237  return SUPEQ;
3238  else if (c == '<')
3239  return MATCH;
3240  else if (c == '>')
3241  st = ST_R_SHIFT;
3242  else if (c == '!')
3243  st = ST_SUP_EXCL;
3244  else
3245  {
3246  ungetc(c, fp);
3247  if (c == '\n')
3248  ctx->line_nb --;
3249  return '>';
3250  }
3251  break;
3252 
3253  case ST_INF:
3254  if (c == '=')
3255  return INFEQ;
3256  else if (c == '<')
3257  st = ST_L_SHIFT;
3258  else
3259  {
3260  ungetc(c, fp);
3261  if (c == '\n')
3262  ctx->line_nb --;
3263  return '<';
3264  }
3265  break;
3266 
3267  case ST_R_SHIFT:
3268  if (c == '=')
3269  return R_SHIFT_EQ;
3270  else if (c == '>')
3271  st = ST_R_USHIFT;
3272  else
3273  {
3274  ungetc(c, fp);
3275  if (c == '\n')
3276  ctx->line_nb --;
3277  return R_SHIFT;
3278  }
3279  /*NOTREACHED*/
3280  break;
3281 
3282  case ST_R_USHIFT:
3283  if (c == '=')
3284  return R_USHIFT_EQ;
3285  else
3286  {
3287  ungetc(c, fp);
3288  if (c == '\n')
3289  ctx->line_nb --;
3290  return R_USHIFT;
3291  }
3292  /*NOTREACHED*/
3293  break;
3294 
3295  case ST_L_SHIFT:
3296  if (c == '=')
3297  return L_SHIFT_EQ;
3298  else
3299  {
3300  ungetc(c, fp);
3301  if (c == '\n')
3302  ctx->line_nb --;
3303  return L_SHIFT;
3304  }
3305  /*NOTREACHED*/
3306  break;
3307 
3308  case ST_AND:
3309  if (c == '&')
3310  return AND;
3311  ungetc(c, fp);
3312  if (c == '\n')
3313  ctx->line_nb --;
3314  return '&';
3315 
3316  case ST_OR:
3317  if (c == '|')
3318  return OR;
3319  ungetc(c, fp);
3320  if (c == '\n')
3321  ctx->line_nb --;
3322  return '|';
3323 
3324  case ST_NOT:
3325  if (c == '=')
3326  return NEQ;
3327  else if (c == '~')
3328  return RE_NOMATCH;
3329  ungetc(c, fp);
3330  if (c == '\n')
3331  ctx->line_nb --;
3332  return '!';
3333 
3334  case ST_EQ:
3335  if (c == '=')
3336  return EQ;
3337  else if (c == '~')
3338  return RE_MATCH;
3339  else if (c == '>')
3340  return ARROW;
3341  ungetc(c, fp);
3342  if (c == '\n')
3343  ctx->line_nb --;
3344  return '=';
3345 
3346  case ST_PLUS:
3347  if (c == '+')
3348  return PLUS_PLUS;
3349  else if (c == '=')
3350  return PLUS_EQ;
3351 
3352  ungetc(c, fp);
3353  if (c == '\n')
3354  ctx->line_nb --;
3355  return '+';
3356 
3357  case ST_MINUS:
3358  if (c == '-')
3359  return MINUS_MINUS;
3360  else if (c == '=')
3361  return MINUS_EQ;
3362 
3363  ungetc(c, fp);
3364  if (c == '\n')
3365  ctx->line_nb --;
3366  return '-';
3367 
3368  case ST_MULT:
3369  if (c == '=')
3370  return MULT_EQ;
3371  else if (c == '*')
3372  return EXPO;
3373  ungetc(c, fp);
3374  if (c == '\n')
3375  ctx->line_nb --;
3376  return '*';
3377 
3378  case ST_DIV:
3379  if (c == '=')
3380  return DIV_EQ;
3381 
3382  ungetc(c, fp);
3383  if (c == '\n')
3384  ctx->line_nb --;
3385  return '/';
3386 
3387  case ST_MODULO:
3388  if (c == '=')
3389  return MODULO_EQ;
3390 
3391  ungetc(c, fp);
3392  if (c == '\n')
3393  ctx->line_nb --;
3394  return '%';
3395 
3396  }
3397 
3398  if (len >= ctx->maxlen)
3399  {
3400  int offs = p - ctx->buffer;
3401  char *buf2;
3402  ctx->maxlen += 80;
3403  buf2 = g_realloc(ctx->buffer, ctx->maxlen + 1);
3404  p = buf2 + offs;
3405  ctx->buffer = buf2;
3406  }
3407  }
3408 
3409  exit_loop:
3410  ctx->buffer[len] = '\0';
3411  switch (st)
3412  {
3413  case ST_START:
3414  case ST_COMMENT:
3415  case ST_SPACE:
3416  return 0;
3417 
3418  case ST_STRING2:
3419  r = STRING2;
3420  lvalp->str = g_strdup(ctx->buffer);
3421  return r;
3422 
3423  case ST_STRING1:
3424  r = STRING1;
3425  lvalp->data.val = g_malloc0 (len+2);
3426  memcpy(lvalp->data.val, ctx->buffer, len+1);
3427  lvalp->data.len = len;
3428  return r;
3429 
3430  case ST_IDENT:
3431  if (strcmp(ctx->buffer, "if") == 0)
3432  r = IF;
3433  else if (strcmp(ctx->buffer, "else") == 0)
3434  r = ELSE;
3435  else if (strcmp(ctx->buffer, "for") == 0)
3436  r = FOR;
3437  else if (strcmp(ctx->buffer, "while") == 0)
3438  r = WHILE;
3439  else if (strcmp(ctx->buffer, "repeat") == 0)
3440  r = REPEAT;
3441  else if (strcmp(ctx->buffer, "until") == 0)
3442  r = UNTIL;
3443  else if (strcmp(ctx->buffer, "foreach") == 0)
3444  r = FOREACH;
3445  else if (strcmp(ctx->buffer, "function") == 0)
3446  r = FUNCTION;
3447  else if (strcmp(ctx->buffer, "return") == 0)
3448  r = RETURN;
3449  else if (strcmp(ctx->buffer, "x") == 0)
3450  r = REP;
3451  else if (strcmp(ctx->buffer, "include") == 0)
3452  r = INCLUDE;
3453  else if (strcmp(ctx->buffer, "break") == 0)
3454  r = BREAK;
3455  else if (strcmp(ctx->buffer, "continue") == 0)
3456  r = CONTINUE;
3457  else if (strcmp(ctx->buffer, "local_var") == 0)
3458  r = LOCAL;
3459  else if (strcmp(ctx->buffer, "global_var") == 0)
3460  r = GLOBAL;
3461  else
3462  {
3463  r = IDENT;
3464  lvalp->str = g_strdup(ctx->buffer);
3465  return r;
3466  }
3467  return r;
3468 
3469  case ST_DEC:
3470  /* -123 is parsed as "-" and "123" so that we can write "4-2" without
3471  * inserting a white space after the minus operator
3472  * Note that strtoul would also work on negative integers */
3473  lvalp->num = x = strtoul(ctx->buffer, NULL, 10);
3474 #if NASL_DEBUG > 1 && defined(ULONG_MAX) && defined(ERANGE)
3475  if (x == ULONG_MAX && errno == ERANGE)
3476  nasl_perror(NULL, "Integer overflow while converting %s at or near line %d\n", ctx->buffer, ctx->line_nb);
3477 #endif
3478  return INTEGER;
3479 
3480  case ST_OCT:
3481  lvalp->num = x = strtoul(ctx->buffer, NULL, 8);
3482 #if NASL_DEBUG > 1 && defined(ULONG_MAX) && defined(ERANGE)
3483  if (x == ULONG_MAX && errno == ERANGE)
3484  nasl_perror(NULL, "Integer overflow while converting %s at or near line %d\n", ctx->buffer, ctx->line_nb);
3485 #endif
3486  return INTEGER;
3487 
3488  case ST_HEX:
3489  lvalp->num = x = strtoul(ctx->buffer, NULL, 16);
3490 #if NASL_DEBUG > 1 && defined(ULONG_MAX)
3491  if (x == ULONG_MAX)
3492  nasl_perror(NULL, "Possible integer overflow while converting %s at or near line %d\n", ctx->buffer, ctx->line_nb);
3493 #endif
3494  return INTEGER;
3495 
3496  case ST_ZEROX:
3497  nasl_perror(NULL, "Invalid token 0x parsed as 0 at line %d\n",
3498  ctx->line_nb);
3499  case ST_ZERO:
3500  lvalp->num = 0;
3501  return INTEGER;
3502  default:
3503  abort();
3504  }
3505 }
3506 
3507 static int
3508 nasllex(YYSTYPE * lvalp, void * parm)
3509 {
3510  int x = mylex (lvalp, parm);
3511  return x;
3512 }
3513 
#define YYSYNTAX_ERROR
#define YY_INITIAL_VALUE(Value)
#define YYSTACK_BYTES(N)
const char * nasl_get_filename(const char *function)
Definition: nasl_debug.c:43
void ref_cell(tree_cell *c)
Definition: nasl_tree.c:188
void * malloc(YYSIZE_T)
#define YY_(Msgid)
#define YYFINAL
#define YYTERROR
#define YYSTACK_FREE
#define YYMAXDEPTH
#define YYEMPTY
#define YYPOPSTACK(N)
char * buffer
#define YYINITDEPTH
void nasl_clean_ctx(naslctxt *c)
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
tree_cell * tree
#define yyerror
char * str_val
Definition: nasl_tree.h:113
struct YYSTYPE::asciiz data
void nasl_dump_tree(const tree_cell *c)
Definition: nasl_tree.c:439
#define YYSTACK_ALLOC
void nasl_clean_inc(void)
int nasldebug
tree_cell * make_array_from_elems(tree_cell *el)
Definition: nasl_var.c:1478
void deref_cell(tree_cell *c)
Definition: nasl_tree.c:202
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define yylex
#define YYLAST
#define yypact_value_is_default(Yystate)
int always_authenticated
unsigned short int yytype_uint16
#define yytable_value_is_error(Yytable_value)
#define yydebug
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
void nasl_set_filename(const char *filename)
Definition: nasl_debug.c:71
void log_legacy_write(const char *format,...)
Legacy function to write a log message.
const gchar * prefs_get(const gchar *key)
Get a string preference value via a key.
Definition: prefs.c:86
#define LNB
short int yytype_int16
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YYUSE(E)
tree_cell * alloc_typed_cell(int typ)
Definition: nasl_tree.c:53
int add_nasl_inc_dir(const char *dir)
Adds the given string as directory for searching for includes.
tree_cell * alloc_RE_cell(int lnb, int t, tree_cell *l, char *re_str)
Definition: nasl_tree.c:61
yytype_int16 yyss_alloc
#define YY_REDUCE_PRINT(Rule)
Top-level KB. This is to be inherited by KB implementations.
Definition: kb.h:102
Definition: nasl_tree.h:105
YYSTYPE yyvs_alloc
signed char yytype_int8
#define YY_NULLPTR
#define YYACCEPT
#define YYTRANSLATE(YYX)
long int num
const char * name
Definition: nasl_init.c:524
#define YYFPRINTF
#define yynerrs
void nasl_perror(lex_ctxt *lexic, char *msg,...)
Definition: nasl_debug.c:94
int nasl_verify_signature(const char *filename)
int naslparse(naslctxt *parm)
unsigned char yytype_uint8
long int i_val
Definition: nasl_tree.h:114
#define YYNTOKENS
#define yyparse
#define YYSIZE_T
#define YYABORT
tree_cell * alloc_tree_cell(int lnb, char *s)
Definition: nasl_tree.c:37
void nasl_set_function_filename(const char *function)
Definition: nasl_debug.c:82
tree_cell * node
#define YYSTACK_ALLOC_MAXIMUM
#define YYDPRINTF(Args)
yytokentype
tree_cell * alloc_expr_cell(int lnb, int t, tree_cell *l, tree_cell *r)
Definition: nasl_tree.c:86
#define YYEOF
GHashTable * includes_hash
#define YY_STACK_PRINT(Bottom, Top)
void free(void *)
#define YYCASE_(N, S)
int init_nasl_ctx(naslctxt *pc, const char *name)
Initialize a NASL context for a NASL file.