OpenVAS Scanner 23.40.3
nasl_grammar.tab.c File Reference
#include <ctype.h>
#include <pcap.h>
#include <string.h>
#include <sys/stat.h>
#include <glib.h>
#include "../misc/plugutils.h"
#include "nasl_tree.h"
#include "nasl_global_ctxt.h"
#include "nasl_func.h"
#include "nasl_var.h"
#include "nasl_lex_ctxt.h"
#include "nasl_debug.h"
#include "nasl_signature.h"
#include "nasl_grammar.tab.h"
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <gvm/base/logging.h>
#include <gvm/base/prefs.h>
#include <libgen.h>
#include <gcrypt.h>
Include dependency graph for nasl_grammar.tab.c:

Go to the source code of this file.

Data Structures

union  yyalloc

Macros

#define YYBISON   30802
#define YYBISON_VERSION   "3.8.2"
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   1
#define YYPUSH   0
#define YYPULL   1
#define yyparse   naslparse
#define yylex   nasllex
#define yyerror   naslerror
#define yydebug   nasldebug
#define yynerrs   naslnerrs
#define YYPARSE_PARAM   parm
#define YYLEX_PARAM   parm
#define YYPARSE_ERRC   err_c
#define YYLEX_ERRC   err_c
#define LNB   (((naslctxt*)parm)->line_nb)
#define LN   (((naslctxt*)parm)->name)
#define ERRC   err_c
#define G_LOG_DOMAIN   "lib nasl"
 GLib logging domain.
#define YYERROR_VERBOSE
#define YY_CAST(Type, Val)
#define YY_REINTERPRET_CAST(Type, Val)
#define YY_NULLPTR   ((void*)0)
#define YYPTRDIFF_T   long
#define YYPTRDIFF_MAXIMUM   LONG_MAX
#define YYSIZE_T   unsigned
#define YYSIZE_MAXIMUM
#define YYSIZEOF(X)
#define YY_(Msgid)
#define YY_ATTRIBUTE_PURE
#define YY_ATTRIBUTE_UNUSED
#define YY_USE(E)
#define YY_INITIAL_VALUE(Value)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YY_IGNORE_USELESS_CAST_BEGIN
#define YY_IGNORE_USELESS_CAST_END
#define YY_ASSERT(E)
#define YYSTACK_ALLOC   YYMALLOC
#define YYSTACK_FREE   YYFREE
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
#define YYMALLOC   malloc
#define YYFREE   free
#define YYSTACK_GAP_MAXIMUM   (YYSIZEOF (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY_NEEDED   1
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define YYCOPY(Dst, Src, Count)
#define YYFINAL   80
#define YYLAST   1009
#define YYNTOKENS   73
#define YYNNTS   43
#define YYNRULES   127
#define YYNSTATES   229
#define YYMAXUTOK   304
#define YYTRANSLATE(YYX)
#define YY_ACCESSING_SYMBOL(State)
#define YYPACT_NINF   (-77)
#define yypact_value_is_default(Yyn)
#define YYTABLE_NINF   (-70)
#define yytable_value_is_error(Yyn)
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrorlab
#define YYNOMEM   goto yyexhaustedlab
#define YYRECOVERING()
#define YYBACKUP(Token, Value)
#define YYERRCODE   YYUNDEF
#define YYFPRINTF   fprintf
#define YYDPRINTF(Args)
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK(N)

Typedefs

typedef enum yysymbol_kind_t yysymbol_kind_t
typedef signed char yytype_int8
typedef short yytype_int16
typedef unsigned char yytype_uint8
typedef unsigned short yytype_uint16
typedef yytype_uint8 yy_state_t
typedef int yy_state_fast_t

Enumerations

enum  yysymbol_kind_t {
  YYSYMBOL_YYEMPTY = -2 , YYSYMBOL_YYEOF = 0 , YYSYMBOL_YYerror = 1 , YYSYMBOL_YYUNDEF = 2 ,
  YYSYMBOL_IF = 3 , YYSYMBOL_ELSE = 4 , YYSYMBOL_EQ = 5 , YYSYMBOL_NEQ = 6 ,
  YYSYMBOL_SUPEQ = 7 , YYSYMBOL_INFEQ = 8 , YYSYMBOL_OR = 9 , YYSYMBOL_AND = 10 ,
  YYSYMBOL_MATCH = 11 , YYSYMBOL_NOMATCH = 12 , YYSYMBOL_REP = 13 , YYSYMBOL_FOR = 14 ,
  YYSYMBOL_REPEAT = 15 , YYSYMBOL_UNTIL = 16 , YYSYMBOL_FOREACH = 17 , YYSYMBOL_WHILE = 18 ,
  YYSYMBOL_BREAK = 19 , YYSYMBOL_CONTINUE = 20 , YYSYMBOL_FUNCTION = 21 , YYSYMBOL_RETURN = 22 ,
  YYSYMBOL_INCLUDE = 23 , YYSYMBOL_LOCAL = 24 , YYSYMBOL_GLOBAL = 25 , YYSYMBOL_PLUS_PLUS = 26 ,
  YYSYMBOL_MINUS_MINUS = 27 , YYSYMBOL_L_SHIFT = 28 , YYSYMBOL_R_SHIFT = 29 , YYSYMBOL_R_USHIFT = 30 ,
  YYSYMBOL_EXPO = 31 , YYSYMBOL_PLUS_EQ = 32 , YYSYMBOL_MINUS_EQ = 33 , YYSYMBOL_MULT_EQ = 34 ,
  YYSYMBOL_DIV_EQ = 35 , YYSYMBOL_MODULO_EQ = 36 , YYSYMBOL_L_SHIFT_EQ = 37 , YYSYMBOL_R_SHIFT_EQ = 38 ,
  YYSYMBOL_R_USHIFT_EQ = 39 , YYSYMBOL_RE_MATCH = 40 , YYSYMBOL_RE_NOMATCH = 41 , YYSYMBOL_ARROW = 42 ,
  YYSYMBOL_IDENT = 43 , YYSYMBOL_STRING1 = 44 , YYSYMBOL_STRING2 = 45 , YYSYMBOL_INTEGER = 46 ,
  YYSYMBOL_47_ = 47 , YYSYMBOL_48_ = 48 , YYSYMBOL_49_ = 49 , YYSYMBOL_50_ = 50 ,
  YYSYMBOL_51_ = 51 , YYSYMBOL_52_ = 52 , YYSYMBOL_53_ = 53 , YYSYMBOL_54_ = 54 ,
  YYSYMBOL_55_ = 55 , YYSYMBOL_56_ = 56 , YYSYMBOL_57_ = 57 , YYSYMBOL_NOT = 58 ,
  YYSYMBOL_UMINUS = 59 , YYSYMBOL_BIT_NOT = 60 , YYSYMBOL_61_ = 61 , YYSYMBOL_62_ = 62 ,
  YYSYMBOL_63_ = 63 , YYSYMBOL_64_ = 64 , YYSYMBOL_65_ = 65 , YYSYMBOL_66_ = 66 ,
  YYSYMBOL_67_ = 67 , YYSYMBOL_68_ = 68 , YYSYMBOL_69_ = 69 , YYSYMBOL_70_ = 70 ,
  YYSYMBOL_71_ = 71 , YYSYMBOL_72_ = 72 , YYSYMBOL_YYACCEPT = 73 , YYSYMBOL_tiptop = 74 ,
  YYSYMBOL_instr_decl_list = 75 , YYSYMBOL_instr_decl = 76 , YYSYMBOL_func_decl = 77 , YYSYMBOL_arg_decl = 78 ,
  YYSYMBOL_arg_decl_1 = 79 , YYSYMBOL_block = 80 , YYSYMBOL_instr_list = 81 , YYSYMBOL_instr = 82 ,
  YYSYMBOL_simple_instr = 83 , YYSYMBOL_ret = 84 , YYSYMBOL_if_block = 85 , YYSYMBOL_loop = 86 ,
  YYSYMBOL_for_loop = 87 , YYSYMBOL_while_loop = 88 , YYSYMBOL_repeat_loop = 89 , YYSYMBOL_foreach_loop = 90 ,
  YYSYMBOL_aff_func = 91 , YYSYMBOL_rep = 92 , YYSYMBOL_string = 93 , YYSYMBOL_inc = 94 ,
  YYSYMBOL_func_call = 95 , YYSYMBOL_arg_list = 96 , YYSYMBOL_arg_list_1 = 97 , YYSYMBOL_arg = 98 ,
  YYSYMBOL_aff = 99 , YYSYMBOL_lvalue = 100 , YYSYMBOL_identifier = 101 , YYSYMBOL_array_elem = 102 ,
  YYSYMBOL_array_index = 103 , YYSYMBOL_post_pre_incr = 104 , YYSYMBOL_expr = 105 , YYSYMBOL_const_array = 106 ,
  YYSYMBOL_list_array_data = 107 , YYSYMBOL_array_data = 108 , YYSYMBOL_atom = 109 , YYSYMBOL_simple_array_data = 110 ,
  YYSYMBOL_var = 111 , YYSYMBOL_var_name = 112 , YYSYMBOL_ipaddr = 113 , YYSYMBOL_loc = 114 ,
  YYSYMBOL_glob = 115
}
enum  { YYENOMEM = -2 }
enum  lex_state {
  ST_START = 0 , ST_SPACE , ST_IDENT , ST_ZERO ,
  ST_ZEROX , ST_OCT , ST_DEC , ST_HEX ,
  ST_COMMENT , ST_SUP , ST_INF , ST_SUP_EXCL ,
  ST_STRING1 , ST_STRING1_ESC , ST_STRING2 , ST_PLUS ,
  ST_MINUS , ST_MULT , ST_DIV , ST_MODULO ,
  ST_R_SHIFT , ST_R_USHIFT , ST_L_SHIFT , ST_NOT ,
  ST_EQ , ST_AND , ST_OR
}

Functions

static void naslerror (naslctxt *, int *, const char *)
static int nasllex (YYSTYPE *lvalp, void *parm, int *err_c)
void * malloc (YYSIZE_T)
void free (void *)
static const char * yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, naslctxt *parm, int *err_c)
static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, naslctxt *parm, int *err_c)
static void yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
static void yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, naslctxt *parm, int *err_c)
static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, naslctxt *parm, int *err_c)
int yyparse (naslctxt *parm, int *err_c)
int add_nasl_inc_dir (const char *dir)
 Adds the given string as directory for searching for includes.
static void load_checksums (kb_t kb)
static char * file_checksum (const char *filename, int algorithm)
 Get the checksum of a file.
static const char * remove_base (const char *path)
static char * fullname_based_on_parent (const char *path, const char *filename)
int init_nasl_ctx (naslctxt *pc, const char *parent, const char *name)
 Initialize a NASL context for a NASL file.
void nasl_clean_ctx (naslctxt *c)
void nasl_clean_inc (void)
int nasl_get_include_order (const char *c)
static int mylex (YYSTYPE *lvalp, void *parm)

Variables

static char * parse_buffer = NULL
static int parse_len = 0
static int include_order = 0
GHashTable * includes_hash = NULL
static const yytype_int8 yytranslate []
static const yytype_int16 yyrline []
static const char *const yytname []
static const yytype_int16 yypact []
static const yytype_int8 yydefact []
static const yytype_int16 yypgoto []
static const yytype_uint8 yydefgoto []
static const yytype_int16 yytable []
static const yytype_int16 yycheck []
static const yytype_int8 yystos []
static const yytype_int8 yyr1 []
static const yytype_int8 yyr2 []
int yydebug
static GSList * inc_dirs = NULL
static int checksum_algorithm = GCRY_MD_NONE

Macro Definition Documentation

◆ ERRC

#define ERRC   err_c

Definition at line 85 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "lib nasl"

GLib logging domain.

Definition at line 107 of file nasl_grammar.tab.c.

◆ LN

#define LN   (((naslctxt*)parm)->name)

Definition at line 84 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ LNB

#define LNB   (((naslctxt*)parm)->line_nb)

Definition at line 83 of file nasl_grammar.tab.c.

Referenced by naslerror(), and yyparse().

◆ YY_

#define YY_ ( Msgid)
Value:
Msgid

Definition at line 399 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YY_ACCESSING_SYMBOL

#define YY_ACCESSING_SYMBOL ( State)
Value:
yysymbol_kind_t
#define YY_CAST(Type, Val)
static const yytype_int8 yystos[]

Accessing symbol of state STATE.

Definition at line 677 of file nasl_grammar.tab.c.

Referenced by yy_reduce_print(), and yyparse().

◆ YY_ASSERT

#define YY_ASSERT ( E)
Value:
((void) (0 && (E)))

Definition at line 465 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE

Definition at line 408 of file nasl_grammar.tab.c.

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED

Definition at line 416 of file nasl_grammar.tab.c.

◆ YY_CAST

#define YY_CAST ( Type,
Val )
Value:
((Type) (Val))

Definition at line 127 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

Definition at line 445 of file nasl_grammar.tab.c.

Referenced by yy_symbol_value_print(), yydestruct(), and yyparse().

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Definition at line 446 of file nasl_grammar.tab.c.

Referenced by yy_symbol_value_print(), yydestruct(), and yyparse().

◆ YY_IGNORE_USELESS_CAST_BEGIN

#define YY_IGNORE_USELESS_CAST_BEGIN

Definition at line 460 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YY_IGNORE_USELESS_CAST_END

#define YY_IGNORE_USELESS_CAST_END

Definition at line 461 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE ( Value)
Value:
Value

Definition at line 442 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YY_NULLPTR

#define YY_NULLPTR   ((void*)0)

Definition at line 139 of file nasl_grammar.tab.c.

◆ YY_REDUCE_PRINT

#define YY_REDUCE_PRINT ( Rule)
Value:
do { \
if (yydebug) \
yy_reduce_print (yyssp, yyvsp, Rule, parm, err_c); \
} while (0)
#define yydebug

Definition at line 1230 of file nasl_grammar.tab.c.

1230# define YY_REDUCE_PRINT(Rule) \
1231do { \
1232 if (yydebug) \
1233 yy_reduce_print (yyssp, yyvsp, Rule, parm, err_c); \
1234} while (0)

Referenced by yyparse().

◆ YY_REINTERPRET_CAST

#define YY_REINTERPRET_CAST ( Type,
Val )
Value:
((Type) (Val))

Definition at line 128 of file nasl_grammar.tab.c.

◆ YY_STACK_PRINT

#define YY_STACK_PRINT ( Bottom,
Top )
Value:
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
} while (0)

Definition at line 1199 of file nasl_grammar.tab.c.

1199# define YY_STACK_PRINT(Bottom, Top) \
1200do { \
1201 if (yydebug) \
1202 yy_stack_print ((Bottom), (Top)); \
1203} while (0)

Referenced by yyparse().

◆ YY_SYMBOL_PRINT

#define YY_SYMBOL_PRINT ( Title,
Kind,
Value,
Location )
Value:
do { \
if (yydebug) \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
Kind, Value, parm, err_c); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)

Definition at line 1135 of file nasl_grammar.tab.c.

1135# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1136do { \
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)

Referenced by yydestruct(), and yyparse().

◆ YY_USE

#define YY_USE ( E)
Value:
((void) (E))

Definition at line 422 of file nasl_grammar.tab.c.

Referenced by yy_symbol_value_print(), and yydestruct().

◆ YYABORT

#define YYABORT   goto yyabortlab

Definition at line 1089 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 1088 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYBACKUP

#define YYBACKUP ( Token,
Value )
Value:
do \
if (yychar == YYEMPTY) \
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (parm, err_c, YY_("syntax error: cannot back up")); \
} \
while (0)
#define YY_(Msgid)
#define YYERROR
@ YYEMPTY

Definition at line 1096 of file nasl_grammar.tab.c.

1096#define YYBACKUP(Token, Value) \
1097 do \
1098 if (yychar == YYEMPTY) \
1099 { \
1100 yychar = (Token); \
1101 yylval = (Value); \
1102 YYPOPSTACK (yylen); \
1103 yystate = *yyssp; \
1104 goto yybackup; \
1105 } \
1106 else \
1107 { \
1108 yyerror (parm, err_c, YY_("syntax error: cannot back up")); \
1109 YYERROR; \
1110 } \
1111 while (0)

◆ YYBISON

#define YYBISON   30802

Definition at line 49 of file nasl_grammar.tab.c.

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.8.2"

Definition at line 52 of file nasl_grammar.tab.c.

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

Definition at line 1086 of file nasl_grammar.tab.c.

◆ YYCOPY

#define YYCOPY ( Dst,
Src,
Count )
Value:
do \
{ \
YYPTRDIFF_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
while (0)
#define YYPTRDIFF_T

Definition at line 582 of file nasl_grammar.tab.c.

582# define YYCOPY(Dst, Src, Count) \
583 do \
584 { \
585 YYPTRDIFF_T yyi; \
586 for (yyi = 0; yyi < (Count); yyi++) \
587 (Dst)[yyi] = (Src)[yyi]; \
588 } \
589 while (0)

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

Definition at line 554 of file nasl_grammar.tab.c.

◆ yydebug

#define yydebug   nasldebug

Definition at line 71 of file nasl_grammar.tab.c.

◆ YYDPRINTF

#define YYDPRINTF ( Args)
Value:
do { \
if (yydebug) \
YYFPRINTF Args; \
} while (0)
#define YYFPRINTF

Definition at line 1126 of file nasl_grammar.tab.c.

1126# define YYDPRINTF(Args) \
1127do { \
1128 if (yydebug) \
1129 YYFPRINTF Args; \
1130} while (0)

Referenced by yyparse().

◆ YYERRCODE

#define YYERRCODE   YYUNDEF

Definition at line 1115 of file nasl_grammar.tab.c.

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

Definition at line 1085 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYERROR

#define YYERROR   goto yyerrorlab

Definition at line 1090 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ yyerror

#define yyerror   naslerror

Definition at line 70 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYERROR_VERBOSE

#define YYERROR_VERBOSE

Definition at line 118 of file nasl_grammar.tab.c.

◆ YYFINAL

#define YYFINAL   80

Definition at line 595 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYFPRINTF

#define YYFPRINTF   fprintf

Definition at line 1123 of file nasl_grammar.tab.c.

Referenced by yy_reduce_print(), yy_stack_print(), and yy_symbol_print().

◆ YYFREE

#define YYFREE   free

Definition at line 526 of file nasl_grammar.tab.c.

◆ YYINITDEPTH

#define YYINITDEPTH   200

Definition at line 1249 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYLAST

#define YYLAST   1009

Definition at line 597 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ yylex

#define yylex   nasllex

Definition at line 69 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYLEX_ERRC

#define YYLEX_ERRC   err_c

Definition at line 81 of file nasl_grammar.tab.c.

◆ YYLEX_PARAM

#define YYLEX_PARAM   parm

Definition at line 79 of file nasl_grammar.tab.c.

◆ YYMALLOC

#define YYMALLOC   malloc

Definition at line 520 of file nasl_grammar.tab.c.

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

Definition at line 1260 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYMAXUTOK

#define YYMAXUTOK   304

Definition at line 609 of file nasl_grammar.tab.c.

◆ yynerrs

#define yynerrs   naslnerrs

Definition at line 72 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYNNTS

#define YYNNTS   43

Definition at line 602 of file nasl_grammar.tab.c.

◆ YYNOMEM

#define YYNOMEM   goto yyexhaustedlab

Definition at line 1091 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYNRULES

#define YYNRULES   127

Definition at line 604 of file nasl_grammar.tab.c.

◆ YYNSTATES

#define YYNSTATES   229

Definition at line 606 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYNTOKENS

#define YYNTOKENS   73

Definition at line 600 of file nasl_grammar.tab.c.

Referenced by yy_symbol_print(), and yyparse().

◆ YYPACT_NINF

#define YYPACT_NINF   (-77)

Definition at line 715 of file nasl_grammar.tab.c.

◆ yypact_value_is_default

#define yypact_value_is_default ( Yyn)
Value:
((Yyn) == YYPACT_NINF)
#define YYPACT_NINF

Definition at line 717 of file nasl_grammar.tab.c.

717#define yypact_value_is_default(Yyn) \
718 ((Yyn) == YYPACT_NINF)

Referenced by yyparse().

◆ yyparse

#define yyparse   naslparse

Definition at line 68 of file nasl_grammar.tab.c.

◆ YYPARSE_ERRC

#define YYPARSE_ERRC   err_c

Definition at line 80 of file nasl_grammar.tab.c.

◆ YYPARSE_PARAM

#define YYPARSE_PARAM   parm

Definition at line 78 of file nasl_grammar.tab.c.

◆ YYPOPSTACK

#define YYPOPSTACK ( N)
Value:
(yyvsp -= (N), yyssp -= (N))

Referenced by yyparse().

◆ YYPTRDIFF_MAXIMUM

#define YYPTRDIFF_MAXIMUM   LONG_MAX

Definition at line 359 of file nasl_grammar.tab.c.

◆ YYPTRDIFF_T

#define YYPTRDIFF_T   long

Definition at line 358 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYPULL

#define YYPULL   1

Definition at line 64 of file nasl_grammar.tab.c.

◆ YYPURE

#define YYPURE   1

Definition at line 58 of file nasl_grammar.tab.c.

◆ YYPUSH

#define YYPUSH   0

Definition at line 61 of file nasl_grammar.tab.c.

◆ YYRECOVERING

#define YYRECOVERING ( )
Value:
(!!yyerrstatus)

Definition at line 1094 of file nasl_grammar.tab.c.

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM
Value:
: YY_CAST (YYSIZE_T, -1)))
#define YYPTRDIFF_MAXIMUM
#define YYSIZE_T

Definition at line 376 of file nasl_grammar.tab.c.

376#define YYSIZE_MAXIMUM \
377 YY_CAST (YYPTRDIFF_T, \
378 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
379 ? YYPTRDIFF_MAXIMUM \
380 : YY_CAST (YYSIZE_T, -1)))

◆ YYSIZE_T

#define YYSIZE_T   unsigned

Definition at line 372 of file nasl_grammar.tab.c.

Referenced by malloc(), and yyparse().

◆ YYSIZEOF

#define YYSIZEOF ( X)
Value:
YY_CAST (YYPTRDIFF_T, sizeof (X))

Definition at line 382 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

Definition at line 55 of file nasl_grammar.tab.c.

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 506 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 509 of file nasl_grammar.tab.c.

◆ YYSTACK_BYTES

#define YYSTACK_BYTES ( N)
Value:
yytype_uint8 yy_state_t
#define YYSIZEOF(X)
#define YYSTACK_GAP_MAXIMUM

Definition at line 550 of file nasl_grammar.tab.c.

550# define YYSTACK_BYTES(N) \
551 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
552 + YYSTACK_GAP_MAXIMUM)

Referenced by yyparse().

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

Definition at line 507 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ YYSTACK_GAP_MAXIMUM

#define YYSTACK_GAP_MAXIMUM   (YYSIZEOF (union yyalloc) - 1)

Definition at line 546 of file nasl_grammar.tab.c.

◆ YYSTACK_RELOCATE

#define YYSTACK_RELOCATE ( Stack_alloc,
Stack )
Value:
do \
{ \
YYPTRDIFF_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / YYSIZEOF (*yyptr); \
} \
while (0)

Definition at line 561 of file nasl_grammar.tab.c.

561# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
562 do \
563 { \
564 YYPTRDIFF_T yynewbytes; \
565 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
566 Stack = &yyptr->Stack_alloc; \
567 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
568 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
569 } \
570 while (0)

Referenced by yyparse().

◆ YYTABLE_NINF

#define YYTABLE_NINF   (-70)

Definition at line 720 of file nasl_grammar.tab.c.

◆ yytable_value_is_error

#define yytable_value_is_error ( Yyn)
Value:
((Yyn) == YYTABLE_NINF)
#define YYTABLE_NINF

Definition at line 722 of file nasl_grammar.tab.c.

722#define yytable_value_is_error(Yyn) \
723 ((Yyn) == YYTABLE_NINF)

Referenced by yyparse().

◆ YYTRANSLATE

#define YYTRANSLATE ( YYX)
Value:
(0 <= (YYX) && (YYX) <= YYMAXUTOK \
static const yytype_int8 yytranslate[]
@ YYSYMBOL_YYUNDEF
#define YYMAXUTOK

Definition at line 614 of file nasl_grammar.tab.c.

614#define YYTRANSLATE(YYX) \
615 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
616 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
617 : YYSYMBOL_YYUNDEF)

Referenced by yyparse().

Typedef Documentation

◆ yy_state_fast_t

typedef int yy_state_fast_t

Definition at line 389 of file nasl_grammar.tab.c.

◆ yy_state_t

Definition at line 386 of file nasl_grammar.tab.c.

◆ yysymbol_kind_t

Definition at line 265 of file nasl_grammar.tab.c.

◆ yytype_int16

typedef short yytype_int16

Definition at line 310 of file nasl_grammar.tab.c.

◆ yytype_int8

typedef signed char yytype_int8

Definition at line 302 of file nasl_grammar.tab.c.

◆ yytype_uint16

typedef unsigned short yytype_uint16

Definition at line 342 of file nasl_grammar.tab.c.

◆ yytype_uint8

typedef unsigned char yytype_uint8

Definition at line 331 of file nasl_grammar.tab.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
YYENOMEM 

Definition at line 1083 of file nasl_grammar.tab.c.

1083{ YYENOMEM = -2 };
@ YYENOMEM

◆ lex_state

enum lex_state
Enumerator
ST_START 
ST_SPACE 
ST_IDENT 
ST_ZERO 
ST_ZEROX 
ST_OCT 
ST_DEC 
ST_HEX 
ST_COMMENT 
ST_SUP 
ST_INF 
ST_SUP_EXCL 
ST_STRING1 
ST_STRING1_ESC 
ST_STRING2 
ST_PLUS 
ST_MINUS 
ST_MULT 
ST_DIV 
ST_MODULO 
ST_R_SHIFT 
ST_R_USHIFT 
ST_L_SHIFT 
ST_NOT 
ST_EQ 
ST_AND 
ST_OR 

Definition at line 2879 of file nasl_grammar.tab.c.

2879 {
2880 ST_START = 0,
2881 ST_SPACE,
2882 ST_IDENT,
2883 ST_ZERO,
2884 ST_ZEROX,
2885 ST_OCT,
2886 ST_DEC,
2887 ST_HEX,
2888 ST_COMMENT,
2889 ST_SUP,
2890 ST_INF,
2892 ST_STRING1,
2894 ST_STRING2,
2895 ST_PLUS,
2896 ST_MINUS,
2897 ST_MULT,
2898 ST_DIV,
2899 ST_MODULO,
2900 ST_R_SHIFT,
2902 ST_L_SHIFT,
2903 ST_NOT,
2904 ST_EQ,
2905 ST_AND,
2906 ST_OR };
@ ST_ZERO
@ ST_MINUS
@ ST_STRING2
@ ST_L_SHIFT
@ ST_ZEROX
@ ST_STRING1
@ ST_IDENT
@ ST_MODULO
@ ST_R_SHIFT
@ ST_MULT
@ ST_SPACE
@ ST_PLUS
@ ST_SUP_EXCL
@ ST_COMMENT
@ ST_STRING1_ESC
@ ST_R_USHIFT
@ ST_START

◆ yysymbol_kind_t

Enumerator
YYSYMBOL_YYEMPTY 
YYSYMBOL_YYEOF 
YYSYMBOL_YYerror 
YYSYMBOL_YYUNDEF 
YYSYMBOL_IF 
YYSYMBOL_ELSE 
YYSYMBOL_EQ 
YYSYMBOL_NEQ 
YYSYMBOL_SUPEQ 
YYSYMBOL_INFEQ 
YYSYMBOL_OR 
YYSYMBOL_AND 
YYSYMBOL_MATCH 
YYSYMBOL_NOMATCH 
YYSYMBOL_REP 
YYSYMBOL_FOR 
YYSYMBOL_REPEAT 
YYSYMBOL_UNTIL 
YYSYMBOL_FOREACH 
YYSYMBOL_WHILE 
YYSYMBOL_BREAK 
YYSYMBOL_CONTINUE 
YYSYMBOL_FUNCTION 
YYSYMBOL_RETURN 
YYSYMBOL_INCLUDE 
YYSYMBOL_LOCAL 
YYSYMBOL_GLOBAL 
YYSYMBOL_PLUS_PLUS 
YYSYMBOL_MINUS_MINUS 
YYSYMBOL_L_SHIFT 
YYSYMBOL_R_SHIFT 
YYSYMBOL_R_USHIFT 
YYSYMBOL_EXPO 
YYSYMBOL_PLUS_EQ 
YYSYMBOL_MINUS_EQ 
YYSYMBOL_MULT_EQ 
YYSYMBOL_DIV_EQ 
YYSYMBOL_MODULO_EQ 
YYSYMBOL_L_SHIFT_EQ 
YYSYMBOL_R_SHIFT_EQ 
YYSYMBOL_R_USHIFT_EQ 
YYSYMBOL_RE_MATCH 
YYSYMBOL_RE_NOMATCH 
YYSYMBOL_ARROW 
YYSYMBOL_IDENT 
YYSYMBOL_STRING1 
YYSYMBOL_STRING2 
YYSYMBOL_INTEGER 
YYSYMBOL_47_ 
YYSYMBOL_48_ 
YYSYMBOL_49_ 
YYSYMBOL_50_ 
YYSYMBOL_51_ 
YYSYMBOL_52_ 
YYSYMBOL_53_ 
YYSYMBOL_54_ 
YYSYMBOL_55_ 
YYSYMBOL_56_ 
YYSYMBOL_57_ 
YYSYMBOL_NOT 
YYSYMBOL_UMINUS 
YYSYMBOL_BIT_NOT 
YYSYMBOL_61_ 
YYSYMBOL_62_ 
YYSYMBOL_63_ 
YYSYMBOL_64_ 
YYSYMBOL_65_ 
YYSYMBOL_66_ 
YYSYMBOL_67_ 
YYSYMBOL_68_ 
YYSYMBOL_69_ 
YYSYMBOL_70_ 
YYSYMBOL_71_ 
YYSYMBOL_72_ 
YYSYMBOL_YYACCEPT 
YYSYMBOL_tiptop 
YYSYMBOL_instr_decl_list 
YYSYMBOL_instr_decl 
YYSYMBOL_func_decl 
YYSYMBOL_arg_decl 
YYSYMBOL_arg_decl_1 
YYSYMBOL_block 
YYSYMBOL_instr_list 
YYSYMBOL_instr 
YYSYMBOL_simple_instr 
YYSYMBOL_ret 
YYSYMBOL_if_block 
YYSYMBOL_loop 
YYSYMBOL_for_loop 
YYSYMBOL_while_loop 
YYSYMBOL_repeat_loop 
YYSYMBOL_foreach_loop 
YYSYMBOL_aff_func 
YYSYMBOL_rep 
YYSYMBOL_string 
YYSYMBOL_inc 
YYSYMBOL_func_call 
YYSYMBOL_arg_list 
YYSYMBOL_arg_list_1 
YYSYMBOL_arg 
YYSYMBOL_aff 
YYSYMBOL_lvalue 
YYSYMBOL_identifier 
YYSYMBOL_array_elem 
YYSYMBOL_array_index 
YYSYMBOL_post_pre_incr 
YYSYMBOL_expr 
YYSYMBOL_const_array 
YYSYMBOL_list_array_data 
YYSYMBOL_array_data 
YYSYMBOL_atom 
YYSYMBOL_simple_array_data 
YYSYMBOL_var 
YYSYMBOL_var_name 
YYSYMBOL_ipaddr 
YYSYMBOL_loc 
YYSYMBOL_glob 

Definition at line 145 of file nasl_grammar.tab.c.

146{
147 YYSYMBOL_YYEMPTY = -2,
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};
@ YYSYMBOL_repeat_loop
@ YYSYMBOL_68_
@ YYSYMBOL_UMINUS
@ YYSYMBOL_INCLUDE
@ YYSYMBOL_MINUS_MINUS
@ YYSYMBOL_const_array
@ YYSYMBOL_71_
@ YYSYMBOL_52_
@ YYSYMBOL_47_
@ YYSYMBOL_53_
@ YYSYMBOL_EQ
@ YYSYMBOL_UNTIL
@ YYSYMBOL_50_
@ YYSYMBOL_array_index
@ YYSYMBOL_IF
@ YYSYMBOL_for_loop
@ YYSYMBOL_loc
@ YYSYMBOL_func_decl
@ YYSYMBOL_instr
@ YYSYMBOL_LOCAL
@ YYSYMBOL_arg_list_1
@ YYSYMBOL_YYerror
@ YYSYMBOL_loop
@ YYSYMBOL_BREAK
@ YYSYMBOL_var_name
@ YYSYMBOL_65_
@ YYSYMBOL_REPEAT
@ YYSYMBOL_49_
@ YYSYMBOL_foreach_loop
@ YYSYMBOL_glob
@ YYSYMBOL_expr
@ YYSYMBOL_STRING1
@ YYSYMBOL_simple_instr
@ YYSYMBOL_63_
@ YYSYMBOL_AND
@ YYSYMBOL_51_
@ YYSYMBOL_instr_decl
@ YYSYMBOL_while_loop
@ YYSYMBOL_ARROW
@ YYSYMBOL_L_SHIFT
@ YYSYMBOL_inc
@ YYSYMBOL_NOMATCH
@ YYSYMBOL_55_
@ YYSYMBOL_FOREACH
@ YYSYMBOL_NEQ
@ YYSYMBOL_48_
@ YYSYMBOL_string
@ YYSYMBOL_67_
@ YYSYMBOL_identifier
@ YYSYMBOL_ELSE
@ YYSYMBOL_instr_decl_list
@ YYSYMBOL_R_USHIFT_EQ
@ YYSYMBOL_arg_decl_1
@ YYSYMBOL_array_data
@ YYSYMBOL_atom
@ YYSYMBOL_61_
@ YYSYMBOL_CONTINUE
@ YYSYMBOL_lvalue
@ YYSYMBOL_RE_NOMATCH
@ YYSYMBOL_BIT_NOT
@ YYSYMBOL_INFEQ
@ YYSYMBOL_instr_list
@ YYSYMBOL_64_
@ YYSYMBOL_WHILE
@ YYSYMBOL_70_
@ YYSYMBOL_54_
@ YYSYMBOL_L_SHIFT_EQ
@ YYSYMBOL_arg
@ YYSYMBOL_SUPEQ
@ YYSYMBOL_arg_list
@ YYSYMBOL_EXPO
@ YYSYMBOL_MINUS_EQ
@ YYSYMBOL_block
@ YYSYMBOL_array_elem
@ YYSYMBOL_56_
@ YYSYMBOL_if_block
@ YYSYMBOL_YYACCEPT
@ YYSYMBOL_57_
@ YYSYMBOL_MATCH
@ YYSYMBOL_OR
@ YYSYMBOL_rep
@ YYSYMBOL_R_SHIFT_EQ
@ YYSYMBOL_MODULO_EQ
@ YYSYMBOL_YYEOF
@ YYSYMBOL_GLOBAL
@ YYSYMBOL_FUNCTION
@ YYSYMBOL_func_call
@ YYSYMBOL_62_
@ YYSYMBOL_STRING2
@ YYSYMBOL_ret
@ YYSYMBOL_R_SHIFT
@ YYSYMBOL_tiptop
@ YYSYMBOL_aff_func
@ YYSYMBOL_MULT_EQ
@ YYSYMBOL_simple_array_data
@ YYSYMBOL_INTEGER
@ YYSYMBOL_ipaddr
@ YYSYMBOL_var
@ YYSYMBOL_list_array_data
@ YYSYMBOL_YYEMPTY
@ YYSYMBOL_aff
@ YYSYMBOL_72_
@ YYSYMBOL_69_
@ YYSYMBOL_RETURN
@ YYSYMBOL_66_
@ YYSYMBOL_IDENT
@ YYSYMBOL_DIV_EQ
@ YYSYMBOL_REP
@ YYSYMBOL_PLUS_EQ
@ YYSYMBOL_PLUS_PLUS
@ YYSYMBOL_FOR
@ YYSYMBOL_NOT
@ YYSYMBOL_R_USHIFT
@ YYSYMBOL_post_pre_incr
@ YYSYMBOL_arg_decl
@ YYSYMBOL_RE_MATCH

Function Documentation

◆ add_nasl_inc_dir()

int add_nasl_inc_dir ( const char * dir)

Adds the given string as directory for searching for includes.

Parameters
dirA directory path. This function will add a copy of this parameter to the list of include folders. This means the parameter can be freed elsewhere without affecting the list.
Returns
0 in case of success. -1 if the stat on the given directory path was unsuccessful. -2 if the given directory path was not a directory.

Definition at line 2536 of file nasl_grammar.tab.c.

2537{
2538 if (dir == NULL)
2539 {
2540 return 0;
2541 }
2542
2543 // Allow initialization with empty element
2544 if (*dir == '\0')
2545 {
2546 inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2547 return 0;
2548 }
2549
2550 struct stat stat_buf;
2551
2552 if (stat (dir, &stat_buf) != 0)
2553 return -1;
2554
2555 if (S_ISDIR(stat_buf.st_mode) != 0)
2556 {
2557 inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2558 return 0;
2559 }
2560 else
2561 return -2;
2562}
static GSList * inc_dirs

References inc_dirs.

Referenced by include_dirs(), init_nasl_ctx(), and main().

Here is the caller graph for this function:

◆ file_checksum()

char * file_checksum ( const char * filename,
int algorithm )
static

Get the checksum of a file.

Parameters
[in]filenamePath to file.
[in]algorithmLibgcrypt hash algorithm to use for generating the checksum.
Returns
checksum string, NULL otherwise.

Definition at line 2642 of file nasl_grammar.tab.c.

2643{
2644 char *content = NULL, digest[128], *result;
2645 size_t len = 0, i, alglen;
2646
2647 assert (algorithm == GCRY_MD_SHA256);
2648 if (!filename || !g_file_get_contents (filename, &content, &len, NULL))
2649 return NULL;
2650
2651 gcry_md_hash_buffer (algorithm, digest, content, len);
2652 alglen = gcry_md_get_algo_dlen (algorithm);
2653 result = g_malloc0 (alglen * 2 + 1);
2654 for (i = 0; i < alglen; i++)
2655 snprintf (result + 2 * i, 3, "%02x", (unsigned char) digest[i]);
2656 g_free (content);
2657
2658 return result;
2659}
uint8_t len

References len.

Referenced by init_nasl_ctx().

Here is the caller graph for this function:

◆ free()

◆ fullname_based_on_parent()

char * fullname_based_on_parent ( const char * path,
const char * filename )
static

Definition at line 2675 of file nasl_grammar.tab.c.

2676{
2677 const char *slash = strrchr(path, '/');
2678 size_t dir_len, total_len;
2679 size_t file_len = strlen(filename);
2680 char *result;
2681
2682 if (slash) {
2683 dir_len = (slash - path) + 1;
2684 } else {
2685 return NULL;
2686 }
2687
2688 if (file_len > 0 && filename[0] == '/') {
2689 filename++;
2690 file_len--;
2691 }
2692
2693 total_len = dir_len + file_len;
2694
2695 result = malloc(total_len + 1);
2696 if (!result) {
2697 return NULL;
2698 }
2699
2700 memcpy(result, path, dir_len);
2701 memcpy(result + dir_len, filename, file_len);
2702 result[total_len] = '\0';
2703
2704 return result;
2705}
void * malloc(YYSIZE_T)

References malloc().

Referenced by init_nasl_ctx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_nasl_ctx()

int init_nasl_ctx ( naslctxt * pc,
const char * parent,
const char * name )

Initialize a NASL context for a NASL file.

Parameters
pcThe NASL context handler.
nameThe filename of the NASL script.
Returns
0 in case of success. Then, file content is set in pc->buffer. -1 if either the filename was not found/accessible or the signature verification failed (provided signature checking is enabled. In any case, various elements of pc are modified (initialized);

Definition at line 2723 of file nasl_grammar.tab.c.

2724{
2725 char *full_name = NULL, key_path[2048], *checksum;
2726 const char *filename;
2727 GSList * inc_dir = inc_dirs; // iterator for include directories
2728 size_t flen = 0;
2729 time_t timestamp;
2730
2731 // initialize if not yet done (for openvas-server < 2.0.1)
2732 if (! inc_dirs) add_nasl_inc_dir("");
2733
2734 pc->line_nb = 1;
2735 pc->name = (char *) name;
2737 pc->tree = NULL;
2738 if (!parse_len)
2739 {
2740 parse_len = 9092;
2741 parse_buffer = g_malloc0 (parse_len);
2742 }
2743 else
2744 parse_buffer[0] = '\0';
2745
2746
2748 while (inc_dir != NULL) {
2749 if (full_name)
2750 g_free (full_name);
2751 full_name = g_build_filename(inc_dir->data, name, NULL);
2752
2753 if ((g_file_get_contents (full_name, &pc->buffer, &flen, NULL)))
2754 break;
2755
2756 inc_dir = g_slist_next(inc_dir);
2757 }
2758
2759
2760verify:
2761 if (!full_name || !pc->buffer) {
2762 g_message ("%s: Not able to open nor to locate it in include paths",
2763 name);
2764 g_free(full_name);
2765 return -1;
2766 }
2767
2768 if (pc->always_signed)
2769 {
2770 g_free(full_name);
2771 return 0;
2772 }
2773 /* Cache the checksum of signature verified files, so that commonly included
2774 * files are not verified multiple times per scan. */
2775 // filename should be always without base as we store everything as defined in sha256sums
2776 filename = remove_base(full_name);
2777
2778
2779 snprintf (key_path, sizeof (key_path), "signaturecheck:%s", filename);
2780 timestamp = kb_item_get_int (pc->kb, key_path);
2781
2782 /* We never use the mtime of a .nasl/.inc file as integrity check during
2783 * the script load up. A complete verification is done in this case.
2784 * Once it has been uploaded in the nvticache it is enough to just check
2785 * the mtime. */
2786 if (timestamp > 0 && pc->exec_descr == 0)
2787 {
2788 struct stat file_stat;
2789
2790 if (stat (full_name, &file_stat) >= 0 && timestamp > file_stat.st_mtime)
2791 {
2792 /* Already checked. No need to check again. */
2793 g_free (full_name);
2794 return 0;
2795 }
2796 }
2797
2798 load_checksums (pc->kb);
2799 if (checksum_algorithm == GCRY_MD_NONE)
2800 return -1;
2801 else if (checksum_algorithm == GCRY_MD_SHA256)
2802 snprintf (key_path, sizeof (key_path), "sha256sums:%s", filename);
2803 else
2804 abort ();
2805 checksum = kb_item_get_str (pc->kb, key_path);
2806 if (!checksum)
2807 {
2808 // try one more time, but set the parent dir as a base
2809 // this can happen when shorthand includes are used for an example:
2810 // in a nasl file of a/test.nasl -> include("test.inc")
2811 // to include a/test.inc instead of writing include("a/test.inc");
2812 if (parent == NULL) {
2813 g_warning ("No checksum for %s (%s)", full_name, filename);
2814 g_free(full_name);
2815 return -1;
2816 }
2817 g_free(full_name);
2818 full_name = fullname_based_on_parent(parent, name);
2819 parent = NULL;
2820 goto verify;
2821 }
2822 else
2823 {
2824 int ret;
2825 char *check = file_checksum (full_name, checksum_algorithm);
2826
2827 snprintf (key_path, sizeof (key_path), "signaturecheck:%s", filename);
2828 ret = strcmp (check, checksum);
2829 if (ret)
2830 {
2831 kb_del_items (pc->kb, key_path);
2832 g_warning ("checksum for %s not matching (%s)", full_name, key_path);
2833 }
2834 else
2835 {
2836 kb_del_items (pc->kb, key_path);
2837 kb_item_add_int (pc->kb, key_path, time (NULL));
2838 }
2839
2840 g_free (full_name);
2841 g_free (checksum);
2842 g_free (check);
2843 return ret;
2844 }
2845}
void nasl_set_filename(const char *filename)
Definition nasl_debug.c:82
static char * file_checksum(const char *filename, int algorithm)
Get the checksum of a file.
static int checksum_algorithm
static char * parse_buffer
static char * fullname_based_on_parent(const char *path, const char *filename)
static const char * remove_base(const char *path)
static int parse_len
int add_nasl_inc_dir(const char *dir)
Adds the given string as directory for searching for includes.
static int include_order
static void load_checksums(kb_t kb)
const char * name
Definition nasl_init.c:440
unsigned int include_order
tree_cell * tree

References add_nasl_inc_dir(), naslctxt::always_signed, naslctxt::buffer, checksum_algorithm, naslctxt::exec_descr, file_checksum(), fullname_based_on_parent(), inc_dirs, include_order, naslctxt::include_order, naslctxt::kb, naslctxt::line_nb, load_checksums(), name, naslctxt::name, nasl_set_filename(), parse_buffer, parse_len, remove_base(), and naslctxt::tree.

Referenced by exec_nasl_script(), and yyparse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_checksums()

void load_checksums ( kb_t kb)
static

Definition at line 2567 of file nasl_grammar.tab.c.

2568{
2569 static int loaded = 0;
2570 const char *base, *prefix;
2571 char filename[2048], *fbuffer;
2572 FILE *file;
2573 size_t flen;
2574
2575 if (loaded)
2576 return;
2577 loaded = 1;
2578 base = prefs_get ("plugins_folder");
2579 snprintf (filename, sizeof (filename), "%s/sha256sums", base);
2580 if (g_file_get_contents (filename, &fbuffer, &flen, NULL))
2581 checksum_algorithm = GCRY_MD_SHA256;
2582 if (checksum_algorithm == GCRY_MD_NONE)
2583 {
2584 g_warning ("No plugins checksums file");
2585 return;
2586 }
2587 /* Verify checksum */
2588 if (nasl_verify_signature (filename, fbuffer, flen) != 0)
2589 {
2590 g_warning ("Erroneous or missing signature for checksums file %s",
2591 filename);
2592 g_free (fbuffer);
2593 return;
2594 }
2595 g_free (fbuffer);
2596
2597 /* Insert content into KB */
2598 file = fopen (filename, "r");
2599 if (!file)
2600 {
2601 g_warning ("%s: Couldn't read file %s", __func__, filename);
2602 return;
2603 }
2604 if (checksum_algorithm == GCRY_MD_SHA256)
2605 {
2606 kb_del_items (kb, "sha256sums:*");
2607 prefix = "sha256sums";
2608 }
2609 while (1)
2610 {
2611 char buffer[2048], **splits;
2612 if (!fgets (buffer, sizeof (buffer), file))
2613 break;
2614 if (strstr (buffer, ".asc")
2615 || (!strstr (buffer, ".inc") && !strstr (buffer, ".nasl")))
2616 continue;
2617 splits = g_strsplit (buffer, " ", -1);
2618 if (g_strv_length (splits) != 2)
2619 {
2620 g_warning ("%s: Erroneous checksum entry %s", __func__, buffer);
2621 g_strfreev (splits);
2622 break;
2623 }
2624 splits[1][strlen (splits[1]) - 1] = '\0';
2625
2626 g_snprintf (buffer, sizeof (buffer), "%s:%s", prefix, splits[1]);
2627 kb_item_set_str (kb, buffer, splits[0], 0);
2628 g_strfreev (splits);
2629 }
2630 fclose (file);
2631}
int nasl_verify_signature(const char *filename)
static void prefix(int n, int i)
Definition nasl_tree.c:219

References checksum_algorithm, nasl_verify_signature(), and prefix().

Referenced by init_nasl_ctx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ malloc()

void * malloc ( YYSIZE_T )

◆ mylex()

int mylex ( YYSTYPE * lvalp,
void * parm )
static

Definition at line 2909 of file nasl_grammar.tab.c.

2910{
2911 char *p;
2912 naslctxt *ctx = parm;
2913 int c, st = ST_START, len, r;
2914 long int x, i;
2915
2916 if (!ctx)
2917 return -1;
2918
2919 p = parse_buffer;
2920 len = 0;
2921
2922 while (1)
2923 {
2924 c = ctx->buffer[ctx->index++];
2925 if (c == '\0')
2926 break;
2927 if (c == '\n')
2928 ctx->line_nb ++;
2929
2930 switch(st)
2931 {
2932 case ST_START:
2933 if (c == '#')
2934 st = ST_COMMENT;
2935 else if (isalpha(c) || c == '_')
2936 {
2937 st = ST_IDENT;
2938 *p++ = c;
2939 len ++;
2940 }
2941 else if (isspace(c))
2942 st = ST_SPACE;
2943 else if (c == '0')
2944 st = ST_ZERO;
2945 else if (isdigit(c))
2946 {
2947 st = ST_DEC;
2948 *p++ = c;
2949 len ++;
2950 }
2951 else if (c == '\'')
2952 st = ST_STRING1;
2953 else if (c == '"')
2954 st = ST_STRING2;
2955 else if (c == '+')
2956 st = ST_PLUS;
2957 else if (c == '-')
2958 st = ST_MINUS;
2959 else if (c == '*')
2960 st = ST_MULT;
2961 else if (c == '/')
2962 st = ST_DIV;
2963 else if (c == '%')
2964 st = ST_MODULO;
2965 else if (c == '>')
2966 st = ST_SUP;
2967 else if (c == '<')
2968 st = ST_INF;
2969 else if (c == '=')
2970 st = ST_EQ;
2971 else if (c == '|')
2972 st = ST_OR;
2973 else if (c == '!')
2974 st = ST_NOT;
2975 else if (c == '&')
2976 st = ST_AND;
2977 else
2978 {
2979 return c;
2980 }
2981 break;
2982
2983 case ST_STRING2:
2984 if (c == '"')
2985 goto exit_loop;
2986 *p++ = c;
2987 len ++;
2988 break;
2989
2990 case ST_STRING1:
2991 if (c == '\'')
2992 goto exit_loop;
2993 else if (c == '\\')
2994 {
2995 c = ctx->buffer[ctx->index++];
2996 if (c == '\0')
2997 {
2998 nasl_perror(NULL, "Unfinished string\n");
2999 goto exit_loop; /* parse error? */
3000 }
3001 switch (c)
3002 {
3003 case '\n': /* escaped end of line */
3004 ctx->line_nb ++;
3005 break;
3006 case '\\':
3007 *p++ ='\\'; len ++;
3008 break;
3009 case 'n':
3010 *p++ = '\n'; len++;
3011 break;
3012 case 'f':
3013 *p++ = '\f'; len ++;
3014 break;
3015 case 't':
3016 *p++ = '\t'; len ++;
3017 break;
3018 case 'r':
3019 *p++ = '\r'; len++;
3020 break;
3021 case 'v':
3022 *p++ = '\v'; len ++;
3023 break;
3024 case '"':
3025 *p ++ = '"'; len ++;
3026 break;
3027 /* Not yet, as we do not return the length of the string */
3028 case '0':
3029 *p++ = '\0'; len++;
3030 break;
3031 case '\'':
3032 *p++ = '\''; len++;
3033 break;
3034
3035 case 'x':
3036 x = 0;
3037 for (i = 0; i < 2; i ++)
3038 {
3039 c = ctx->buffer[ctx->index++];
3040 if (c == '\0')
3041 {
3042 nasl_perror(NULL, "Unfinished \\x escape sequence (EOF)\n");
3043 goto exit_loop;
3044 }
3045 if (c == '\n')
3046 ctx->line_nb ++;
3047
3048 c = tolower(c);
3049 if (c >= '0' && c <= '9')
3050 x = x * 16 + (c - '0');
3051 else if (c >= 'a' && c <= 'f')
3052 x = x * 16 + 10 + (c - 'a');
3053 else
3054 {
3055 nasl_perror(NULL, "Unfinished \\x escape sequence\n");
3056 ctx->index--;
3057 if (c == '\n')
3058 ctx->line_nb --;
3059 break;
3060 }
3061 }
3062 *p++ = x; len ++;
3063 break;
3064
3065 default:
3066 nasl_perror(NULL, "Unknown escape sequence \\%c\n", c);
3067 ctx->index--;
3068 goto exit_loop;
3069 }
3070 }
3071 else
3072 {
3073 *p++ = c;
3074 len ++;
3075 }
3076 break;
3077
3078 case ST_IDENT:
3079 if (isalnum(c) || c == '_')
3080 {
3081 st = ST_IDENT;
3082 *p++ = c;
3083 len ++;
3084 }
3085 else
3086 {
3087 ctx->index--;
3088 if (c == '\n')
3089 ctx->line_nb --;
3090 goto exit_loop;
3091 }
3092 break;
3093
3094 case ST_ZERO:
3095 if (c == 'x' || c == 'X')
3096 st = ST_ZEROX;
3097 else if (isdigit(c))
3098 {
3099 if (c <= '7')
3100 st = ST_OCT;
3101 else
3102 st = ST_DEC;
3103 *p ++ = c;
3104 len ++;
3105 }
3106 else
3107 {
3108 ctx->index--;
3109 if (c == '\n')
3110 ctx->line_nb --;
3111 goto exit_loop;
3112 }
3113 break;
3114
3115 case ST_ZEROX:
3116 if (isxdigit(c))
3117 {
3118 st = ST_HEX;
3119 *p++ = c;
3120 len ++;
3121 }
3122 else
3123 {
3124 /* This should be a parse error */
3125 ctx->index--;
3126 if (c == '\n')
3127 ctx->line_nb --;
3128 goto exit_loop;
3129 }
3130 break;
3131
3132 case ST_OCT:
3133 if (c >= '0')
3134 {
3135 if (c <= '7')
3136 {
3137 *p++ = c;
3138 len ++;
3139 break;
3140 }
3141 else if (c <= '9')
3142 {
3143 *p++ = c;
3144 len ++;
3145 st = ST_DEC;
3146 break;
3147 }
3148 }
3149 ctx->index--;
3150 if (c == '\n')
3151 ctx->line_nb --;
3152 goto exit_loop;
3153
3154 case ST_DEC:
3155 if (isdigit(c))
3156 {
3157 *p++ = c;
3158 len ++;
3159 }
3160 else
3161 {
3162 ctx->index--;
3163 if (c == '\n')
3164 ctx->line_nb --;
3165 goto exit_loop;
3166 }
3167 break;
3168
3169 case ST_HEX:
3170 if (isxdigit(c))
3171 {
3172 *p++ = c;
3173 len ++;
3174 }
3175 else
3176 {
3177 ctx->index--;
3178 if (c == '\n')
3179 ctx->line_nb --;
3180 goto exit_loop;
3181 }
3182 break;
3183
3184 case ST_SPACE:
3185 if (! isspace(c))
3186 {
3187 ctx->index--;
3188 if (c == '\n')
3189 ctx->line_nb --;
3190 st = ST_START;
3191 }
3192 break;
3193
3194 case ST_COMMENT:
3195 if (c == '\n')
3196 st = ST_START;
3197 break;
3198
3199 case ST_SUP_EXCL:
3200 if (c == '<')
3201 return NOMATCH;
3202 else
3203 {
3204 ctx->index--;
3205 if (c == '\n')
3206 ctx->line_nb --;
3207 if (! isprint(c)) c = '.';
3208 g_message ("lexer error: invalid token >!%c "
3209 "parsed as >!< %c", c, c);
3210 return NOMATCH;
3211 }
3212 break;
3213
3214 case ST_SUP:
3215 if (c == '=')
3216 return SUPEQ;
3217 else if (c == '<')
3218 return MATCH;
3219 else if (c == '>')
3220 st = ST_R_SHIFT;
3221 else if (c == '!')
3222 st = ST_SUP_EXCL;
3223 else
3224 {
3225 ctx->index--;
3226 if (c == '\n')
3227 ctx->line_nb --;
3228 return '>';
3229 }
3230 break;
3231
3232 case ST_INF:
3233 if (c == '=')
3234 return INFEQ;
3235 else if (c == '<')
3236 st = ST_L_SHIFT;
3237 else
3238 {
3239 ctx->index--;
3240 if (c == '\n')
3241 ctx->line_nb --;
3242 return '<';
3243 }
3244 break;
3245
3246 case ST_R_SHIFT:
3247 if (c == '=')
3248 return R_SHIFT_EQ;
3249 else if (c == '>')
3250 st = ST_R_USHIFT;
3251 else
3252 {
3253 ctx->index--;
3254 if (c == '\n')
3255 ctx->line_nb --;
3256 return R_SHIFT;
3257 }
3258 /*NOTREACHED*/
3259 break;
3260
3261 case ST_R_USHIFT:
3262 if (c == '=')
3263 return R_USHIFT_EQ;
3264 else
3265 {
3266 ctx->index--;
3267 if (c == '\n')
3268 ctx->line_nb --;
3269 return R_USHIFT;
3270 }
3271 /*NOTREACHED*/
3272 break;
3273
3274 case ST_L_SHIFT:
3275 if (c == '=')
3276 return L_SHIFT_EQ;
3277 else
3278 {
3279 ctx->index--;
3280 if (c == '\n')
3281 ctx->line_nb --;
3282 return L_SHIFT;
3283 }
3284 /*NOTREACHED*/
3285 break;
3286
3287 case ST_AND:
3288 if (c == '&')
3289 return AND;
3290 ctx->index--;
3291 if (c == '\n')
3292 ctx->line_nb --;
3293 return '&';
3294
3295 case ST_OR:
3296 if (c == '|')
3297 return OR;
3298 ctx->index--;
3299 if (c == '\n')
3300 ctx->line_nb --;
3301 return '|';
3302
3303 case ST_NOT:
3304 if (c == '=')
3305 return NEQ;
3306 else if (c == '~')
3307 return RE_NOMATCH;
3308 ctx->index--;
3309 if (c == '\n')
3310 ctx->line_nb --;
3311 return '!';
3312
3313 case ST_EQ:
3314 if (c == '=')
3315 return EQ;
3316 else if (c == '~')
3317 return RE_MATCH;
3318 else if (c == '>')
3319 return ARROW;
3320 ctx->index--;
3321 if (c == '\n')
3322 ctx->line_nb --;
3323 return '=';
3324
3325 case ST_PLUS:
3326 if (c == '+')
3327 return PLUS_PLUS;
3328 else if (c == '=')
3329 return PLUS_EQ;
3330
3331 ctx->index--;
3332 if (c == '\n')
3333 ctx->line_nb --;
3334 return '+';
3335
3336 case ST_MINUS:
3337 if (c == '-')
3338 return MINUS_MINUS;
3339 else if (c == '=')
3340 return MINUS_EQ;
3341
3342 ctx->index--;
3343 if (c == '\n')
3344 ctx->line_nb --;
3345 return '-';
3346
3347 case ST_MULT:
3348 if (c == '=')
3349 return MULT_EQ;
3350 else if (c == '*')
3351 return EXPO;
3352 ctx->index--;
3353 if (c == '\n')
3354 ctx->line_nb --;
3355 return '*';
3356
3357 case ST_DIV:
3358 if (c == '=')
3359 return DIV_EQ;
3360
3361 ctx->index--;
3362 if (c == '\n')
3363 ctx->line_nb --;
3364 return '/';
3365
3366 case ST_MODULO:
3367 if (c == '=')
3368 return MODULO_EQ;
3369
3370 ctx->index--;
3371 if (c == '\n')
3372 ctx->line_nb --;
3373 return '%';
3374
3375 }
3376
3377 if (len >= parse_len)
3378 {
3379 int offs = p - parse_buffer;
3380 parse_len += 9092;
3381 parse_buffer = g_realloc (parse_buffer, parse_len);
3382 p = parse_buffer + offs;
3383 }
3384 }
3385
3386 exit_loop:
3387 parse_buffer[len] = '\0';
3388 switch (st)
3389 {
3390 case ST_START:
3391 case ST_COMMENT:
3392 case ST_SPACE:
3393 return 0;
3394
3395 case ST_STRING2:
3396 r = STRING2;
3397 lvalp->str = g_strdup (parse_buffer);
3398 return r;
3399
3400 case ST_STRING1:
3401 r = STRING1;
3402 lvalp->data.val = g_malloc0 (len+2);
3403 memcpy (lvalp->data.val, parse_buffer, len + 1);
3404 lvalp->data.len = len;
3405 return r;
3406
3407 case ST_IDENT:
3408 if (strcmp (parse_buffer, "if") == 0)
3409 r = IF;
3410 else if (strcmp (parse_buffer, "else") == 0)
3411 r = ELSE;
3412 else if (strcmp (parse_buffer, "for") == 0)
3413 r = FOR;
3414 else if (strcmp (parse_buffer, "while") == 0)
3415 r = WHILE;
3416 else if (strcmp (parse_buffer, "repeat") == 0)
3417 r = REPEAT;
3418 else if (strcmp (parse_buffer, "until") == 0)
3419 r = UNTIL;
3420 else if (strcmp (parse_buffer, "foreach") == 0)
3421 r = FOREACH;
3422 else if (strcmp (parse_buffer, "function") == 0)
3423 r = FUNCTION;
3424 else if (strcmp (parse_buffer, "return") == 0)
3425 r = RETURN;
3426 else if (strcmp (parse_buffer, "x") == 0)
3427 r = REP;
3428 else if (strcmp (parse_buffer, "include") == 0)
3429 r = INCLUDE;
3430 else if (strcmp (parse_buffer, "break") == 0)
3431 r = BREAK;
3432 else if (strcmp (parse_buffer, "continue") == 0)
3433 r = CONTINUE;
3434 else if (strcmp (parse_buffer, "local_var") == 0)
3435 r = LOCAL;
3436 else if (strcmp (parse_buffer, "global_var") == 0)
3437 r = GLOBAL;
3438 else
3439 {
3440 r = IDENT;
3441 lvalp->str = g_strdup (parse_buffer);
3442 return r;
3443 }
3444 return r;
3445
3446 case ST_DEC:
3447 /* -123 is parsed as "-" and "123" so that we can write "4-2" without
3448 * inserting a white space after the minus operator
3449 * Note that strtoul would also work on negative integers */
3450 lvalp->num = x = strtoul (parse_buffer, NULL, 10);
3451 return INTEGER;
3452
3453 case ST_OCT:
3454 lvalp->num = x = strtoul (parse_buffer, NULL, 8);
3455 return INTEGER;
3456
3457 case ST_HEX:
3458 lvalp->num = x = strtoul (parse_buffer, NULL, 16);
3459 return INTEGER;
3460
3461 case ST_ZEROX:
3462 nasl_perror(NULL, "Invalid token 0x parsed as 0 at line %d\n",
3463 ctx->line_nb);
3464 /* fallthrough */
3465 case ST_ZERO:
3466 lvalp->num = 0;
3467 return INTEGER;
3468 default:
3469 abort();
3470 }
3471}
void nasl_perror(lex_ctxt *lexic, char *msg,...)
Definition nasl_debug.c:105
@ MINUS_EQ
@ PLUS_PLUS
@ R_SHIFT_EQ
@ MATCH
@ DIV_EQ
@ MINUS_MINUS
@ R_SHIFT
@ INCLUDE
@ MODULO_EQ
@ WHILE
@ RE_NOMATCH
@ CONTINUE
@ PLUS_EQ
@ RETURN
@ ARROW
@ INTEGER
@ INFEQ
@ FOREACH
@ NOMATCH
@ EXPO
@ L_SHIFT
@ AND
@ R_USHIFT
@ ELSE
@ BREAK
@ REPEAT
@ STRING1
@ UNTIL
@ FOR
@ R_USHIFT_EQ
@ FUNCTION
@ NEQ
@ L_SHIFT_EQ
@ REP
@ LOCAL
@ MULT_EQ
@ RE_MATCH
@ STRING2
@ SUPEQ
@ IDENT
@ GLOBAL
long int num
struct YYSTYPE::asciiz data

References AND, ARROW, BREAK, naslctxt::buffer, CONTINUE, YYSTYPE::data, DIV_EQ, ELSE, EQ, EXPO, FOR, FOREACH, FUNCTION, GLOBAL, IDENT, IF, INCLUDE, naslctxt::index, INFEQ, INTEGER, L_SHIFT, L_SHIFT_EQ, len, YYSTYPE::asciiz::len, naslctxt::line_nb, LOCAL, MATCH, MINUS_EQ, MINUS_MINUS, MODULO_EQ, MULT_EQ, nasl_perror(), NEQ, NOMATCH, YYSTYPE::num, OR, parse_buffer, parse_len, PLUS_EQ, PLUS_PLUS, R_SHIFT, R_SHIFT_EQ, R_USHIFT, R_USHIFT_EQ, RE_MATCH, RE_NOMATCH, REP, REPEAT, RETURN, ST_AND, ST_COMMENT, ST_DEC, ST_DIV, ST_EQ, ST_HEX, ST_IDENT, ST_INF, ST_L_SHIFT, ST_MINUS, ST_MODULO, ST_MULT, ST_NOT, ST_OCT, ST_OR, ST_PLUS, ST_R_SHIFT, ST_R_USHIFT, ST_SPACE, ST_START, ST_STRING1, ST_STRING2, ST_SUP, ST_SUP_EXCL, ST_ZERO, ST_ZEROX, YYSTYPE::str, STRING1, STRING2, SUPEQ, UNTIL, YYSTYPE::asciiz::val, and WHILE.

Referenced by nasllex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nasl_clean_ctx()

void nasl_clean_ctx ( naslctxt * c)

Definition at line 2848 of file nasl_grammar.tab.c.

2849{
2850 deref_cell(c->tree);
2851 g_free (c->buffer);
2852}
void deref_cell(tree_cell *c)
Definition nasl_tree.c:178

References naslctxt::buffer, deref_cell(), and naslctxt::tree.

Referenced by exec_nasl_script().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nasl_clean_inc()

void nasl_clean_inc ( void )

Definition at line 2858 of file nasl_grammar.tab.c.

2859{
2860 if (!includes_hash)
2861 return;
2862 g_hash_table_destroy (includes_hash);
2863 includes_hash = NULL;
2864}
GHashTable * includes_hash

References includes_hash.

Referenced by plugins_reload_from_dir().

Here is the caller graph for this function:

◆ nasl_get_include_order()

int nasl_get_include_order ( const char * c)

Definition at line 2867 of file nasl_grammar.tab.c.

2868{
2869 tree_cell *ctx;
2870 if (!includes_hash)
2871 return -2;
2872
2873 if ((ctx = g_hash_table_lookup (includes_hash, c))) {
2874 return ctx->include_order;
2875 }
2876 return -1;
2877}
struct TC tree_cell
int include_order
Definition nasl_tree.h:100

References TC::include_order, and includes_hash.

Referenced by check_called_files(), and nasl_lint_call().

Here is the caller graph for this function:

◆ naslerror()

void naslerror ( naslctxt * parm,
int * error_counter,
const char * s )
static

Definition at line 2511 of file nasl_grammar.tab.c.

2512{
2513 (void) parm;
2514 (*error_counter)++;
2515 g_message ("Parse error at or near line %d:", LNB);
2516 g_message (" %s", s);
2517}
#define LNB

References LNB.

◆ nasllex()

int nasllex ( YYSTYPE * lvalp,
void * parm,
int * err_c )
static

Definition at line 3474 of file nasl_grammar.tab.c.

3475{
3476 #pragma GCC diagnostic push
3477 #pragma GCC diagnostic ignored "-Wunused-parameter"
3478 (void) err_c;
3479 #pragma GCC diagnostic pop
3480 int x = mylex (lvalp, parm);
3481 return x;
3482}
static int mylex(YYSTYPE *lvalp, void *parm)

References mylex().

Here is the call graph for this function:

◆ remove_base()

const char * remove_base ( const char * path)
static

Definition at line 2661 of file nasl_grammar.tab.c.

2661 {
2662 const char *base = prefs_get ("plugins_folder");
2663 const char *result = path;
2664 size_t len = strlen (base);
2665
2666 if (strncmp(path, base, len) == 0) {
2667 result = path + len;
2668 while (*result == '/') {
2669 result++;
2670 }
2671 }
2672 return result;
2673}

References len.

Referenced by init_nasl_ctx().

Here is the caller graph for this function:

◆ yy_reduce_print()

void yy_reduce_print ( yy_state_t * yyssp,
YYSTYPE * yyvsp,
int yyrule,
naslctxt * parm,
int * err_c )
static

Definition at line 1211 of file nasl_grammar.tab.c.

1213{
1214 int yylno = yyrline[yyrule];
1215 int yynrhs = yyr2[yyrule];
1216 int yyi;
1217 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1218 yyrule - 1, yylno);
1219 /* The symbols being reduced. */
1220 for (yyi = 0; yyi < yynrhs; yyi++)
1221 {
1222 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1223 yy_symbol_print (stderr,
1224 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1225 &yyvsp[(yyi + 1) - (yynrhs)], parm, err_c);
1226 YYFPRINTF (stderr, "\n");
1227 }
1228}
static const yytype_int16 yyrline[]
#define YY_ACCESSING_SYMBOL(State)
static const yytype_int8 yyr2[]
static void yy_symbol_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, naslctxt *parm, int *err_c)

References YY_ACCESSING_SYMBOL, yy_symbol_print(), YYFPRINTF, yyr2, and yyrline.

Here is the call graph for this function:

◆ yy_stack_print()

void yy_stack_print ( yy_state_t * yybottom,
yy_state_t * yytop )
static

Definition at line 1188 of file nasl_grammar.tab.c.

1189{
1190 YYFPRINTF (stderr, "Stack now");
1191 for (; yybottom <= yytop; yybottom++)
1192 {
1193 int yybot = *yybottom;
1194 YYFPRINTF (stderr, " %d", yybot);
1195 }
1196 YYFPRINTF (stderr, "\n");
1197}

References YYFPRINTF.

◆ yy_symbol_print()

void yy_symbol_print ( FILE * yyo,
yysymbol_kind_t yykind,
YYSTYPE const *const yyvaluep,
naslctxt * parm,
int * err_c )
static

Definition at line 1172 of file nasl_grammar.tab.c.

1174{
1175 YYFPRINTF (yyo, "%s %s (",
1176 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1177
1178 yy_symbol_value_print (yyo, yykind, yyvaluep, parm, err_c);
1179 YYFPRINTF (yyo, ")");
1180}
static const char * yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
#define YYNTOKENS
static void yy_symbol_value_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, naslctxt *parm, int *err_c)

References yy_symbol_value_print(), YYFPRINTF, YYNTOKENS, and yysymbol_name().

Referenced by yy_reduce_print().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yy_symbol_value_print()

void yy_symbol_value_print ( FILE * yyo,
yysymbol_kind_t yykind,
YYSTYPE const *const yyvaluep,
naslctxt * parm,
int * err_c )
static

Definition at line 1152 of file nasl_grammar.tab.c.

1154{
1155 FILE *yyoutput = yyo;
1156 YY_USE (yyoutput);
1157 YY_USE (parm);
1158 YY_USE (err_c);
1159 if (!yyvaluep)
1160 return;
1162 YY_USE (yykind);
1164}
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YY_USE(E)

References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, and YY_USE.

Referenced by yy_symbol_print().

Here is the caller graph for this function:

◆ yydestruct()

void yydestruct ( const char * yymsg,
yysymbol_kind_t yykind,
YYSTYPE * yyvaluep,
naslctxt * parm,
int * err_c )
static

Definition at line 1273 of file nasl_grammar.tab.c.

1275{
1276 YY_USE (yyvaluep);
1277 YY_USE (parm);
1278 YY_USE (err_c);
1279 if (!yymsg)
1280 yymsg = "Deleting";
1281 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1282
1284 YY_USE (yykind);
1286}
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)

References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_SYMBOL_PRINT, and YY_USE.

Referenced by yyparse().

Here is the caller graph for this function:

◆ yyparse()

int yyparse ( naslctxt * parm,
int * err_c )

Definition at line 1298 of file nasl_grammar.tab.c.

1299{
1300/* Lookahead token kind. */
1301int yychar;
1302
1303
1304/* The semantic value of the lookahead symbol. */
1305/* Default value used for initialization, for pacifying older GCCs
1306 or non-GCC compilers. */
1307YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1308YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1309
1310 /* Number of syntax errors so far. */
1311 int yynerrs = 0;
1312
1313 yy_state_fast_t yystate = 0;
1314 /* Number of tokens to shift before error messages enabled. */
1315 int yyerrstatus = 0;
1316
1317 /* Refer to the stacks through separate pointers, to allow yyoverflow
1318 to reallocate them elsewhere. */
1319
1320 /* Their size. */
1321 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1322
1323 /* The state stack: array, bottom, top. */
1324 yy_state_t yyssa[YYINITDEPTH];
1325 yy_state_t *yyss = yyssa;
1326 yy_state_t *yyssp = yyss;
1327
1328 /* The semantic value stack: array, bottom, top. */
1329 YYSTYPE yyvsa[YYINITDEPTH];
1330 YYSTYPE *yyvs = yyvsa;
1331 YYSTYPE *yyvsp = yyvs;
1332
1333 int yyn;
1334 /* The return value of yyparse. */
1335 int yyresult;
1336 /* Lookahead symbol kind. */
1338 /* The variables used to return semantic value and location from the
1339 action routines. */
1340 YYSTYPE yyval;
1341
1342
1343
1344#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1345
1346 /* The number of symbols on the RHS of the reduced rule.
1347 Keep to zero when no symbol should be popped. */
1348 int yylen = 0;
1349
1350 YYDPRINTF ((stderr, "Starting parse\n"));
1351
1352 yychar = YYEMPTY; /* Cause a token to be read. */
1353
1354 goto yysetstate;
1355
1356
1357/*------------------------------------------------------------.
1358| yynewstate -- push a new state, which is found in yystate. |
1359`------------------------------------------------------------*/
1360yynewstate:
1361 /* In all cases, when you get here, the value and location stacks
1362 have just been pushed. So pushing a state here evens the stacks. */
1363 yyssp++;
1364
1365
1366/*--------------------------------------------------------------------.
1367| yysetstate -- set current state (the top of the stack) to yystate. |
1368`--------------------------------------------------------------------*/
1369yysetstate:
1370 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1371 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1373 *yyssp = YY_CAST (yy_state_t, yystate);
1375 YY_STACK_PRINT (yyss, yyssp);
1376
1377 if (yyss + yystacksize - 1 <= yyssp)
1378#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1379 YYNOMEM;
1380#else
1381 {
1382 /* Get the current used size of the three stacks, in elements. */
1383 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1384
1385# if defined yyoverflow
1386 {
1387 /* Give user a chance to reallocate the stack. Use copies of
1388 these so that the &'s don't force the real ones into
1389 memory. */
1390 yy_state_t *yyss1 = yyss;
1391 YYSTYPE *yyvs1 = yyvs;
1392
1393 /* Each stack pointer address is followed by the size of the
1394 data in use in that stack, in bytes. This used to be a
1395 conditional around just the two extra args, but that might
1396 be undefined if yyoverflow is a macro. */
1397 yyoverflow (YY_("memory exhausted"),
1398 &yyss1, yysize * YYSIZEOF (*yyssp),
1399 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1400 &yystacksize);
1401 yyss = yyss1;
1402 yyvs = yyvs1;
1403 }
1404# else /* defined YYSTACK_RELOCATE */
1405 /* Extend the stack our own way. */
1406 if (YYMAXDEPTH <= yystacksize)
1407 YYNOMEM;
1408 yystacksize *= 2;
1409 if (YYMAXDEPTH < yystacksize)
1410 yystacksize = YYMAXDEPTH;
1411
1412 {
1413 yy_state_t *yyss1 = yyss;
1414 union yyalloc *yyptr =
1415 YY_CAST (union yyalloc *,
1416 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1417 if (! yyptr)
1418 YYNOMEM;
1421# undef YYSTACK_RELOCATE
1422 if (yyss1 != yyssa)
1423 YYSTACK_FREE (yyss1);
1424 }
1425# endif
1426
1427 yyssp = yyss + yysize - 1;
1428 yyvsp = yyvs + yysize - 1;
1429
1431 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1432 YY_CAST (long, yystacksize)));
1434
1435 if (yyss + yystacksize - 1 <= yyssp)
1436 YYABORT;
1437 }
1438#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1439
1440
1441 if (yystate == YYFINAL)
1442 YYACCEPT;
1443
1444 goto yybackup;
1445
1446
1447/*-----------.
1448| yybackup. |
1449`-----------*/
1450yybackup:
1451 /* Do appropriate processing given the current state. Read a
1452 lookahead token if we need one and don't already have one. */
1453
1454 /* First try to decide what to do without reference to lookahead token. */
1455 yyn = yypact[yystate];
1456 if (yypact_value_is_default (yyn))
1457 goto yydefault;
1458
1459 /* Not known => get a lookahead token if don't already have one. */
1460
1461 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1462 if (yychar == YYEMPTY)
1463 {
1464 YYDPRINTF ((stderr, "Reading a token\n"));
1465 yychar = yylex (&yylval, parm, err_c);
1466 }
1467
1468 if (yychar <= YYEOF)
1469 {
1470 yychar = YYEOF;
1471 yytoken = YYSYMBOL_YYEOF;
1472 YYDPRINTF ((stderr, "Now at end of input.\n"));
1473 }
1474 else if (yychar == YYerror)
1475 {
1476 /* The scanner already issued an error message, process directly
1477 to error recovery. But do not keep the error token as
1478 lookahead, it is too special and may lead us to an endless
1479 loop in error recovery. */
1480 yychar = YYUNDEF;
1481 yytoken = YYSYMBOL_YYerror;
1482 goto yyerrlab1;
1483 }
1484 else
1485 {
1486 yytoken = YYTRANSLATE (yychar);
1487 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1488 }
1489
1490 /* If the proper action on seeing token YYTOKEN is to reduce or to
1491 detect an error, take that action. */
1492 yyn += yytoken;
1493 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1494 goto yydefault;
1495 yyn = yytable[yyn];
1496 if (yyn <= 0)
1497 {
1498 if (yytable_value_is_error (yyn))
1499 goto yyerrlab;
1500 yyn = -yyn;
1501 goto yyreduce;
1502 }
1503
1504 /* Count tokens shifted since error; after three, turn off error
1505 status. */
1506 if (yyerrstatus)
1507 yyerrstatus--;
1508
1509 /* Shift the lookahead token. */
1510 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1511 yystate = yyn;
1513 *++yyvsp = yylval;
1515
1516 /* Discard the shifted token. */
1517 yychar = YYEMPTY;
1518 goto yynewstate;
1519
1520
1521/*-----------------------------------------------------------.
1522| yydefault -- do the default action for the current state. |
1523`-----------------------------------------------------------*/
1524yydefault:
1525 yyn = yydefact[yystate];
1526 if (yyn == 0)
1527 goto yyerrlab;
1528 goto yyreduce;
1529
1530
1531/*-----------------------------.
1532| yyreduce -- do a reduction. |
1533`-----------------------------*/
1534yyreduce:
1535 /* yyn is the number of a rule to reduce with. */
1536 yylen = yyr2[yyn];
1537
1538 /* If YYLEN is nonzero, implement the default value of the action:
1539 '$$ = $1'.
1540
1541 Otherwise, the following line sets YYVAL to garbage.
1542 This behavior is undocumented and Bison
1543 users should not rely upon it. Assigning to YYVAL
1544 unconditionally makes the parser a bit smaller, and it avoids a
1545 GCC warning that YYVAL may be used uninitialized. */
1546 yyval = yyvsp[1-yylen];
1547
1548
1549 YY_REDUCE_PRINT (yyn);
1550 switch (yyn)
1551 {
1552 case 2: /* tiptop: instr_decl_list */
1553#line 153 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1554 {
1555 ((naslctxt*)parm)->tree = (yyvsp[0].node);
1556 }
1557#line 1558 "nasl_grammar.tab.c"
1558 break;
1559
1560 case 3: /* instr_decl_list: instr_decl */
1561#line 158 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1562 {
1564 (yyval.node)->line_nb = LNB;
1565 (yyval.node)->link[0] = (yyvsp[0].node);
1566 }
1567#line 1568 "nasl_grammar.tab.c"
1568 break;
1569
1570 case 4: /* instr_decl_list: instr_decl instr_decl_list */
1571#line 164 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1572 {
1574 (yyval.node)->line_nb = LNB;
1575 (yyval.node)->link[0] = (yyvsp[-1].node);
1576 (yyval.node)->link[1] = (yyvsp[0].node);
1577 }
1578#line 1579 "nasl_grammar.tab.c"
1579 break;
1580
1581 case 7: /* func_decl: FUNCTION identifier '(' arg_decl ')' block */
1582#line 174 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1583 {
1584 nasl_set_function_filename ((yyvsp[-4].str));
1586 (yyval.node)->name = LN;
1587 (yyval.node)->line_nb = LNB;
1588 (yyval.node)->x.str_val = (yyvsp[-4].str);
1589 (yyval.node)->link[0] = (yyvsp[-2].node);
1590 (yyval.node)->link[1] = (yyvsp[0].node);
1591 }
1592#line 1593 "nasl_grammar.tab.c"
1593 break;
1594
1595 case 8: /* arg_decl: %empty */
1596#line 184 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1597 { (yyval.node) = NULL; }
1598#line 1599 "nasl_grammar.tab.c"
1599 break;
1600
1601 case 9: /* arg_decl: arg_decl_1 */
1602#line 184 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1603 { (yyval.node) = (yyvsp[0].node); }
1604#line 1605 "nasl_grammar.tab.c"
1605 break;
1606
1607 case 10: /* arg_decl_1: identifier */
1608#line 186 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1609 {
1610 (yyval.node) = alloc_typed_cell (NODE_DECL);
1611 (yyval.node)->name = LN;
1612 (yyval.node)->line_nb = LNB;
1613 (yyval.node)->x.str_val = (yyvsp[0].str);
1614 }
1615#line 1616 "nasl_grammar.tab.c"
1616 break;
1617
1618 case 11: /* arg_decl_1: identifier ',' arg_decl_1 */
1619#line 193 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1620 {
1621 (yyval.node) = alloc_typed_cell (NODE_DECL);
1622 (yyval.node)->name = LN;
1623 (yyval.node)->line_nb = LNB;
1624 (yyval.node)->x.str_val = (yyvsp[-2].str);
1625 (yyval.node)->link[0] = (yyvsp[0].node);
1626 }
1627#line 1628 "nasl_grammar.tab.c"
1628 break;
1629
1630 case 12: /* block: '{' instr_list '}' */
1631#line 202 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1632 { (yyval.node) = (yyvsp[-1].node); }
1633#line 1634 "nasl_grammar.tab.c"
1634 break;
1635
1636 case 13: /* block: '{' '}' */
1637#line 202 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1638 { (yyval.node) = NULL; }
1639#line 1640 "nasl_grammar.tab.c"
1640 break;
1641
1642 case 15: /* instr_list: instr instr_list */
1643#line 205 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1644 {
1645 if ((yyvsp[-1].node) == NULL)
1646 (yyval.node) = (yyvsp[0].node);
1647 else
1648 {
1650 (yyval.node)->name = LN;
1651 (yyval.node)->line_nb = LNB;
1652 (yyval.node)->link[0] = (yyvsp[-1].node);
1653 (yyval.node)->link[1] = (yyvsp[0].node);
1654 }
1655 }
1656#line 1657 "nasl_grammar.tab.c"
1657 break;
1658
1659 case 16: /* instr: simple_instr ';' */
1660#line 219 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1661 { (yyval.node) = (yyvsp[-1].node); }
1662#line 1663 "nasl_grammar.tab.c"
1663 break;
1664
1665 case 20: /* instr: error ';' */
1666#line 220 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1667 {yyerrok;}
1668#line 1669 "nasl_grammar.tab.c"
1669 break;
1670
1671 case 29: /* simple_instr: BREAK */
1672#line 226 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1673 {
1674 (yyval.node) = alloc_typed_cell (NODE_BREAK);
1675 (yyval.node)->name = LN;
1676 (yyval.node)->line_nb = LNB;
1677 }
1678#line 1679 "nasl_grammar.tab.c"
1679 break;
1680
1681 case 30: /* simple_instr: CONTINUE */
1682#line 231 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1683 {
1685 (yyval.node)->name = LN;
1686 (yyval.node)->line_nb = LNB;
1687 }
1688#line 1689 "nasl_grammar.tab.c"
1689 break;
1690
1691 case 31: /* simple_instr: %empty */
1692#line 236 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1693 { (yyval.node) = NULL; }
1694#line 1695 "nasl_grammar.tab.c"
1695 break;
1696
1697 case 32: /* ret: RETURN expr */
1698#line 240 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1699 {
1700 (yyval.node) = alloc_typed_cell (NODE_RETURN);
1701 (yyval.node)->name = LN;
1702 (yyval.node)->line_nb = LNB;
1703 (yyval.node)->link[0] = (yyvsp[0].node);
1704 }
1705#line 1706 "nasl_grammar.tab.c"
1706 break;
1707
1708 case 33: /* ret: RETURN */
1709#line 247 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1710 {
1711 (yyval.node) = alloc_typed_cell (NODE_RETURN);
1712 (yyval.node)->name = LN;
1713 (yyval.node)->line_nb = LNB;
1714 }
1715#line 1716 "nasl_grammar.tab.c"
1716 break;
1717
1718 case 34: /* if_block: IF '(' expr ')' instr */
1719#line 255 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1720 {
1722 (yyval.node)->name = LN;
1723 (yyval.node)->line_nb = LNB;
1724 (yyval.node)->link[0] = (yyvsp[-2].node); (yyval.node)->link[1] = (yyvsp[0].node);
1725 }
1726#line 1727 "nasl_grammar.tab.c"
1727 break;
1728
1729 case 35: /* if_block: IF '(' expr ')' instr ELSE instr */
1730#line 262 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1731 {
1733 (yyval.node)->name = LN;
1734 (yyval.node)->line_nb = LNB;
1735 (yyval.node)->link[0] = (yyvsp[-4].node); (yyval.node)->link[1] = (yyvsp[-2].node); (yyval.node)->link[2] = (yyvsp[0].node);
1736 }
1737#line 1738 "nasl_grammar.tab.c"
1738 break;
1739
1740 case 40: /* for_loop: FOR '(' aff_func ';' expr ';' aff_func ')' instr */
1741#line 272 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1742 {
1743 (yyval.node) = alloc_typed_cell (NODE_FOR);
1744 (yyval.node)->name = LN;
1745 (yyval.node)->line_nb = LNB;
1746 (yyval.node)->link[0] = (yyvsp[-6].node);
1747 (yyval.node)->link[1] = (yyvsp[-4].node);
1748 (yyval.node)->link[2] = (yyvsp[-2].node);
1749 (yyval.node)->link[3] = (yyvsp[0].node);
1750 }
1751#line 1752 "nasl_grammar.tab.c"
1752 break;
1753
1754 case 41: /* while_loop: WHILE '(' expr ')' instr */
1755#line 283 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1756 {
1757 (yyval.node) = alloc_typed_cell (NODE_WHILE);
1758 (yyval.node)->name = LN;
1759 (yyval.node)->line_nb = LNB;
1760 (yyval.node)->link[0] = (yyvsp[-2].node);
1761 (yyval.node)->link[1] = (yyvsp[0].node);
1762 }
1763#line 1764 "nasl_grammar.tab.c"
1764 break;
1765
1766 case 42: /* repeat_loop: REPEAT instr UNTIL expr ';' */
1767#line 291 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1768 {
1770 (yyval.node)->name = LN;
1771 (yyval.node)->line_nb = LNB;
1772 (yyval.node)->link[0] = (yyvsp[-3].node);
1773 (yyval.node)->link[1] = (yyvsp[-1].node);
1774 }
1775#line 1776 "nasl_grammar.tab.c"
1776 break;
1777
1778 case 43: /* foreach_loop: FOREACH identifier '(' expr ')' instr */
1779#line 300 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1780 {
1782 (yyval.node)->name = LN;
1783 (yyval.node)->line_nb = LNB;
1784 (yyval.node)->x.str_val = (yyvsp[-4].str);
1785 (yyval.node)->link[0] = (yyvsp[-2].node);
1786 (yyval.node)->link[1] = (yyvsp[0].node);
1787 }
1788#line 1789 "nasl_grammar.tab.c"
1789 break;
1790
1791 case 47: /* aff_func: %empty */
1792#line 310 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1793 { (yyval.node) = NULL; }
1794#line 1795 "nasl_grammar.tab.c"
1795 break;
1796
1797 case 48: /* rep: func_call REP expr */
1798#line 314 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1799 {
1801 (yyval.node)->name = LN;
1802 (yyval.node)->line_nb = LNB;
1803 (yyval.node)->link[0] = (yyvsp[-2].node);
1804 (yyval.node)->link[1] = (yyvsp[0].node);
1805 }
1806#line 1807 "nasl_grammar.tab.c"
1807 break;
1808
1809 case 49: /* string: STRING1 */
1810#line 322 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1811 { (yyval.str) = (yyvsp[0].data).val; }
1812#line 1813 "nasl_grammar.tab.c"
1813 break;
1814
1815 case 51: /* inc: INCLUDE '(' string ')' */
1816#line 326 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1817 {
1818 char *tmp;
1819 naslctxt subctx;
1820 #pragma GCC diagnostic push
1821 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
1822 int * error_counter;
1823 #pragma GCC diagnostic pop
1824 error_counter = (int*)err_c;
1825
1826 bzero (&subctx, sizeof (subctx));
1827 subctx.always_signed = ((naslctxt*)parm)->always_signed;
1828 subctx.exec_descr = ((naslctxt*)parm)->exec_descr;
1829 subctx.kb = ((naslctxt *) parm)->kb;
1830 subctx.tree = ((naslctxt*) parm)->tree;
1831 (yyval.node) = NULL;
1832 tmp = g_strdup (nasl_get_filename (NULL));
1833 nasl_set_filename ((yyvsp[-1].str));
1834 if (!includes_hash)
1835 includes_hash = g_hash_table_new_full
1836 (g_str_hash, g_str_equal, g_free,
1837 (GDestroyNotify) deref_cell);
1838
1839 if ((subctx.tree = g_hash_table_lookup (includes_hash, (yyvsp[-1].str))))
1840 {
1841 (yyval.node) = subctx.tree;
1842 ref_cell ((yyval.node));
1843 g_free ((yyvsp[-1].str));
1844 }
1845 else if (init_nasl_ctx (&subctx, (const char *)tmp, (yyvsp[-1].str)) >= 0)
1846 {
1847 if (!naslparse (&subctx, err_c))
1848 {
1849 // set the name of tree to the filename for further
1850 // identification of origin (e.g. whos is calling a func).
1851 subctx.tree->name = (yyvsp[-1].str);
1853 (yyval.node) = subctx.tree;
1854 g_hash_table_insert (includes_hash, (yyvsp[-1].str), (yyval.node));
1855 ref_cell ((yyval.node));
1856 }
1857 else
1858 {
1859 nasl_perror (NULL, "%s: Parse error at or near line %d\n", (yyvsp[-1].str),
1860 subctx.line_nb);
1861 g_free ((yyvsp[-1].str));
1862 }
1863 g_free (subctx.buffer);
1864 }
1865 else
1866 {
1867 g_free((yyvsp[-1].str));
1868 g_free (tmp);
1869 return -2;
1870 }
1871 nasl_set_filename (tmp);
1872 g_free (tmp);
1873 }
1874#line 1875 "nasl_grammar.tab.c"
1875 break;
1876
1877 case 52: /* func_call: identifier '(' arg_list ')' */
1878#line 386 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1879 {
1881 (yyval.node)->name = LN;
1882 (yyval.node)->line_nb = LNB;
1883 (yyval.node)->x.str_val = (yyvsp[-3].str);
1884 (yyval.node)->link[0] = (yyvsp[-1].node);
1885 }
1886#line 1887 "nasl_grammar.tab.c"
1887 break;
1888
1889 case 54: /* arg_list: %empty */
1890#line 394 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1891 { (yyval.node) = NULL; }
1892#line 1893 "nasl_grammar.tab.c"
1893 break;
1894
1895 case 56: /* arg_list_1: arg ',' arg_list_1 */
1896#line 396 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1897 {
1898 (yyvsp[-2].node)->link[1] = (yyvsp[0].node);
1899 (yyval.node) = (yyvsp[-2].node);
1900 }
1901#line 1902 "nasl_grammar.tab.c"
1902 break;
1903
1904 case 57: /* arg: expr */
1905#line 402 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1906 {
1907 (yyval.node) = alloc_typed_cell (NODE_ARG);
1908 (yyval.node)->name = LN;
1909 (yyval.node)->line_nb = LNB;
1910 (yyval.node)->link[0] = (yyvsp[0].node);
1911 }
1912#line 1913 "nasl_grammar.tab.c"
1913 break;
1914
1915 case 58: /* arg: identifier ':' expr */
1916#line 409 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1917 {
1918 (yyval.node) = alloc_typed_cell (NODE_ARG);
1919 (yyval.node)->name = LN;
1920 (yyval.node)->line_nb = LNB;
1921 (yyval.node)->x.str_val = (yyvsp[-2].str);
1922 (yyval.node)->link[0] = (yyvsp[0].node);
1923 }
1924#line 1925 "nasl_grammar.tab.c"
1925 break;
1926
1927 case 59: /* aff: lvalue '=' expr */
1928#line 419 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1929 {
1930 (yyval.node) = alloc_expr_cell(LNB, NODE_AFF, (yyvsp[-2].node), (yyvsp[0].node));
1931 }
1932#line 1933 "nasl_grammar.tab.c"
1933 break;
1934
1935 case 60: /* aff: lvalue PLUS_EQ expr */
1936#line 422 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1937 { (yyval.node) = alloc_expr_cell(LNB, NODE_PLUS_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1938#line 1939 "nasl_grammar.tab.c"
1939 break;
1940
1941 case 61: /* aff: lvalue MINUS_EQ expr */
1942#line 423 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1943 { (yyval.node) = alloc_expr_cell(LNB, NODE_MINUS_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1944#line 1945 "nasl_grammar.tab.c"
1945 break;
1946
1947 case 62: /* aff: lvalue MULT_EQ expr */
1948#line 424 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1949 { (yyval.node) = alloc_expr_cell(LNB, NODE_MULT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1950#line 1951 "nasl_grammar.tab.c"
1951 break;
1952
1953 case 63: /* aff: lvalue DIV_EQ expr */
1954#line 425 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1955 { (yyval.node) = alloc_expr_cell(LNB, NODE_DIV_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1956#line 1957 "nasl_grammar.tab.c"
1957 break;
1958
1959 case 64: /* aff: lvalue MODULO_EQ expr */
1960#line 426 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1961 { (yyval.node) = alloc_expr_cell(LNB, NODE_MODULO_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1962#line 1963 "nasl_grammar.tab.c"
1963 break;
1964
1965 case 65: /* aff: lvalue R_SHIFT_EQ expr */
1966#line 427 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1967 { (yyval.node) = alloc_expr_cell(LNB, NODE_R_SHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1968#line 1969 "nasl_grammar.tab.c"
1969 break;
1970
1971 case 66: /* aff: lvalue R_USHIFT_EQ expr */
1972#line 428 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1973 { (yyval.node) = alloc_expr_cell(LNB, NODE_R_USHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1974#line 1975 "nasl_grammar.tab.c"
1975 break;
1976
1977 case 67: /* aff: lvalue L_SHIFT_EQ expr */
1978#line 429 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1979 { (yyval.node) = alloc_expr_cell(LNB, NODE_L_SHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
1980#line 1981 "nasl_grammar.tab.c"
1981 break;
1982
1983 case 68: /* lvalue: identifier */
1984#line 433 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1985 { (yyval.node) = alloc_typed_cell (NODE_VAR);
1986 (yyval.node)->line_nb = LNB;
1987 (yyval.node)->x.str_val = (yyvsp[0].str);
1988 }
1989#line 1990 "nasl_grammar.tab.c"
1990 break;
1991
1992 case 71: /* identifier: REP */
1993#line 438 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
1994 { (yyval.str) = strdup("x"); }
1995#line 1996 "nasl_grammar.tab.c"
1996 break;
1997
1998 case 72: /* array_elem: identifier '[' array_index ']' */
1999#line 441 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2000 {
2002 (yyval.node)->line_nb = LNB;
2003 (yyval.node)->x.str_val = (yyvsp[-3].str);
2004 (yyval.node)->link[0] = (yyvsp[-1].node);
2005 }
2006#line 2007 "nasl_grammar.tab.c"
2007 break;
2008
2009 case 74: /* post_pre_incr: PLUS_PLUS lvalue */
2010#line 451 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2011 { (yyval.node) = alloc_expr_cell(LNB, EXPR_INCR, NULL, (yyvsp[0].node)); }
2012#line 2013 "nasl_grammar.tab.c"
2013 break;
2014
2015 case 75: /* post_pre_incr: MINUS_MINUS lvalue */
2016#line 452 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2017 {(yyval.node) = alloc_expr_cell(LNB, EXPR_DECR, NULL, (yyvsp[0].node)); }
2018#line 2019 "nasl_grammar.tab.c"
2019 break;
2020
2021 case 76: /* post_pre_incr: lvalue PLUS_PLUS */
2022#line 453 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2023 { (yyval.node)= alloc_expr_cell(LNB, EXPR_INCR, (yyvsp[-1].node), NULL); }
2024#line 2025 "nasl_grammar.tab.c"
2025 break;
2026
2027 case 77: /* post_pre_incr: lvalue MINUS_MINUS */
2028#line 454 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2029 { (yyval.node)= alloc_expr_cell(LNB, EXPR_DECR, (yyvsp[-1].node), NULL); }
2030#line 2031 "nasl_grammar.tab.c"
2031 break;
2032
2033 case 78: /* expr: '(' expr ')' */
2034#line 458 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2035 { (yyval.node) = (yyvsp[-1].node); }
2036#line 2037 "nasl_grammar.tab.c"
2037 break;
2038
2039 case 79: /* expr: expr AND expr */
2040#line 459 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2041 { (yyval.node) = alloc_expr_cell(LNB, EXPR_AND, (yyvsp[-2].node), (yyvsp[0].node)); }
2042#line 2043 "nasl_grammar.tab.c"
2043 break;
2044
2045 case 80: /* expr: '!' expr */
2046#line 460 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2047 { (yyval.node) = alloc_expr_cell(LNB, EXPR_NOT, (yyvsp[0].node), NULL); }
2048#line 2049 "nasl_grammar.tab.c"
2049 break;
2050
2051 case 81: /* expr: expr OR expr */
2052#line 461 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2053 { (yyval.node) = alloc_expr_cell(LNB, EXPR_OR, (yyvsp[-2].node), (yyvsp[0].node)); }
2054#line 2055 "nasl_grammar.tab.c"
2055 break;
2056
2057 case 82: /* expr: expr '+' expr */
2058#line 462 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2059 { (yyval.node) = alloc_expr_cell(LNB, EXPR_PLUS, (yyvsp[-2].node), (yyvsp[0].node)); }
2060#line 2061 "nasl_grammar.tab.c"
2061 break;
2062
2063 case 83: /* expr: expr '-' expr */
2064#line 463 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2065 { (yyval.node) = alloc_expr_cell(LNB, EXPR_MINUS, (yyvsp[-2].node), (yyvsp[0].node)); }
2066#line 2067 "nasl_grammar.tab.c"
2067 break;
2068
2069 case 84: /* expr: '-' expr */
2070#line 464 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2071 { (yyval.node) = alloc_expr_cell(LNB, EXPR_U_MINUS, (yyvsp[0].node), NULL);}
2072#line 2073 "nasl_grammar.tab.c"
2073 break;
2074
2075 case 85: /* expr: '~' expr */
2076#line 465 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2077 { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_NOT, (yyvsp[0].node), NULL);}
2078#line 2079 "nasl_grammar.tab.c"
2079 break;
2080
2081 case 86: /* expr: expr '*' expr */
2082#line 466 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2083 { (yyval.node) = alloc_expr_cell(LNB, EXPR_MULT, (yyvsp[-2].node), (yyvsp[0].node)); }
2084#line 2085 "nasl_grammar.tab.c"
2085 break;
2086
2087 case 87: /* expr: expr EXPO expr */
2088#line 467 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2089 { (yyval.node) = alloc_expr_cell(LNB, EXPR_EXPO, (yyvsp[-2].node), (yyvsp[0].node)); }
2090#line 2091 "nasl_grammar.tab.c"
2091 break;
2092
2093 case 88: /* expr: expr '/' expr */
2094#line 468 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2095 { (yyval.node) = alloc_expr_cell(LNB, EXPR_DIV, (yyvsp[-2].node), (yyvsp[0].node)); }
2096#line 2097 "nasl_grammar.tab.c"
2097 break;
2098
2099 case 89: /* expr: expr '%' expr */
2100#line 469 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2101 { (yyval.node) = alloc_expr_cell(LNB, EXPR_MODULO, (yyvsp[-2].node), (yyvsp[0].node)); }
2102#line 2103 "nasl_grammar.tab.c"
2103 break;
2104
2105 case 90: /* expr: expr '&' expr */
2106#line 470 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2107 { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_AND, (yyvsp[-2].node), (yyvsp[0].node)); }
2108#line 2109 "nasl_grammar.tab.c"
2109 break;
2110
2111 case 91: /* expr: expr '^' expr */
2112#line 471 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2113 { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_XOR, (yyvsp[-2].node), (yyvsp[0].node)); }
2114#line 2115 "nasl_grammar.tab.c"
2115 break;
2116
2117 case 92: /* expr: expr '|' expr */
2118#line 472 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2119 { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_OR, (yyvsp[-2].node), (yyvsp[0].node)); }
2120#line 2121 "nasl_grammar.tab.c"
2121 break;
2122
2123 case 93: /* expr: expr R_SHIFT expr */
2124#line 473 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2125 { (yyval.node) = alloc_expr_cell(LNB, EXPR_R_SHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2126#line 2127 "nasl_grammar.tab.c"
2127 break;
2128
2129 case 94: /* expr: expr R_USHIFT expr */
2130#line 474 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2131 { (yyval.node) = alloc_expr_cell(LNB, EXPR_R_USHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2132#line 2133 "nasl_grammar.tab.c"
2133 break;
2134
2135 case 95: /* expr: expr L_SHIFT expr */
2136#line 475 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2137 { (yyval.node) = alloc_expr_cell(LNB, EXPR_L_SHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2138#line 2139 "nasl_grammar.tab.c"
2139 break;
2140
2141 case 97: /* expr: expr MATCH expr */
2142#line 477 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2143 { (yyval.node) = alloc_expr_cell(LNB, COMP_MATCH, (yyvsp[-2].node), (yyvsp[0].node)); }
2144#line 2145 "nasl_grammar.tab.c"
2145 break;
2146
2147 case 98: /* expr: expr NOMATCH expr */
2148#line 478 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2149 { (yyval.node) = alloc_expr_cell(LNB, COMP_NOMATCH, (yyvsp[-2].node), (yyvsp[0].node)); }
2150#line 2151 "nasl_grammar.tab.c"
2151 break;
2152
2153 case 99: /* expr: expr RE_MATCH string */
2154#line 479 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2155 { (yyval.node) = alloc_RE_cell(LNB, COMP_RE_MATCH, (yyvsp[-2].node), (yyvsp[0].str), ERRC); }
2156#line 2157 "nasl_grammar.tab.c"
2157 break;
2158
2159 case 100: /* expr: expr RE_NOMATCH string */
2160#line 480 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2161 { (yyval.node) = alloc_RE_cell(LNB, COMP_RE_NOMATCH, (yyvsp[-2].node), (yyvsp[0].str), ERRC); }
2162#line 2163 "nasl_grammar.tab.c"
2163 break;
2164
2165 case 101: /* expr: expr '<' expr */
2166#line 481 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2167 { (yyval.node) = alloc_expr_cell(LNB, COMP_LT, (yyvsp[-2].node), (yyvsp[0].node)); }
2168#line 2169 "nasl_grammar.tab.c"
2169 break;
2170
2171 case 102: /* expr: expr '>' expr */
2172#line 482 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2173 { (yyval.node) = alloc_expr_cell(LNB, COMP_GT, (yyvsp[-2].node), (yyvsp[0].node)); }
2174#line 2175 "nasl_grammar.tab.c"
2175 break;
2176
2177 case 103: /* expr: expr EQ expr */
2178#line 483 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2179 { (yyval.node) = alloc_expr_cell(LNB, COMP_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2180#line 2181 "nasl_grammar.tab.c"
2181 break;
2182
2183 case 104: /* expr: expr NEQ expr */
2184#line 484 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2185 { (yyval.node) = alloc_expr_cell(LNB, COMP_NE, (yyvsp[-2].node), (yyvsp[0].node)); }
2186#line 2187 "nasl_grammar.tab.c"
2187 break;
2188
2189 case 105: /* expr: expr SUPEQ expr */
2190#line 485 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2191 { (yyval.node) = alloc_expr_cell(LNB, COMP_GE, (yyvsp[-2].node), (yyvsp[0].node)); }
2192#line 2193 "nasl_grammar.tab.c"
2193 break;
2194
2195 case 106: /* expr: expr INFEQ expr */
2196#line 486 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2197 { (yyval.node) = alloc_expr_cell(LNB, COMP_LE, (yyvsp[-2].node), (yyvsp[0].node)); }
2198#line 2199 "nasl_grammar.tab.c"
2199 break;
2200
2201 case 112: /* const_array: '[' list_array_data ']' */
2202#line 490 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2203 { (yyval.node) = make_array_from_elems((yyvsp[-1].node)); }
2204#line 2205 "nasl_grammar.tab.c"
2205 break;
2206
2207 case 113: /* list_array_data: array_data */
2208#line 492 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2209 { (yyval.node) = (yyvsp[0].node); }
2210#line 2211 "nasl_grammar.tab.c"
2211 break;
2212
2213 case 114: /* list_array_data: array_data ',' list_array_data */
2214#line 493 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2215 {
2216 (yyvsp[-2].node)->link[1] = (yyvsp[0].node); (yyval.node) = (yyvsp[-2].node);
2217 }
2218#line 2219 "nasl_grammar.tab.c"
2219 break;
2220
2221 case 115: /* array_data: simple_array_data */
2222#line 497 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2223 {
2224 (yyval.node) = alloc_typed_cell(ARRAY_ELEM);
2225 (yyval.node)->link[0] = (yyvsp[0].node);
2226 }
2227#line 2228 "nasl_grammar.tab.c"
2228 break;
2229
2230 case 116: /* array_data: string ARROW simple_array_data */
2231#line 500 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2232 {
2233 (yyval.node) = alloc_typed_cell(ARRAY_ELEM);
2234 (yyval.node)->link[0] = (yyvsp[0].node);
2235 (yyval.node)->x.str_val = (yyvsp[-2].str);
2236 }
2237#line 2238 "nasl_grammar.tab.c"
2238 break;
2239
2240 case 117: /* atom: INTEGER */
2241#line 506 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2242 { (yyval.node) = alloc_typed_cell(CONST_INT); (yyval.node)->x.i_val = (yyvsp[0].num); }
2243#line 2244 "nasl_grammar.tab.c"
2244 break;
2245
2246 case 118: /* atom: STRING2 */
2247#line 507 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2248 {
2249 (yyval.node) = alloc_typed_cell(CONST_STR); (yyval.node)->x.str_val = (yyvsp[0].str);
2250 (yyval.node)->size = strlen((yyvsp[0].str));
2251 }
2252#line 2253 "nasl_grammar.tab.c"
2253 break;
2254
2255 case 119: /* atom: STRING1 */
2256#line 511 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2257 {
2258 (yyval.node) = alloc_typed_cell(CONST_DATA); (yyval.node)->x.str_val = (yyvsp[0].data).val;
2259 (yyval.node)->size = (yyvsp[0].data).len;
2260 }
2261#line 2262 "nasl_grammar.tab.c"
2262 break;
2263
2264 case 121: /* var: var_name */
2265#line 519 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2266 {
2267 (yyval.node) = alloc_typed_cell (NODE_VAR);
2268 (yyval.node)->line_nb = LNB;
2269 (yyval.node)->x.str_val = (yyvsp[0].str);
2270 }
2271#line 2272 "nasl_grammar.tab.c"
2272 break;
2273
2274 case 125: /* ipaddr: INTEGER '.' INTEGER '.' INTEGER '.' INTEGER */
2275#line 529 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2276 {
2277 char *s = g_strdup_printf ("%ld.%ld.%ld.%ld", (yyvsp[-6].num), (yyvsp[-4].num), (yyvsp[-2].num), (yyvsp[0].num));
2278 (yyval.node) = alloc_typed_cell (CONST_STR);
2279 (yyval.node)->line_nb = LNB;
2280 (yyval.node)->x.str_val = s;
2281 (yyval.node)->size = strlen(s);
2282 }
2283#line 2284 "nasl_grammar.tab.c"
2284 break;
2285
2286 case 126: /* loc: LOCAL arg_decl */
2287#line 539 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2288 {
2289 (yyval.node) = alloc_typed_cell (NODE_LOCAL);
2290 (yyval.node)->line_nb = LNB;
2291 (yyval.node)->link[0] = (yyvsp[0].node);
2292 }
2293#line 2294 "nasl_grammar.tab.c"
2294 break;
2295
2296 case 127: /* glob: GLOBAL arg_decl */
2297#line 547 "/usr/src/RPM/BUILD/openvas-scanner-23.40.3/nasl/nasl_grammar.y"
2298 {
2299 (yyval.node) = alloc_typed_cell (NODE_GLOBAL);
2300 (yyval.node)->line_nb = LNB;
2301 (yyval.node)->link[0] = (yyvsp[0].node);
2302 }
2303#line 2304 "nasl_grammar.tab.c"
2304 break;
2305
2306
2307#line 2308 "nasl_grammar.tab.c"
2308
2309 default: break;
2310 }
2311 /* User semantic actions sometimes alter yychar, and that requires
2312 that yytoken be updated with the new translation. We take the
2313 approach of translating immediately before every use of yytoken.
2314 One alternative is translating here after every semantic action,
2315 but that translation would be missed if the semantic action invokes
2316 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2317 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2318 incorrect destructor might then be invoked immediately. In the
2319 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2320 to an incorrect destructor call or verbose syntax error message
2321 before the lookahead is translated. */
2322 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2323
2324 YYPOPSTACK (yylen);
2325 yylen = 0;
2326
2327 *++yyvsp = yyval;
2328
2329 /* Now 'shift' the result of the reduction. Determine what state
2330 that goes to, based on the state we popped back to and the rule
2331 number reduced by. */
2332 {
2333 const int yylhs = yyr1[yyn] - YYNTOKENS;
2334 const int yyi = yypgoto[yylhs] + *yyssp;
2335 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2336 ? yytable[yyi]
2337 : yydefgoto[yylhs]);
2338 }
2339
2340 goto yynewstate;
2341
2342
2343/*--------------------------------------.
2344| yyerrlab -- here on detecting error. |
2345`--------------------------------------*/
2346yyerrlab:
2347 /* Make sure we have latest lookahead translation. See comments at
2348 user semantic actions for why this is necessary. */
2349 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
2350 /* If not already recovering from an error, report this error. */
2351 if (!yyerrstatus)
2352 {
2353 ++yynerrs;
2354 yyerror (parm, err_c, YY_("syntax error"));
2355 }
2356
2357 if (yyerrstatus == 3)
2358 {
2359 /* If just tried and failed to reuse lookahead token after an
2360 error, discard it. */
2361
2362 if (yychar <= YYEOF)
2363 {
2364 /* Return failure if at end of input. */
2365 if (yychar == YYEOF)
2366 YYABORT;
2367 }
2368 else
2369 {
2370 yydestruct ("Error: discarding",
2371 yytoken, &yylval, parm, err_c);
2372 yychar = YYEMPTY;
2373 }
2374 }
2375
2376 /* Else will try to reuse lookahead token after shifting the error
2377 token. */
2378 goto yyerrlab1;
2379
2380
2381/*---------------------------------------------------.
2382| yyerrorlab -- error raised explicitly by YYERROR. |
2383`---------------------------------------------------*/
2384yyerrorlab:
2385 /* Pacify compilers when the user code never invokes YYERROR and the
2386 label yyerrorlab therefore never appears in user code. */
2387 if (0)
2388 YYERROR;
2389 ++yynerrs;
2390
2391 /* Do not reclaim the symbols of the rule whose action triggered
2392 this YYERROR. */
2393 YYPOPSTACK (yylen);
2394 yylen = 0;
2395 YY_STACK_PRINT (yyss, yyssp);
2396 yystate = *yyssp;
2397 goto yyerrlab1;
2398
2399
2400/*-------------------------------------------------------------.
2401| yyerrlab1 -- common code for both syntax error and YYERROR. |
2402`-------------------------------------------------------------*/
2403yyerrlab1:
2404 yyerrstatus = 3; /* Each real token shifted decrements this. */
2405
2406 /* Pop stack until we find a state that shifts the error token. */
2407 for (;;)
2408 {
2409 yyn = yypact[yystate];
2410 if (!yypact_value_is_default (yyn))
2411 {
2412 yyn += YYSYMBOL_YYerror;
2413 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2414 {
2415 yyn = yytable[yyn];
2416 if (0 < yyn)
2417 break;
2418 }
2419 }
2420
2421 /* Pop the current state because it cannot handle the error token. */
2422 if (yyssp == yyss)
2423 YYABORT;
2424
2425
2426 yydestruct ("Error: popping",
2427 YY_ACCESSING_SYMBOL (yystate), yyvsp, parm, err_c);
2428 YYPOPSTACK (1);
2429 yystate = *yyssp;
2430 YY_STACK_PRINT (yyss, yyssp);
2431 }
2432
2434 *++yyvsp = yylval;
2436
2437
2438 /* Shift the error token. */
2439 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2440
2441 yystate = yyn;
2442 goto yynewstate;
2443
2444
2445/*-------------------------------------.
2446| yyacceptlab -- YYACCEPT comes here. |
2447`-------------------------------------*/
2448yyacceptlab:
2449 yyresult = 0;
2450 goto yyreturnlab;
2451
2452
2453/*-----------------------------------.
2454| yyabortlab -- YYABORT comes here. |
2455`-----------------------------------*/
2456yyabortlab:
2457 yyresult = 1;
2458 goto yyreturnlab;
2459
2460
2461/*-----------------------------------------------------------.
2462| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2463`-----------------------------------------------------------*/
2464yyexhaustedlab:
2465 yyerror (parm, err_c, YY_("memory exhausted"));
2466 yyresult = 2;
2467 goto yyreturnlab;
2468
2469
2470/*----------------------------------------------------------.
2471| yyreturnlab -- parsing is finished, clean up and return. |
2472`----------------------------------------------------------*/
2473yyreturnlab:
2474 if (yychar != YYEMPTY)
2475 {
2476 /* Make sure we have latest lookahead translation. See comments at
2477 user semantic actions for why this is necessary. */
2478 yytoken = YYTRANSLATE (yychar);
2479 yydestruct ("Cleanup: discarding lookahead",
2480 yytoken, &yylval, parm, err_c);
2481 }
2482 /* Do not reclaim the symbols of the rule whose action triggered
2483 this YYABORT or YYACCEPT. */
2484 YYPOPSTACK (yylen);
2485 YY_STACK_PRINT (yyss, yyssp);
2486 while (yyssp != yyss)
2487 {
2488 yydestruct ("Cleanup: popping",
2489 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, parm, err_c);
2490 YYPOPSTACK (1);
2491 }
2492#ifndef yyoverflow
2493 if (yyss != yyssa)
2494 YYSTACK_FREE (yyss);
2495#endif
2496
2497 return yyresult;
2498}
int naslparse(naslctxt *, int *)
void nasl_set_function_filename(const char *function)
Definition nasl_debug.c:93
const char * nasl_get_filename(const char *function)
Definition nasl_debug.c:54
int init_nasl_ctx(naslctxt *, const char *, const char *)
Initialize a NASL context for a NASL file.
#define YYMAXDEPTH
#define YYSTACK_FREE
#define yyerrok
#define YY_ASSERT(E)
#define YYNOMEM
static const yytype_int8 yydefact[]
#define YYNSTATES
#define YY_IGNORE_USELESS_CAST_END
#define YYABORT
#define YYSTACK_BYTES(N)
#define YY_REDUCE_PRINT(Rule)
static const yytype_int16 yypact[]
#define yylex
static const yytype_uint8 yydefgoto[]
#define YYFINAL
static const yytype_int16 yypgoto[]
#define YY_INITIAL_VALUE(Value)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_IGNORE_USELESS_CAST_BEGIN
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, naslctxt *parm, int *err_c)
#define LN
#define yynerrs
static const yytype_int16 yytable[]
#define YYACCEPT
#define yytable_value_is_error(Yyn)
#define YYTRANSLATE(YYX)
#define ERRC
static const yytype_int8 yyr1[]
#define YYPOPSTACK(N)
int yy_state_fast_t
#define YYLAST
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define yypact_value_is_default(Yyn)
#define YYINITDEPTH
static const yytype_int16 yycheck[]
#define YYSTACK_ALLOC
#define YYDPRINTF(Args)
#define yyerror
@ YYEOF
@ YYerror
@ YYUNDEF
void ref_cell(tree_cell *c)
Definition nasl_tree.c:164
tree_cell * alloc_RE_cell(int lnb, int t, tree_cell *l, char *re_str, int *err_c)
Definition nasl_tree.c:33
tree_cell * alloc_expr_cell(int lnb, int t, tree_cell *l, tree_cell *r)
Definition nasl_tree.c:60
tree_cell * alloc_typed_cell(int typ)
Definition nasl_tree.c:25
@ NODE_FOR
Definition nasl_tree.h:16
@ NODE_ARRAY_EL
Definition nasl_tree.h:29
@ NODE_L_SHIFT_EQ
Definition nasl_tree.h:41
@ NODE_PLUS_EQ
Definition nasl_tree.h:35
@ NODE_FUN_CALL
Definition nasl_tree.h:22
@ COMP_LE
Definition nasl_tree.h:73
@ NODE_R_SHIFT_EQ
Definition nasl_tree.h:42
@ COMP_GT
Definition nasl_tree.h:76
@ NODE_LOCAL
Definition nasl_tree.h:32
@ CONST_DATA
Definition nasl_tree.h:82
@ NODE_AFF
Definition nasl_tree.h:30
@ EXPR_MODULO
Definition nasl_tree.h:54
@ COMP_RE_MATCH
Definition nasl_tree.h:69
@ NODE_MULT_EQ
Definition nasl_tree.h:37
@ COMP_NE
Definition nasl_tree.h:75
@ NODE_VAR
Definition nasl_tree.h:31
@ NODE_R_USHIFT_EQ
Definition nasl_tree.h:43
@ NODE_ARG
Definition nasl_tree.h:24
@ NODE_CONTINUE
Definition nasl_tree.h:27
@ COMP_EQ
Definition nasl_tree.h:74
@ EXPR_MULT
Definition nasl_tree.h:52
@ NODE_FUN_DEF
Definition nasl_tree.h:21
@ COMP_GE
Definition nasl_tree.h:77
@ ARRAY_ELEM
Definition nasl_tree.h:85
@ NODE_REPEAT_UNTIL
Definition nasl_tree.h:19
@ NODE_REPEATED
Definition nasl_tree.h:20
@ EXPR_BIT_NOT
Definition nasl_tree.h:60
@ EXPR_R_SHIFT
Definition nasl_tree.h:64
@ EXPR_DIV
Definition nasl_tree.h:53
@ COMP_RE_NOMATCH
Definition nasl_tree.h:70
@ NODE_RETURN
Definition nasl_tree.h:25
@ EXPR_BIT_XOR
Definition nasl_tree.h:59
@ NODE_FOREACH
Definition nasl_tree.h:18
@ NODE_IF_ELSE
Definition nasl_tree.h:14
@ NODE_DIV_EQ
Definition nasl_tree.h:38
@ NODE_MINUS_EQ
Definition nasl_tree.h:36
@ COMP_NOMATCH
Definition nasl_tree.h:68
@ COMP_MATCH
Definition nasl_tree.h:67
@ EXPR_NOT
Definition nasl_tree.h:47
@ EXPR_PLUS
Definition nasl_tree.h:49
@ EXPR_L_SHIFT
Definition nasl_tree.h:63
@ NODE_DECL
Definition nasl_tree.h:23
@ CONST_STR
Definition nasl_tree.h:80
@ EXPR_BIT_AND
Definition nasl_tree.h:57
@ EXPR_EXPO
Definition nasl_tree.h:55
@ EXPR_INCR
Definition nasl_tree.h:61
@ NODE_INSTR_L
Definition nasl_tree.h:15
@ EXPR_BIT_OR
Definition nasl_tree.h:58
@ EXPR_U_MINUS
Definition nasl_tree.h:51
@ COMP_LT
Definition nasl_tree.h:72
@ EXPR_OR
Definition nasl_tree.h:46
@ NODE_BREAK
Definition nasl_tree.h:26
@ EXPR_DECR
Definition nasl_tree.h:62
@ EXPR_R_USHIFT
Definition nasl_tree.h:65
@ NODE_GLOBAL
Definition nasl_tree.h:33
@ CONST_INT
Definition nasl_tree.h:79
@ NODE_WHILE
Definition nasl_tree.h:17
@ EXPR_MINUS
Definition nasl_tree.h:50
@ NODE_MODULO_EQ
Definition nasl_tree.h:39
@ EXPR_AND
Definition nasl_tree.h:45
tree_cell * make_array_from_elems(tree_cell *el)
Definition nasl_var.c:1323
long int i_val
Definition nasl_tree.h:104
char * name
Definition nasl_tree.h:97
char * str_val
Definition nasl_tree.h:103
tree_cell * node
YYSTYPE yyvs_alloc
yy_state_t yyss_alloc

References alloc_expr_cell(), alloc_RE_cell(), alloc_typed_cell(), naslctxt::always_signed, ARRAY_ELEM, naslctxt::buffer, COMP_EQ, COMP_GE, COMP_GT, COMP_LE, COMP_LT, COMP_MATCH, COMP_NE, COMP_NOMATCH, COMP_RE_MATCH, COMP_RE_NOMATCH, CONST_DATA, CONST_INT, CONST_STR, YYSTYPE::data, deref_cell(), ERRC, naslctxt::exec_descr, EXPR_AND, EXPR_BIT_AND, EXPR_BIT_NOT, EXPR_BIT_OR, EXPR_BIT_XOR, EXPR_DECR, EXPR_DIV, EXPR_EXPO, EXPR_INCR, EXPR_L_SHIFT, EXPR_MINUS, EXPR_MODULO, EXPR_MULT, EXPR_NOT, EXPR_OR, EXPR_PLUS, EXPR_R_SHIFT, EXPR_R_USHIFT, EXPR_U_MINUS, TC::i_val, include_order, TC::include_order, includes_hash, init_nasl_ctx(), naslctxt::kb, naslctxt::line_nb, LN, LNB, make_array_from_elems(), name, TC::name, nasl_get_filename(), nasl_perror(), nasl_set_filename(), nasl_set_function_filename(), naslparse(), YYSTYPE::node, NODE_AFF, NODE_ARG, NODE_ARRAY_EL, NODE_BREAK, NODE_CONTINUE, NODE_DECL, NODE_DIV_EQ, NODE_FOR, NODE_FOREACH, NODE_FUN_CALL, NODE_FUN_DEF, NODE_GLOBAL, NODE_IF_ELSE, NODE_INSTR_L, NODE_L_SHIFT_EQ, NODE_LOCAL, NODE_MINUS_EQ, NODE_MODULO_EQ, NODE_MULT_EQ, NODE_PLUS_EQ, NODE_R_SHIFT_EQ, NODE_R_USHIFT_EQ, NODE_REPEAT_UNTIL, NODE_REPEATED, NODE_RETURN, NODE_VAR, NODE_WHILE, YYSTYPE::num, ref_cell(), YYSTYPE::str, TC::str_val, naslctxt::tree, YY_, YY_ACCESSING_SYMBOL, YY_ASSERT, YY_CAST, YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_IGNORE_USELESS_CAST_BEGIN, YY_IGNORE_USELESS_CAST_END, YY_INITIAL_VALUE, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yycheck, yydefact, yydefgoto, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, yyerrok, YYERROR, YYerror, yyerror, YYFINAL, YYINITDEPTH, YYLAST, yylex, YYMAXDEPTH, yynerrs, YYNOMEM, YYNSTATES, YYNTOKENS, yypact, yypact_value_is_default, yypgoto, YYPOPSTACK, YYPTRDIFF_T, yyr1, yyr2, YYSIZE_T, YYSIZEOF, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, YYSYMBOL_YYEMPTY, YYSYMBOL_YYEOF, YYSYMBOL_YYerror, yytable, yytable_value_is_error, YYTRANSLATE, YYUNDEF, and yyalloc::yyvs_alloc.

Here is the call graph for this function:

◆ yysymbol_name()

const char * yysymbol_name ( yysymbol_kind_t yysymbol)
static

Definition at line 709 of file nasl_grammar.tab.c.

710{
711 return yytname[yysymbol];
712}
static const char *const yytname[]

References yytname.

Referenced by yy_symbol_print().

Here is the caller graph for this function:

Variable Documentation

◆ checksum_algorithm

int checksum_algorithm = GCRY_MD_NONE
static

Definition at line 2564 of file nasl_grammar.tab.c.

Referenced by init_nasl_ctx(), and load_checksums().

◆ inc_dirs

GSList* inc_dirs = NULL
static

Definition at line 2519 of file nasl_grammar.tab.c.

Referenced by add_nasl_inc_dir(), and init_nasl_ctx().

◆ include_order

int include_order = 0
static

Definition at line 112 of file nasl_grammar.tab.c.

Referenced by init_nasl_ctx(), and yyparse().

◆ includes_hash

GHashTable* includes_hash = NULL

Definition at line 116 of file nasl_grammar.tab.c.

Referenced by nasl_clean_inc(), nasl_get_include_order(), and yyparse().

◆ parse_buffer

char* parse_buffer = NULL
static

Definition at line 109 of file nasl_grammar.tab.c.

Referenced by init_nasl_ctx(), and mylex().

◆ parse_len

int parse_len = 0
static

Definition at line 111 of file nasl_grammar.tab.c.

Referenced by init_nasl_ctx(), and mylex().

◆ yycheck

const yytype_int16 yycheck[]
static

Definition at line 912 of file nasl_grammar.tab.c.

912 {
913 0, 55, 0, 14, 69, 5, 6, 5, 13, 66,
914 10, 13, 0, 13, 14, 15, 16, 5, 18, 5,
915 18, 21, 61, 21, 26, 27, 61, 15, 16, 68,
916 18, 0, 18, 21, 61, 31, 5, 0, 43, 15,
917 16, 43, 5, 44, 45, 45, 61, 45, 61, 18,
918 0, 13, 21, 61, 66, 18, 72, 45, 21, 55,
919 56, 57, 26, 27, 16, 68, 131, 132, 32, 33,
920 34, 35, 36, 37, 38, 39, 45, 61, 63, 79,
921 46, 79, 45, 47, 44, 45, 46, 44, 45, 46,
922 65, 79, 66, 79, 105, 95, 31, 61, 42, 42,
923 42, 69, 63, 67, 68, 105, 62, 62, 4, 63,
924 79, 0, 1, 62, 3, 46, 79, 64, 69, 72,
925 174, 62, 176, 46, 13, 14, 15, 72, 17, 18,
926 19, 20, 21, 22, 23, 24, 25, 26, 27, 21,
927 146, 212, 79, 219, 204, 176, 146, -1, 174, -1,
928 26, 27, -1, -1, 43, -1, 32, 33, 34, 35,
929 36, 37, 38, 39, -1, -1, 166, -1, 166, -1,
930 170, 47, 170, -1, -1, 64, -1, 66, 166, -1,
931 166, -1, 170, -1, 170, 61, -1, -1, 28, 29,
932 30, 31, 68, -1, -1, -1, -1, 166, -1, -1,
933 11, 170, -1, 166, 204, -1, -1, 170, -1, -1,
934 210, -1, 210, 53, 54, 55, 56, 57, 218, 219,
935 218, 219, 210, -1, 210, -1, 226, -1, 226, -1,
936 218, 219, 218, 44, -1, -1, -1, 48, 226, -1,
937 226, 210, 53, 54, -1, 56, 57, 210, -1, 218,
938 219, -1, -1, -1, -1, 218, 219, 226, -1, -1,
939 -1, -1, -1, 226, -1, -1, -1, -1, 28, 29,
940 30, 31, 83, -1, -1, 86, 87, 88, 89, 90,
941 91, 92, 93, 94, -1, 96, -1, -1, -1, -1,
942 -1, 102, 103, 53, 54, 55, 56, 57, -1, -1,
943 -1, -1, -1, -1, -1, -1, -1, -1, 119, 120,
944 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
945 -1, -1, 133, 134, 135, 136, 137, 138, 139, 140,
946 141, 142, -1, -1, -1, -1, -1, -1, -1, -1,
947 -1, 1, -1, 3, 28, 29, 30, 31, -1, -1,
948 -1, -1, -1, 13, 14, 15, 167, 17, 18, 19,
949 20, 21, 22, 23, 24, 25, 26, 27, 52, 53,
950 54, 55, 56, 57, 1, -1, 3, -1, -1, -1,
951 -1, -1, -1, 43, -1, -1, 13, 14, 15, -1,
952 17, 18, 19, 20, 205, 22, 23, 24, 25, 26,
953 27, 1, -1, 3, 64, -1, 66, -1, -1, -1,
954 -1, -1, -1, 13, 14, 15, 43, 17, 18, 19,
955 20, -1, 22, 23, 24, 25, 26, 27, 1, -1,
956 3, -1, 28, 29, 30, 31, -1, 64, 65, 66,
957 13, 14, 15, 43, 17, 18, 19, 20, -1, 22,
958 23, 24, 25, 26, 27, 51, 52, 53, 54, 55,
959 56, 57, -1, -1, 64, 65, 66, -1, -1, -1,
960 43, 5, 6, 7, 8, 9, 10, 11, 12, -1,
961 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
962 -1, 64, -1, 66, 28, 29, 30, 31, -1, -1,
963 -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
964 -1, -1, -1, -1, 48, 49, 50, 51, 52, 53,
965 54, 55, 56, 57, 5, 6, 7, 8, 9, 10,
966 11, 12, 66, 26, 27, -1, -1, -1, -1, 32,
967 33, 34, 35, 36, 37, 38, 39, 28, 29, 30,
968 31, 13, -1, -1, 47, -1, -1, -1, -1, 40,
969 41, -1, -1, -1, 26, 27, -1, 48, 49, 50,
970 51, 52, 53, 54, 55, 56, 57, -1, -1, -1,
971 -1, 43, 44, 45, 46, 66, -1, -1, -1, -1,
972 -1, -1, 54, -1, -1, -1, -1, -1, -1, 61,
973 -1, -1, -1, -1, -1, -1, 68, -1, 70, 71,
974 5, 6, 7, 8, 9, 10, 11, 12, 26, 27,
975 -1, -1, -1, -1, 32, 33, 34, 35, 36, 37,
976 38, 39, -1, 28, 29, 30, 31, -1, -1, 47,
977 -1, -1, -1, -1, -1, 40, 41, -1, -1, -1,
978 -1, -1, -1, 48, 49, 50, 51, 52, 53, 54,
979 55, 56, 57, -1, -1, -1, -1, 62, 5, 6,
980 7, 8, 9, 10, 11, 12, -1, -1, -1, -1,
981 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
982 -1, 28, 29, 30, 31, -1, -1, -1, -1, -1,
983 -1, -1, -1, 40, 41, -1, -1, -1, -1, -1,
984 -1, 48, 49, 50, 51, 52, 53, 54, 55, 56,
985 57, -1, -1, -1, -1, 62, 5, 6, 7, 8,
986 9, 10, 11, 12, -1, -1, -1, -1, -1, -1,
987 -1, -1, -1, -1, -1, -1, -1, -1, -1, 28,
988 29, 30, 31, -1, -1, -1, -1, -1, -1, -1,
989 -1, 40, 41, -1, -1, -1, -1, -1, -1, 48,
990 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
991 -1, -1, -1, 62, 5, 6, 7, 8, 9, 10,
992 11, 12, -1, -1, -1, -1, -1, -1, -1, -1,
993 -1, -1, -1, -1, -1, -1, -1, 28, 29, 30,
994 31, -1, -1, -1, -1, -1, -1, -1, -1, 40,
995 41, -1, -1, -1, -1, -1, -1, 48, 49, 50,
996 51, 52, 53, 54, 55, 56, 57, -1, -1, -1,
997 -1, 62, 5, 6, 7, 8, 9, 10, 11, 12,
998 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
999 -1, -1, -1, -1, -1, 28, 29, 30, 31, -1,
1000 -1, -1, -1, -1, -1, -1, -1, 40, 41, -1,
1001 -1, -1, -1, -1, -1, 48, 49, 50, 51, 52,
1002 53, 54, 55, 56, 57, 5, 6, 7, 8, -1,
1003 10, 11, 12, -1, -1, -1, -1, -1, -1, -1,
1004 -1, -1, -1, -1, -1, -1, -1, -1, 28, 29,
1005 30, 31, -1, -1, -1, -1, 5, 6, 7, 8,
1006 40, 41, 11, 12, -1, -1, -1, -1, 48, 49,
1007 50, 51, 52, 53, 54, 55, 56, 57, -1, 28,
1008 29, 30, 31, -1, -1, -1, -1, 5, 6, 7,
1009 8, 40, 41, 11, 12, -1, -1, -1, -1, 48,
1010 49, 50, 51, 52, 53, 54, 55, 56, 57, -1,
1011 28, 29, 30, 31, -1, -1, -1, -1, -1, -1,
1012 -1, -1, 40, 41, -1, -1, -1, -1, -1, -1,
1013 48, 49, 50, 51, 52, 53, 54, 55, 56, 57
1014};

Referenced by yyparse().

◆ yydebug

int yydebug

Definition at line 1238 of file nasl_grammar.tab.c.

◆ yydefact

const yytype_int8 yydefact[]
static
Initial value:
=
{
0, 0, 0, 71, 0, 0, 0, 0, 29, 30,
0, 33, 0, 8, 8, 0, 0, 70, 0, 0,
2, 0, 6, 17, 5, 0, 25, 18, 19, 36,
37, 38, 39, 23, 26, 24, 21, 0, 68, 69,
22, 27, 28, 20, 0, 47, 0, 0, 0, 0,
119, 118, 117, 0, 0, 0, 0, 0, 123, 108,
124, 122, 96, 32, 111, 110, 107, 121, 109, 0,
126, 9, 10, 127, 74, 68, 75, 13, 0, 0,
1, 4, 16, 0, 76, 77, 0, 0, 0, 0,
0, 0, 0, 0, 0, 54, 0, 0, 0, 46,
44, 45, 0, 0, 0, 8, 0, 84, 0, 119,
118, 117, 0, 0, 113, 120, 115, 80, 85, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 49, 50, 0, 0, 12, 15, 48,
60, 61, 62, 63, 64, 67, 65, 66, 59, 0,
53, 55, 124, 57, 0, 73, 0, 0, 0, 0,
0, 0, 0, 78, 0, 112, 0, 103, 104, 105,
106, 81, 79, 97, 98, 95, 93, 94, 87, 99,
100, 101, 102, 92, 91, 90, 82, 83, 86, 88,
89, 51, 11, 52, 0, 0, 72, 34, 0, 42,
0, 41, 0, 0, 116, 114, 56, 58, 0, 47,
43, 7, 0, 35, 0, 0, 0, 125, 40
}

Definition at line 757 of file nasl_grammar.tab.c.

757 {
758 0, 0, 0, 71, 0, 0, 0, 0, 29, 30,
759 0, 33, 0, 8, 8, 0, 0, 70, 0, 0,
760 2, 0, 6, 17, 5, 0, 25, 18, 19, 36,
761 37, 38, 39, 23, 26, 24, 21, 0, 68, 69,
762 22, 27, 28, 20, 0, 47, 0, 0, 0, 0,
763 119, 118, 117, 0, 0, 0, 0, 0, 123, 108,
764 124, 122, 96, 32, 111, 110, 107, 121, 109, 0,
765 126, 9, 10, 127, 74, 68, 75, 13, 0, 0,
766 1, 4, 16, 0, 76, 77, 0, 0, 0, 0,
767 0, 0, 0, 0, 0, 54, 0, 0, 0, 46,
768 44, 45, 0, 0, 0, 8, 0, 84, 0, 119,
769 118, 117, 0, 0, 113, 120, 115, 80, 85, 0,
770 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
771 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
772 0, 0, 0, 49, 50, 0, 0, 12, 15, 48,
773 60, 61, 62, 63, 64, 67, 65, 66, 59, 0,
774 53, 55, 124, 57, 0, 73, 0, 0, 0, 0,
775 0, 0, 0, 78, 0, 112, 0, 103, 104, 105,
776 106, 81, 79, 97, 98, 95, 93, 94, 87, 99,
777 100, 101, 102, 92, 91, 90, 82, 83, 86, 88,
778 89, 51, 11, 52, 0, 0, 72, 34, 0, 42,
779 0, 41, 0, 0, 116, 114, 56, 58, 0, 47,
780 43, 7, 0, 35, 0, 0, 0, 125, 40
781};

Referenced by yyparse().

◆ yydefgoto

const yytype_uint8 yydefgoto[]
static
Initial value:
=
{
0, 19, 20, 21, 22, 70, 71, 23, 78, 24,
25, 26, 27, 28, 29, 30, 31, 32, 98, 33,
112, 34, 58, 159, 160, 161, 59, 37, 60, 61,
164, 62, 163, 64, 113, 114, 65, 116, 66, 67,
68, 41, 42
}

Definition at line 795 of file nasl_grammar.tab.c.

795 {
796 0, 19, 20, 21, 22, 70, 71, 23, 78, 24,
797 25, 26, 27, 28, 29, 30, 31, 32, 98, 33,
798 112, 34, 58, 159, 160, 161, 59, 37, 60, 61,
799 164, 62, 163, 64, 113, 114, 65, 116, 66, 67,
800 68, 41, 42
801};

Referenced by yyparse().

◆ yypact

const yytype_int16 yypact[]
static
Initial value:
=
{
340, -57, -35, -77, -27, 427, -5, -15, -77, -77,
-5, 538, -13, -5, -5, -5, -5, -77, 373, 50,
-77, 111, -77, -77, -77, -12, -77, -77, -77, -77,
-77, -77, -77, -77, -77, 38, -77, 507, -39, -77,
-77, -77, -77, -77, 538, -2, 48, -8, 538, 16,
-77, -77, -16, 538, 538, 40, 538, 538, -77, -77,
124, 592, -77, 837, -77, -77, -77, -77, -77, -1,
-77, -77, 15, -77, -77, -3, -77, -77, 25, 400,
-77, -77, -77, 538, -77, -77, 538, 538, 538, 538,
538, 538, 538, 538, 538, 538, 538, 605, 26, -77,
-77, -77, 538, 538, 663, -5, 34, 65, 721, 56,
57, -77, 58, 32, 39, -77, -77, 65, 65, 538,
538, 538, 538, 538, 538, 538, 538, 538, 538, 538,
538, -1, -1, 538, 538, 538, 538, 538, 538, 538,
538, 538, 538, -77, -77, 44, -5, -77, -77, 837,
837, 837, 837, 837, 837, 837, 837, 837, 837, 45,
-77, 46, 36, 837, 49, 837, 427, 538, 466, 779,
427, 51, 47, -77, 43, -77, 40, 921, 921, 921,
921, 890, 952, 921, 921, 160, 160, 160, 65, -77,
-77, 921, 921, 404, 316, 240, 4, 4, 65, 65,
65, -77, -77, -77, 538, 538, -77, 104, 519, -77,
427, -77, 53, 69, -77, -77, -77, 837, 427, -2,
-77, -77, 55, -77, 59, 77, 427, -77, -77
}

Definition at line 727 of file nasl_grammar.tab.c.

727 {
728 340, -57, -35, -77, -27, 427, -5, -15, -77, -77,
729 -5, 538, -13, -5, -5, -5, -5, -77, 373, 50,
730 -77, 111, -77, -77, -77, -12, -77, -77, -77, -77,
731 -77, -77, -77, -77, -77, 38, -77, 507, -39, -77,
732 -77, -77, -77, -77, 538, -2, 48, -8, 538, 16,
733 -77, -77, -16, 538, 538, 40, 538, 538, -77, -77,
734 124, 592, -77, 837, -77, -77, -77, -77, -77, -1,
735 -77, -77, 15, -77, -77, -3, -77, -77, 25, 400,
736 -77, -77, -77, 538, -77, -77, 538, 538, 538, 538,
737 538, 538, 538, 538, 538, 538, 538, 605, 26, -77,
738 -77, -77, 538, 538, 663, -5, 34, 65, 721, 56,
739 57, -77, 58, 32, 39, -77, -77, 65, 65, 538,
740 538, 538, 538, 538, 538, 538, 538, 538, 538, 538,
741 538, -1, -1, 538, 538, 538, 538, 538, 538, 538,
742 538, 538, 538, -77, -77, 44, -5, -77, -77, 837,
743 837, 837, 837, 837, 837, 837, 837, 837, 837, 45,
744 -77, 46, 36, 837, 49, 837, 427, 538, 466, 779,
745 427, 51, 47, -77, 43, -77, 40, 921, 921, 921,
746 921, 890, 952, 921, 921, 160, 160, 160, 65, -77,
747 -77, 921, 921, 404, 316, 240, 4, 4, 65, 65,
748 65, -77, -77, -77, 538, 538, -77, 104, 519, -77,
749 427, -77, 53, 69, -77, -77, -77, 837, 427, -2,
750 -77, -77, 55, -77, 59, 77, 427, -77, -77
751};

Referenced by yyparse().

◆ yypgoto

const yytype_int16 yypgoto[]
static
Initial value:
=
{
-77, -77, 118, -77, -77, -11, -6, -71, 63, 14,
-77, -77, -77, -77, -77, -77, -77, -77, -76, -77,
-65, -77, 2, -77, -60, -77, 31, 24, 0, 12,
-77, 37, 189, -77, -31, -77, -54, -26, -77, -77,
-77, -77, -77
}

Definition at line 785 of file nasl_grammar.tab.c.

785 {
786 -77, -77, 118, -77, -77, -11, -6, -71, 63, 14,
787 -77, -77, -77, -77, -77, -77, -77, -77, -76, -77,
788 -65, -77, 2, -77, -60, -77, 31, 24, 0, 12,
789 -77, 37, 189, -77, -31, -77, -54, -26, -77, -77,
790 -77, -77, -77
791};

Referenced by yyparse().

◆ yyr1

const yytype_int8 yyr1[]
static
Initial value:
=
{
0, 73, 74, 75, 75, 76, 76, 77, 78, 78,
79, 79, 80, 80, 81, 81, 82, 82, 82, 82,
82, 83, 83, 83, 83, 83, 83, 83, 83, 83,
83, 83, 84, 84, 85, 85, 86, 86, 86, 86,
87, 88, 89, 90, 91, 91, 91, 91, 92, 93,
93, 94, 95, 96, 96, 97, 97, 98, 98, 99,
99, 99, 99, 99, 99, 99, 99, 99, 100, 100,
101, 101, 102, 103, 104, 104, 104, 104, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 105, 106, 107, 107, 108, 108, 109, 109, 109,
110, 111, 111, 111, 112, 113, 114, 115
}

Definition at line 1047 of file nasl_grammar.tab.c.

1047 {
1048 0, 73, 74, 75, 75, 76, 76, 77, 78, 78,
1049 79, 79, 80, 80, 81, 81, 82, 82, 82, 82,
1050 82, 83, 83, 83, 83, 83, 83, 83, 83, 83,
1051 83, 83, 84, 84, 85, 85, 86, 86, 86, 86,
1052 87, 88, 89, 90, 91, 91, 91, 91, 92, 93,
1053 93, 94, 95, 96, 96, 97, 97, 98, 98, 99,
1054 99, 99, 99, 99, 99, 99, 99, 99, 100, 100,
1055 101, 101, 102, 103, 104, 104, 104, 104, 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, 105, 105, 105, 105, 105, 105, 105, 105,
1059 105, 105, 106, 107, 107, 108, 108, 109, 109, 109,
1060 110, 111, 111, 111, 112, 113, 114, 115
1061};

Referenced by yyparse().

◆ yyr2

const yytype_int8 yyr2[]
static
Initial value:
=
{
0, 2, 1, 1, 2, 1, 1, 6, 0, 1,
1, 3, 3, 2, 1, 2, 2, 1, 1, 1,
2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 2, 1, 5, 7, 1, 1, 1, 1,
9, 5, 5, 6, 1, 1, 1, 0, 3, 1,
1, 4, 4, 1, 0, 1, 3, 1, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 1, 1,
1, 1, 4, 1, 2, 2, 2, 2, 3, 3,
2, 3, 3, 3, 2, 2, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 1, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 1, 1, 1,
1, 1, 3, 1, 3, 1, 3, 1, 1, 1,
1, 1, 1, 1, 1, 7, 2, 2
}

Definition at line 1065 of file nasl_grammar.tab.c.

1065 {
1066 0, 2, 1, 1, 2, 1, 1, 6, 0, 1,
1067 1, 3, 3, 2, 1, 2, 2, 1, 1, 1,
1068 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1069 1, 0, 2, 1, 5, 7, 1, 1, 1, 1,
1070 9, 5, 5, 6, 1, 1, 1, 0, 3, 1,
1071 1, 4, 4, 1, 0, 1, 3, 1, 3, 3,
1072 3, 3, 3, 3, 3, 3, 3, 3, 1, 1,
1073 1, 1, 4, 1, 2, 2, 2, 2, 3, 3,
1074 2, 3, 3, 3, 2, 2, 3, 3, 3, 3,
1075 3, 3, 3, 3, 3, 3, 1, 3, 3, 3,
1076 3, 3, 3, 3, 3, 3, 3, 1, 1, 1,
1077 1, 1, 3, 1, 3, 1, 3, 1, 1, 1,
1078 1, 1, 1, 1, 1, 7, 2, 2
1079};

Referenced by yy_reduce_print(), and yyparse().

◆ yyrline

const yytype_int16 yyrline[]
static
Initial value:
=
{
0, 152, 152, 157, 163, 170, 170, 173, 184, 184,
185, 192, 202, 202, 203, 204, 219, 219, 219, 219,
220, 224, 224, 224, 225, 225, 225, 225, 225, 226,
231, 236, 239, 246, 254, 261, 270, 270, 270, 270,
271, 282, 290, 299, 310, 310, 310, 310, 313, 322,
322, 325, 385, 394, 394, 395, 395, 401, 408, 418,
422, 423, 424, 425, 426, 427, 428, 429, 432, 436,
438, 438, 440, 448, 451, 452, 453, 454, 458, 459,
460, 461, 462, 463, 464, 465, 466, 467, 468, 469,
470, 471, 472, 473, 474, 475, 476, 477, 478, 479,
480, 481, 482, 483, 484, 485, 486, 487, 487, 487,
487, 487, 490, 492, 493, 497, 500, 506, 507, 511,
516, 518, 524, 524, 526, 528, 538, 546
}

Definition at line 658 of file nasl_grammar.tab.c.

658 {
659 0, 152, 152, 157, 163, 170, 170, 173, 184, 184,
660 185, 192, 202, 202, 203, 204, 219, 219, 219, 219,
661 220, 224, 224, 224, 225, 225, 225, 225, 225, 226,
662 231, 236, 239, 246, 254, 261, 270, 270, 270, 270,
663 271, 282, 290, 299, 310, 310, 310, 310, 313, 322,
664 322, 325, 385, 394, 394, 395, 395, 401, 408, 418,
665 422, 423, 424, 425, 426, 427, 428, 429, 432, 436,
666 438, 438, 440, 448, 451, 452, 453, 454, 458, 459,
667 460, 461, 462, 463, 464, 465, 466, 467, 468, 469,
668 470, 471, 472, 473, 474, 475, 476, 477, 478, 479,
669 480, 481, 482, 483, 484, 485, 486, 487, 487, 487,
670 487, 487, 490, 492, 493, 497, 500, 506, 507, 511,
671 516, 518, 524, 524, 526, 528, 538, 546
672};

Referenced by yy_reduce_print().

◆ yystos

const yytype_int8 yystos[]
static
Initial value:
=
{
0, 1, 3, 13, 14, 15, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 43, 64, 74,
75, 76, 77, 80, 82, 83, 84, 85, 86, 87,
88, 89, 90, 92, 94, 95, 99, 100, 101, 102,
104, 114, 115, 66, 61, 61, 82, 101, 61, 101,
44, 45, 46, 54, 61, 68, 70, 71, 95, 99,
101, 102, 104, 105, 106, 109, 111, 112, 113, 61,
78, 79, 101, 78, 100, 101, 100, 65, 81, 82,
0, 75, 66, 13, 26, 27, 32, 33, 34, 35,
36, 37, 38, 39, 47, 61, 68, 105, 91, 95,
99, 104, 16, 61, 105, 61, 72, 105, 105, 44,
45, 46, 93, 107, 108, 109, 110, 105, 105, 5,
6, 7, 8, 9, 10, 11, 12, 28, 29, 30,
31, 40, 41, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 44, 45, 93, 63, 65, 81, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 96,
97, 98, 101, 105, 103, 105, 62, 66, 105, 105,
62, 78, 46, 62, 42, 69, 63, 105, 105, 105,
105, 105, 105, 105, 105, 105, 105, 105, 105, 93,
93, 105, 105, 105, 105, 105, 105, 105, 105, 105,
105, 62, 79, 62, 63, 67, 69, 82, 105, 66,
62, 82, 62, 72, 110, 107, 97, 105, 4, 66,
82, 80, 46, 82, 91, 72, 62, 46, 82
}

Definition at line 1019 of file nasl_grammar.tab.c.

1019 {
1020 0, 1, 3, 13, 14, 15, 17, 18, 19, 20,
1021 21, 22, 23, 24, 25, 26, 27, 43, 64, 74,
1022 75, 76, 77, 80, 82, 83, 84, 85, 86, 87,
1023 88, 89, 90, 92, 94, 95, 99, 100, 101, 102,
1024 104, 114, 115, 66, 61, 61, 82, 101, 61, 101,
1025 44, 45, 46, 54, 61, 68, 70, 71, 95, 99,
1026 101, 102, 104, 105, 106, 109, 111, 112, 113, 61,
1027 78, 79, 101, 78, 100, 101, 100, 65, 81, 82,
1028 0, 75, 66, 13, 26, 27, 32, 33, 34, 35,
1029 36, 37, 38, 39, 47, 61, 68, 105, 91, 95,
1030 99, 104, 16, 61, 105, 61, 72, 105, 105, 44,
1031 45, 46, 93, 107, 108, 109, 110, 105, 105, 5,
1032 6, 7, 8, 9, 10, 11, 12, 28, 29, 30,
1033 31, 40, 41, 48, 49, 50, 51, 52, 53, 54,
1034 55, 56, 57, 44, 45, 93, 63, 65, 81, 105,
1035 105, 105, 105, 105, 105, 105, 105, 105, 105, 96,
1036 97, 98, 101, 105, 103, 105, 62, 66, 105, 105,
1037 62, 78, 46, 62, 42, 69, 63, 105, 105, 105,
1038 105, 105, 105, 105, 105, 105, 105, 105, 105, 93,
1039 93, 105, 105, 105, 105, 105, 105, 105, 105, 105,
1040 105, 62, 79, 62, 63, 67, 69, 82, 105, 66,
1041 62, 82, 62, 72, 110, 107, 97, 105, 4, 66,
1042 82, 80, 46, 82, 91, 72, 62, 46, 82
1043};

◆ yytable

const yytype_int16 yytable[]
static

Definition at line 807 of file nasl_grammar.tab.c.

807 {
808 38, 115, 35, 73, 145, 38, 47, 35, 3, 43,
809 49, 3, 39, 72, 72, 75, 75, 39, 38, 46,
810 35, 38, 95, 35, 15, 16, 44, 39, 39, 96,
811 39, 36, 79, 39, 45, 130, 36, 40, 17, 74,
812 76, 17, 40, 143, 144, 38, 48, 99, 69, 36,
813 80, 83, 36, 103, 82, 40, 106, 39, 40, 140,
814 141, 142, -68, -68, 102, 96, 189, 190, -68, -68,
815 -68, -68, -68, -68, -68, -68, 100, 105, 146, 38,
816 172, 35, 101, -68, 109, 110, 111, 50, 51, 111,
817 147, 39, 167, 79, 171, 162, 130, 95, -49, -50,
818 174, 175, 176, 205, 96, 72, 201, 203, 218, 204,
819 36, -3, 1, 212, 2, 222, 40, 18, 206, 213,
820 115, 226, 115, 227, 3, 4, 5, 225, 6, 7,
821 8, 9, 10, 11, 12, 13, 14, 15, 16, 81,
822 202, 221, 148, 224, 216, 215, 72, 0, 214, 0,
823 -68, -68, 0, 0, 17, 0, -68, -68, -68, -68,
824 -68, -68, -68, -68, 0, 0, 38, 0, 35, 0,
825 38, -68, 35, 0, 0, 18, 0, -31, 39, 0,
826 207, 0, 39, 0, 211, 95, 0, 0, -70, -70,
827 -70, 130, 96, 0, 0, 0, 0, 36, 0, 0,
828 63, 36, 0, 40, 162, 0, 0, 40, 0, 0,
829 38, 0, 35, 138, 139, 140, 141, 142, 38, 38,
830 35, 99, 39, 0, 220, 0, 38, 0, 35, 0,
831 39, 39, 223, 97, 0, 0, 0, 104, 39, 0,
832 228, 36, 107, 108, 0, 117, 118, 40, 0, 36,
833 100, 0, 0, 0, 0, 40, 101, 36, 0, 0,
834 0, 0, 0, 40, 0, 0, 0, 0, 127, 128,
835 129, 130, 149, 0, 0, 150, 151, 152, 153, 154,
836 155, 156, 157, 158, 0, 165, 0, 0, 0, 0,
837 0, 168, 169, 138, 139, 140, 141, 142, 0, 0,
838 0, 0, 0, 0, 0, 0, 0, 0, 177, 178,
839 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
840 0, 0, 191, 192, 193, 194, 195, 196, 197, 198,
841 199, 200, 0, 0, 0, 0, 0, 0, 0, 0,
842 0, 1, 0, 2, 127, 128, 129, 130, 0, 0,
843 0, 0, 0, 3, 4, 5, 208, 6, 7, 8,
844 9, 10, 11, 12, 13, 14, 15, 16, 137, 138,
845 139, 140, 141, 142, 1, 0, 2, 0, 0, 0,
846 0, 0, 0, 17, 0, 0, 3, 4, 5, 0,
847 6, 7, 8, 9, 217, 11, 12, 13, 14, 15,
848 16, 1, 0, 2, 18, 0, -31, 0, 0, 0,
849 0, 0, 0, 3, 4, 5, 17, 6, 7, 8,
850 9, 0, 11, 12, 13, 14, 15, 16, 1, 0,
851 2, 0, 127, 128, 129, 130, 0, 18, 77, -31,
852 3, 4, 5, 17, 6, 7, 8, 9, 0, 11,
853 12, 13, 14, 15, 16, 136, 137, 138, 139, 140,
854 141, 142, 0, 0, 18, -14, -31, 0, 0, 0,
855 17, 119, 120, 121, 122, 123, 124, 125, 126, 0,
856 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
857 0, 18, 0, -31, 127, 128, 129, 130, 0, 0,
858 0, 0, 0, 0, 0, 0, 131, 132, 0, 0,
859 0, 0, 0, 0, 133, 134, 135, 136, 137, 138,
860 139, 140, 141, 142, 119, 120, 121, 122, 123, 124,
861 125, 126, 209, 84, 85, 0, 0, 0, 0, 86,
862 87, 88, 89, 90, 91, 92, 93, 127, 128, 129,
863 130, 3, 0, 0, 94, 0, 0, 0, 0, 131,
864 132, 0, 0, 0, 15, 16, 0, 133, 134, 135,
865 136, 137, 138, 139, 140, 141, 142, 0, 0, 0,
866 0, 17, 50, 51, 52, 219, 0, 0, 0, 0,
867 0, 0, 53, 0, 0, 0, 0, 0, 0, 54,
868 0, 0, 0, 0, 0, 0, 55, 0, 56, 57,
869 119, 120, 121, 122, 123, 124, 125, 126, -69, -69,
870 0, 0, 0, 0, -69, -69, -69, -69, -69, -69,
871 -69, -69, 0, 127, 128, 129, 130, 0, 0, -69,
872 0, 0, 0, 0, 0, 131, 132, 0, 0, 0,
873 0, 0, 0, 133, 134, 135, 136, 137, 138, 139,
874 140, 141, 142, 0, 0, 0, 0, 166, 119, 120,
875 121, 122, 123, 124, 125, 126, 0, 0, 0, 0,
876 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
877 0, 127, 128, 129, 130, 0, 0, 0, 0, 0,
878 0, 0, 0, 131, 132, 0, 0, 0, 0, 0,
879 0, 133, 134, 135, 136, 137, 138, 139, 140, 141,
880 142, 0, 0, 0, 0, 170, 119, 120, 121, 122,
881 123, 124, 125, 126, 0, 0, 0, 0, 0, 0,
882 0, 0, 0, 0, 0, 0, 0, 0, 0, 127,
883 128, 129, 130, 0, 0, 0, 0, 0, 0, 0,
884 0, 131, 132, 0, 0, 0, 0, 0, 0, 133,
885 134, 135, 136, 137, 138, 139, 140, 141, 142, 0,
886 0, 0, 0, 173, 119, 120, 121, 122, 123, 124,
887 125, 126, 0, 0, 0, 0, 0, 0, 0, 0,
888 0, 0, 0, 0, 0, 0, 0, 127, 128, 129,
889 130, 0, 0, 0, 0, 0, 0, 0, 0, 131,
890 132, 0, 0, 0, 0, 0, 0, 133, 134, 135,
891 136, 137, 138, 139, 140, 141, 142, 0, 0, 0,
892 0, 210, 119, 120, 121, 122, 123, 124, 125, 126,
893 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
894 0, 0, 0, 0, 0, 127, 128, 129, 130, 0,
895 0, 0, 0, 0, 0, 0, 0, 131, 132, 0,
896 0, 0, 0, 0, 0, 133, 134, 135, 136, 137,
897 138, 139, 140, 141, 142, 119, 120, 121, 122, 0,
898 124, 125, 126, 0, 0, 0, 0, 0, 0, 0,
899 0, 0, 0, 0, 0, 0, 0, 0, 127, 128,
900 129, 130, 0, 0, 0, 0, -70, -70, -70, -70,
901 131, 132, -70, -70, 0, 0, 0, 0, 133, 134,
902 135, 136, 137, 138, 139, 140, 141, 142, 0, 127,
903 128, 129, 130, 0, 0, 0, 0, 119, 120, 121,
904 122, -70, -70, 125, 126, 0, 0, 0, 0, -70,
905 -70, 135, 136, 137, 138, 139, 140, 141, 142, 0,
906 127, 128, 129, 130, 0, 0, 0, 0, 0, 0,
907 0, 0, 131, 132, 0, 0, 0, 0, 0, 0,
908 133, 134, 135, 136, 137, 138, 139, 140, 141, 142
909};

Referenced by yyparse().

◆ yytname

const char* const yytname[]
static
Initial value:
=
{
"\"end of file\"", "error", "\"invalid token\"", "IF", "ELSE", "EQ",
"NEQ", "SUPEQ", "INFEQ", "OR", "AND", "MATCH", "NOMATCH", "REP", "FOR",
"REPEAT", "UNTIL", "FOREACH", "WHILE", "BREAK", "CONTINUE", "FUNCTION",
"RETURN", "INCLUDE", "LOCAL", "GLOBAL", "PLUS_PLUS", "MINUS_MINUS",
"L_SHIFT", "R_SHIFT", "R_USHIFT", "EXPO", "PLUS_EQ", "MINUS_EQ",
"MULT_EQ", "DIV_EQ", "MODULO_EQ", "L_SHIFT_EQ", "R_SHIFT_EQ",
"R_USHIFT_EQ", "RE_MATCH", "RE_NOMATCH", "ARROW", "IDENT", "STRING1",
"STRING2", "INTEGER", "'='", "'<'", "'>'", "'|'", "'^'", "'&'", "'+'",
"'-'", "'*'", "'/'", "'%'", "NOT", "UMINUS", "BIT_NOT", "'('", "')'",
"','", "'{'", "'}'", "';'", "':'", "'['", "']'", "'!'", "'~'", "'.'",
"$accept", "tiptop", "instr_decl_list", "instr_decl", "func_decl",
"arg_decl", "arg_decl_1", "block", "instr_list", "instr", "simple_instr",
"ret", "if_block", "loop", "for_loop", "while_loop", "repeat_loop",
"foreach_loop", "aff_func", "rep", "string", "inc", "func_call",
"arg_list", "arg_list_1", "arg", "aff", "lvalue", "identifier",
"array_elem", "array_index", "post_pre_incr", "expr", "const_array",
"list_array_data", "array_data", "atom", "simple_array_data", "var",
"var_name", "ipaddr", "loc", "glob", YY_NULLPTR
}
#define YY_NULLPTR

Definition at line 686 of file nasl_grammar.tab.c.

686 {
687 "\"end of file\"", "error", "\"invalid token\"", "IF", "ELSE", "EQ",
688 "NEQ", "SUPEQ", "INFEQ", "OR", "AND", "MATCH", "NOMATCH", "REP", "FOR",
689 "REPEAT", "UNTIL", "FOREACH", "WHILE", "BREAK", "CONTINUE", "FUNCTION",
690 "RETURN", "INCLUDE", "LOCAL", "GLOBAL", "PLUS_PLUS", "MINUS_MINUS",
691 "L_SHIFT", "R_SHIFT", "R_USHIFT", "EXPO", "PLUS_EQ", "MINUS_EQ",
692 "MULT_EQ", "DIV_EQ", "MODULO_EQ", "L_SHIFT_EQ", "R_SHIFT_EQ",
693 "R_USHIFT_EQ", "RE_MATCH", "RE_NOMATCH", "ARROW", "IDENT", "STRING1",
694 "STRING2", "INTEGER", "'='", "'<'", "'>'", "'|'", "'^'", "'&'", "'+'",
695 "'-'", "'*'", "'/'", "'%'", "NOT", "UMINUS", "BIT_NOT", "'('", "')'",
696 "','", "'{'", "'}'", "';'", "':'", "'['", "']'", "'!'", "'~'", "'.'",
697 "$accept", "tiptop", "instr_decl_list", "instr_decl", "func_decl",
698 "arg_decl", "arg_decl_1", "block", "instr_list", "instr", "simple_instr",
699 "ret", "if_block", "loop", "for_loop", "while_loop", "repeat_loop",
700 "foreach_loop", "aff_func", "rep", "string", "inc", "func_call",
701 "arg_list", "arg_list_1", "arg", "aff", "lvalue", "identifier",
702 "array_elem", "array_index", "post_pre_incr", "expr", "const_array",
703 "list_array_data", "array_data", "atom", "simple_array_data", "var",
704 "var_name", "ipaddr", "loc", "glob", YY_NULLPTR
705};

Referenced by yysymbol_name().

◆ yytranslate

const yytype_int8 yytranslate[]
static

Definition at line 621 of file nasl_grammar.tab.c.

621 {
622 0, 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, 70, 2, 2, 2, 57, 52, 2,
626 61, 62, 55, 53, 63, 54, 72, 56, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 67, 66,
628 48, 47, 49, 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, 2, 2, 2, 2,
631 2, 68, 2, 69, 51, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 64, 50, 65, 71, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
648 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
649 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
650 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
651 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
652 45, 46, 58, 59, 60
653};