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