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