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.4. */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5  Copyright (C) 1984, 1989-1990, 2000-2015 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.4"
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  YYCASE_(0, YY_("syntax error"));
1325  YYCASE_(1, YY_("syntax error, unexpected %s"));
1326  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1327  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1328  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1329  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1330 # undef YYCASE_
1331  }
1332 
1333  {
1334  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1335  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1336  return 2;
1337  yysize = yysize1;
1338  }
1339 
1340  if (*yymsg_alloc < yysize)
1341  {
1342  *yymsg_alloc = 2 * yysize;
1343  if (! (yysize <= *yymsg_alloc
1344  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1345  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1346  return 1;
1347  }
1348 
1349  /* Avoid sprintf, as that infringes on the user's name space.
1350  Don't have undefined behavior even if the translation
1351  produced a string with the wrong number of "%s"s. */
1352  {
1353  char *yyp = *yymsg;
1354  int yyi = 0;
1355  while ((*yyp = *yyformat) != '\0')
1356  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1357  {
1358  yyp += yytnamerr (yyp, yyarg[yyi++]);
1359  yyformat += 2;
1360  }
1361  else
1362  {
1363  yyp++;
1364  yyformat++;
1365  }
1366  }
1367  return 0;
1368 }
1369 #endif /* YYERROR_VERBOSE */
1370 
1371 /*-----------------------------------------------.
1372 | Release the memory associated to this symbol. |
1373 `-----------------------------------------------*/
1374 
1375 static void
1376 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, naslctxt * parm)
1377 {
1378  YYUSE (yyvaluep);
1379  YYUSE (parm);
1380  if (!yymsg)
1381  yymsg = "Deleting";
1382  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1383 
1385  YYUSE (yytype);
1387 }
1388 
1389 
1390 
1391 
1392 /*----------.
1393 | yyparse. |
1394 `----------*/
1395 
1396 int
1398 {
1399 /* The lookahead symbol. */
1400 int yychar;
1401 
1402 
1403 /* The semantic value of the lookahead symbol. */
1404 /* Default value used for initialization, for pacifying older GCCs
1405  or non-GCC compilers. */
1406 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1407 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1408 
1409  /* Number of syntax errors so far. */
1410  int yynerrs;
1411 
1412  int yystate;
1413  /* Number of tokens to shift before error messages enabled. */
1414  int yyerrstatus;
1415 
1416  /* The stacks and their tools:
1417  'yyss': related to states.
1418  'yyvs': related to semantic values.
1419 
1420  Refer to the stacks through separate pointers, to allow yyoverflow
1421  to reallocate them elsewhere. */
1422 
1423  /* The state stack. */
1424  yytype_int16 yyssa[YYINITDEPTH];
1425  yytype_int16 *yyss;
1426  yytype_int16 *yyssp;
1427 
1428  /* The semantic value stack. */
1429  YYSTYPE yyvsa[YYINITDEPTH];
1430  YYSTYPE *yyvs;
1431  YYSTYPE *yyvsp;
1432 
1433  YYSIZE_T yystacksize;
1434 
1435  int yyn;
1436  int yyresult;
1437  /* Lookahead token as an internal (translated) token number. */
1438  int yytoken = 0;
1439  /* The variables used to return semantic value and location from the
1440  action routines. */
1441  YYSTYPE yyval;
1442 
1443 #if YYERROR_VERBOSE
1444  /* Buffer for error messages, and its allocated size. */
1445  char yymsgbuf[128];
1446  char *yymsg = yymsgbuf;
1447  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1448 #endif
1449 
1450 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1451 
1452  /* The number of symbols on the RHS of the reduced rule.
1453  Keep to zero when no symbol should be popped. */
1454  int yylen = 0;
1455 
1456  yyssp = yyss = yyssa;
1457  yyvsp = yyvs = yyvsa;
1458  yystacksize = YYINITDEPTH;
1459 
1460  YYDPRINTF ((stderr, "Starting parse\n"));
1461 
1462  yystate = 0;
1463  yyerrstatus = 0;
1464  yynerrs = 0;
1465  yychar = YYEMPTY; /* Cause a token to be read. */
1466  goto yysetstate;
1467 
1468 /*------------------------------------------------------------.
1469 | yynewstate -- Push a new state, which is found in yystate. |
1470 `------------------------------------------------------------*/
1471  yynewstate:
1472  /* In all cases, when you get here, the value and location stacks
1473  have just been pushed. So pushing a state here evens the stacks. */
1474  yyssp++;
1475 
1476  yysetstate:
1477  *yyssp = yystate;
1478 
1479  if (yyss + yystacksize - 1 <= yyssp)
1480  {
1481  /* Get the current used size of the three stacks, in elements. */
1482  YYSIZE_T yysize = yyssp - yyss + 1;
1483 
1484 #ifdef yyoverflow
1485  {
1486  /* Give user a chance to reallocate the stack. Use copies of
1487  these so that the &'s don't force the real ones into
1488  memory. */
1489  YYSTYPE *yyvs1 = yyvs;
1490  yytype_int16 *yyss1 = yyss;
1491 
1492  /* Each stack pointer address is followed by the size of the
1493  data in use in that stack, in bytes. This used to be a
1494  conditional around just the two extra args, but that might
1495  be undefined if yyoverflow is a macro. */
1496  yyoverflow (YY_("memory exhausted"),
1497  &yyss1, yysize * sizeof (*yyssp),
1498  &yyvs1, yysize * sizeof (*yyvsp),
1499  &yystacksize);
1500 
1501  yyss = yyss1;
1502  yyvs = yyvs1;
1503  }
1504 #else /* no yyoverflow */
1505 # ifndef YYSTACK_RELOCATE
1506  goto yyexhaustedlab;
1507 # else
1508  /* Extend the stack our own way. */
1509  if (YYMAXDEPTH <= yystacksize)
1510  goto yyexhaustedlab;
1511  yystacksize *= 2;
1512  if (YYMAXDEPTH < yystacksize)
1513  yystacksize = YYMAXDEPTH;
1514 
1515  {
1516  yytype_int16 *yyss1 = yyss;
1517  union yyalloc *yyptr =
1518  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1519  if (! yyptr)
1520  goto yyexhaustedlab;
1521  YYSTACK_RELOCATE (yyss_alloc, yyss);
1522  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1523 # undef YYSTACK_RELOCATE
1524  if (yyss1 != yyssa)
1525  YYSTACK_FREE (yyss1);
1526  }
1527 # endif
1528 #endif /* no yyoverflow */
1529 
1530  yyssp = yyss + yysize - 1;
1531  yyvsp = yyvs + yysize - 1;
1532 
1533  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1534  (unsigned long int) yystacksize));
1535 
1536  if (yyss + yystacksize - 1 <= yyssp)
1537  YYABORT;
1538  }
1539 
1540  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1541 
1542  if (yystate == YYFINAL)
1543  YYACCEPT;
1544 
1545  goto yybackup;
1546 
1547 /*-----------.
1548 | yybackup. |
1549 `-----------*/
1550 yybackup:
1551 
1552  /* Do appropriate processing given the current state. Read a
1553  lookahead token if we need one and don't already have one. */
1554 
1555  /* First try to decide what to do without reference to lookahead token. */
1556  yyn = yypact[yystate];
1557  if (yypact_value_is_default (yyn))
1558  goto yydefault;
1559 
1560  /* Not known => get a lookahead token if don't already have one. */
1561 
1562  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1563  if (yychar == YYEMPTY)
1564  {
1565  YYDPRINTF ((stderr, "Reading a token: "));
1566  yychar = yylex (&yylval, parm);
1567  }
1568 
1569  if (yychar <= YYEOF)
1570  {
1571  yychar = yytoken = YYEOF;
1572  YYDPRINTF ((stderr, "Now at end of input.\n"));
1573  }
1574  else
1575  {
1576  yytoken = YYTRANSLATE (yychar);
1577  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1578  }
1579 
1580  /* If the proper action on seeing token YYTOKEN is to reduce or to
1581  detect an error, take that action. */
1582  yyn += yytoken;
1583  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1584  goto yydefault;
1585  yyn = yytable[yyn];
1586  if (yyn <= 0)
1587  {
1588  if (yytable_value_is_error (yyn))
1589  goto yyerrlab;
1590  yyn = -yyn;
1591  goto yyreduce;
1592  }
1593 
1594  /* Count tokens shifted since error; after three, turn off error
1595  status. */
1596  if (yyerrstatus)
1597  yyerrstatus--;
1598 
1599  /* Shift the lookahead token. */
1600  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1601 
1602  /* Discard the shifted token. */
1603  yychar = YYEMPTY;
1604 
1605  yystate = yyn;
1607  *++yyvsp = yylval;
1609 
1610  goto yynewstate;
1611 
1612 
1613 /*-----------------------------------------------------------.
1614 | yydefault -- do the default action for the current state. |
1615 `-----------------------------------------------------------*/
1616 yydefault:
1617  yyn = yydefact[yystate];
1618  if (yyn == 0)
1619  goto yyerrlab;
1620  goto yyreduce;
1621 
1622 
1623 /*-----------------------------.
1624 | yyreduce -- Do a reduction. |
1625 `-----------------------------*/
1626 yyreduce:
1627  /* yyn is the number of a rule to reduce with. */
1628  yylen = yyr2[yyn];
1629 
1630  /* If YYLEN is nonzero, implement the default value of the action:
1631  '$$ = $1'.
1632 
1633  Otherwise, the following line sets YYVAL to garbage.
1634  This behavior is undocumented and Bison
1635  users should not rely upon it. Assigning to YYVAL
1636  unconditionally makes the parser a bit smaller, and it avoids a
1637  GCC warning that YYVAL may be used uninitialized. */
1638  yyval = yyvsp[1-yylen];
1639 
1640 
1641  YY_REDUCE_PRINT (yyn);
1642  switch (yyn)
1643  {
1644  case 2:
1645 #line 145 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1646  {
1647  ((naslctxt*)parm)->tree = (yyvsp[0].node);
1648  }
1649 #line 1650 "nasl_grammar.tab.c" /* yacc.c:1646 */
1650  break;
1651 
1652  case 3:
1653 #line 150 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1654  {
1655  (yyval.node) = alloc_tree_cell(LNB, NULL);
1656  (yyval.node)->type = NODE_INSTR_L;
1657  (yyval.node)->link[0] = (yyvsp[0].node);
1658  }
1659 #line 1660 "nasl_grammar.tab.c" /* yacc.c:1646 */
1660  break;
1661 
1662  case 4:
1663 #line 156 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1664  {
1665  (yyval.node) = alloc_tree_cell(LNB, NULL);
1666  (yyval.node)->type = NODE_INSTR_L;
1667  (yyval.node)->link[0] = (yyvsp[-1].node);
1668  (yyval.node)->link[1] = (yyvsp[0].node);
1669  }
1670 #line 1671 "nasl_grammar.tab.c" /* yacc.c:1646 */
1671  break;
1672 
1673  case 7:
1674 #line 166 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1675  {
1676  nasl_set_function_filename ((yyvsp[-4].str));
1677  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-4].str));
1678  (yyval.node)->type = NODE_FUN_DEF;
1679  (yyval.node)->link[0] = (yyvsp[-2].node);
1680  (yyval.node)->link[1] = (yyvsp[0].node);
1681  }
1682 #line 1683 "nasl_grammar.tab.c" /* yacc.c:1646 */
1683  break;
1684 
1685  case 8:
1686 #line 174 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1687  { (yyval.node) = NULL; }
1688 #line 1689 "nasl_grammar.tab.c" /* yacc.c:1646 */
1689  break;
1690 
1691  case 9:
1692 #line 174 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1693  { (yyval.node) = (yyvsp[0].node); }
1694 #line 1695 "nasl_grammar.tab.c" /* yacc.c:1646 */
1695  break;
1696 
1697  case 10:
1698 #line 175 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1699  { (yyval.node) = alloc_tree_cell(LNB, (yyvsp[0].str)); (yyval.node)->type = NODE_DECL; }
1700 #line 1701 "nasl_grammar.tab.c" /* yacc.c:1646 */
1701  break;
1702 
1703  case 11:
1704 #line 177 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1705  {
1706  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-2].str));
1707  (yyval.node)->type = NODE_DECL;
1708  (yyval.node)->link[0] = (yyvsp[0].node);
1709  }
1710 #line 1711 "nasl_grammar.tab.c" /* yacc.c:1646 */
1711  break;
1712 
1713  case 12:
1714 #line 184 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1715  { (yyval.node) = (yyvsp[-1].node); }
1716 #line 1717 "nasl_grammar.tab.c" /* yacc.c:1646 */
1717  break;
1718 
1719  case 13:
1720 #line 184 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1721  { (yyval.node) = NULL; }
1722 #line 1723 "nasl_grammar.tab.c" /* yacc.c:1646 */
1723  break;
1724 
1725  case 15:
1726 #line 187 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1727  {
1728  if ((yyvsp[-1].node) == NULL)
1729  (yyval.node) = (yyvsp[0].node);
1730  else
1731  {
1732  (yyval.node) = alloc_tree_cell(LNB, NULL);
1733  (yyval.node)->type = NODE_INSTR_L;
1734  (yyval.node)->link[0] = (yyvsp[-1].node);
1735  (yyval.node)->link[1] = (yyvsp[0].node);
1736  }
1737  }
1738 #line 1739 "nasl_grammar.tab.c" /* yacc.c:1646 */
1739  break;
1740 
1741  case 16:
1742 #line 200 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1743  { (yyval.node) = (yyvsp[-1].node); }
1744 #line 1745 "nasl_grammar.tab.c" /* yacc.c:1646 */
1745  break;
1746 
1747  case 28:
1748 #line 205 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1749  {
1750  (yyval.node) = alloc_tree_cell(LNB, NULL);
1751  (yyval.node)->type = NODE_BREAK;
1752  }
1753 #line 1754 "nasl_grammar.tab.c" /* yacc.c:1646 */
1754  break;
1755 
1756  case 29:
1757 #line 209 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1758  {
1759  (yyval.node) = alloc_tree_cell(LNB, NULL);
1760  (yyval.node)->type = NODE_CONTINUE;
1761  }
1762 #line 1763 "nasl_grammar.tab.c" /* yacc.c:1646 */
1763  break;
1764 
1765  case 30:
1766 #line 213 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1767  { (yyval.node) = NULL; }
1768 #line 1769 "nasl_grammar.tab.c" /* yacc.c:1646 */
1769  break;
1770 
1771  case 31:
1772 #line 217 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1773  {
1774  (yyval.node) = alloc_tree_cell(LNB, NULL);
1775  (yyval.node)->type = NODE_RETURN;
1776  (yyval.node)->link[0] = (yyvsp[0].node);
1777  }
1778 #line 1779 "nasl_grammar.tab.c" /* yacc.c:1646 */
1779  break;
1780 
1781  case 32:
1782 #line 223 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1783  {
1784  (yyval.node) = alloc_tree_cell(LNB, NULL);
1785  (yyval.node)->type = NODE_RETURN;
1786  }
1787 #line 1788 "nasl_grammar.tab.c" /* yacc.c:1646 */
1788  break;
1789 
1790  case 33:
1791 #line 230 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1792  {
1793  (yyval.node) = alloc_tree_cell(LNB, NULL);
1794  (yyval.node)->type = NODE_IF_ELSE;
1795  (yyval.node)->link[0] = (yyvsp[-2].node); (yyval.node)->link[1] = (yyvsp[0].node);
1796  }
1797 #line 1798 "nasl_grammar.tab.c" /* yacc.c:1646 */
1798  break;
1799 
1800  case 34:
1801 #line 236 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1802  {
1803  (yyval.node) = alloc_tree_cell(LNB, NULL);
1804  (yyval.node)->type = NODE_IF_ELSE;
1805  (yyval.node)->link[0] = (yyvsp[-4].node); (yyval.node)->link[1] = (yyvsp[-2].node); (yyval.node)->link[2] = (yyvsp[0].node);
1806  }
1807 #line 1808 "nasl_grammar.tab.c" /* yacc.c:1646 */
1808  break;
1809 
1810  case 39:
1811 #line 245 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1812  {
1813  (yyval.node) = alloc_tree_cell(LNB, NULL);
1814  (yyval.node)->type = NODE_FOR;
1815  (yyval.node)->link[0] = (yyvsp[-6].node);
1816  (yyval.node)->link[1] = (yyvsp[-4].node);
1817  (yyval.node)->link[2] = (yyvsp[-2].node);
1818  (yyval.node)->link[3] = (yyvsp[0].node);
1819  }
1820 #line 1821 "nasl_grammar.tab.c" /* yacc.c:1646 */
1821  break;
1822 
1823  case 40:
1824 #line 255 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1825  {
1826  (yyval.node) = alloc_tree_cell(LNB, NULL);
1827  (yyval.node)->type = NODE_WHILE;
1828  (yyval.node)->link[0] = (yyvsp[-2].node);
1829  (yyval.node)->link[1] = (yyvsp[0].node);
1830  }
1831 #line 1832 "nasl_grammar.tab.c" /* yacc.c:1646 */
1832  break;
1833 
1834  case 41:
1835 #line 262 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1836  {
1837  (yyval.node) = alloc_tree_cell(LNB, NULL);
1838  (yyval.node)->type = NODE_REPEAT_UNTIL;
1839  (yyval.node)->link[0] = (yyvsp[-3].node);
1840  (yyval.node)->link[1] = (yyvsp[-1].node);
1841  }
1842 #line 1843 "nasl_grammar.tab.c" /* yacc.c:1646 */
1843  break;
1844 
1845  case 42:
1846 #line 270 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1847  {
1848  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-4].str));
1849  (yyval.node)->type = NODE_FOREACH;
1850  (yyval.node)->link[0] = (yyvsp[-2].node);
1851  (yyval.node)->link[1] = (yyvsp[0].node);
1852  }
1853 #line 1854 "nasl_grammar.tab.c" /* yacc.c:1646 */
1854  break;
1855 
1856  case 46:
1857 #line 278 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1858  { (yyval.node) = NULL; }
1859 #line 1860 "nasl_grammar.tab.c" /* yacc.c:1646 */
1860  break;
1861 
1862  case 47:
1863 #line 282 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1864  {
1865  (yyval.node) = alloc_tree_cell(LNB, NULL);
1866  (yyval.node)->type = NODE_REPEATED;
1867  (yyval.node)->link[0] = (yyvsp[-2].node);
1868  (yyval.node)->link[1] = (yyvsp[0].node);
1869  }
1870 #line 1871 "nasl_grammar.tab.c" /* yacc.c:1646 */
1871  break;
1872 
1873  case 48:
1874 #line 289 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1875  { (yyval.str) = (yyvsp[0].data).val; }
1876 #line 1877 "nasl_grammar.tab.c" /* yacc.c:1646 */
1877  break;
1878 
1879  case 50:
1880 #line 293 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1881  {
1882  char *tmp;
1883  naslctxt subctx;
1884 
1885  bzero (&subctx, sizeof (subctx));
1886  subctx.always_authenticated = ((naslctxt*)parm)->always_authenticated;
1887  subctx.kb = ((naslctxt *) parm)->kb;
1888  subctx.tree = ((naslctxt *) parm)->tree;
1889  (yyval.node) = NULL;
1890  tmp = g_strdup (nasl_get_filename (NULL));
1891  nasl_set_filename ((yyvsp[-1].str));
1892  if (!includes_hash)
1893  includes_hash = g_hash_table_new_full
1894  (g_str_hash, g_str_equal, g_free,
1895  (GDestroyNotify) deref_cell);
1896 
1897  if ((subctx.tree = g_hash_table_lookup (includes_hash, (yyvsp[-1].str))))
1898  {
1899  (yyval.node) = subctx.tree;
1900  ref_cell ((yyval.node));
1901  g_free ((yyvsp[-1].str));
1902  }
1903  else if (init_nasl_ctx (&subctx, (yyvsp[-1].str)) >= 0)
1904  {
1905  if (!naslparse (&subctx))
1906  {
1907  (yyval.node) = subctx.tree;
1908  g_hash_table_insert (includes_hash, (yyvsp[-1].str), (yyval.node));
1909  ref_cell ((yyval.node));
1910  }
1911  else
1912  {
1913  nasl_perror (NULL, "%s: Parse error at or near line %d\n",
1914  (yyvsp[-1].str), subctx.line_nb);
1915  g_free ((yyvsp[-1].str));
1916  }
1917  g_free(subctx.buffer);
1918  subctx.buffer = NULL;
1919  fclose(subctx.fp);
1920  subctx.fp = NULL;
1921  }
1922  else
1923  {
1924  g_free((yyvsp[-1].str));
1925  g_free (tmp);
1926  return -2;
1927  }
1928  nasl_set_filename (tmp);
1929  g_free (tmp);
1930  }
1931 #line 1932 "nasl_grammar.tab.c" /* yacc.c:1646 */
1932  break;
1933 
1934  case 51:
1935 #line 346 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1936  {
1937  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-3].str));
1938  (yyval.node)->type = NODE_FUN_CALL;
1939  (yyval.node)->link[0] = (yyvsp[-1].node);
1940  }
1941 #line 1942 "nasl_grammar.tab.c" /* yacc.c:1646 */
1942  break;
1943 
1944  case 53:
1945 #line 352 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1946  { (yyval.node) = NULL; }
1947 #line 1948 "nasl_grammar.tab.c" /* yacc.c:1646 */
1948  break;
1949 
1950  case 55:
1951 #line 354 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1952  {
1953  (yyvsp[-2].node)->link[1] = (yyvsp[0].node);
1954  (yyval.node) = (yyvsp[-2].node);
1955  }
1956 #line 1957 "nasl_grammar.tab.c" /* yacc.c:1646 */
1957  break;
1958 
1959  case 56:
1960 #line 360 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1961  {
1962  (yyval.node) = alloc_tree_cell(LNB, NULL);
1963  (yyval.node)->type = NODE_ARG;
1964  (yyval.node)->link[0] = (yyvsp[0].node);
1965  }
1966 #line 1967 "nasl_grammar.tab.c" /* yacc.c:1646 */
1967  break;
1968 
1969  case 57:
1970 #line 366 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1971  {
1972  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-2].str));
1973  (yyval.node)->type = NODE_ARG;
1974  (yyval.node)->link[0] = (yyvsp[0].node);
1975  }
1976 #line 1977 "nasl_grammar.tab.c" /* yacc.c:1646 */
1977  break;
1978 
1979  case 58:
1980 #line 374 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1981  {
1982  (yyval.node) = alloc_expr_cell(LNB, NODE_AFF, (yyvsp[-2].node), (yyvsp[0].node));
1983  }
1984 #line 1985 "nasl_grammar.tab.c" /* yacc.c:1646 */
1985  break;
1986 
1987  case 59:
1988 #line 377 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1989  { (yyval.node) = alloc_expr_cell(LNB, NODE_PLUS_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1990 #line 1991 "nasl_grammar.tab.c" /* yacc.c:1646 */
1991  break;
1992 
1993  case 60:
1994 #line 378 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
1995  { (yyval.node) = alloc_expr_cell(LNB, NODE_MINUS_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1996 #line 1997 "nasl_grammar.tab.c" /* yacc.c:1646 */
1997  break;
1998 
1999  case 61:
2000 #line 379 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2001  { (yyval.node) = alloc_expr_cell(LNB, NODE_MULT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2002 #line 2003 "nasl_grammar.tab.c" /* yacc.c:1646 */
2003  break;
2004 
2005  case 62:
2006 #line 380 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2007  { (yyval.node) = alloc_expr_cell(LNB, NODE_DIV_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2008 #line 2009 "nasl_grammar.tab.c" /* yacc.c:1646 */
2009  break;
2010 
2011  case 63:
2012 #line 381 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2013  { (yyval.node) = alloc_expr_cell(LNB, NODE_MODULO_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2014 #line 2015 "nasl_grammar.tab.c" /* yacc.c:1646 */
2015  break;
2016 
2017  case 64:
2018 #line 382 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2019  { (yyval.node) = alloc_expr_cell(LNB, NODE_R_SHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2020 #line 2021 "nasl_grammar.tab.c" /* yacc.c:1646 */
2021  break;
2022 
2023  case 65:
2024 #line 383 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2025  { (yyval.node) = alloc_expr_cell(LNB, NODE_R_USHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2026 #line 2027 "nasl_grammar.tab.c" /* yacc.c:1646 */
2027  break;
2028 
2029  case 66:
2030 #line 384 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2031  { (yyval.node) = alloc_expr_cell(LNB, NODE_L_SHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2032 #line 2033 "nasl_grammar.tab.c" /* yacc.c:1646 */
2033  break;
2034 
2035  case 67:
2036 #line 387 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2037  { (yyval.node) = alloc_tree_cell(LNB, (yyvsp[0].str)); (yyval.node)->type = NODE_VAR; }
2038 #line 2039 "nasl_grammar.tab.c" /* yacc.c:1646 */
2039  break;
2040 
2041  case 70:
2042 #line 389 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2043  { (yyval.str) = strdup("x"); }
2044 #line 2045 "nasl_grammar.tab.c" /* yacc.c:1646 */
2045  break;
2046 
2047  case 71:
2048 #line 392 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2049  {
2050  (yyval.node) = alloc_tree_cell(LNB, (yyvsp[-3].str));
2051  (yyval.node)->type = NODE_ARRAY_EL;
2052  (yyval.node)->link[0] = (yyvsp[-1].node);
2053  }
2054 #line 2055 "nasl_grammar.tab.c" /* yacc.c:1646 */
2055  break;
2056 
2057  case 73:
2058 #line 401 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2059  { (yyval.node) = alloc_expr_cell(LNB, EXPR_INCR, NULL, (yyvsp[0].node)); }
2060 #line 2061 "nasl_grammar.tab.c" /* yacc.c:1646 */
2061  break;
2062 
2063  case 74:
2064 #line 402 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2065  {(yyval.node) = alloc_expr_cell(LNB, EXPR_DECR, NULL, (yyvsp[0].node)); }
2066 #line 2067 "nasl_grammar.tab.c" /* yacc.c:1646 */
2067  break;
2068 
2069  case 75:
2070 #line 403 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2071  { (yyval.node)= alloc_expr_cell(LNB, EXPR_INCR, (yyvsp[-1].node), NULL); }
2072 #line 2073 "nasl_grammar.tab.c" /* yacc.c:1646 */
2073  break;
2074 
2075  case 76:
2076 #line 404 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2077  { (yyval.node)= alloc_expr_cell(LNB, EXPR_DECR, (yyvsp[-1].node), NULL); }
2078 #line 2079 "nasl_grammar.tab.c" /* yacc.c:1646 */
2079  break;
2080 
2081  case 77:
2082 #line 408 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2083  { (yyval.node) = (yyvsp[-1].node); }
2084 #line 2085 "nasl_grammar.tab.c" /* yacc.c:1646 */
2085  break;
2086 
2087  case 78:
2088 #line 409 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2089  { (yyval.node) = alloc_expr_cell(LNB, EXPR_AND, (yyvsp[-2].node), (yyvsp[0].node)); }
2090 #line 2091 "nasl_grammar.tab.c" /* yacc.c:1646 */
2091  break;
2092 
2093  case 79:
2094 #line 410 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2095  { (yyval.node) = alloc_expr_cell(LNB, EXPR_NOT, (yyvsp[0].node), NULL); }
2096 #line 2097 "nasl_grammar.tab.c" /* yacc.c:1646 */
2097  break;
2098 
2099  case 80:
2100 #line 411 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2101  { (yyval.node) = alloc_expr_cell(LNB, EXPR_OR, (yyvsp[-2].node), (yyvsp[0].node)); }
2102 #line 2103 "nasl_grammar.tab.c" /* yacc.c:1646 */
2103  break;
2104 
2105  case 81:
2106 #line 412 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2107  { (yyval.node) = alloc_expr_cell(LNB, EXPR_PLUS, (yyvsp[-2].node), (yyvsp[0].node)); }
2108 #line 2109 "nasl_grammar.tab.c" /* yacc.c:1646 */
2109  break;
2110 
2111  case 82:
2112 #line 413 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2113  { (yyval.node) = alloc_expr_cell(LNB, EXPR_MINUS, (yyvsp[-2].node), (yyvsp[0].node)); }
2114 #line 2115 "nasl_grammar.tab.c" /* yacc.c:1646 */
2115  break;
2116 
2117  case 83:
2118 #line 414 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2119  { (yyval.node) = alloc_expr_cell(LNB, EXPR_U_MINUS, (yyvsp[0].node), NULL);}
2120 #line 2121 "nasl_grammar.tab.c" /* yacc.c:1646 */
2121  break;
2122 
2123  case 84:
2124 #line 415 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2125  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_NOT, (yyvsp[0].node), NULL);}
2126 #line 2127 "nasl_grammar.tab.c" /* yacc.c:1646 */
2127  break;
2128 
2129  case 85:
2130 #line 416 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2131  { (yyval.node) = alloc_expr_cell(LNB, EXPR_MULT, (yyvsp[-2].node), (yyvsp[0].node)); }
2132 #line 2133 "nasl_grammar.tab.c" /* yacc.c:1646 */
2133  break;
2134 
2135  case 86:
2136 #line 417 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2137  { (yyval.node) = alloc_expr_cell(LNB, EXPR_EXPO, (yyvsp[-2].node), (yyvsp[0].node)); }
2138 #line 2139 "nasl_grammar.tab.c" /* yacc.c:1646 */
2139  break;
2140 
2141  case 87:
2142 #line 418 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2143  { (yyval.node) = alloc_expr_cell(LNB, EXPR_DIV, (yyvsp[-2].node), (yyvsp[0].node)); }
2144 #line 2145 "nasl_grammar.tab.c" /* yacc.c:1646 */
2145  break;
2146 
2147  case 88:
2148 #line 419 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2149  { (yyval.node) = alloc_expr_cell(LNB, EXPR_MODULO, (yyvsp[-2].node), (yyvsp[0].node)); }
2150 #line 2151 "nasl_grammar.tab.c" /* yacc.c:1646 */
2151  break;
2152 
2153  case 89:
2154 #line 420 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2155  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_AND, (yyvsp[-2].node), (yyvsp[0].node)); }
2156 #line 2157 "nasl_grammar.tab.c" /* yacc.c:1646 */
2157  break;
2158 
2159  case 90:
2160 #line 421 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2161  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_XOR, (yyvsp[-2].node), (yyvsp[0].node)); }
2162 #line 2163 "nasl_grammar.tab.c" /* yacc.c:1646 */
2163  break;
2164 
2165  case 91:
2166 #line 422 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2167  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_OR, (yyvsp[-2].node), (yyvsp[0].node)); }
2168 #line 2169 "nasl_grammar.tab.c" /* yacc.c:1646 */
2169  break;
2170 
2171  case 92:
2172 #line 423 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2173  { (yyval.node) = alloc_expr_cell(LNB, EXPR_R_SHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2174 #line 2175 "nasl_grammar.tab.c" /* yacc.c:1646 */
2175  break;
2176 
2177  case 93:
2178 #line 424 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2179  { (yyval.node) = alloc_expr_cell(LNB, EXPR_R_USHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2180 #line 2181 "nasl_grammar.tab.c" /* yacc.c:1646 */
2181  break;
2182 
2183  case 94:
2184 #line 425 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2185  { (yyval.node) = alloc_expr_cell(LNB, EXPR_L_SHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2186 #line 2187 "nasl_grammar.tab.c" /* yacc.c:1646 */
2187  break;
2188 
2189  case 96:
2190 #line 427 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2191  { (yyval.node) = alloc_expr_cell(LNB, COMP_MATCH, (yyvsp[-2].node), (yyvsp[0].node)); }
2192 #line 2193 "nasl_grammar.tab.c" /* yacc.c:1646 */
2193  break;
2194 
2195  case 97:
2196 #line 428 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2197  { (yyval.node) = alloc_expr_cell(LNB, COMP_NOMATCH, (yyvsp[-2].node), (yyvsp[0].node)); }
2198 #line 2199 "nasl_grammar.tab.c" /* yacc.c:1646 */
2199  break;
2200 
2201  case 98:
2202 #line 429 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2203  { (yyval.node) = alloc_RE_cell(LNB, COMP_RE_MATCH, (yyvsp[-2].node), (yyvsp[0].str)); }
2204 #line 2205 "nasl_grammar.tab.c" /* yacc.c:1646 */
2205  break;
2206 
2207  case 99:
2208 #line 430 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2209  { (yyval.node) = alloc_RE_cell(LNB, COMP_RE_NOMATCH, (yyvsp[-2].node), (yyvsp[0].str)); }
2210 #line 2211 "nasl_grammar.tab.c" /* yacc.c:1646 */
2211  break;
2212 
2213  case 100:
2214 #line 431 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2215  { (yyval.node) = alloc_expr_cell(LNB, COMP_LT, (yyvsp[-2].node), (yyvsp[0].node)); }
2216 #line 2217 "nasl_grammar.tab.c" /* yacc.c:1646 */
2217  break;
2218 
2219  case 101:
2220 #line 432 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2221  { (yyval.node) = alloc_expr_cell(LNB, COMP_GT, (yyvsp[-2].node), (yyvsp[0].node)); }
2222 #line 2223 "nasl_grammar.tab.c" /* yacc.c:1646 */
2223  break;
2224 
2225  case 102:
2226 #line 433 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2227  { (yyval.node) = alloc_expr_cell(LNB, COMP_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2228 #line 2229 "nasl_grammar.tab.c" /* yacc.c:1646 */
2229  break;
2230 
2231  case 103:
2232 #line 434 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2233  { (yyval.node) = alloc_expr_cell(LNB, COMP_NE, (yyvsp[-2].node), (yyvsp[0].node)); }
2234 #line 2235 "nasl_grammar.tab.c" /* yacc.c:1646 */
2235  break;
2236 
2237  case 104:
2238 #line 435 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2239  { (yyval.node) = alloc_expr_cell(LNB, COMP_GE, (yyvsp[-2].node), (yyvsp[0].node)); }
2240 #line 2241 "nasl_grammar.tab.c" /* yacc.c:1646 */
2241  break;
2242 
2243  case 105:
2244 #line 436 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2245  { (yyval.node) = alloc_expr_cell(LNB, COMP_LE, (yyvsp[-2].node), (yyvsp[0].node)); }
2246 #line 2247 "nasl_grammar.tab.c" /* yacc.c:1646 */
2247  break;
2248 
2249  case 111:
2250 #line 440 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2251  { (yyval.node) = make_array_from_elems((yyvsp[-1].node)); }
2252 #line 2253 "nasl_grammar.tab.c" /* yacc.c:1646 */
2253  break;
2254 
2255  case 112:
2256 #line 442 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2257  { (yyval.node) = (yyvsp[0].node); }
2258 #line 2259 "nasl_grammar.tab.c" /* yacc.c:1646 */
2259  break;
2260 
2261  case 113:
2262 #line 443 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2263  {
2264  (yyvsp[-2].node)->link[1] = (yyvsp[0].node); (yyval.node) = (yyvsp[-2].node);
2265  }
2266 #line 2267 "nasl_grammar.tab.c" /* yacc.c:1646 */
2267  break;
2268 
2269  case 114:
2270 #line 447 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2271  {
2272  (yyval.node) = alloc_typed_cell(ARRAY_ELEM);
2273  (yyval.node)->link[0] = (yyvsp[0].node);
2274  }
2275 #line 2276 "nasl_grammar.tab.c" /* yacc.c:1646 */
2276  break;
2277 
2278  case 115:
2279 #line 450 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2280  {
2281  (yyval.node) = alloc_typed_cell(ARRAY_ELEM);
2282  (yyval.node)->link[0] = (yyvsp[0].node);
2283  (yyval.node)->x.str_val = (yyvsp[-2].str);
2284  }
2285 #line 2286 "nasl_grammar.tab.c" /* yacc.c:1646 */
2286  break;
2287 
2288  case 116:
2289 #line 456 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2290  { (yyval.node) = alloc_typed_cell(CONST_INT); (yyval.node)->x.i_val = (yyvsp[0].num); }
2291 #line 2292 "nasl_grammar.tab.c" /* yacc.c:1646 */
2292  break;
2293 
2294  case 117:
2295 #line 457 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2296  {
2297  (yyval.node) = alloc_typed_cell(CONST_STR); (yyval.node)->x.str_val = (yyvsp[0].str);
2298  (yyval.node)->size = strlen((yyvsp[0].str));
2299  }
2300 #line 2301 "nasl_grammar.tab.c" /* yacc.c:1646 */
2301  break;
2302 
2303  case 118:
2304 #line 461 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2305  {
2306  (yyval.node) = alloc_typed_cell(CONST_DATA); (yyval.node)->x.str_val = (yyvsp[0].data).val;
2307  (yyval.node)->size = (yyvsp[0].data).len;
2308  }
2309 #line 2310 "nasl_grammar.tab.c" /* yacc.c:1646 */
2310  break;
2311 
2312  case 120:
2313 #line 468 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2314  { (yyval.node) = alloc_tree_cell(LNB, (yyvsp[0].str)); (yyval.node)->type = NODE_VAR; }
2315 #line 2316 "nasl_grammar.tab.c" /* yacc.c:1646 */
2316  break;
2317 
2318  case 124:
2319 #line 474 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2320  {
2321  char *s = g_strdup_printf ("%ld.%ld.%ld.%ld", (yyvsp[-6].num), (yyvsp[-4].num), (yyvsp[-2].num), (yyvsp[0].num));
2322  (yyval.node) = alloc_tree_cell(LNB, s);
2323  (yyval.node)->type = CONST_STR;
2324  (yyval.node)->size = strlen(s);
2325  }
2326 #line 2327 "nasl_grammar.tab.c" /* yacc.c:1646 */
2327  break;
2328 
2329  case 125:
2330 #line 483 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2331  {
2332  (yyval.node) = alloc_tree_cell(LNB, NULL);
2333  (yyval.node)->type = NODE_LOCAL;
2334  (yyval.node)->link[0] = (yyvsp[0].node);
2335  }
2336 #line 2337 "nasl_grammar.tab.c" /* yacc.c:1646 */
2337  break;
2338 
2339  case 126:
2340 #line 491 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1646 */
2341  {
2342  (yyval.node) = alloc_tree_cell(LNB, NULL);
2343  (yyval.node)->type = NODE_GLOBAL;
2344  (yyval.node)->link[0] = (yyvsp[0].node);
2345  }
2346 #line 2347 "nasl_grammar.tab.c" /* yacc.c:1646 */
2347  break;
2348 
2349 
2350 #line 2351 "nasl_grammar.tab.c" /* yacc.c:1646 */
2351  default: break;
2352  }
2353  /* User semantic actions sometimes alter yychar, and that requires
2354  that yytoken be updated with the new translation. We take the
2355  approach of translating immediately before every use of yytoken.
2356  One alternative is translating here after every semantic action,
2357  but that translation would be missed if the semantic action invokes
2358  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2359  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2360  incorrect destructor might then be invoked immediately. In the
2361  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2362  to an incorrect destructor call or verbose syntax error message
2363  before the lookahead is translated. */
2364  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2365 
2366  YYPOPSTACK (yylen);
2367  yylen = 0;
2368  YY_STACK_PRINT (yyss, yyssp);
2369 
2370  *++yyvsp = yyval;
2371 
2372  /* Now 'shift' the result of the reduction. Determine what state
2373  that goes to, based on the state we popped back to and the rule
2374  number reduced by. */
2375 
2376  yyn = yyr1[yyn];
2377 
2378  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2379  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2380  yystate = yytable[yystate];
2381  else
2382  yystate = yydefgoto[yyn - YYNTOKENS];
2383 
2384  goto yynewstate;
2385 
2386 
2387 /*--------------------------------------.
2388 | yyerrlab -- here on detecting error. |
2389 `--------------------------------------*/
2390 yyerrlab:
2391  /* Make sure we have latest lookahead translation. See comments at
2392  user semantic actions for why this is necessary. */
2393  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2394 
2395  /* If not already recovering from an error, report this error. */
2396  if (!yyerrstatus)
2397  {
2398  ++yynerrs;
2399 #if ! YYERROR_VERBOSE
2400  yyerror (parm, YY_("syntax error"));
2401 #else
2402 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2403  yyssp, yytoken)
2404  {
2405  char const *yymsgp = YY_("syntax error");
2406  int yysyntax_error_status;
2407  yysyntax_error_status = YYSYNTAX_ERROR;
2408  if (yysyntax_error_status == 0)
2409  yymsgp = yymsg;
2410  else if (yysyntax_error_status == 1)
2411  {
2412  if (yymsg != yymsgbuf)
2413  YYSTACK_FREE (yymsg);
2414  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2415  if (!yymsg)
2416  {
2417  yymsg = yymsgbuf;
2418  yymsg_alloc = sizeof yymsgbuf;
2419  yysyntax_error_status = 2;
2420  }
2421  else
2422  {
2423  yysyntax_error_status = YYSYNTAX_ERROR;
2424  yymsgp = yymsg;
2425  }
2426  }
2427  yyerror (parm, yymsgp);
2428  if (yysyntax_error_status == 2)
2429  goto yyexhaustedlab;
2430  }
2431 # undef YYSYNTAX_ERROR
2432 #endif
2433  }
2434 
2435 
2436 
2437  if (yyerrstatus == 3)
2438  {
2439  /* If just tried and failed to reuse lookahead token after an
2440  error, discard it. */
2441 
2442  if (yychar <= YYEOF)
2443  {
2444  /* Return failure if at end of input. */
2445  if (yychar == YYEOF)
2446  YYABORT;
2447  }
2448  else
2449  {
2450  yydestruct ("Error: discarding",
2451  yytoken, &yylval, parm);
2452  yychar = YYEMPTY;
2453  }
2454  }
2455 
2456  /* Else will try to reuse lookahead token after shifting the error
2457  token. */
2458  goto yyerrlab1;
2459 
2460 
2461 /*---------------------------------------------------.
2462 | yyerrorlab -- error raised explicitly by YYERROR. |
2463 `---------------------------------------------------*/
2464 yyerrorlab:
2465 
2466  /* Pacify compilers like GCC when the user code never invokes
2467  YYERROR and the label yyerrorlab therefore never appears in user
2468  code. */
2469  if (/*CONSTCOND*/ 0)
2470  goto yyerrorlab;
2471 
2472  /* Do not reclaim the symbols of the rule whose action triggered
2473  this YYERROR. */
2474  YYPOPSTACK (yylen);
2475  yylen = 0;
2476  YY_STACK_PRINT (yyss, yyssp);
2477  yystate = *yyssp;
2478  goto yyerrlab1;
2479 
2480 
2481 /*-------------------------------------------------------------.
2482 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2483 `-------------------------------------------------------------*/
2484 yyerrlab1:
2485  yyerrstatus = 3; /* Each real token shifted decrements this. */
2486 
2487  for (;;)
2488  {
2489  yyn = yypact[yystate];
2490  if (!yypact_value_is_default (yyn))
2491  {
2492  yyn += YYTERROR;
2493  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2494  {
2495  yyn = yytable[yyn];
2496  if (0 < yyn)
2497  break;
2498  }
2499  }
2500 
2501  /* Pop the current state because it cannot handle the error token. */
2502  if (yyssp == yyss)
2503  YYABORT;
2504 
2505 
2506  yydestruct ("Error: popping",
2507  yystos[yystate], yyvsp, parm);
2508  YYPOPSTACK (1);
2509  yystate = *yyssp;
2510  YY_STACK_PRINT (yyss, yyssp);
2511  }
2512 
2514  *++yyvsp = yylval;
2516 
2517 
2518  /* Shift the error token. */
2519  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2520 
2521  yystate = yyn;
2522  goto yynewstate;
2523 
2524 
2525 /*-------------------------------------.
2526 | yyacceptlab -- YYACCEPT comes here. |
2527 `-------------------------------------*/
2528 yyacceptlab:
2529  yyresult = 0;
2530  goto yyreturn;
2531 
2532 /*-----------------------------------.
2533 | yyabortlab -- YYABORT comes here. |
2534 `-----------------------------------*/
2535 yyabortlab:
2536  yyresult = 1;
2537  goto yyreturn;
2538 
2539 #if !defined yyoverflow || YYERROR_VERBOSE
2540 /*-------------------------------------------------.
2541 | yyexhaustedlab -- memory exhaustion comes here. |
2542 `-------------------------------------------------*/
2543 yyexhaustedlab:
2544  yyerror (parm, YY_("memory exhausted"));
2545  yyresult = 2;
2546  /* Fall through. */
2547 #endif
2548 
2549 yyreturn:
2550  if (yychar != YYEMPTY)
2551  {
2552  /* Make sure we have latest lookahead translation. See comments at
2553  user semantic actions for why this is necessary. */
2554  yytoken = YYTRANSLATE (yychar);
2555  yydestruct ("Cleanup: discarding lookahead",
2556  yytoken, &yylval, parm);
2557  }
2558  /* Do not reclaim the symbols of the rule whose action triggered
2559  this YYABORT or YYACCEPT. */
2560  YYPOPSTACK (yylen);
2561  YY_STACK_PRINT (yyss, yyssp);
2562  while (yyssp != yyss)
2563  {
2564  yydestruct ("Cleanup: popping",
2565  yystos[*yyssp], yyvsp, parm);
2566  YYPOPSTACK (1);
2567  }
2568 #ifndef yyoverflow
2569  if (yyss != yyssa)
2570  YYSTACK_FREE (yyss);
2571 #endif
2572 #if YYERROR_VERBOSE
2573  if (yymsg != yymsgbuf)
2574  YYSTACK_FREE (yymsg);
2575 #endif
2576  return yyresult;
2577 }
2578 #line 497 "/builddir/build/BUILD/gvm-libs-9.0.3/nasl/nasl_grammar.y" /* yacc.c:1906 */
2579 
2580 
2581 #include <stdio.h>
2582 #include <stdlib.h>
2583 #include "../misc/openvas_logging.h"
2584 #include "../misc/prefs.h"
2585 #include "../base/openvas_file.h"
2586 #include <libgen.h>
2587 #include <gcrypt.h>
2588 
2589 static void
2590 naslerror(naslctxt *parm, const char *s)
2591 {
2592  fputs(s, stderr);
2593 }
2594 
2595 static GSList * inc_dirs = NULL;
2596 
2608 int
2609 add_nasl_inc_dir (const char * dir)
2610 {
2611  if (dir == NULL)
2612  {
2613  return 0;
2614  }
2615 
2616  // Allow initialization with empty element
2617  if (*dir == '\0')
2618  {
2619  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2620  return 0;
2621  }
2622 
2623  struct stat stat_buf;
2624 
2625  if (stat (dir, &stat_buf) != 0)
2626  return -1;
2627 
2628  if (S_ISDIR(stat_buf.st_mode) != 0)
2629  {
2630  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2631  return 0;
2632  }
2633  else
2634  return -2;
2635 }
2636 
2645 static char *
2646 file_checksum (const char *filename, int algorithm)
2647 {
2648  char *content = NULL, digest[128], *result;
2649  size_t len = 0, i, alglen;
2650 
2651  assert (algorithm == GCRY_MD_MD5 || algorithm == GCRY_MD_SHA256);
2652  if (!filename || !g_file_get_contents (filename, &content, &len, NULL))
2653  return NULL;
2654 
2655  gcry_md_hash_buffer (algorithm, digest, content, len);
2656  alglen = gcry_md_get_algo_dlen (algorithm);
2657  result = g_malloc0 (alglen * 2 + 1);
2658  for (i = 0; i < alglen; i++)
2659  snprintf (result + 2 * i, 3, "%02x", (unsigned char) digest[i]);
2660  g_free (content);
2661 
2662  return result;
2663 }
2664 
2665 static int checksum_algorithm = GCRY_MD_NONE;
2666 
2667 static char checksum_file[2048];
2668 
2669 static void
2670 init_checksum_algorithm (void)
2671 {
2672  const char *base = prefs_get ("plugins_folder");
2673 
2674  checksum_algorithm = GCRY_MD_SHA256;
2675  snprintf (checksum_file, sizeof (checksum_file), "%s/sha256sums", base);
2676  if (g_file_test (checksum_file, G_FILE_TEST_EXISTS))
2677  return;
2678  checksum_algorithm = GCRY_MD_MD5;
2679  snprintf (checksum_file, sizeof (checksum_file), "%s/md5sums", base);
2680  if (g_file_test (checksum_file, G_FILE_TEST_EXISTS))
2681  return;
2682  if (checksum_algorithm == GCRY_MD_NONE)
2683  {
2684  log_legacy_write ("No plugins checksums file");
2685  return;
2686  }
2687 }
2688 
2689 static void
2690 load_checksums (kb_t kb)
2691 {
2692  static int loaded = 0;
2693  const char *base, *prefix;
2694  FILE *file;
2695 
2696  if (loaded)
2697  return;
2698  loaded = 1;
2699  /* Verify checksum */
2700  base = prefs_get ("plugins_folder");
2701  if (nasl_verify_signature (checksum_file) != 0)
2702  {
2703  log_legacy_write ("Erroneous or missing signature for checksums file %s",
2704  checksum_file);
2705  return;
2706  }
2707 
2708  /* Insert content into KB */
2709  file = fopen (checksum_file, "r");
2710  if (!file)
2711  {
2712  log_legacy_write ("%s: Couldn't read file %s", __FUNCTION__,
2713  checksum_file);
2714  return;
2715  }
2716  if (checksum_algorithm == GCRY_MD_MD5)
2717  {
2718  kb_del_items (kb, "md5sums:*");
2719  prefix = "md5sums";
2720  }
2721  else
2722  {
2723  kb_del_items (kb, "sha256sums:*");
2724  prefix = "sha256sums";
2725  }
2726  while (1)
2727  {
2728  char buffer[2048], **splits;
2729  if (!fgets (buffer, sizeof (buffer), file))
2730  break;
2731  if (strstr (buffer, ".asc")
2732  || (!strstr (buffer, ".inc") && !strstr (buffer, ".nasl")))
2733  continue;
2734  splits = g_strsplit (buffer, " ", -1);
2735  if (g_strv_length (splits) != 2)
2736  {
2737  log_legacy_write ("%s: Erroneous checksum entry %s", __FUNCTION__,
2738  buffer);
2739  g_strfreev (splits);
2740  break;
2741  }
2742  splits[1][strlen (splits[1]) - 1] = '\0';
2743  if (strstr (splits[1], ".inc"))
2744  g_snprintf (buffer, sizeof (buffer), "%s:%s", prefix,
2745  basename (splits[1]));
2746  else
2747  g_snprintf (buffer, sizeof (buffer), "%s:%s/%s", prefix, base,
2748  splits[1]);
2749  kb_item_set_str (kb, buffer, splits[0]);
2750  g_strfreev (splits);
2751  }
2752  fclose (file);
2753 }
2754 
2771 int
2772 init_nasl_ctx(naslctxt* pc, const char* name)
2773 {
2774  char *full_name = NULL, key_path[2048], *checksum, *filename, *check = NULL;
2775  GSList * inc_dir = inc_dirs; // iterator for include directories
2776 
2777  // initialize if not yet done (for openvas-server < 2.0.1)
2778  if (! inc_dirs) add_nasl_inc_dir("");
2779 
2780  pc->line_nb = 1;
2781  pc->tree = NULL;
2782  pc->buffer = g_malloc0 (80);
2783  pc->maxlen = 80;
2784  pc->fp = NULL;
2786  while (inc_dir != NULL) {
2787  if (full_name)
2788  g_free (full_name);
2789  full_name = g_build_filename(inc_dir->data, name, NULL);
2790 
2791  if ((pc->fp = fopen(full_name, "r")) != NULL)
2792  break;
2793 
2794  inc_dir = g_slist_next(inc_dir);
2795  }
2796 
2797  if (! pc->fp) {
2798  log_legacy_write ("%s: Not able to open nor to locate it in include paths",
2799  name);
2800  g_free(full_name);
2801  return -1;
2802  }
2803 
2804  if (pc->always_authenticated)
2805  {
2806  g_free(full_name);
2807  return 0;
2808  }
2809  /* Cache the checksum of signature verified files, so that commonly included
2810  * files are not verified multiple times per scan. */
2811 
2812  filename = full_name;
2813  if (strstr (full_name, ".inc"))
2814  filename = basename (full_name);
2815  init_checksum_algorithm ();
2816  if (checksum_algorithm == GCRY_MD_NONE)
2817  return -1;
2818 
2819  snprintf (key_path, sizeof (key_path), "checksum:%s", filename);
2820  checksum = kb_item_get_str (pc->kb, key_path);
2821  if (checksum)
2822  {
2823  int ret;
2824  check = file_checksum (full_name, checksum_algorithm);
2825  ret = strcmp (check, checksum);
2826  if (!ret)
2827  {
2828  /* Already checked. No need to check again. */
2829  g_free (full_name);
2830  g_free (checksum);
2831  g_free (check);
2832  return 0;
2833  }
2834  g_free (checksum);
2835  g_free (check);
2836  }
2837 
2838  load_checksums (pc->kb);
2839  if (checksum_algorithm == GCRY_MD_MD5)
2840  snprintf (key_path, sizeof (key_path), "md5sums:%s", filename);
2841  else if (checksum_algorithm == GCRY_MD_SHA256)
2842  snprintf (key_path, sizeof (key_path), "sha256sums:%s", filename);
2843  else
2844  abort ();
2845  checksum = kb_item_get_str (pc->kb, key_path);
2846  if (!checksum)
2847  {
2848  log_legacy_write ("No checksum for %s", full_name);
2849  g_free (full_name);
2850  return -1;
2851  }
2852  else
2853  {
2854  int ret;
2855 
2856  check = file_checksum (full_name, checksum_algorithm);
2857  ret = strcmp (check, checksum);
2858  if (ret)
2859  log_legacy_write ("checksum for %s not matching", full_name);
2860  else
2861  {
2862  snprintf (key_path, sizeof (key_path), "checksum:%s", filename);
2863  kb_item_set_str (pc->kb, key_path, check);
2864  }
2865  g_free (full_name);
2866  g_free (checksum);
2867  g_free (check);
2868  return ret;
2869  }
2870 }
2871 
2872 void
2874 {
2875 #if 0
2876  nasl_dump_tree(c->tree);
2877 #endif
2878  deref_cell(c->tree);
2879  g_free(c->buffer);
2880  c->buffer = NULL;
2881  if (c->fp)
2882  {
2883  fclose(c->fp);
2884  c->fp = NULL;
2885  }
2886 }
2887 
2888 void
2890 {
2891  if (!includes_hash)
2892  return;
2893  g_hash_table_destroy (includes_hash);
2894  includes_hash = NULL;
2895 }
2896 
2925 
2926 static int
2927 mylex(lvalp, parm)
2928  YYSTYPE *lvalp;
2929  void *parm;
2930 {
2931  char *p;
2932  naslctxt *ctx = parm;
2933  FILE *fp;
2934  int c, st = ST_START, len, r;
2935  long int x, i;
2936 
2937  if (!ctx)
2938  return -1;
2939 
2940  fp = ctx->fp;
2941  p = ctx->buffer;
2942  len = 0;
2943 
2944  while ((c = getc(fp)) != EOF)
2945  {
2946  if (c == '\n')
2947  ctx->line_nb ++;
2948 
2949  switch(st)
2950  {
2951  case ST_START:
2952  if (c == '#')
2953  st = ST_COMMENT;
2954  else if (isalpha(c) || c == '_')
2955  {
2956  st = ST_IDENT;
2957  *p++ = c;
2958  len ++;
2959  }
2960  else if (isspace(c))
2961  st = ST_SPACE;
2962  else if (c == '0')
2963  st = ST_ZERO;
2964  else if (isdigit(c))
2965  {
2966  st = ST_DEC;
2967  *p++ = c;
2968  len ++;
2969  }
2970  else if (c == '\'')
2971  st = ST_STRING1;
2972  else if (c == '"')
2973  st = ST_STRING2;
2974  else if (c == '+')
2975  st = ST_PLUS;
2976  else if (c == '-')
2977  st = ST_MINUS;
2978  else if (c == '*')
2979  st = ST_MULT;
2980  else if (c == '/')
2981  st = ST_DIV;
2982  else if (c == '%')
2983  st = ST_MODULO;
2984  else if (c == '>')
2985  st = ST_SUP;
2986  else if (c == '<')
2987  st = ST_INF;
2988  else if (c == '=')
2989  st = ST_EQ;
2990  else if (c == '|')
2991  st = ST_OR;
2992  else if (c == '!')
2993  st = ST_NOT;
2994  else if (c == '&')
2995  st = ST_AND;
2996  else
2997  {
2998  return c;
2999  }
3000  break;
3001 
3002  case ST_STRING2:
3003  if (c == '"')
3004  goto exit_loop;
3005  *p++ = c;
3006  len ++;
3007  break;
3008 
3009  case ST_STRING1:
3010  if (c == '\'')
3011  goto exit_loop;
3012  else if (c == '\\')
3013  {
3014  c = getc(fp);
3015  switch (c)
3016  {
3017  case EOF:
3018  nasl_perror(NULL, "Unfinished string\n");
3019  goto exit_loop; /* parse error? */
3020 
3021  case '\n': /* escaped end of line */
3022  ctx->line_nb ++;
3023  break;
3024  case '\\':
3025  *p++ ='\\'; len ++;
3026  break;
3027  case 'n':
3028  *p++ = '\n'; len++;
3029  break;
3030  case 'f':
3031  *p++ = '\f'; len ++;
3032  break;
3033  case 't':
3034  *p++ = '\t'; len ++;
3035  break;
3036  case 'r':
3037  *p++ = '\r'; len++;
3038  break;
3039  case 'v':
3040  *p++ = '\v'; len ++;
3041  break;
3042  case '"':
3043  *p ++ = '"'; len ++;
3044  break;
3045  /* Not yet, as we do not return the length of the string */
3046  case '0':
3047  *p++ = '\0'; len++;
3048  break;
3049  case '\'':
3050  *p++ = '\''; len++;
3051  break;
3052 
3053  case 'x':
3054  x = 0;
3055  for (i = 0; i < 2; i ++)
3056  {
3057  c = getc(fp);
3058  if (c == EOF)
3059  {
3060  nasl_perror(NULL, "Unfinished \\x escape sequence (EOF)\n");
3061  goto exit_loop;
3062  }
3063  if (c == '\n')
3064  ctx->line_nb ++;
3065 
3066  c = tolower(c);
3067  if (c >= '0' && c <= '9')
3068  x = x * 16 + (c - '0');
3069  else if (c >= 'a' && c <= 'f')
3070  x = x * 16 + 10 + (c - 'a');
3071  else
3072  {
3073  nasl_perror(NULL, "Unfinished \\x escape sequence\n");
3074  ungetc(c, fp);
3075  if (c == '\n')
3076  ctx->line_nb --;
3077  break;
3078  }
3079  }
3080  *p++ = x; len ++;
3081  break;
3082 
3083  default:
3084  nasl_perror(NULL, "Unknown escape sequence \\%c\n", c);
3085  ungetc(c, fp);
3086  if (c == '\n')
3087  ctx->line_nb --;
3088  goto exit_loop;
3089  }
3090  }
3091  else
3092  {
3093  *p++ = c;
3094  len ++;
3095  }
3096  break;
3097 
3098  case ST_IDENT:
3099  if (isalnum(c) || c == '_')
3100  {
3101  st = ST_IDENT;
3102  *p++ = c;
3103  len ++;
3104  }
3105  else
3106  {
3107  ungetc(c, fp);
3108  if (c == '\n')
3109  ctx->line_nb --;
3110  goto exit_loop;
3111  }
3112  break;
3113 
3114  case ST_ZERO:
3115  if (c == 'x' || c == 'X')
3116  st = ST_ZEROX;
3117  else if (isdigit(c))
3118  {
3119  if (c <= '7')
3120  st = ST_OCT;
3121  else
3122  st = ST_DEC;
3123  *p ++ = c;
3124  len ++;
3125  }
3126  else
3127  {
3128  ungetc(c, fp);
3129  if (c == '\n')
3130  ctx->line_nb --;
3131  goto exit_loop;
3132  }
3133  break;
3134 
3135  case ST_ZEROX:
3136  if (isxdigit(c))
3137  {
3138  st = ST_HEX;
3139  *p++ = c;
3140  len ++;
3141  }
3142  else
3143  {
3144  /* This should be a parse error */
3145  ungetc(c, fp);
3146  if (c == '\n')
3147  ctx->line_nb --;
3148  goto exit_loop;
3149  }
3150  break;
3151 
3152  case ST_OCT:
3153  if (c >= '0')
3154  {
3155  if (c <= '7')
3156  {
3157  *p++ = c;
3158  len ++;
3159  break;
3160  }
3161  else if (c <= '9')
3162  {
3163  *p++ = c;
3164  len ++;
3165  st = ST_DEC;
3166  break;
3167  }
3168  }
3169  ungetc(c, fp);
3170  if (c == '\n')
3171  ctx->line_nb --;
3172  goto exit_loop;
3173 
3174  case ST_DEC:
3175  if (isdigit(c))
3176  {
3177  *p++ = c;
3178  len ++;
3179  }
3180  else
3181  {
3182  ungetc(c, fp);
3183  if (c == '\n')
3184  ctx->line_nb --;
3185  goto exit_loop;
3186  }
3187  break;
3188 
3189  case ST_HEX:
3190  if (isxdigit(c))
3191  {
3192  *p++ = c;
3193  len ++;
3194  }
3195  else
3196  {
3197  ungetc(c, fp);
3198  if (c == '\n')
3199  ctx->line_nb --;
3200  goto exit_loop;
3201  }
3202  break;
3203 
3204  case ST_SPACE:
3205  if (! isspace(c))
3206  {
3207  ungetc(c, fp);
3208  if (c == '\n')
3209  ctx->line_nb --;
3210  st = ST_START;
3211  }
3212  break;
3213 
3214  case ST_COMMENT:
3215  if (c == '\n')
3216  st = ST_START;
3217  break;
3218 
3219  case ST_SUP_EXCL:
3220  if (c == '<')
3221  return NOMATCH;
3222  else
3223  {
3224  ungetc(c, fp);
3225  if (c == '\n')
3226  ctx->line_nb --;
3227  if (! isprint(c)) c = '.';
3228  log_legacy_write ("lexer error: invalid token >!%c "
3229  "parsed as >!< %c", c, c);
3230  return NOMATCH;
3231  }
3232  break;
3233 
3234  case ST_SUP:
3235  if (c == '=')
3236  return SUPEQ;
3237  else if (c == '<')
3238  return MATCH;
3239  else if (c == '>')
3240  st = ST_R_SHIFT;
3241  else if (c == '!')
3242  st = ST_SUP_EXCL;
3243  else
3244  {
3245  ungetc(c, fp);
3246  if (c == '\n')
3247  ctx->line_nb --;
3248  return '>';
3249  }
3250  break;
3251 
3252  case ST_INF:
3253  if (c == '=')
3254  return INFEQ;
3255  else if (c == '<')
3256  st = ST_L_SHIFT;
3257  else
3258  {
3259  ungetc(c, fp);
3260  if (c == '\n')
3261  ctx->line_nb --;
3262  return '<';
3263  }
3264  break;
3265 
3266  case ST_R_SHIFT:
3267  if (c == '=')
3268  return R_SHIFT_EQ;
3269  else if (c == '>')
3270  st = ST_R_USHIFT;
3271  else
3272  {
3273  ungetc(c, fp);
3274  if (c == '\n')
3275  ctx->line_nb --;
3276  return R_SHIFT;
3277  }
3278  /*NOTREACHED*/
3279  break;
3280 
3281  case ST_R_USHIFT:
3282  if (c == '=')
3283  return R_USHIFT_EQ;
3284  else
3285  {
3286  ungetc(c, fp);
3287  if (c == '\n')
3288  ctx->line_nb --;
3289  return R_USHIFT;
3290  }
3291  /*NOTREACHED*/
3292  break;
3293 
3294  case ST_L_SHIFT:
3295  if (c == '=')
3296  return L_SHIFT_EQ;
3297  else
3298  {
3299  ungetc(c, fp);
3300  if (c == '\n')
3301  ctx->line_nb --;
3302  return L_SHIFT;
3303  }
3304  /*NOTREACHED*/
3305  break;
3306 
3307  case ST_AND:
3308  if (c == '&')
3309  return AND;
3310  ungetc(c, fp);
3311  if (c == '\n')
3312  ctx->line_nb --;
3313  return '&';
3314 
3315  case ST_OR:
3316  if (c == '|')
3317  return OR;
3318  ungetc(c, fp);
3319  if (c == '\n')
3320  ctx->line_nb --;
3321  return '|';
3322 
3323  case ST_NOT:
3324  if (c == '=')
3325  return NEQ;
3326  else if (c == '~')
3327  return RE_NOMATCH;
3328  ungetc(c, fp);
3329  if (c == '\n')
3330  ctx->line_nb --;
3331  return '!';
3332 
3333  case ST_EQ:
3334  if (c == '=')
3335  return EQ;
3336  else if (c == '~')
3337  return RE_MATCH;
3338  else if (c == '>')
3339  return ARROW;
3340  ungetc(c, fp);
3341  if (c == '\n')
3342  ctx->line_nb --;
3343  return '=';
3344 
3345  case ST_PLUS:
3346  if (c == '+')
3347  return PLUS_PLUS;
3348  else if (c == '=')
3349  return PLUS_EQ;
3350 
3351  ungetc(c, fp);
3352  if (c == '\n')
3353  ctx->line_nb --;
3354  return '+';
3355 
3356  case ST_MINUS:
3357  if (c == '-')
3358  return MINUS_MINUS;
3359  else if (c == '=')
3360  return MINUS_EQ;
3361 
3362  ungetc(c, fp);
3363  if (c == '\n')
3364  ctx->line_nb --;
3365  return '-';
3366 
3367  case ST_MULT:
3368  if (c == '=')
3369  return MULT_EQ;
3370  else if (c == '*')
3371  return EXPO;
3372  ungetc(c, fp);
3373  if (c == '\n')
3374  ctx->line_nb --;
3375  return '*';
3376 
3377  case ST_DIV:
3378  if (c == '=')
3379  return DIV_EQ;
3380 
3381  ungetc(c, fp);
3382  if (c == '\n')
3383  ctx->line_nb --;
3384  return '/';
3385 
3386  case ST_MODULO:
3387  if (c == '=')
3388  return MODULO_EQ;
3389 
3390  ungetc(c, fp);
3391  if (c == '\n')
3392  ctx->line_nb --;
3393  return '%';
3394 
3395  }
3396 
3397  if (len >= ctx->maxlen)
3398  {
3399  int offs = p - ctx->buffer;
3400  char *buf2;
3401  ctx->maxlen += 80;
3402  buf2 = g_realloc(ctx->buffer, ctx->maxlen + 1);
3403  p = buf2 + offs;
3404  ctx->buffer = buf2;
3405  }
3406  }
3407 
3408  exit_loop:
3409  ctx->buffer[len] = '\0';
3410  switch (st)
3411  {
3412  case ST_START:
3413  case ST_COMMENT:
3414  case ST_SPACE:
3415  return 0;
3416 
3417  case ST_STRING2:
3418  r = STRING2;
3419  lvalp->str = g_strdup(ctx->buffer);
3420  return r;
3421 
3422  case ST_STRING1:
3423  r = STRING1;
3424  lvalp->data.val = g_malloc0 (len+2);
3425  memcpy(lvalp->data.val, ctx->buffer, len+1);
3426  lvalp->data.len = len;
3427  return r;
3428 
3429  case ST_IDENT:
3430  if (strcmp(ctx->buffer, "if") == 0)
3431  r = IF;
3432  else if (strcmp(ctx->buffer, "else") == 0)
3433  r = ELSE;
3434  else if (strcmp(ctx->buffer, "for") == 0)
3435  r = FOR;
3436  else if (strcmp(ctx->buffer, "while") == 0)
3437  r = WHILE;
3438  else if (strcmp(ctx->buffer, "repeat") == 0)
3439  r = REPEAT;
3440  else if (strcmp(ctx->buffer, "until") == 0)
3441  r = UNTIL;
3442  else if (strcmp(ctx->buffer, "foreach") == 0)
3443  r = FOREACH;
3444  else if (strcmp(ctx->buffer, "function") == 0)
3445  r = FUNCTION;
3446  else if (strcmp(ctx->buffer, "return") == 0)
3447  r = RETURN;
3448  else if (strcmp(ctx->buffer, "x") == 0)
3449  r = REP;
3450  else if (strcmp(ctx->buffer, "include") == 0)
3451  r = INCLUDE;
3452  else if (strcmp(ctx->buffer, "break") == 0)
3453  r = BREAK;
3454  else if (strcmp(ctx->buffer, "continue") == 0)
3455  r = CONTINUE;
3456  else if (strcmp(ctx->buffer, "local_var") == 0)
3457  r = LOCAL;
3458  else if (strcmp(ctx->buffer, "global_var") == 0)
3459  r = GLOBAL;
3460  else
3461  {
3462  r = IDENT;
3463  lvalp->str = g_strdup(ctx->buffer);
3464  return r;
3465  }
3466  return r;
3467 
3468  case ST_DEC:
3469  /* -123 is parsed as "-" and "123" so that we can write "4-2" without
3470  * inserting a white space after the minus operator
3471  * Note that strtoul would also work on negative integers */
3472  lvalp->num = x = strtoul(ctx->buffer, NULL, 10);
3473 #if NASL_DEBUG > 1 && defined(ULONG_MAX) && defined(ERANGE)
3474  if (x == ULONG_MAX && errno == ERANGE)
3475  nasl_perror(NULL, "Integer overflow while converting %s at or near line %d\n", ctx->buffer, ctx->line_nb);
3476 #endif
3477  return INTEGER;
3478 
3479  case ST_OCT:
3480  lvalp->num = x = strtoul(ctx->buffer, NULL, 8);
3481 #if NASL_DEBUG > 1 && defined(ULONG_MAX) && defined(ERANGE)
3482  if (x == ULONG_MAX && errno == ERANGE)
3483  nasl_perror(NULL, "Integer overflow while converting %s at or near line %d\n", ctx->buffer, ctx->line_nb);
3484 #endif
3485  return INTEGER;
3486 
3487  case ST_HEX:
3488  lvalp->num = x = strtoul(ctx->buffer, NULL, 16);
3489 #if NASL_DEBUG > 1 && defined(ULONG_MAX)
3490  if (x == ULONG_MAX)
3491  nasl_perror(NULL, "Possible integer overflow while converting %s at or near line %d\n", ctx->buffer, ctx->line_nb);
3492 #endif
3493  return INTEGER;
3494 
3495  case ST_ZEROX:
3496  nasl_perror(NULL, "Invalid token 0x parsed as 0 at line %d\n",
3497  ctx->line_nb);
3498  case ST_ZERO:
3499  lvalp->num = 0;
3500  return INTEGER;
3501  default:
3502  abort();
3503  }
3504 }
3505 
3506 static int
3507 nasllex(YYSTYPE * lvalp, void * parm)
3508 {
3509  int x = mylex (lvalp, parm);
3510  return x;
3511 }
3512 
#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.