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

Go to the source code of this file.

Data Structures

union  yyalloc

Macros

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

Typedefs

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

Enumerations

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

Functions

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

Variables

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

Macro Definition Documentation

◆ ERRC

#define ERRC   err_c

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

Referenced by yyparse().

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "lib nasl"

GLib logging domain.

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

◆ LN

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

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

Referenced by yyparse().

◆ LNB

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

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

Referenced by naslerror(), and yyparse().

◆ YY_

#define YY_ ( Msgid)
Value:
Msgid

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

Referenced by yyparse().

◆ YY_ACCESSING_SYMBOL

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

Accessing symbol of state STATE.

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

Referenced by yy_reduce_print(), and yyparse().

◆ YY_ASSERT

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

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

Referenced by yyparse().

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE

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

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED

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

◆ YY_CAST

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

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

Referenced by yyparse().

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

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

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

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

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

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

◆ YY_IGNORE_USELESS_CAST_BEGIN

#define YY_IGNORE_USELESS_CAST_BEGIN

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

Referenced by yyparse().

◆ YY_IGNORE_USELESS_CAST_END

#define YY_IGNORE_USELESS_CAST_END

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

Referenced by yyparse().

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE ( Value)
Value:
Value

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

Referenced by yyparse().

◆ YY_NULLPTR

#define YY_NULLPTR   ((void*)0)

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

◆ YY_REDUCE_PRINT

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

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

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

Referenced by yyparse().

◆ YY_REINTERPRET_CAST

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

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

◆ YY_STACK_PRINT

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

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

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

Referenced by yyparse().

◆ YY_SYMBOL_PRINT

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

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

1135# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1136do { \
1137 if (yydebug) \
1138 { \
1139 YYFPRINTF (stderr, "%s ", Title); \
1140 yy_symbol_print (stderr, \
1141 Kind, Value, parm, err_c); \
1142 YYFPRINTF (stderr, "\n"); \
1143 } \
1144} while (0)

Referenced by yydestruct(), and yyparse().

◆ YY_USE

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

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

Referenced by yy_symbol_value_print(), and yydestruct().

◆ YYABORT

#define YYABORT   goto yyabortlab

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

Referenced by yyparse().

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

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

Referenced by yyparse().

◆ YYBACKUP

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

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

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

◆ YYBISON

#define YYBISON   30802

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

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.8.2"

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

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

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

◆ YYCOPY

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

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

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

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

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

◆ yydebug

#define yydebug   nasldebug

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

◆ YYDPRINTF

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

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

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

Referenced by yyparse().

◆ YYERRCODE

#define YYERRCODE   YYUNDEF

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

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

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

Referenced by yyparse().

◆ YYERROR

#define YYERROR   goto yyerrorlab

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

Referenced by yyparse().

◆ yyerror

#define yyerror   naslerror

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

Referenced by yyparse().

◆ YYERROR_VERBOSE

#define YYERROR_VERBOSE

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

◆ YYFINAL

#define YYFINAL   80

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

Referenced by yyparse().

◆ YYFPRINTF

#define YYFPRINTF   fprintf

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

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

◆ YYFREE

#define YYFREE   free

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

◆ YYINITDEPTH

#define YYINITDEPTH   200

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

Referenced by yyparse().

◆ YYLAST

#define YYLAST   1009

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

Referenced by yyparse().

◆ yylex

#define yylex   nasllex

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

Referenced by yyparse().

◆ YYLEX_ERRC

#define YYLEX_ERRC   err_c

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

◆ YYLEX_PARAM

#define YYLEX_PARAM   parm

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

◆ YYMALLOC

#define YYMALLOC   malloc

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

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

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

Referenced by yyparse().

◆ YYMAXUTOK

#define YYMAXUTOK   304

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

◆ yynerrs

#define yynerrs   naslnerrs

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

Referenced by yyparse().

◆ YYNNTS

#define YYNNTS   43

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

◆ YYNOMEM

#define YYNOMEM   goto yyexhaustedlab

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

Referenced by yyparse().

◆ YYNRULES

#define YYNRULES   127

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

◆ YYNSTATES

#define YYNSTATES   229

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

Referenced by yyparse().

◆ YYNTOKENS

#define YYNTOKENS   73

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

Referenced by yy_symbol_print(), and yyparse().

◆ YYPACT_NINF

#define YYPACT_NINF   (-77)

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

◆ yypact_value_is_default

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

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

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

Referenced by yyparse().

◆ yyparse

#define yyparse   naslparse

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

◆ YYPARSE_ERRC

#define YYPARSE_ERRC   err_c

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

◆ YYPARSE_PARAM

#define YYPARSE_PARAM   parm

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

◆ YYPOPSTACK

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

Referenced by yyparse().

◆ YYPTRDIFF_MAXIMUM

#define YYPTRDIFF_MAXIMUM   LONG_MAX

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

◆ YYPTRDIFF_T

#define YYPTRDIFF_T   long

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

Referenced by yyparse().

◆ YYPULL

#define YYPULL   1

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

◆ YYPURE

#define YYPURE   1

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

◆ YYPUSH

#define YYPUSH   0

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

◆ YYRECOVERING

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

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

◆ YYSIZE_MAXIMUM

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

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

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

◆ YYSIZE_T

#define YYSIZE_T   unsigned

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

Referenced by malloc(), and yyparse().

◆ YYSIZEOF

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

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

Referenced by yyparse().

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

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

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   YYMALLOC

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

Referenced by yyparse().

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

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

◆ YYSTACK_BYTES

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

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

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

Referenced by yyparse().

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

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

Referenced by yyparse().

◆ YYSTACK_GAP_MAXIMUM

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

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

◆ YYSTACK_RELOCATE

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

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

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

Referenced by yyparse().

◆ YYTABLE_NINF

#define YYTABLE_NINF   (-70)

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

◆ yytable_value_is_error

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

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

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

Referenced by yyparse().

◆ YYTRANSLATE

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

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

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

Referenced by yyparse().

Typedef Documentation

◆ yy_state_fast_t

typedef int yy_state_fast_t

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

◆ yy_state_t

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

◆ yysymbol_kind_t

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

◆ yytype_int16

typedef short yytype_int16

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

◆ yytype_int8

typedef signed char yytype_int8

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

◆ yytype_uint16

typedef unsigned short yytype_uint16

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

◆ yytype_uint8

typedef unsigned char yytype_uint8

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
YYENOMEM 

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

1083{ YYENOMEM = -2 };
@ YYENOMEM

◆ lex_state

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

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

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

◆ yysymbol_kind_t

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

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

146{
147 YYSYMBOL_YYEMPTY = -2,
148 YYSYMBOL_YYEOF = 0, /* "end of file" */
149 YYSYMBOL_YYerror = 1, /* error */
150 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
151 YYSYMBOL_IF = 3, /* IF */
152 YYSYMBOL_ELSE = 4, /* ELSE */
153 YYSYMBOL_EQ = 5, /* EQ */
154 YYSYMBOL_NEQ = 6, /* NEQ */
155 YYSYMBOL_SUPEQ = 7, /* SUPEQ */
156 YYSYMBOL_INFEQ = 8, /* INFEQ */
157 YYSYMBOL_OR = 9, /* OR */
158 YYSYMBOL_AND = 10, /* AND */
159 YYSYMBOL_MATCH = 11, /* MATCH */
160 YYSYMBOL_NOMATCH = 12, /* NOMATCH */
161 YYSYMBOL_REP = 13, /* REP */
162 YYSYMBOL_FOR = 14, /* FOR */
163 YYSYMBOL_REPEAT = 15, /* REPEAT */
164 YYSYMBOL_UNTIL = 16, /* UNTIL */
165 YYSYMBOL_FOREACH = 17, /* FOREACH */
166 YYSYMBOL_WHILE = 18, /* WHILE */
167 YYSYMBOL_BREAK = 19, /* BREAK */
168 YYSYMBOL_CONTINUE = 20, /* CONTINUE */
169 YYSYMBOL_FUNCTION = 21, /* FUNCTION */
170 YYSYMBOL_RETURN = 22, /* RETURN */
171 YYSYMBOL_INCLUDE = 23, /* INCLUDE */
172 YYSYMBOL_LOCAL = 24, /* LOCAL */
173 YYSYMBOL_GLOBAL = 25, /* GLOBAL */
174 YYSYMBOL_PLUS_PLUS = 26, /* PLUS_PLUS */
175 YYSYMBOL_MINUS_MINUS = 27, /* MINUS_MINUS */
176 YYSYMBOL_L_SHIFT = 28, /* L_SHIFT */
177 YYSYMBOL_R_SHIFT = 29, /* R_SHIFT */
178 YYSYMBOL_R_USHIFT = 30, /* R_USHIFT */
179 YYSYMBOL_EXPO = 31, /* EXPO */
180 YYSYMBOL_PLUS_EQ = 32, /* PLUS_EQ */
181 YYSYMBOL_MINUS_EQ = 33, /* MINUS_EQ */
182 YYSYMBOL_MULT_EQ = 34, /* MULT_EQ */
183 YYSYMBOL_DIV_EQ = 35, /* DIV_EQ */
184 YYSYMBOL_MODULO_EQ = 36, /* MODULO_EQ */
185 YYSYMBOL_L_SHIFT_EQ = 37, /* L_SHIFT_EQ */
186 YYSYMBOL_R_SHIFT_EQ = 38, /* R_SHIFT_EQ */
187 YYSYMBOL_R_USHIFT_EQ = 39, /* R_USHIFT_EQ */
188 YYSYMBOL_RE_MATCH = 40, /* RE_MATCH */
189 YYSYMBOL_RE_NOMATCH = 41, /* RE_NOMATCH */
190 YYSYMBOL_ARROW = 42, /* ARROW */
191 YYSYMBOL_IDENT = 43, /* IDENT */
192 YYSYMBOL_STRING1 = 44, /* STRING1 */
193 YYSYMBOL_STRING2 = 45, /* STRING2 */
194 YYSYMBOL_INTEGER = 46, /* INTEGER */
195 YYSYMBOL_47_ = 47, /* '=' */
196 YYSYMBOL_48_ = 48, /* '<' */
197 YYSYMBOL_49_ = 49, /* '>' */
198 YYSYMBOL_50_ = 50, /* '|' */
199 YYSYMBOL_51_ = 51, /* '^' */
200 YYSYMBOL_52_ = 52, /* '&' */
201 YYSYMBOL_53_ = 53, /* '+' */
202 YYSYMBOL_54_ = 54, /* '-' */
203 YYSYMBOL_55_ = 55, /* '*' */
204 YYSYMBOL_56_ = 56, /* '/' */
205 YYSYMBOL_57_ = 57, /* '%' */
206 YYSYMBOL_NOT = 58, /* NOT */
207 YYSYMBOL_UMINUS = 59, /* UMINUS */
208 YYSYMBOL_BIT_NOT = 60, /* BIT_NOT */
209 YYSYMBOL_61_ = 61, /* '(' */
210 YYSYMBOL_62_ = 62, /* ')' */
211 YYSYMBOL_63_ = 63, /* ',' */
212 YYSYMBOL_64_ = 64, /* '{' */
213 YYSYMBOL_65_ = 65, /* '}' */
214 YYSYMBOL_66_ = 66, /* ';' */
215 YYSYMBOL_67_ = 67, /* ':' */
216 YYSYMBOL_68_ = 68, /* '[' */
217 YYSYMBOL_69_ = 69, /* ']' */
218 YYSYMBOL_70_ = 70, /* '!' */
219 YYSYMBOL_71_ = 71, /* '~' */
220 YYSYMBOL_72_ = 72, /* '.' */
221 YYSYMBOL_YYACCEPT = 73, /* $accept */
222 YYSYMBOL_tiptop = 74, /* tiptop */
223 YYSYMBOL_instr_decl_list = 75, /* instr_decl_list */
224 YYSYMBOL_instr_decl = 76, /* instr_decl */
225 YYSYMBOL_func_decl = 77, /* func_decl */
226 YYSYMBOL_arg_decl = 78, /* arg_decl */
227 YYSYMBOL_arg_decl_1 = 79, /* arg_decl_1 */
228 YYSYMBOL_block = 80, /* block */
229 YYSYMBOL_instr_list = 81, /* instr_list */
230 YYSYMBOL_instr = 82, /* instr */
231 YYSYMBOL_simple_instr = 83, /* simple_instr */
232 YYSYMBOL_ret = 84, /* ret */
233 YYSYMBOL_if_block = 85, /* if_block */
234 YYSYMBOL_loop = 86, /* loop */
235 YYSYMBOL_for_loop = 87, /* for_loop */
236 YYSYMBOL_while_loop = 88, /* while_loop */
237 YYSYMBOL_repeat_loop = 89, /* repeat_loop */
238 YYSYMBOL_foreach_loop = 90, /* foreach_loop */
239 YYSYMBOL_aff_func = 91, /* aff_func */
240 YYSYMBOL_rep = 92, /* rep */
241 YYSYMBOL_string = 93, /* string */
242 YYSYMBOL_inc = 94, /* inc */
243 YYSYMBOL_func_call = 95, /* func_call */
244 YYSYMBOL_arg_list = 96, /* arg_list */
245 YYSYMBOL_arg_list_1 = 97, /* arg_list_1 */
246 YYSYMBOL_arg = 98, /* arg */
247 YYSYMBOL_aff = 99, /* aff */
248 YYSYMBOL_lvalue = 100, /* lvalue */
249 YYSYMBOL_identifier = 101, /* identifier */
250 YYSYMBOL_array_elem = 102, /* array_elem */
251 YYSYMBOL_array_index = 103, /* array_index */
252 YYSYMBOL_post_pre_incr = 104, /* post_pre_incr */
253 YYSYMBOL_expr = 105, /* expr */
254 YYSYMBOL_const_array = 106, /* const_array */
255 YYSYMBOL_list_array_data = 107, /* list_array_data */
256 YYSYMBOL_array_data = 108, /* array_data */
257 YYSYMBOL_atom = 109, /* atom */
258 YYSYMBOL_simple_array_data = 110, /* simple_array_data */
259 YYSYMBOL_var = 111, /* var */
260 YYSYMBOL_var_name = 112, /* var_name */
261 YYSYMBOL_ipaddr = 113, /* ipaddr */
262 YYSYMBOL_loc = 114, /* loc */
263 YYSYMBOL_glob = 115 /* glob */
264};
@ YYSYMBOL_repeat_loop
@ YYSYMBOL_68_
@ YYSYMBOL_UMINUS
@ YYSYMBOL_INCLUDE
@ YYSYMBOL_MINUS_MINUS
@ YYSYMBOL_const_array
@ YYSYMBOL_71_
@ YYSYMBOL_52_
@ YYSYMBOL_47_
@ YYSYMBOL_53_
@ YYSYMBOL_EQ
@ YYSYMBOL_UNTIL
@ YYSYMBOL_50_
@ YYSYMBOL_array_index
@ YYSYMBOL_IF
@ YYSYMBOL_for_loop
@ YYSYMBOL_loc
@ YYSYMBOL_func_decl
@ YYSYMBOL_instr
@ YYSYMBOL_LOCAL
@ YYSYMBOL_arg_list_1
@ YYSYMBOL_YYerror
@ YYSYMBOL_loop
@ YYSYMBOL_BREAK
@ YYSYMBOL_var_name
@ YYSYMBOL_65_
@ YYSYMBOL_REPEAT
@ YYSYMBOL_49_
@ YYSYMBOL_foreach_loop
@ YYSYMBOL_glob
@ YYSYMBOL_expr
@ YYSYMBOL_STRING1
@ YYSYMBOL_simple_instr
@ YYSYMBOL_63_
@ YYSYMBOL_AND
@ YYSYMBOL_51_
@ YYSYMBOL_instr_decl
@ YYSYMBOL_while_loop
@ YYSYMBOL_ARROW
@ YYSYMBOL_L_SHIFT
@ YYSYMBOL_inc
@ YYSYMBOL_NOMATCH
@ YYSYMBOL_55_
@ YYSYMBOL_FOREACH
@ YYSYMBOL_NEQ
@ YYSYMBOL_48_
@ YYSYMBOL_string
@ YYSYMBOL_67_
@ YYSYMBOL_identifier
@ YYSYMBOL_ELSE
@ YYSYMBOL_instr_decl_list
@ YYSYMBOL_R_USHIFT_EQ
@ YYSYMBOL_arg_decl_1
@ YYSYMBOL_array_data
@ YYSYMBOL_atom
@ YYSYMBOL_61_
@ YYSYMBOL_CONTINUE
@ YYSYMBOL_lvalue
@ YYSYMBOL_RE_NOMATCH
@ YYSYMBOL_BIT_NOT
@ YYSYMBOL_INFEQ
@ YYSYMBOL_instr_list
@ YYSYMBOL_64_
@ YYSYMBOL_WHILE
@ YYSYMBOL_70_
@ YYSYMBOL_54_
@ YYSYMBOL_L_SHIFT_EQ
@ YYSYMBOL_arg
@ YYSYMBOL_SUPEQ
@ YYSYMBOL_arg_list
@ YYSYMBOL_EXPO
@ YYSYMBOL_MINUS_EQ
@ YYSYMBOL_block
@ YYSYMBOL_array_elem
@ YYSYMBOL_56_
@ YYSYMBOL_if_block
@ YYSYMBOL_YYACCEPT
@ YYSYMBOL_57_
@ YYSYMBOL_MATCH
@ YYSYMBOL_OR
@ YYSYMBOL_rep
@ YYSYMBOL_R_SHIFT_EQ
@ YYSYMBOL_MODULO_EQ
@ YYSYMBOL_YYEOF
@ YYSYMBOL_GLOBAL
@ YYSYMBOL_FUNCTION
@ YYSYMBOL_func_call
@ YYSYMBOL_62_
@ YYSYMBOL_STRING2
@ YYSYMBOL_ret
@ YYSYMBOL_R_SHIFT
@ YYSYMBOL_tiptop
@ YYSYMBOL_aff_func
@ YYSYMBOL_MULT_EQ
@ YYSYMBOL_simple_array_data
@ YYSYMBOL_INTEGER
@ YYSYMBOL_ipaddr
@ YYSYMBOL_var
@ YYSYMBOL_list_array_data
@ YYSYMBOL_YYEMPTY
@ YYSYMBOL_aff
@ YYSYMBOL_72_
@ YYSYMBOL_69_
@ YYSYMBOL_RETURN
@ YYSYMBOL_66_
@ YYSYMBOL_IDENT
@ YYSYMBOL_DIV_EQ
@ YYSYMBOL_REP
@ YYSYMBOL_PLUS_EQ
@ YYSYMBOL_PLUS_PLUS
@ YYSYMBOL_FOR
@ YYSYMBOL_NOT
@ YYSYMBOL_R_USHIFT
@ YYSYMBOL_post_pre_incr
@ YYSYMBOL_arg_decl
@ YYSYMBOL_RE_MATCH

Function Documentation

◆ add_nasl_inc_dir()

int add_nasl_inc_dir ( const char * dir)

Adds the given string as directory for searching for includes.

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

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

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

References inc_dirs.

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

Here is the caller graph for this function:

◆ file_checksum()

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

Get the checksum of a file.

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

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

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

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

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

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

void load_checksums ( kb_t kb)
static

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

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

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

Referenced by init_nasl_ctx().

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

◆ malloc()

void * malloc ( YYSIZE_T )

References YYSIZE_T.

Referenced by ipc_contexts_init(), ipc_exec_as_process(), o_krb5_gss_session_key_context(), and o_krb5_gss_update_context().

Here is the caller graph for this function:

◆ mylex()

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

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

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

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

Referenced by nasllex().

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

◆ nasl_clean_ctx()

void nasl_clean_ctx ( naslctxt * c)

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

2794{
2795 deref_cell(c->tree);
2796 g_free (c->buffer);
2797}
void deref_cell(tree_cell *c)
Definition nasl_tree.c:178

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

Referenced by exec_nasl_script().

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

◆ nasl_clean_inc()

void nasl_clean_inc ( void )

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

2804{
2805 if (!includes_hash)
2806 return;
2807 g_hash_table_destroy (includes_hash);
2808 includes_hash = NULL;
2809}
GHashTable * includes_hash

References includes_hash.

Referenced by plugins_reload_from_dir().

Here is the caller graph for this function:

◆ nasl_get_include_order()

int nasl_get_include_order ( const char * c)

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

2813{
2814 tree_cell *ctx;
2815 if (!includes_hash)
2816 return -2;
2817
2818 if ((ctx = g_hash_table_lookup (includes_hash, c))) {
2819 return ctx->include_order;
2820 }
2821 return -1;
2822}
struct TC tree_cell
int include_order
Definition nasl_tree.h:100

References TC::include_order, and includes_hash.

Referenced by check_called_files(), and nasl_lint_call().

Here is the caller graph for this function:

◆ naslerror()

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

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

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

References LNB.

◆ nasllex()

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

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

3420{
3421 #pragma GCC diagnostic push
3422 #pragma GCC diagnostic ignored "-Wunused-parameter"
3423 (void) err_c;
3424 #pragma GCC diagnostic pop
3425 int x = mylex (lvalp, parm);
3426 return x;
3427}
static int mylex(YYSTYPE *lvalp, void *parm)

References mylex().

Here is the call graph for this function:

◆ yy_reduce_print()

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

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

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

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

Here is the call graph for this function:

◆ yy_stack_print()

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

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

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

References YYFPRINTF.

◆ yy_symbol_print()

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

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

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

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

Referenced by yy_reduce_print().

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

◆ yy_symbol_value_print()

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

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

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

References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, and YY_USE.

Referenced by yy_symbol_print().

Here is the caller graph for this function:

◆ yydestruct()

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

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

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

References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_SYMBOL_PRINT, and YY_USE.

Referenced by yyparse().

Here is the caller graph for this function:

◆ yyparse()

int yyparse ( naslctxt * parm,
int * err_c )

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

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

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

Here is the call graph for this function:

◆ yysymbol_name()

const char * yysymbol_name ( yysymbol_kind_t yysymbol)
static

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

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

References yytname.

Referenced by yy_symbol_print().

Here is the caller graph for this function:

Variable Documentation

◆ checksum_algorithm

int checksum_algorithm = GCRY_MD_NONE
static

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

Referenced by init_nasl_ctx(), and load_checksums().

◆ inc_dirs

GSList* inc_dirs = NULL
static

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

Referenced by add_nasl_inc_dir(), and init_nasl_ctx().

◆ include_order

int include_order = 0
static

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

Referenced by init_nasl_ctx(), and yyparse().

◆ includes_hash

GHashTable* includes_hash = NULL

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

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

◆ parse_buffer

char* parse_buffer = NULL
static

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

Referenced by init_nasl_ctx(), and mylex().

◆ parse_len

int parse_len = 0
static

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

Referenced by init_nasl_ctx(), and mylex().

◆ yycheck

const yytype_int16 yycheck[]
static

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

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

Referenced by yyparse().

◆ yydebug

int yydebug

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

◆ yydefact

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

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

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

Referenced by yyparse().

◆ yydefgoto

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

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

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

Referenced by yyparse().

◆ yypact

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

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

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

Referenced by yyparse().

◆ yypgoto

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

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

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

Referenced by yyparse().

◆ yyr1

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

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

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

Referenced by yyparse().

◆ yyr2

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

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

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

Referenced by yy_reduce_print(), and yyparse().

◆ yyrline

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

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

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

Referenced by yy_reduce_print().

◆ yystos

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

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

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

◆ yytable

const yytype_int16 yytable[]
static

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

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

Referenced by yyparse().

◆ yytname

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

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

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

Referenced by yysymbol_name().

◆ yytranslate

const yytype_int8 yytranslate[]
static

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

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