OpenVAS Scanner  22.7.9
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   1
 
#define YYBISON_VERSION   "3.7.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. More...
 
#define YYERROR_VERBOSE
 
#define YY_CAST(Type, Val)   ((Type) (Val))
 
#define YY_REINTERPRET_CAST(Type, Val)   ((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)   YY_CAST (YYPTRDIFF_T, sizeof (X))
 
#define YY_(Msgid)   Msgid
 
#define YY_ATTRIBUTE_PURE
 
#define YY_ATTRIBUTE_UNUSED
 
#define YYUSE(E)   ((void) (E))
 
#define YY_INITIAL_VALUE(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)   ((void) (0 && (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)   YY_CAST (yysymbol_kind_t, yystos[State])
 
#define YYPACT_NINF   (-77)
 
#define yypact_value_is_default(Yyn)    ((Yyn) == YYPACT_NINF)
 
#define YYTABLE_NINF   (-70)
 
#define yytable_value_is_error(Yyn)    ((Yyn) == YYTABLE_NINF)
 
#define yyerrok   (yyerrstatus = 0)
 
#define yyclearin   (yychar = YYEMPTY)
 
#define YYACCEPT   goto yyacceptlab
 
#define YYABORT   goto yyabortlab
 
#define YYERROR   goto yyerrorlab
 
#define YYRECOVERING()   (!!yyerrstatus)
 
#define YYBACKUP(Token, Value)
 
#define YYERRCODE   YYUNDEF
 
#define YYFPRINTF   fprintf
 
#define YYDPRINTF(Args)
 
#define YY_LOCATION_PRINT(File, Loc)   ((void) 0)
 
#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)   (yyvsp -= (N), yyssp -= (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. More...
 
static void load_checksums (kb_t kb)
 
static char * file_checksum (const char *filename, int algorithm)
 Get the checksum of a file. More...
 
int init_nasl_ctx (naslctxt *pc, const char *name)
 Initialize a NASL context for a NASL file. More...
 
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_int16 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.

◆ 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.

◆ LNB

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

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

◆ YY_

#define YY_ (   Msgid)    Msgid

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

◆ YY_ACCESSING_SYMBOL

#define YY_ACCESSING_SYMBOL (   State)    YY_CAST (yysymbol_kind_t, yystos[State])

Accessing symbol of state STATE.

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

◆ YY_ASSERT

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

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

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE

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

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED

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

◆ YY_CAST

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

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

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

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

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

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

◆ YY_IGNORE_USELESS_CAST_BEGIN

#define YY_IGNORE_USELESS_CAST_BEGIN

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

◆ YY_IGNORE_USELESS_CAST_END

#define YY_IGNORE_USELESS_CAST_END

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

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE (   Value)    Value

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

◆ YY_LOCATION_PRINT

#define YY_LOCATION_PRINT (   File,
  Loc 
)    ((void) 0)

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

◆ 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)

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

◆ YY_REINTERPRET_CAST

#define YY_REINTERPRET_CAST (   Type,
  Val 
)    ((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 1203 of file nasl_grammar.tab.c.

◆ 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.

◆ YYABORT

#define YYABORT   goto yyabortlab

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

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

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

◆ 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")); \
YYERROR; \
} \
while (0)

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

◆ YYBISON

#define YYBISON   1

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

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.7.2"

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

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

Definition at line 1084 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)

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

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

Definition at line 536 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)

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

◆ YYERRCODE

#define YYERRCODE   YYUNDEF

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

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

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

◆ yyerror

#define yyerror   naslerror

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

◆ YYERROR

#define YYERROR   goto yyerrorlab

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

◆ YYERROR_VERBOSE

#define YYERROR_VERBOSE

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

◆ YYFINAL

#define YYFINAL   80

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

◆ YYFPRINTF

#define YYFPRINTF   fprintf

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

◆ YYFREE

#define YYFREE   free

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

◆ YYINITDEPTH

#define YYINITDEPTH   200

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

◆ YYLAST

#define YYLAST   1009

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

◆ yylex

#define yylex   nasllex

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

◆ 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 502 of file nasl_grammar.tab.c.

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

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

◆ YYMAXUTOK

#define YYMAXUTOK   304

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

◆ yynerrs

#define yynerrs   naslnerrs

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

◆ YYNNTS

#define YYNNTS   43

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

◆ YYNRULES

#define YYNRULES   127

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

◆ YYNSTATES

#define YYNSTATES   229

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

◆ YYNTOKENS

#define YYNTOKENS   73

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

◆ YYPACT_NINF

#define YYPACT_NINF   (-77)

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

◆ yypact_value_is_default

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

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

◆ 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)    (yyvsp -= (N), yyssp -= (N))

◆ YYPTRDIFF_MAXIMUM

#define YYPTRDIFF_MAXIMUM   LONG_MAX

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

◆ YYPTRDIFF_T

#define YYPTRDIFF_T   long

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

◆ 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 ( )    (!!yyerrstatus)

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

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM
Value:

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

◆ YYSIZE_T

#define YYSIZE_T   unsigned

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

◆ YYSIZEOF

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

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

◆ 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 488 of file nasl_grammar.tab.c.

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

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

◆ YYSTACK_BYTES

#define YYSTACK_BYTES (   N)
Value:

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

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

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

◆ YYSTACK_GAP_MAXIMUM

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

Definition at line 528 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 543 of file nasl_grammar.tab.c.

◆ YYTABLE_NINF

#define YYTABLE_NINF   (-70)

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

◆ yytable_value_is_error

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

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

◆ YYTRANSLATE

#define YYTRANSLATE (   YYX)
Value:
(0 <= (YYX) && (YYX) <= YYMAXUTOK \

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

◆ YYUSE

#define YYUSE (   E)    ((void) (E))

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

Typedef Documentation

◆ yy_state_fast_t

typedef int yy_state_fast_t

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

◆ yy_state_t

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

◆ yysymbol_kind_t

Definition at line 116 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 330 of file nasl_grammar.tab.c.

◆ yytype_uint8

typedef unsigned char yytype_uint8

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
YYENOMEM 

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

1081 { YYENOMEM = -2 };

◆ 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 2827 of file nasl_grammar.tab.c.

2827  {
2828  ST_START = 0,
2829  ST_SPACE,
2830  ST_IDENT,
2831  ST_ZERO,
2832  ST_ZEROX,
2833  ST_OCT,
2834  ST_DEC,
2835  ST_HEX,
2836  ST_COMMENT,
2837  ST_SUP,
2838  ST_INF,
2839  ST_SUP_EXCL,
2840  ST_STRING1,
2842  ST_STRING2,
2843  ST_PLUS,
2844  ST_MINUS,
2845  ST_MULT,
2846  ST_DIV,
2847  ST_MODULO,
2848  ST_R_SHIFT,
2849  ST_R_USHIFT,
2850  ST_L_SHIFT,
2851  ST_NOT,
2852  ST_EQ,
2853  ST_AND,
2854  ST_OR };

◆ 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 };

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 2539 of file nasl_grammar.tab.c.

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

References inc_dirs.

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

Here is the caller graph for this function:

◆ file_checksum()

static 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 2649 of file nasl_grammar.tab.c.

2650 {
2651  char *content = NULL, digest[128], *result;
2652  size_t len = 0, i, alglen;
2653 
2654  assert (algorithm == GCRY_MD_SHA256);
2655  if (!filename || !g_file_get_contents (filename, &content, &len, NULL))
2656  return NULL;
2657 
2658  gcry_md_hash_buffer (algorithm, digest, content, len);
2659  alglen = gcry_md_get_algo_dlen (algorithm);
2660  result = g_malloc0 (alglen * 2 + 1);
2661  for (i = 0; i < alglen; i++)
2662  snprintf (result + 2 * i, 3, "%02x", (unsigned char) digest[i]);
2663  g_free (content);
2664 
2665  return result;
2666 }

References len.

Referenced by init_nasl_ctx().

Here is the caller graph for this function:

◆ free()

◆ init_nasl_ctx()

int init_nasl_ctx ( naslctxt pc,
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 2684 of file nasl_grammar.tab.c.

2685 {
2686  char *full_name = NULL, key_path[2048], *checksum, *filename;
2687  GSList * inc_dir = inc_dirs; // iterator for include directories
2688  size_t flen = 0;
2689  time_t timestamp;
2690 
2691  // initialize if not yet done (for openvas-server < 2.0.1)
2692  if (! inc_dirs) add_nasl_inc_dir("");
2693 
2694  pc->line_nb = 1;
2695  pc->name = (char *) name;
2696  pc->include_order = include_order++;
2697  pc->tree = NULL;
2698  if (!parse_len)
2699  {
2700  parse_len = 9092;
2701  parse_buffer = g_malloc0 (parse_len);
2702  }
2703  else
2704  parse_buffer[0] = '\0';
2705 
2706 
2708  while (inc_dir != NULL) {
2709  if (full_name)
2710  g_free (full_name);
2711  full_name = g_build_filename(inc_dir->data, name, NULL);
2712 
2713  if ((g_file_get_contents (full_name, &pc->buffer, &flen, NULL)))
2714  break;
2715 
2716  inc_dir = g_slist_next(inc_dir);
2717  }
2718 
2719  if (!full_name || !pc->buffer) {
2720  g_message ("%s: Not able to open nor to locate it in include paths",
2721  name);
2722  g_free(full_name);
2723  return -1;
2724  }
2725 
2726  if (pc->always_signed)
2727  {
2728  g_free(full_name);
2729  return 0;
2730  }
2731  /* Cache the checksum of signature verified files, so that commonly included
2732  * files are not verified multiple times per scan. */
2733  if (strstr (full_name, ".inc"))
2734  filename = basename (full_name);
2735  else
2736  filename = full_name;
2737  snprintf (key_path, sizeof (key_path), "signaturecheck:%s", filename);
2738  timestamp = kb_item_get_int (pc->kb, key_path);
2739 
2740  /* We never use the mtime of a .nasl/.inc file as integrity check during
2741  * the script load up. A complete verification is done in this case.
2742  * Once it has been uploaded in the nvticache it is enough to just check
2743  * the mtime. */
2744  if (timestamp > 0 && pc->exec_descr == 0)
2745  {
2746  struct stat file_stat;
2747 
2748  if (stat (full_name, &file_stat) >= 0 && timestamp > file_stat.st_mtime)
2749  {
2750  /* Already checked. No need to check again. */
2751  g_free (full_name);
2752  return 0;
2753  }
2754  }
2755 
2756  load_checksums (pc->kb);
2757  if (checksum_algorithm == GCRY_MD_NONE)
2758  return -1;
2759  else if (checksum_algorithm == GCRY_MD_SHA256)
2760  snprintf (key_path, sizeof (key_path), "sha256sums:%s", filename);
2761  else
2762  abort ();
2763  checksum = kb_item_get_str (pc->kb, key_path);
2764  if (!checksum)
2765  {
2766  g_warning ("No checksum for %s", full_name);
2767  g_free (full_name);
2768  return -1;
2769  }
2770  else
2771  {
2772  int ret;
2773  char *check = file_checksum (full_name, checksum_algorithm);
2774 
2775  snprintf (key_path, sizeof (key_path), "signaturecheck:%s", filename);
2776  ret = strcmp (check, checksum);
2777  if (ret)
2778  {
2779  kb_del_items (pc->kb, key_path);
2780  g_warning ("checksum for %s not matching", full_name);
2781  }
2782  else
2783  {
2784  kb_del_items (pc->kb, key_path);
2785  kb_item_add_int (pc->kb, key_path, time (NULL));
2786  }
2787 
2788  g_free (full_name);
2789  g_free (checksum);
2790  g_free (check);
2791  return ret;
2792  }
2793 }

References add_nasl_inc_dir(), naslctxt::always_signed, naslctxt::buffer, checksum_algorithm, naslctxt::exec_descr, file_checksum(), inc_dirs, naslctxt::include_order, include_order, naslctxt::kb, naslctxt::line_nb, load_checksums(), naslctxt::name, name, nasl_set_filename(), parse_buffer, parse_len, 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()

static void load_checksums ( kb_t  kb)
static

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

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

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  )

Referenced by ipc_contexts_init(), and ipc_exec_as_process().

Here is the caller graph for this function:

◆ mylex()

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

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

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

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, YYSTYPE::asciiz::len, 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 2796 of file nasl_grammar.tab.c.

2797 {
2798  deref_cell(c->tree);
2799  g_free (c->buffer);
2800 }

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 2806 of file nasl_grammar.tab.c.

2807 {
2808  if (!includes_hash)
2809  return;
2810  g_hash_table_destroy (includes_hash);
2811  includes_hash = NULL;
2812 }

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 2815 of file nasl_grammar.tab.c.

2816 {
2817  tree_cell *ctx;
2818  if (!includes_hash)
2819  return -2;
2820 
2821  if ((ctx = g_hash_table_lookup (includes_hash, c))) {
2822  return ctx->include_order;
2823  }
2824  return -1;
2825 }

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()

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

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

2515 {
2516  (void) parm;
2517  (*error_counter)++;
2518  g_message ("Parse error at or near line %d:", LNB);
2519  g_message (" %s", s);
2520 }

References LNB.

◆ nasllex()

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

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

3423 {
3424  #pragma GCC diagnostic push
3425  #pragma GCC diagnostic ignored "-Wunused-parameter"
3426  (void) err_c;
3427  #pragma GCC diagnostic pop
3428  int x = mylex (lvalp, parm);
3429  return x;
3430 }

References mylex().

Here is the call graph for this function:

◆ yy_reduce_print()

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

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

1217 {
1218  int yylno = yyrline[yyrule];
1219  int yynrhs = yyr2[yyrule];
1220  int yyi;
1221  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1222  yyrule - 1, yylno);
1223  /* The symbols being reduced. */
1224  for (yyi = 0; yyi < yynrhs; yyi++)
1225  {
1226  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1227  yy_symbol_print (stderr,
1228  YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1229  &yyvsp[(yyi + 1) - (yynrhs)], parm, err_c);
1230  YYFPRINTF (stderr, "\n");
1231  }
1232 }

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

Here is the call graph for this function:

◆ yy_stack_print()

static void yy_stack_print ( yy_state_t yybottom,
yy_state_t yytop 
)
static

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

1193 {
1194  YYFPRINTF (stderr, "Stack now");
1195  for (; yybottom <= yytop; yybottom++)
1196  {
1197  int yybot = *yybottom;
1198  YYFPRINTF (stderr, " %d", yybot);
1199  }
1200  YYFPRINTF (stderr, "\n");
1201 }

References YYFPRINTF.

◆ yy_symbol_print()

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

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

1178 {
1179  YYFPRINTF (yyo, "%s %s (",
1180  yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1181 
1182  yy_symbol_value_print (yyo, yykind, yyvaluep, parm, err_c);
1183  YYFPRINTF (yyo, ")");
1184 }

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()

static 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  YYUSE (yyoutput);
1157  YYUSE (parm);
1158  YYUSE (err_c);
1159  if (!yyvaluep)
1160  return;
1161 # ifdef YYPRINT
1162  if (yykind < YYNTOKENS)
1163  YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
1164 # endif
1166  YYUSE (yykind);
1168 }

References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YYNTOKENS, and YYUSE.

Referenced by yy_symbol_print().

Here is the caller graph for this function:

◆ yydestruct()

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

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

1279 {
1280  YYUSE (yyvaluep);
1281  YYUSE (parm);
1282  YYUSE (err_c);
1283  if (!yymsg)
1284  yymsg = "Deleting";
1285  YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1286 
1288  YYUSE (yykind);
1290 }

References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_SYMBOL_PRINT, and YYUSE.

Referenced by yyparse().

Here is the caller graph for this function:

◆ yyparse()

int yyparse ( naslctxt parm,
int *  err_c 
)

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

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

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, 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, 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, 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()

static const char * yysymbol_name ( yysymbol_kind_t  yysymbol)
static

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

692 {
693  return yytname[yysymbol];
694 }

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 2567 of file nasl_grammar.tab.c.

Referenced by init_nasl_ctx(), and load_checksums().

◆ inc_dirs

GSList* inc_dirs = NULL
static

Definition at line 2522 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 910 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ yydebug

int yydebug

Definition at line 1242 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 755 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ yydefgoto

const yytype_int16 yydefgoto[]
static
Initial value:
=
{
-1, 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 793 of file nasl_grammar.tab.c.

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 725 of file nasl_grammar.tab.c.

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 783 of file nasl_grammar.tab.c.

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 1045 of file nasl_grammar.tab.c.

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 1063 of file nasl_grammar.tab.c.

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 640 of file nasl_grammar.tab.c.

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 1017 of file nasl_grammar.tab.c.

◆ yytable

const yytype_int16 yytable[]
static

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

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
}

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

Referenced by yysymbol_name().

◆ yytranslate

const yytype_int8 yytranslate[]
static

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

NODE_LOCAL
@ NODE_LOCAL
Definition: nasl_tree.h:32
ST_STRING1_ESC
@ ST_STRING1_ESC
Definition: nasl_grammar.tab.c:2841
EXPR_AND
@ EXPR_AND
Definition: nasl_tree.h:45
YYSYMBOL_list_array_data
@ YYSYMBOL_list_array_data
Definition: nasl_grammar.tab.c:255
YYSYMBOL_FUNCTION
@ YYSYMBOL_FUNCTION
Definition: nasl_grammar.tab.c:169
yylex
#define yylex
Definition: nasl_grammar.tab.c:69
RE_MATCH
@ RE_MATCH
Definition: nasl_grammar.tab.h:94
YYSYMBOL_REPEAT
@ YYSYMBOL_REPEAT
Definition: nasl_grammar.tab.c:163
YYSYMBOL_L_SHIFT_EQ
@ YYSYMBOL_L_SHIFT_EQ
Definition: nasl_grammar.tab.c:185
YYerror
@ YYerror
Definition: nasl_grammar.tab.h:55
STRING1
@ STRING1
Definition: nasl_grammar.tab.h:98
EXPR_BIT_XOR
@ EXPR_BIT_XOR
Definition: nasl_tree.h:59
yydefact
static const yytype_int8 yydefact[]
Definition: nasl_grammar.tab.c:755
ST_AND
@ ST_AND
Definition: nasl_grammar.tab.c:2853
INCLUDE
@ INCLUDE
Definition: nasl_grammar.tab.h:77
ST_STRING1
@ ST_STRING1
Definition: nasl_grammar.tab.c:2840
CONST_DATA
@ CONST_DATA
Definition: nasl_tree.h:82
FOREACH
@ FOREACH
Definition: nasl_grammar.tab.h:71
yy_symbol_value_print
static void yy_symbol_value_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, naslctxt *parm, int *err_c)
Definition: nasl_grammar.tab.c:1152
ST_DIV
@ ST_DIV
Definition: nasl_grammar.tab.c:2846
ST_HEX
@ ST_HEX
Definition: nasl_grammar.tab.c:2835
YYSYMBOL_63_
@ YYSYMBOL_63_
Definition: nasl_grammar.tab.c:211
NODE_MINUS_EQ
@ NODE_MINUS_EQ
Definition: nasl_tree.h:36
NODE_WHILE
@ NODE_WHILE
Definition: nasl_tree.h:17
INTEGER
@ INTEGER
Definition: nasl_grammar.tab.h:100
YYSIZEOF
#define YYSIZEOF(X)
Definition: nasl_grammar.tab.c:370
yy_state_fast_t
int yy_state_fast_t
Definition: nasl_grammar.tab.c:377
NODE_DECL
@ NODE_DECL
Definition: nasl_tree.h:23
YYSYMBOL_WHILE
@ YYSYMBOL_WHILE
Definition: nasl_grammar.tab.c:166
NODE_RETURN
@ NODE_RETURN
Definition: nasl_tree.h:25
TC::str_val
char * str_val
Definition: nasl_tree.h:103
REPEAT
@ REPEAT
Definition: nasl_grammar.tab.h:69
NODE_GLOBAL
@ NODE_GLOBAL
Definition: nasl_tree.h:33
TC::name
char * name
Definition: nasl_tree.h:97
YY_
#define YY_(Msgid)
Definition: nasl_grammar.tab.c:387
IDENT
@ IDENT
Definition: nasl_grammar.tab.h:97
NODE_AFF
@ NODE_AFF
Definition: nasl_tree.h:30
naslctxt::include_order
unsigned int include_order
Definition: nasl_global_ctxt.h:26
NODE_DIV_EQ
@ NODE_DIV_EQ
Definition: nasl_tree.h:38
yysymbol_name
static const char * yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
Definition: nasl_grammar.tab.c:691
NODE_L_SHIFT_EQ
@ NODE_L_SHIFT_EQ
Definition: nasl_tree.h:41
YYSYMBOL_post_pre_incr
@ YYSYMBOL_post_pre_incr
Definition: nasl_grammar.tab.c:252
EXPR_R_USHIFT
@ EXPR_R_USHIFT
Definition: nasl_tree.h:65
CONST_STR
@ CONST_STR
Definition: nasl_tree.h:80
yy_symbol_print
static void yy_symbol_print(FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const *const yyvaluep, naslctxt *parm, int *err_c)
Definition: nasl_grammar.tab.c:1176
ERRC
#define ERRC
Definition: nasl_grammar.tab.c:85
YYSYMBOL_var_name
@ YYSYMBOL_var_name
Definition: nasl_grammar.tab.c:260
SUPEQ
@ SUPEQ
Definition: nasl_grammar.tab.h:61
YYSTACK_BYTES
#define YYSTACK_BYTES(N)
Definition: nasl_grammar.tab.c:532
YYSYMBOL_ret
@ YYSYMBOL_ret
Definition: nasl_grammar.tab.c:232
YYSYMBOL_MINUS_MINUS
@ YYSYMBOL_MINUS_MINUS
Definition: nasl_grammar.tab.c:175
YYSYMBOL_68_
@ YYSYMBOL_68_
Definition: nasl_grammar.tab.c:216
load_checksums
static void load_checksums(kb_t kb)
Definition: nasl_grammar.tab.c:2570
naslctxt
Definition: nasl_global_ctxt.h:18
YYSYMBOL_func_decl
@ YYSYMBOL_func_decl
Definition: nasl_grammar.tab.c:225
YYSTYPE::num
long int num
Definition: nasl_grammar.tab.h:114
NODE_REPEAT_UNTIL
@ NODE_REPEAT_UNTIL
Definition: nasl_tree.h:19
ST_OCT
@ ST_OCT
Definition: nasl_grammar.tab.c:2833
YY_STACK_PRINT
#define YY_STACK_PRINT(Bottom, Top)
Definition: nasl_grammar.tab.c:1203
NODE_ARRAY_EL
@ NODE_ARRAY_EL
Definition: nasl_tree.h:29
inc_dirs
static GSList * inc_dirs
Definition: nasl_grammar.tab.c:2522
yypact
static const yytype_int16 yypact[]
Definition: nasl_grammar.tab.c:725
YYSYMBOL_ELSE
@ YYSYMBOL_ELSE
Definition: nasl_grammar.tab.c:152
ST_L_SHIFT
@ ST_L_SHIFT
Definition: nasl_grammar.tab.c:2850
YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition: nasl_grammar.tab.c:428
YYSYMBOL_MINUS_EQ
@ YYSYMBOL_MINUS_EQ
Definition: nasl_grammar.tab.c:181
YYPTRDIFF_MAXIMUM
#define YYPTRDIFF_MAXIMUM
Definition: nasl_grammar.tab.c:347
YYSYMBOL_70_
@ YYSYMBOL_70_
Definition: nasl_grammar.tab.c:218
YYSTYPE::node
tree_cell * node
Definition: nasl_grammar.tab.h:120
ST_OR
@ ST_OR
Definition: nasl_grammar.tab.c:2854
YYSYMBOL_EQ
@ YYSYMBOL_EQ
Definition: nasl_grammar.tab.c:153
include_order
static int include_order
Definition: nasl_grammar.tab.c:112
R_USHIFT
@ R_USHIFT
Definition: nasl_grammar.tab.h:84
YY_REDUCE_PRINT
#define YY_REDUCE_PRINT(Rule)
Definition: nasl_grammar.tab.c:1234
YYSYMBOL_49_
@ YYSYMBOL_49_
Definition: nasl_grammar.tab.c:197
ST_R_USHIFT
@ ST_R_USHIFT
Definition: nasl_grammar.tab.c:2849
nasl_set_function_filename
void nasl_set_function_filename(const char *function)
Definition: nasl_debug.c:99
MINUS_EQ
@ MINUS_EQ
Definition: nasl_grammar.tab.h:87
ST_COMMENT
@ ST_COMMENT
Definition: nasl_grammar.tab.c:2836
PLUS_EQ
@ PLUS_EQ
Definition: nasl_grammar.tab.h:86
YYSTACK_ALLOC
#define YYSTACK_ALLOC
Definition: nasl_grammar.tab.c:488
YYSYMBOL_YYEOF
@ YYSYMBOL_YYEOF
Definition: nasl_grammar.tab.c:148
YYSYMBOL_YYEMPTY
@ YYSYMBOL_YYEMPTY
Definition: nasl_grammar.tab.c:147
YYSYMBOL_array_index
@ YYSYMBOL_array_index
Definition: nasl_grammar.tab.c:251
yyalloc::yyss_alloc
yy_state_t yyss_alloc
Definition: nasl_grammar.tab.c:523
LOCAL
@ LOCAL
Definition: nasl_grammar.tab.h:78
YYSYMBOL_instr_list
@ YYSYMBOL_instr_list
Definition: nasl_grammar.tab.c:229
YYPOPSTACK
#define YYPOPSTACK(N)
EXPR_BIT_NOT
@ EXPR_BIT_NOT
Definition: nasl_tree.h:60
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition: nasl_grammar.tab.c:427
YYSYMBOL_56_
@ YYSYMBOL_56_
Definition: nasl_grammar.tab.c:204
YYSYMBOL_DIV_EQ
@ YYSYMBOL_DIV_EQ
Definition: nasl_grammar.tab.c:183
YYSYMBOL_arg_list
@ YYSYMBOL_arg_list
Definition: nasl_grammar.tab.c:244
YY_SYMBOL_PRINT
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition: nasl_grammar.tab.c:1135
NODE_FUN_DEF
@ NODE_FUN_DEF
Definition: nasl_tree.h:21
OR
@ OR
Definition: nasl_grammar.tab.h:63
checksum_algorithm
static int checksum_algorithm
Definition: nasl_grammar.tab.c:2567
yyr1
static const yytype_int8 yyr1[]
Definition: nasl_grammar.tab.c:1045
MODULO_EQ
@ MODULO_EQ
Definition: nasl_grammar.tab.h:90
YYSYMBOL_STRING2
@ YYSYMBOL_STRING2
Definition: nasl_grammar.tab.c:193
YYSYMBOL_52_
@ YYSYMBOL_52_
Definition: nasl_grammar.tab.c:200
YYSYMBOL_GLOBAL
@ YYSYMBOL_GLOBAL
Definition: nasl_grammar.tab.c:173
YYSYMBOL_array_elem
@ YYSYMBOL_array_elem
Definition: nasl_grammar.tab.c:250
FUNCTION
@ FUNCTION
Definition: nasl_grammar.tab.h:75
GLOBAL
@ GLOBAL
Definition: nasl_grammar.tab.h:79
EXPR_U_MINUS
@ EXPR_U_MINUS
Definition: nasl_tree.h:51
YYSYMBOL_54_
@ YYSYMBOL_54_
Definition: nasl_grammar.tab.c:202
yynerrs
#define yynerrs
Definition: nasl_grammar.tab.c:72
YYLAST
#define YYLAST
Definition: nasl_grammar.tab.c:579
REP
@ REP
Definition: nasl_grammar.tab.h:67
YYSYMBOL_arg_decl_1
@ YYSYMBOL_arg_decl_1
Definition: nasl_grammar.tab.c:227
YYSYMBOL_loc
@ YYSYMBOL_loc
Definition: nasl_grammar.tab.c:262
YYSYMBOL_SUPEQ
@ YYSYMBOL_SUPEQ
Definition: nasl_grammar.tab.c:155
yyerror
#define yyerror
Definition: nasl_grammar.tab.c:70
name
const char * name
Definition: nasl_init.c:411
YYSYMBOL_foreach_loop
@ YYSYMBOL_foreach_loop
Definition: nasl_grammar.tab.c:238
YYSYMBOL_69_
@ YYSYMBOL_69_
Definition: nasl_grammar.tab.c:217
YYSYMBOL_AND
@ YYSYMBOL_AND
Definition: nasl_grammar.tab.c:158
naslctxt::kb
kb_t kb
Definition: nasl_global_ctxt.h:29
yypgoto
static const yytype_int16 yypgoto[]
Definition: nasl_grammar.tab.c:783
YYSYMBOL_R_USHIFT_EQ
@ YYSYMBOL_R_USHIFT_EQ
Definition: nasl_grammar.tab.c:187
LNB
#define LNB
Definition: nasl_grammar.tab.c:83
YYEOF
@ YYEOF
Definition: nasl_grammar.tab.h:54
ST_INF
@ ST_INF
Definition: nasl_grammar.tab.c:2838
YYSYMBOL_aff
@ YYSYMBOL_aff
Definition: nasl_grammar.tab.c:247
YYSYMBOL_L_SHIFT
@ YYSYMBOL_L_SHIFT
Definition: nasl_grammar.tab.c:176
YYNSTATES
#define YYNSTATES
Definition: nasl_grammar.tab.c:588
yytable_value_is_error
#define yytable_value_is_error(Yyn)
Definition: nasl_grammar.tab.c:720
naslctxt::exec_descr
int exec_descr
Definition: nasl_global_ctxt.h:23
NODE_R_SHIFT_EQ
@ NODE_R_SHIFT_EQ
Definition: nasl_tree.h:42
EXPR_MODULO
@ EXPR_MODULO
Definition: nasl_tree.h:54
YYSYMBOL_INCLUDE
@ YYSYMBOL_INCLUDE
Definition: nasl_grammar.tab.c:171
FOR
@ FOR
Definition: nasl_grammar.tab.h:68
yyerrok
#define yyerrok
Definition: nasl_grammar.tab.c:1083
NODE_FUN_CALL
@ NODE_FUN_CALL
Definition: nasl_tree.h:22
YY_CAST
#define YY_CAST(Type, Val)
Definition: nasl_grammar.tab.c:127
MATCH
@ MATCH
Definition: nasl_grammar.tab.h:65
YYSYMBOL_EXPO
@ YYSYMBOL_EXPO
Definition: nasl_grammar.tab.c:179
YYSYMBOL_MATCH
@ YYSYMBOL_MATCH
Definition: nasl_grammar.tab.c:159
YYSYMBOL_YYerror
@ YYSYMBOL_YYerror
Definition: nasl_grammar.tab.c:149
YYSYMBOL_loop
@ YYSYMBOL_loop
Definition: nasl_grammar.tab.c:234
YY_INITIAL_VALUE
#define YY_INITIAL_VALUE(Value)
Definition: nasl_grammar.tab.c:424
COMP_LE
@ COMP_LE
Definition: nasl_tree.h:73
naslctxt::buffer
char * buffer
Definition: nasl_global_ctxt.h:28
ST_MULT
@ ST_MULT
Definition: nasl_grammar.tab.c:2845
nasl_verify_signature
int nasl_verify_signature(const char *filename)
YYSYMBOL_arg
@ YYSYMBOL_arg
Definition: nasl_grammar.tab.c:246
YYSYMBOL_instr_decl_list
@ YYSYMBOL_instr_decl_list
Definition: nasl_grammar.tab.c:223
YYSYMBOL_NOT
@ YYSYMBOL_NOT
Definition: nasl_grammar.tab.c:206
ARRAY_ELEM
@ ARRAY_ELEM
Definition: nasl_tree.h:85
NODE_FOREACH
@ NODE_FOREACH
Definition: nasl_tree.h:18
ARROW
@ ARROW
Definition: nasl_grammar.tab.h:96
yy_state_t
yytype_uint8 yy_state_t
Definition: nasl_grammar.tab.c:374
L_SHIFT_EQ
@ L_SHIFT_EQ
Definition: nasl_grammar.tab.h:91
YYSYMBOL_string
@ YYSYMBOL_string
Definition: nasl_grammar.tab.c:241
nasl_perror
void nasl_perror(lex_ctxt *lexic, char *msg,...)
Definition: nasl_debug.c:111
mylex
static int mylex(YYSTYPE *lvalp, void *parm)
Definition: nasl_grammar.tab.c:2857
YYSYMBOL_REP
@ YYSYMBOL_REP
Definition: nasl_grammar.tab.c:161
EXPR_DECR
@ EXPR_DECR
Definition: nasl_tree.h:62
YYSYMBOL_simple_instr
@ YYSYMBOL_simple_instr
Definition: nasl_grammar.tab.c:231
YYINITDEPTH
#define YYINITDEPTH
Definition: nasl_grammar.tab.c:1253
YY_ASSERT
#define YY_ASSERT(E)
Definition: nasl_grammar.tab.c:447
YYSYMBOL_YYACCEPT
@ YYSYMBOL_YYACCEPT
Definition: nasl_grammar.tab.c:221
YYPTRDIFF_T
#define YYPTRDIFF_T
Definition: nasl_grammar.tab.c:346
ST_DEC
@ ST_DEC
Definition: nasl_grammar.tab.c:2834
alloc_RE_cell
tree_cell * alloc_RE_cell(int lnb, int t, tree_cell *l, char *re_str, int *err_c)
Definition: nasl_tree.c:36
YYSYMBOL_YYUNDEF
@ YYSYMBOL_YYUNDEF
Definition: nasl_grammar.tab.c:150
yyr2
static const yytype_int8 yyr2[]
Definition: nasl_grammar.tab.c:1063
ST_SUP_EXCL
@ ST_SUP_EXCL
Definition: nasl_grammar.tab.c:2839
ST_SUP
@ ST_SUP
Definition: nasl_grammar.tab.c:2837
NODE_VAR
@ NODE_VAR
Definition: nasl_tree.h:31
R_SHIFT
@ R_SHIFT
Definition: nasl_grammar.tab.h:83
YYSYMBOL_array_data
@ YYSYMBOL_array_data
Definition: nasl_grammar.tab.c:256
YYSYMBOL_block
@ YYSYMBOL_block
Definition: nasl_grammar.tab.c:228
YYENOMEM
@ YYENOMEM
Definition: nasl_grammar.tab.c:1081
WHILE
@ WHILE
Definition: nasl_grammar.tab.h:72
YYEMPTY
@ YYEMPTY
Definition: nasl_grammar.tab.h:53
yytranslate
static const yytype_int8 yytranslate[]
Definition: nasl_grammar.tab.c:603
YYSYMBOL_55_
@ YYSYMBOL_55_
Definition: nasl_grammar.tab.c:203
EXPR_PLUS
@ EXPR_PLUS
Definition: nasl_tree.h:49
YYSYMBOL_STRING1
@ YYSYMBOL_STRING1
Definition: nasl_grammar.tab.c:192
NODE_INSTR_L
@ NODE_INSTR_L
Definition: nasl_tree.h:15
TC::include_order
int include_order
Definition: nasl_tree.h:100
YYSYMBOL_OR
@ YYSYMBOL_OR
Definition: nasl_grammar.tab.c:157
YYSYMBOL_arg_list_1
@ YYSYMBOL_arg_list_1
Definition: nasl_grammar.tab.c:245
len
uint8_t len
Definition: nasl_packet_forgery.c:1
ST_ZERO
@ ST_ZERO
Definition: nasl_grammar.tab.c:2831
YYSYMBOL_var
@ YYSYMBOL_var
Definition: nasl_grammar.tab.c:259
YYDPRINTF
#define YYDPRINTF(Args)
Definition: nasl_grammar.tab.c:1123
NODE_REPEATED
@ NODE_REPEATED
Definition: nasl_tree.h:20
YY_NULLPTR
#define YY_NULLPTR
Definition: nasl_grammar.tab.c:139
YYSTYPE
Definition: nasl_grammar.tab.h:111
YYSYMBOL_INFEQ
@ YYSYMBOL_INFEQ
Definition: nasl_grammar.tab.c:156
INFEQ
@ INFEQ
Definition: nasl_grammar.tab.h:62
YYSYMBOL_tiptop
@ YYSYMBOL_tiptop
Definition: nasl_grammar.tab.c:222
CONTINUE
@ CONTINUE
Definition: nasl_grammar.tab.h:74
EXPR_R_SHIFT
@ EXPR_R_SHIFT
Definition: nasl_tree.h:64
EXPR_NOT
@ EXPR_NOT
Definition: nasl_tree.h:47
IF
@ IF
Definition: nasl_grammar.tab.h:57
NEQ
@ NEQ
Definition: nasl_grammar.tab.h:60
YYSYMBOL_CONTINUE
@ YYSYMBOL_CONTINUE
Definition: nasl_grammar.tab.c:168
BREAK
@ BREAK
Definition: nasl_grammar.tab.h:73
STRING2
@ STRING2
Definition: nasl_grammar.tab.h:99
YYSYMBOL_66_
@ YYSYMBOL_66_
Definition: nasl_grammar.tab.c:214
YYSYMBOL_UMINUS
@ YYSYMBOL_UMINUS
Definition: nasl_grammar.tab.c:207
yytname
static const char *const yytname[]
Definition: nasl_grammar.tab.c:668
EXPR_DIV
@ EXPR_DIV
Definition: nasl_tree.h:53
ST_NOT
@ ST_NOT
Definition: nasl_grammar.tab.c:2851
ST_EQ
@ ST_EQ
Definition: nasl_grammar.tab.c:2852
YYSYMBOL_arg_decl
@ YYSYMBOL_arg_decl
Definition: nasl_grammar.tab.c:226
YY_IGNORE_USELESS_CAST_BEGIN
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition: nasl_grammar.tab.c:442
prefix
static void prefix(int n, int i)
Definition: nasl_tree.c:222
YYSTACK_RELOCATE
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition: nasl_grammar.tab.c:543
YYSTACK_GAP_MAXIMUM
#define YYSTACK_GAP_MAXIMUM
Definition: nasl_grammar.tab.c:528
YYSYMBOL_simple_array_data
@ YYSYMBOL_simple_array_data
Definition: nasl_grammar.tab.c:258
YYSYMBOL_RETURN
@ YYSYMBOL_RETURN
Definition: nasl_grammar.tab.c:170
YY_ACCESSING_SYMBOL
#define YY_ACCESSING_SYMBOL(State)
Definition: nasl_grammar.tab.c:659
yyalloc::yyvs_alloc
YYSTYPE yyvs_alloc
Definition: nasl_grammar.tab.c:524
YYSYMBOL_61_
@ YYSYMBOL_61_
Definition: nasl_grammar.tab.c:209
YYSYMBOL_glob
@ YYSYMBOL_glob
Definition: nasl_grammar.tab.c:263
yycheck
static const yytype_int16 yycheck[]
Definition: nasl_grammar.tab.c:910
file_checksum
static char * file_checksum(const char *filename, int algorithm)
Get the checksum of a file.
Definition: nasl_grammar.tab.c:2649
ST_R_SHIFT
@ ST_R_SHIFT
Definition: nasl_grammar.tab.c:2848
YYSYMBOL_ARROW
@ YYSYMBOL_ARROW
Definition: nasl_grammar.tab.c:190
COMP_RE_NOMATCH
@ COMP_RE_NOMATCH
Definition: nasl_tree.h:70
alloc_expr_cell
tree_cell * alloc_expr_cell(int lnb, int t, tree_cell *l, tree_cell *r)
Definition: nasl_tree.c:63
YYSYMBOL_const_array
@ YYSYMBOL_const_array
Definition: nasl_grammar.tab.c:254
YYSYMBOL_62_
@ YYSYMBOL_62_
Definition: nasl_grammar.tab.c:210
YY_IGNORE_USELESS_CAST_END
#define YY_IGNORE_USELESS_CAST_END
Definition: nasl_grammar.tab.c:443
ST_ZEROX
@ ST_ZEROX
Definition: nasl_grammar.tab.c:2832
naslparse
int naslparse(naslctxt *, int *)
YYSYMBOL_FOR
@ YYSYMBOL_FOR
Definition: nasl_grammar.tab.c:162
make_array_from_elems
tree_cell * make_array_from_elems(tree_cell *el)
Definition: nasl_var.c:1323
EXPR_L_SHIFT
@ EXPR_L_SHIFT
Definition: nasl_tree.h:63
YYSTYPE::asciiz::val
char * val
Definition: nasl_grammar.tab.h:117
YYSYMBOL_PLUS_EQ
@ YYSYMBOL_PLUS_EQ
Definition: nasl_grammar.tab.c:180
EXPR_BIT_AND
@ EXPR_BIT_AND
Definition: nasl_tree.h:57
TC
Definition: nasl_tree.h:94
YYSYMBOL_inc
@ YYSYMBOL_inc
Definition: nasl_grammar.tab.c:242
YYSYMBOL_50_
@ YYSYMBOL_50_
Definition: nasl_grammar.tab.c:198
YYSYMBOL_R_SHIFT_EQ
@ YYSYMBOL_R_SHIFT_EQ
Definition: nasl_grammar.tab.c:186
YYSYMBOL_atom
@ YYSYMBOL_atom
Definition: nasl_grammar.tab.c:257
COMP_MATCH
@ COMP_MATCH
Definition: nasl_tree.h:67
YYSYMBOL_rep
@ YYSYMBOL_rep
Definition: nasl_grammar.tab.c:240
parse_buffer
static char * parse_buffer
Definition: nasl_grammar.tab.c:109
naslctxt::tree
tree_cell * tree
Definition: nasl_global_ctxt.h:27
L_SHIFT
@ L_SHIFT
Definition: nasl_grammar.tab.h:82
YYFPRINTF
#define YYFPRINTF
Definition: nasl_grammar.tab.c:1120
RE_NOMATCH
@ RE_NOMATCH
Definition: nasl_grammar.tab.h:95
YYSYMBOL_aff_func
@ YYSYMBOL_aff_func
Definition: nasl_grammar.tab.c:239
YYSYMBOL_51_
@ YYSYMBOL_51_
Definition: nasl_grammar.tab.c:199
YYSYMBOL_R_USHIFT
@ YYSYMBOL_R_USHIFT
Definition: nasl_grammar.tab.c:178
YYSYMBOL_MODULO_EQ
@ YYSYMBOL_MODULO_EQ
Definition: nasl_grammar.tab.c:184
yydebug
#define yydebug
Definition: nasl_grammar.tab.c:71
naslctxt::always_signed
int always_signed
Definition: nasl_global_ctxt.h:21
ST_SPACE
@ ST_SPACE
Definition: nasl_grammar.tab.c:2829
yysymbol_kind_t
yysymbol_kind_t
Definition: nasl_grammar.tab.c:146
YYSYMBOL_NEQ
@ YYSYMBOL_NEQ
Definition: nasl_grammar.tab.c:154
YYSYMBOL_FOREACH
@ YYSYMBOL_FOREACH
Definition: nasl_grammar.tab.c:165
ST_STRING2
@ ST_STRING2
Definition: nasl_grammar.tab.c:2842
LN
#define LN
Definition: nasl_grammar.tab.c:84
ref_cell
void ref_cell(tree_cell *c)
Definition: nasl_tree.c:167
NODE_R_USHIFT_EQ
@ NODE_R_USHIFT_EQ
Definition: nasl_tree.h:43
yydefgoto
static const yytype_int16 yydefgoto[]
Definition: nasl_grammar.tab.c:793
EXPO
@ EXPO
Definition: nasl_grammar.tab.h:85
ST_PLUS
@ ST_PLUS
Definition: nasl_grammar.tab.c:2843
COMP_GE
@ COMP_GE
Definition: nasl_tree.h:77
NODE_MULT_EQ
@ NODE_MULT_EQ
Definition: nasl_tree.h:37
YYSYMBOL_BIT_NOT
@ YYSYMBOL_BIT_NOT
Definition: nasl_grammar.tab.c:208
EXPR_MINUS
@ EXPR_MINUS
Definition: nasl_tree.h:50
add_nasl_inc_dir
int add_nasl_inc_dir(const char *dir)
Adds the given string as directory for searching for includes.
Definition: nasl_grammar.tab.c:2539
YYSYMBOL_IF
@ YYSYMBOL_IF
Definition: nasl_grammar.tab.c:151
YYSYMBOL_RE_MATCH
@ YYSYMBOL_RE_MATCH
Definition: nasl_grammar.tab.c:188
YYSIZE_T
#define YYSIZE_T
Definition: nasl_grammar.tab.c:360
ELSE
@ ELSE
Definition: nasl_grammar.tab.h:58
naslctxt::index
int index
Definition: nasl_global_ctxt.h:25
YYSYMBOL_RE_NOMATCH
@ YYSYMBOL_RE_NOMATCH
Definition: nasl_grammar.tab.c:189
EXPR_INCR
@ EXPR_INCR
Definition: nasl_tree.h:61
YYABORT
#define YYABORT
Definition: nasl_grammar.tab.c:1087
CONST_INT
@ CONST_INT
Definition: nasl_tree.h:79
yypact_value_is_default
#define yypact_value_is_default(Yyn)
Definition: nasl_grammar.tab.c:715
PLUS_PLUS
@ PLUS_PLUS
Definition: nasl_grammar.tab.h:80
YYSTYPE::asciiz::len
int len
Definition: nasl_grammar.tab.h:118
YYERROR
#define YYERROR
Definition: nasl_grammar.tab.c:1088
YYUNDEF
@ YYUNDEF
Definition: nasl_grammar.tab.h:56
yyrline
static const yytype_int16 yyrline[]
Definition: nasl_grammar.tab.c:640
YYMAXDEPTH
#define YYMAXDEPTH
Definition: nasl_grammar.tab.c:1264
YYSYMBOL_48_
@ YYSYMBOL_48_
Definition: nasl_grammar.tab.c:196
YYUSE
#define YYUSE(E)
Definition: nasl_grammar.tab.c:410
COMP_LT
@ COMP_LT
Definition: nasl_tree.h:72
YYSYMBOL_expr
@ YYSYMBOL_expr
Definition: nasl_grammar.tab.c:253
NODE_IF_ELSE
@ NODE_IF_ELSE
Definition: nasl_tree.h:14
YYSTYPE::data
struct YYSTYPE::asciiz data
YYNTOKENS
#define YYNTOKENS
Definition: nasl_grammar.tab.c:582
COMP_NE
@ COMP_NE
Definition: nasl_tree.h:75
YYSYMBOL_71_
@ YYSYMBOL_71_
Definition: nasl_grammar.tab.c:219
ST_START
@ ST_START
Definition: nasl_grammar.tab.c:2828
parse_len
static int parse_len
Definition: nasl_grammar.tab.c:111
YYSYMBOL_BREAK
@ YYSYMBOL_BREAK
Definition: nasl_grammar.tab.c:167
YYSYMBOL_65_
@ YYSYMBOL_65_
Definition: nasl_grammar.tab.c:213
ST_IDENT
@ ST_IDENT
Definition: nasl_grammar.tab.c:2830
EXPR_OR
@ EXPR_OR
Definition: nasl_tree.h:46
YYSYMBOL_MULT_EQ
@ YYSYMBOL_MULT_EQ
Definition: nasl_grammar.tab.c:182
ST_MODULO
@ ST_MODULO
Definition: nasl_grammar.tab.c:2847
NODE_CONTINUE
@ NODE_CONTINUE
Definition: nasl_tree.h:27
yyalloc
Definition: nasl_grammar.tab.c:522
YYSYMBOL_instr_decl
@ YYSYMBOL_instr_decl
Definition: nasl_grammar.tab.c:224
NODE_FOR
@ NODE_FOR
Definition: nasl_tree.h:16
YYSYMBOL_72_
@ YYSYMBOL_72_
Definition: nasl_grammar.tab.c:220
YYSYMBOL_repeat_loop
@ YYSYMBOL_repeat_loop
Definition: nasl_grammar.tab.c:237
COMP_RE_MATCH
@ COMP_RE_MATCH
Definition: nasl_tree.h:69
YYSYMBOL_57_
@ YYSYMBOL_57_
Definition: nasl_grammar.tab.c:205
YYSYMBOL_while_loop
@ YYSYMBOL_while_loop
Definition: nasl_grammar.tab.c:236
YYSYMBOL_instr
@ YYSYMBOL_instr
Definition: nasl_grammar.tab.c:230
MINUS_MINUS
@ MINUS_MINUS
Definition: nasl_grammar.tab.h:81
nasl_get_filename
const char * nasl_get_filename(const char *function)
Definition: nasl_debug.c:60
YYSYMBOL_func_call
@ YYSYMBOL_func_call
Definition: nasl_grammar.tab.c:243
NODE_MODULO_EQ
@ NODE_MODULO_EQ
Definition: nasl_tree.h:39
YYFINAL
#define YYFINAL
Definition: nasl_grammar.tab.c:577
YYSYMBOL_R_SHIFT
@ YYSYMBOL_R_SHIFT
Definition: nasl_grammar.tab.c:177
yytable
static const yytype_int16 yytable[]
Definition: nasl_grammar.tab.c:805
nasl_set_filename
void nasl_set_filename(const char *filename)
Definition: nasl_debug.c:88
YYSYMBOL_NOMATCH
@ YYSYMBOL_NOMATCH
Definition: nasl_grammar.tab.c:160
NODE_BREAK
@ NODE_BREAK
Definition: nasl_tree.h:26
YYSYMBOL_LOCAL
@ YYSYMBOL_LOCAL
Definition: nasl_grammar.tab.c:172
YYSYMBOL_identifier
@ YYSYMBOL_identifier
Definition: nasl_grammar.tab.c:249
init_nasl_ctx
int init_nasl_ctx(naslctxt *pc, const char *name)
Initialize a NASL context for a NASL file.
Definition: nasl_grammar.tab.c:2684
YYSTACK_FREE
#define YYSTACK_FREE
Definition: nasl_grammar.tab.c:489
YYSTYPE::str
char * str
Definition: nasl_grammar.tab.h:115
NODE_PLUS_EQ
@ NODE_PLUS_EQ
Definition: nasl_tree.h:35
AND
@ AND
Definition: nasl_grammar.tab.h:64
yydestruct
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, naslctxt *parm, int *err_c)
Definition: nasl_grammar.tab.c:1277
YYSYMBOL_INTEGER
@ YYSYMBOL_INTEGER
Definition: nasl_grammar.tab.c:194
deref_cell
void deref_cell(tree_cell *c)
Definition: nasl_tree.c:181
alloc_typed_cell
tree_cell * alloc_typed_cell(int typ)
Definition: nasl_tree.c:28
COMP_NOMATCH
@ COMP_NOMATCH
Definition: nasl_tree.h:68
YYSYMBOL_53_
@ YYSYMBOL_53_
Definition: nasl_grammar.tab.c:201
YYSYMBOL_lvalue
@ YYSYMBOL_lvalue
Definition: nasl_grammar.tab.c:248
MULT_EQ
@ MULT_EQ
Definition: nasl_grammar.tab.h:88
YYACCEPT
#define YYACCEPT
Definition: nasl_grammar.tab.c:1086
YYSYMBOL_ipaddr
@ YYSYMBOL_ipaddr
Definition: nasl_grammar.tab.c:261
NODE_ARG
@ NODE_ARG
Definition: nasl_tree.h:24
DIV_EQ
@ DIV_EQ
Definition: nasl_grammar.tab.h:89
NOMATCH
@ NOMATCH
Definition: nasl_grammar.tab.h:66
EXPR_EXPO
@ EXPR_EXPO
Definition: nasl_tree.h:55
includes_hash
GHashTable * includes_hash
Definition: nasl_grammar.tab.c:116
YYSYMBOL_47_
@ YYSYMBOL_47_
Definition: nasl_grammar.tab.c:195
EQ
@ EQ
Definition: nasl_grammar.tab.h:59
YYMAXUTOK
#define YYMAXUTOK
Definition: nasl_grammar.tab.c:591
UNTIL
@ UNTIL
Definition: nasl_grammar.tab.h:70
RETURN
@ RETURN
Definition: nasl_grammar.tab.h:76
R_USHIFT_EQ
@ R_USHIFT_EQ
Definition: nasl_grammar.tab.h:93
YYTRANSLATE
#define YYTRANSLATE(YYX)
Definition: nasl_grammar.tab.c:596
EXPR_BIT_OR
@ EXPR_BIT_OR
Definition: nasl_tree.h:58
EXPR_MULT
@ EXPR_MULT
Definition: nasl_tree.h:52
R_SHIFT_EQ
@ R_SHIFT_EQ
Definition: nasl_grammar.tab.h:92
COMP_EQ
@ COMP_EQ
Definition: nasl_tree.h:74
naslctxt::line_nb
int line_nb
Definition: nasl_global_ctxt.h:19
YYSYMBOL_PLUS_PLUS
@ YYSYMBOL_PLUS_PLUS
Definition: nasl_grammar.tab.c:174
ST_MINUS
@ ST_MINUS
Definition: nasl_grammar.tab.c:2844
YYSYMBOL_IDENT
@ YYSYMBOL_IDENT
Definition: nasl_grammar.tab.c:191
YYSYMBOL_64_
@ YYSYMBOL_64_
Definition: nasl_grammar.tab.c:212
naslctxt::name
char * name
Definition: nasl_global_ctxt.h:20
YYSYMBOL_for_loop
@ YYSYMBOL_for_loop
Definition: nasl_grammar.tab.c:235
TC::i_val
long int i_val
Definition: nasl_tree.h:104
YYSYMBOL_UNTIL
@ YYSYMBOL_UNTIL
Definition: nasl_grammar.tab.c:164
YYSYMBOL_67_
@ YYSYMBOL_67_
Definition: nasl_grammar.tab.c:215
YYSYMBOL_if_block
@ YYSYMBOL_if_block
Definition: nasl_grammar.tab.c:233
COMP_GT
@ COMP_GT
Definition: nasl_tree.h:76