OpenVAS Scanner  7.0.1~git
nasl_grammar.tab.c File Reference
#include <ctype.h>
#include <pcap.h>
#include <string.h>
#include <sys/stat.h>
#include <glib.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 <stddef.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  YYSTYPE
 
struct  YYSTYPE::asciiz
 
union  yyalloc
 

Macros

#define YYBISON   1
 
#define YYBISON_VERSION   "3.0.4"
 
#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 LNB   (((naslctxt*)parm)->line_nb)
 
#define G_LOG_DOMAIN   "lib nasl"
 GLib logging domain. More...
 
#define YYERROR_VERBOSE
 
#define YY_NULLPTR   0
 
#define YYERROR_VERBOSE   1
 
#define YY_NASL_NASL_GRAMMAR_TAB_H_INCLUDED
 
#define YYDEBUG   1
 
#define YYTOKENTYPE
 
#define YYSTYPE_IS_TRIVIAL   1
 
#define YYSTYPE_IS_DECLARED   1
 
#define YYSIZE_T   size_t
 
#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)
 
#define YY_(Msgid)   Msgid
 
#define YY_ATTRIBUTE(Spec)   /* empty */
 
#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
 
#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))
 
#define _Noreturn   YY_ATTRIBUTE ((__noreturn__))
 
#define YYUSE(E)   ((void) (E))
 
#define YY_INITIAL_VALUE(Value)   Value
 
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
 
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
 
#define YYSTACK_ALLOC   YYMALLOC
 
#define YYSTACK_FREE   YYFREE
 
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
 
#define YYMALLOC   malloc
 
#define YYFREE   free
 
#define YYSTACK_GAP_MAXIMUM   (sizeof (union yyalloc) - 1)
 
#define YYSTACK_BYTES(N)
 
#define YYCOPY_NEEDED   1
 
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
 
#define YYCOPY(Dst, Src, Count)
 
#define YYFINAL   78
 
#define YYLAST   1029
 
#define YYNTOKENS   73
 
#define YYNNTS   43
 
#define YYNRULES   126
 
#define YYNSTATES   227
 
#define YYUNDEFTOK   2
 
#define YYMAXUTOK   304
 
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
#define YYPACT_NINF   -91
 
#define yypact_value_is_default(Yystate)   (!!((Yystate) == (-91)))
 
#define YYTABLE_NINF   -69
 
#define yytable_value_is_error(Yytable_value)   (!!((Yytable_value) == (-69)))
 
#define yyerrok   (yyerrstatus = 0)
 
#define yyclearin   (yychar = YYEMPTY)
 
#define YYEMPTY   (-2)
 
#define YYEOF   0
 
#define YYACCEPT   goto yyacceptlab
 
#define YYABORT   goto yyabortlab
 
#define YYERROR   goto yyerrorlab
 
#define YYRECOVERING()   (!!yyerrstatus)
 
#define YYBACKUP(Token, Value)
 
#define YYTERROR   1
 
#define YYERRCODE   256
 
#define YYFPRINTF   fprintf
 
#define YYDPRINTF(Args)
 
#define YY_LOCATION_PRINT(File, Loc)   ((void) 0)
 
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 
#define YY_STACK_PRINT(Bottom, Top)
 
#define YY_REDUCE_PRINT(Rule)
 
#define YYINITDEPTH   200
 
#define YYMAXDEPTH   10000
 
#define YYCASE_(N, S)
 
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
#define YYSYNTAX_ERROR
 

Typedefs

typedef union YYSTYPE YYSTYPE
 
typedef unsigned char yytype_uint8
 
typedef signed char yytype_int8
 
typedef unsigned short int yytype_uint16
 
typedef short int yytype_int16
 

Enumerations

enum  yytokentype {
  IF = 258, ELSE = 259, EQ = 260, NEQ = 261,
  SUPEQ = 262, INFEQ = 263, OR = 264, AND = 265,
  MATCH = 266, NOMATCH = 267, REP = 268, FOR = 269,
  REPEAT = 270, UNTIL = 271, FOREACH = 272, WHILE = 273,
  BREAK = 274, CONTINUE = 275, FUNCTION = 276, RETURN = 277,
  INCLUDE = 278, LOCAL = 279, GLOBAL = 280, PLUS_PLUS = 281,
  MINUS_MINUS = 282, L_SHIFT = 283, R_SHIFT = 284, R_USHIFT = 285,
  EXPO = 286, PLUS_EQ = 287, MINUS_EQ = 288, MULT_EQ = 289,
  DIV_EQ = 290, MODULO_EQ = 291, L_SHIFT_EQ = 292, R_SHIFT_EQ = 293,
  R_USHIFT_EQ = 294, RE_MATCH = 295, RE_NOMATCH = 296, ARROW = 297,
  IDENT = 298, STRING1 = 299, STRING2 = 300, INTEGER = 301,
  NOT = 302, UMINUS = 303, BIT_NOT = 304, IF = 258,
  ELSE = 259, EQ = 260, NEQ = 261, SUPEQ = 262,
  INFEQ = 263, OR = 264, AND = 265, MATCH = 266,
  NOMATCH = 267, REP = 268, FOR = 269, REPEAT = 270,
  UNTIL = 271, FOREACH = 272, WHILE = 273, BREAK = 274,
  CONTINUE = 275, FUNCTION = 276, RETURN = 277, INCLUDE = 278,
  LOCAL = 279, GLOBAL = 280, PLUS_PLUS = 281, MINUS_MINUS = 282,
  L_SHIFT = 283, R_SHIFT = 284, R_USHIFT = 285, EXPO = 286,
  PLUS_EQ = 287, MINUS_EQ = 288, MULT_EQ = 289, DIV_EQ = 290,
  MODULO_EQ = 291, L_SHIFT_EQ = 292, R_SHIFT_EQ = 293, R_USHIFT_EQ = 294,
  RE_MATCH = 295, RE_NOMATCH = 296, ARROW = 297, IDENT = 298,
  STRING1 = 299, STRING2 = 300, INTEGER = 301, NOT = 302,
  UMINUS = 303, BIT_NOT = 304
}
 
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 *, const char *)
 
int naslparse (naslctxt *parm)
 
static int nasllex (YYSTYPE *lvalp, void *parm)
 
void * malloc (YYSIZE_T)
 
void free (void *)
 
static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep, naslctxt *parm)
 
static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep, naslctxt *parm)
 
static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 
static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, naslctxt *parm)
 
static YYSIZE_T yystrlen (const char *yystr)
 
static char * yystpcpy (char *yydest, const char *yysrc)
 
static YYSIZE_T yytnamerr (char *yyres, const char *yystr)
 
static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
 
static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, naslctxt *parm)
 
int yyparse (naslctxt *parm)
 
int add_nasl_inc_dir (const char *dir)
 Adds the given string as directory for searching for includes. More...
 
static void load_checksums (kb_t kb)
 
static char * file_checksum (const char *filename, int algorithm)
 Get the checksum of a file. More...
 
int init_nasl_ctx (naslctxt *pc, const char *name)
 Initialize a NASL context for a NASL file. More...
 
void nasl_clean_ctx (naslctxt *c)
 
void nasl_clean_inc (void)
 
static int mylex (YYSTYPE *lvalp, void *parm)
 

Variables

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

Macro Definition Documentation

◆ _Noreturn

#define _Noreturn   YY_ATTRIBUTE ((__noreturn__))

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

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "lib nasl"

GLib logging domain.

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

◆ LNB

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

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

Referenced by yyparse().

◆ YY_

#define YY_ (   Msgid)    Msgid

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

Referenced by yyparse(), and yysyntax_error().

◆ YY_ATTRIBUTE

#define YY_ATTRIBUTE (   Spec)    /* empty */

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

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))

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

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))

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

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

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

Referenced by yydestruct(), and yyparse().

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

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

Referenced by yydestruct(), and yyparse().

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE (   Value)    Value

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

Referenced by yyparse().

◆ YY_LOCATION_PRINT

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

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

◆ YY_NASL_NASL_GRAMMAR_TAB_H_INCLUDED

#define YY_NASL_NASL_GRAMMAR_TAB_H_INCLUDED

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

◆ YY_NULLPTR

#define YY_NULLPTR   0

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

Referenced by yysyntax_error().

◆ YY_REDUCE_PRINT

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

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

Referenced by yyparse().

◆ YY_STACK_PRINT

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

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

Referenced by yyparse().

◆ YY_SYMBOL_PRINT

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

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

Referenced by yydestruct(), and yyparse().

◆ YYABORT

#define YYABORT   goto yyabortlab

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

Referenced by yyparse().

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 983 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, YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (0)
#define YY_(Msgid)
#define YYEMPTY

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

◆ YYBISON

#define YYBISON   1

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

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.0.4"

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

◆ YYCASE_

#define YYCASE_ (   N,
 
)
Value:
case N: \
yyformat = S; \
break

Referenced by yysyntax_error().

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

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

◆ YYCOPY

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

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

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

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

◆ yydebug

#define yydebug   nasldebug

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

◆ YYDEBUG

#define YYDEBUG   1

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

◆ YYDPRINTF

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

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

Referenced by yyparse().

◆ YYEMPTY

#define YYEMPTY   (-2)

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

Referenced by yyparse(), and yysyntax_error().

◆ YYEOF

#define YYEOF   0

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

Referenced by yyparse().

◆ YYERRCODE

#define YYERRCODE   256

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

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

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

◆ yyerror

#define yyerror   naslerror

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

Referenced by yyparse().

◆ YYERROR

#define YYERROR   goto yyerrorlab

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

◆ YYERROR_VERBOSE [1/2]

#define YYERROR_VERBOSE

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

◆ YYERROR_VERBOSE [2/2]

#define YYERROR_VERBOSE   1

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

◆ YYFINAL

#define YYFINAL   78

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

Referenced by yyparse().

◆ YYFPRINTF

#define YYFPRINTF   fprintf

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

◆ YYINITDEPTH

#define YYINITDEPTH   200

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

Referenced by yyparse().

◆ YYLAST

#define YYLAST   1029

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

Referenced by yyparse(), and yysyntax_error().

◆ yylex

#define yylex   nasllex

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

Referenced by yyparse().

◆ YYLEX_PARAM

#define YYLEX_PARAM   parm

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

◆ YYMALLOC

#define YYMALLOC   malloc

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

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

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

Referenced by yyparse().

◆ YYMAXUTOK

#define YYMAXUTOK   304

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

◆ yynerrs

#define yynerrs   naslnerrs

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

Referenced by yyparse().

◆ YYNNTS

#define YYNNTS   43

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

◆ YYNRULES

#define YYNRULES   126

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

◆ YYNSTATES

#define YYNSTATES   227

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

◆ YYNTOKENS

#define YYNTOKENS   73

◆ YYPACT_NINF

#define YYPACT_NINF   -91

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

◆ yypact_value_is_default

#define yypact_value_is_default (   Yystate)    (!!((Yystate) == (-91)))

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

Referenced by yyparse(), and yysyntax_error().

◆ yyparse

#define yyparse   naslparse

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

◆ YYPARSE_PARAM

#define YYPARSE_PARAM   parm

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

◆ YYPOPSTACK

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

Referenced by yyparse().

◆ YYPULL

#define YYPULL   1

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

◆ YYPURE

#define YYPURE   1

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

◆ YYPUSH

#define YYPUSH   0

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

◆ YYRECOVERING

#define YYRECOVERING ( )    (!!yyerrstatus)

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

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

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

◆ YYSIZE_T

#define YYSIZE_T   size_t

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

Referenced by yyparse(), yystrlen(), yysyntax_error(), and yytnamerr().

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

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

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   YYMALLOC

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

Referenced by yyparse().

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

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

Referenced by yysyntax_error().

◆ YYSTACK_BYTES

#define YYSTACK_BYTES (   N)
Value:
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
short int yytype_int16
union YYSTYPE YYSTYPE
#define YYSTACK_GAP_MAXIMUM

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

Referenced by yyparse().

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

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

Referenced by yyparse().

◆ YYSTACK_GAP_MAXIMUM

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

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

◆ YYSTACK_RELOCATE

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

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

Referenced by yyparse().

◆ YYSTYPE_IS_DECLARED

#define YYSTYPE_IS_DECLARED   1

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

◆ YYSTYPE_IS_TRIVIAL

#define YYSTYPE_IS_TRIVIAL   1

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

◆ YYSYNTAX_ERROR

#define YYSYNTAX_ERROR
Value:
yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)
static int yysyntax_error(YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)

Referenced by yyparse().

◆ YYTABLE_NINF

#define YYTABLE_NINF   -69

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

◆ yytable_value_is_error

#define yytable_value_is_error (   Yytable_value)    (!!((Yytable_value) == (-69)))

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

Referenced by yyparse(), and yysyntax_error().

◆ YYTERROR

#define YYTERROR   1

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

Referenced by yyparse(), and yysyntax_error().

◆ YYTOKENTYPE

#define YYTOKENTYPE

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

◆ YYTRANSLATE

#define YYTRANSLATE (   YYX)    ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)

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

Referenced by yyparse().

◆ YYUNDEFTOK

#define YYUNDEFTOK   2

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

◆ YYUSE

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

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

Referenced by yy_symbol_value_print(), and yydestruct().

Typedef Documentation

◆ YYSTYPE

typedef union YYSTYPE YYSTYPE

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

◆ yytype_int16

typedef short int yytype_int16

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

◆ yytype_int8

typedef signed char yytype_int8

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

◆ yytype_uint16

typedef unsigned short int yytype_uint16

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

◆ yytype_uint8

typedef unsigned char yytype_uint8

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

Enumeration Type Documentation

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

2909  {
2910  ST_START = 0,
2911  ST_SPACE,
2912  ST_IDENT,
2913  ST_ZERO,
2914  ST_ZEROX,
2915  ST_OCT,
2916  ST_DEC,
2917  ST_HEX,
2918  ST_COMMENT,
2919  ST_SUP,
2920  ST_INF,
2921  ST_SUP_EXCL,
2922  ST_STRING1,
2924  ST_STRING2,
2925  ST_PLUS,
2926  ST_MINUS,
2927  ST_MULT,
2928  ST_DIV,
2929  ST_MODULO,
2930  ST_R_SHIFT,
2931  ST_R_USHIFT,
2932  ST_L_SHIFT,
2933  ST_NOT,
2934  ST_EQ,
2935  ST_AND,
2936  ST_OR };

◆ yytokentype

Enumerator
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 
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 

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

161  {
162  IF = 258,
163  ELSE = 259,
164  EQ = 260,
165  NEQ = 261,
166  SUPEQ = 262,
167  INFEQ = 263,
168  OR = 264,
169  AND = 265,
170  MATCH = 266,
171  NOMATCH = 267,
172  REP = 268,
173  FOR = 269,
174  REPEAT = 270,
175  UNTIL = 271,
176  FOREACH = 272,
177  WHILE = 273,
178  BREAK = 274,
179  CONTINUE = 275,
180  FUNCTION = 276,
181  RETURN = 277,
182  INCLUDE = 278,
183  LOCAL = 279,
184  GLOBAL = 280,
185  PLUS_PLUS = 281,
186  MINUS_MINUS = 282,
187  L_SHIFT = 283,
188  R_SHIFT = 284,
189  R_USHIFT = 285,
190  EXPO = 286,
191  PLUS_EQ = 287,
192  MINUS_EQ = 288,
193  MULT_EQ = 289,
194  DIV_EQ = 290,
195  MODULO_EQ = 291,
196  L_SHIFT_EQ = 292,
197  R_SHIFT_EQ = 293,
198  R_USHIFT_EQ = 294,
199  RE_MATCH = 295,
200  RE_NOMATCH = 296,
201  ARROW = 297,
202  IDENT = 298,
203  STRING1 = 299,
204  STRING2 = 300,
205  INTEGER = 301,
206  NOT = 302,
207  UMINUS = 303,
208  BIT_NOT = 304
209  };

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

References inc_dirs.

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

2637 {
2638  if (dir == NULL)
2639  {
2640  return 0;
2641  }
2642 
2643  // Allow initialization with empty element
2644  if (*dir == '\0')
2645  {
2646  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2647  return 0;
2648  }
2649 
2650  struct stat stat_buf;
2651 
2652  if (stat (dir, &stat_buf) != 0)
2653  return -1;
2654 
2655  if (S_ISDIR(stat_buf.st_mode) != 0)
2656  {
2657  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2658  return 0;
2659  }
2660  else
2661  return -2;
2662 }
static GSList * inc_dirs
Here is the caller graph for this function:

◆ file_checksum()

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

Get the checksum of a file.

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

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

Referenced by init_nasl_ctx().

2758 {
2759  char *content = NULL, digest[128], *result;
2760  size_t len = 0, i, alglen;
2761 
2762  assert (algorithm == GCRY_MD_MD5 || algorithm == GCRY_MD_SHA256);
2763  if (!filename || !g_file_get_contents (filename, &content, &len, NULL))
2764  return NULL;
2765 
2766  gcry_md_hash_buffer (algorithm, digest, content, len);
2767  alglen = gcry_md_get_algo_dlen (algorithm);
2768  result = g_malloc0 (alglen * 2 + 1);
2769  for (i = 0; i < alglen; i++)
2770  snprintf (result + 2 * i, 3, "%02x", (unsigned char) digest[i]);
2771  g_free (content);
2772 
2773  return result;
2774 }
Here is the caller graph for this function:

◆ free()

void free ( void *  )

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

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

Referenced by exec_nasl_script(), and yyparse().

2793 {
2794  char *full_name = NULL, key_path[2048], *checksum, *filename;
2795  GSList * inc_dir = inc_dirs; // iterator for include directories
2796  size_t flen = 0;
2797  time_t timestamp;
2798 
2799  // initialize if not yet done (for openvas-server < 2.0.1)
2800  if (! inc_dirs) add_nasl_inc_dir("");
2801 
2802  pc->line_nb = 1;
2803  pc->tree = NULL;
2804  if (!parse_len)
2805  {
2806  parse_len = 9092;
2807  parse_buffer = g_malloc0 (parse_len);
2808  }
2809  else
2810  parse_buffer[0] = '\0';
2811 
2812 
2814  while (inc_dir != NULL) {
2815  if (full_name)
2816  g_free (full_name);
2817  full_name = g_build_filename(inc_dir->data, name, NULL);
2818 
2819  if ((g_file_get_contents (full_name, &pc->buffer, &flen, NULL)))
2820  break;
2821 
2822  inc_dir = g_slist_next(inc_dir);
2823  }
2824 
2825  if (!full_name || !pc->buffer) {
2826  g_message ("%s: Not able to open nor to locate it in include paths",
2827  name);
2828  g_free(full_name);
2829  return -1;
2830  }
2831 
2832  if (pc->always_signed)
2833  {
2834  g_free(full_name);
2835  return 0;
2836  }
2837  /* Cache the checksum of signature verified files, so that commonly included
2838  * files are not verified multiple times per scan. */
2839  if (strstr (full_name, ".inc"))
2840  filename = basename (full_name);
2841  else
2842  filename = full_name;
2843  snprintf (key_path, sizeof (key_path), "signaturecheck:%s", filename);
2844  timestamp = kb_item_get_int (pc->kb, key_path);
2845  if (timestamp > 0)
2846  {
2847  struct stat file_stat;
2848 
2849  if (stat (full_name, &file_stat) >= 0 && timestamp > file_stat.st_mtime)
2850  {
2851  /* Already checked. No need to check again. */
2852  g_free (full_name);
2853  return 0;
2854  }
2855  }
2856 
2857  load_checksums (pc->kb);
2858  if (checksum_algorithm == GCRY_MD_NONE)
2859  return -1;
2860  else if (checksum_algorithm == GCRY_MD_MD5)
2861  snprintf (key_path, sizeof (key_path), "md5sums:%s", filename);
2862  else if (checksum_algorithm == GCRY_MD_SHA256)
2863  snprintf (key_path, sizeof (key_path), "sha256sums:%s", filename);
2864  else
2865  abort ();
2866  checksum = kb_item_get_str (pc->kb, key_path);
2867  if (!checksum)
2868  {
2869  g_warning ("No checksum for %s", full_name);
2870  g_free (full_name);
2871  return -1;
2872  }
2873  else
2874  {
2875  int ret;
2876  char *check = file_checksum (full_name, checksum_algorithm);
2877 
2878  ret = strcmp (check, checksum);
2879  if (ret)
2880  g_warning ("checksum for %s not matching", full_name);
2881  else
2882  {
2883  snprintf (key_path, sizeof (key_path), "signaturecheck:%s", filename);
2884  kb_item_add_int (pc->kb, key_path, time (NULL));
2885  }
2886  g_free (full_name);
2887  g_free (checksum);
2888  g_free (check);
2889  return ret;
2890  }
2891 }
static void load_checksums(kb_t kb)
char * buffer
static int checksum_algorithm
tree_cell * tree
static GSList * inc_dirs
void nasl_set_filename(const char *filename)
Definition: nasl_debug.c:97
int add_nasl_inc_dir(const char *dir)
Adds the given string as directory for searching for includes.
static char * parse_buffer
const char * name
Definition: nasl_init.c:377
static int parse_len
static char * file_checksum(const char *filename, int algorithm)
Get the checksum of a file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_checksums()

static void load_checksums ( kb_t  kb)
static

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

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

Referenced by init_nasl_ctx().

2668 {
2669  static int loaded = 0;
2670  const char *base, *prefix;
2671  char filename[2048], *fbuffer;
2672  FILE *file;
2673  size_t flen;
2674 
2675  if (loaded)
2676  return;
2677  loaded = 1;
2678  base = prefs_get ("plugins_folder");
2679  snprintf (filename, sizeof (filename), "%s/sha256sums", base);
2680  if (g_file_get_contents (filename, &fbuffer, &flen, NULL))
2681  checksum_algorithm = GCRY_MD_SHA256;
2682  else
2683  {
2684  snprintf (filename, sizeof (filename), "%s/md5sums", base);
2685  if (g_file_get_contents (filename, &fbuffer, &flen, NULL))
2686  checksum_algorithm = GCRY_MD_MD5;
2687  }
2688  if (checksum_algorithm == GCRY_MD_NONE)
2689  {
2690  g_warning ("No plugins checksums file");
2691  return;
2692  }
2693  /* Verify checksum */
2694  if (nasl_verify_signature (filename, fbuffer, flen) != 0)
2695  {
2696  g_warning ("Erroneous or missing signature for checksums file %s",
2697  filename);
2698  g_free (fbuffer);
2699  return;
2700  }
2701  g_free (fbuffer);
2702 
2703  /* Insert content into KB */
2704  file = fopen (filename, "r");
2705  if (!file)
2706  {
2707  g_warning ("%s: Couldn't read file %s", __FUNCTION__, filename);
2708  return;
2709  }
2710  if (checksum_algorithm == GCRY_MD_MD5)
2711  {
2712  kb_del_items (kb, "md5sums:*");
2713  prefix = "md5sums";
2714  }
2715  else
2716  {
2717  kb_del_items (kb, "sha256sums:*");
2718  prefix = "sha256sums";
2719  }
2720  while (1)
2721  {
2722  char buffer[2048], **splits;
2723  if (!fgets (buffer, sizeof (buffer), file))
2724  break;
2725  if (strstr (buffer, ".asc")
2726  || (!strstr (buffer, ".inc") && !strstr (buffer, ".nasl")))
2727  continue;
2728  splits = g_strsplit (buffer, " ", -1);
2729  if (g_strv_length (splits) != 2)
2730  {
2731  g_warning ("%s: Erroneous checksum entry %s", __FUNCTION__, buffer);
2732  g_strfreev (splits);
2733  break;
2734  }
2735  splits[1][strlen (splits[1]) - 1] = '\0';
2736  if (strstr (splits[1], ".inc"))
2737  g_snprintf (buffer, sizeof (buffer), "%s:%s", prefix,
2738  basename (splits[1]));
2739  else
2740  g_snprintf (buffer, sizeof (buffer), "%s:%s/%s", prefix, base,
2741  splits[1]);
2742  kb_item_set_str (kb, buffer, splits[0], 0);
2743  g_strfreev (splits);
2744  }
2745  fclose (file);
2746 }
static int checksum_algorithm
int nasl_verify_signature(const char *filename)
static void prefix(int n, int i)
Definition: nasl_tree.c:233
Here is the call graph for this function:
Here is the caller graph for this function:

◆ malloc()

void* malloc ( YYSIZE_T  )

◆ mylex()

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

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

References AND, ARROW, BREAK, naslctxt::buffer, CONTINUE, YYSTYPE::data, DIV_EQ, ELSE, EQ, EXPO, FOR, FOREACH, FUNCTION, GLOBAL, IDENT, IF, INCLUDE, naslctxt::index, INFEQ, INTEGER, L_SHIFT, L_SHIFT_EQ, YYSTYPE::asciiz::len, 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().

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

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

Referenced by exec_nasl_script().

2895 {
2896  deref_cell(c->tree);
2897  g_free (c->buffer);
2898 }
char * buffer
tree_cell * tree
void deref_cell(tree_cell *c)
Definition: nasl_tree.c:192
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 2901 of file nasl_grammar.tab.c.

References includes_hash.

Referenced by plugins_reload_from_dir().

2902 {
2903  if (!includes_hash)
2904  return;
2905  g_hash_table_destroy (includes_hash);
2906  includes_hash = NULL;
2907 }
GHashTable * includes_hash
Here is the caller graph for this function:

◆ naslerror()

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

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

2617 {
2618  (void) parm;
2619  g_message ("%s", s);
2620 }

◆ nasllex()

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

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

References mylex().

3505 {
3506  int x = mylex (lvalp, parm);
3507  return x;
3508 }
static int mylex(YYSTYPE *lvalp, void *parm)
Here is the call graph for this function:

◆ naslparse()

int naslparse ( naslctxt parm)

Referenced by yyparse().

Here is the caller graph for this function:

◆ yy_reduce_print()

static void yy_reduce_print ( yytype_int16 yyssp,
YYSTYPE yyvsp,
int  yyrule,
naslctxt parm 
)
static

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

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

1109 {
1110  unsigned long int yylno = yyrline[yyrule];
1111  int yynrhs = yyr2[yyrule];
1112  int yyi;
1113  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1114  yyrule - 1, yylno);
1115  /* The symbols being reduced. */
1116  for (yyi = 0; yyi < yynrhs; yyi++)
1117  {
1118  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1119  yy_symbol_print (stderr,
1120  yystos[yyssp[yyi + 1 - yynrhs]],
1121  &(yyvsp[(yyi + 1) - (yynrhs)])
1122  , parm);
1123  YYFPRINTF (stderr, "\n");
1124  }
1125 }
static const yytype_uint16 yyrline[]
static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep, naslctxt *parm)
static const yytype_uint8 yystos[]
static const yytype_uint8 yyr2[]
#define YYFPRINTF
Here is the call graph for this function:

◆ yy_stack_print()

static void yy_stack_print ( yytype_int16 yybottom,
yytype_int16 yytop 
)
static

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

References YYFPRINTF.

1086 {
1087  YYFPRINTF (stderr, "Stack now");
1088  for (; yybottom <= yytop; yybottom++)
1089  {
1090  int yybot = *yybottom;
1091  YYFPRINTF (stderr, " %d", yybot);
1092  }
1093  YYFPRINTF (stderr, "\n");
1094 }
#define YYFPRINTF

◆ yy_symbol_print()

static void yy_symbol_print ( FILE *  yyoutput,
int  yytype,
YYSTYPE const *const  yyvaluep,
naslctxt parm 
)
static

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

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

Referenced by yy_reduce_print().

1071 {
1072  YYFPRINTF (yyoutput, "%s %s (",
1073  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1074 
1075  yy_symbol_value_print (yyoutput, yytype, yyvaluep, parm);
1076  YYFPRINTF (yyoutput, ")");
1077 }
static void yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep, naslctxt *parm)
static const char *const yytname[]
#define YYFPRINTF
#define YYNTOKENS
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yy_symbol_value_print()

static void yy_symbol_value_print ( FILE *  yyoutput,
int  yytype,
YYSTYPE const *const  yyvaluep,
naslctxt parm 
)
static

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

References YYNTOKENS, and YYUSE.

Referenced by yy_symbol_print().

1051 {
1052  FILE *yyo = yyoutput;
1053  YYUSE (yyo);
1054  YYUSE (parm);
1055  if (!yyvaluep)
1056  return;
1057 # ifdef YYPRINT
1058  if (yytype < YYNTOKENS)
1059  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1060 # endif
1061  YYUSE (yytype);
1062 }
#define YYUSE(E)
#define YYNTOKENS
Here is the caller graph for this function:

◆ yydestruct()

static void yydestruct ( const char *  yymsg,
int  yytype,
YYSTYPE yyvaluep,
naslctxt parm 
)
static

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

References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_SYMBOL_PRINT, and YYUSE.

Referenced by yyparse().

1389 {
1390  YYUSE (yyvaluep);
1391  YYUSE (parm);
1392  if (!yymsg)
1393  yymsg = "Deleting";
1394  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1395 
1397  YYUSE (yytype);
1399 }
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YYUSE(E)
Here is the caller graph for this function:

◆ yyparse()

int yyparse ( naslctxt parm)

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

References alloc_expr_cell(), alloc_RE_cell(), alloc_typed_cell(), naslctxt::always_signed, ARRAY_ELEM, naslctxt::buffer, COMP_EQ, COMP_GE, COMP_GT, COMP_LE, COMP_LT, COMP_MATCH, COMP_NE, COMP_NOMATCH, COMP_RE_MATCH, COMP_RE_NOMATCH, CONST_DATA, CONST_INT, CONST_STR, deref_cell(), 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, includes_hash, init_nasl_ctx(), naslctxt::kb, naslctxt::line_nb, LNB, make_array_from_elems(), nasl_get_filename(), nasl_perror(), nasl_set_filename(), nasl_set_function_filename(), naslparse(), YYSTYPE::node, NODE_AFF, NODE_ARG, NODE_ARRAY_EL, NODE_BREAK, NODE_CONTINUE, NODE_DECL, NODE_DIV_EQ, NODE_FOR, NODE_FOREACH, NODE_FUN_CALL, NODE_FUN_DEF, NODE_GLOBAL, NODE_IF_ELSE, NODE_INSTR_L, NODE_L_SHIFT_EQ, NODE_LOCAL, NODE_MINUS_EQ, NODE_MODULO_EQ, NODE_MULT_EQ, NODE_PLUS_EQ, NODE_R_SHIFT_EQ, NODE_R_USHIFT_EQ, NODE_REPEAT_UNTIL, NODE_REPEATED, NODE_RETURN, NODE_VAR, NODE_WHILE, ref_cell(), YYSTYPE::str, TC::str_val, naslctxt::tree, YY_, YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_INITIAL_VALUE, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yycheck, yydefact, yydefgoto, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, yyerror, YYFINAL, YYINITDEPTH, YYLAST, yylex, YYMAXDEPTH, yynerrs, YYNTOKENS, yypact, yypact_value_is_default, yypgoto, YYPOPSTACK, yyr1, yyr2, YYSIZE_T, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yystos, YYSYNTAX_ERROR, yytable, yytable_value_is_error, YYTERROR, YYTRANSLATE, and yyalloc::yyvs_alloc.

1410 {
1411 /* The lookahead symbol. */
1412 int yychar;
1413 
1414 
1415 /* The semantic value of the lookahead symbol. */
1416 /* Default value used for initialization, for pacifying older GCCs
1417  or non-GCC compilers. */
1418 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1419 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1420 
1421  /* Number of syntax errors so far. */
1422  int yynerrs;
1423 
1424  int yystate;
1425  /* Number of tokens to shift before error messages enabled. */
1426  int yyerrstatus;
1427 
1428  /* The stacks and their tools:
1429  'yyss': related to states.
1430  'yyvs': related to semantic values.
1431 
1432  Refer to the stacks through separate pointers, to allow yyoverflow
1433  to reallocate them elsewhere. */
1434 
1435  /* The state stack. */
1436  yytype_int16 yyssa[YYINITDEPTH];
1437  yytype_int16 *yyss;
1438  yytype_int16 *yyssp;
1439 
1440  /* The semantic value stack. */
1441  YYSTYPE yyvsa[YYINITDEPTH];
1442  YYSTYPE *yyvs;
1443  YYSTYPE *yyvsp;
1444 
1445  YYSIZE_T yystacksize;
1446 
1447  int yyn;
1448  int yyresult;
1449  /* Lookahead token as an internal (translated) token number. */
1450  int yytoken = 0;
1451  /* The variables used to return semantic value and location from the
1452  action routines. */
1453  YYSTYPE yyval;
1454 
1455 #if YYERROR_VERBOSE
1456  /* Buffer for error messages, and its allocated size. */
1457  char yymsgbuf[128];
1458  char *yymsg = yymsgbuf;
1459  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1460 #endif
1461 
1462 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1463 
1464  /* The number of symbols on the RHS of the reduced rule.
1465  Keep to zero when no symbol should be popped. */
1466  int yylen = 0;
1467 
1468  yyssp = yyss = yyssa;
1469  yyvsp = yyvs = yyvsa;
1470  yystacksize = YYINITDEPTH;
1471 
1472  YYDPRINTF ((stderr, "Starting parse\n"));
1473 
1474  yystate = 0;
1475  yyerrstatus = 0;
1476  yynerrs = 0;
1477  yychar = YYEMPTY; /* Cause a token to be read. */
1478  goto yysetstate;
1479 
1480 /*------------------------------------------------------------.
1481 | yynewstate -- Push a new state, which is found in yystate. |
1482 `------------------------------------------------------------*/
1483  yynewstate:
1484  /* In all cases, when you get here, the value and location stacks
1485  have just been pushed. So pushing a state here evens the stacks. */
1486  yyssp++;
1487 
1488  yysetstate:
1489  *yyssp = yystate;
1490 
1491  if (yyss + yystacksize - 1 <= yyssp)
1492  {
1493  /* Get the current used size of the three stacks, in elements. */
1494  YYSIZE_T yysize = yyssp - yyss + 1;
1495 
1496 #ifdef yyoverflow
1497  {
1498  /* Give user a chance to reallocate the stack. Use copies of
1499  these so that the &'s don't force the real ones into
1500  memory. */
1501  YYSTYPE *yyvs1 = yyvs;
1502  yytype_int16 *yyss1 = yyss;
1503 
1504  /* Each stack pointer address is followed by the size of the
1505  data in use in that stack, in bytes. This used to be a
1506  conditional around just the two extra args, but that might
1507  be undefined if yyoverflow is a macro. */
1508  yyoverflow (YY_("memory exhausted"),
1509  &yyss1, yysize * sizeof (*yyssp),
1510  &yyvs1, yysize * sizeof (*yyvsp),
1511  &yystacksize);
1512 
1513  yyss = yyss1;
1514  yyvs = yyvs1;
1515  }
1516 #else /* no yyoverflow */
1517 # ifndef YYSTACK_RELOCATE
1518  goto yyexhaustedlab;
1519 # else
1520  /* Extend the stack our own way. */
1521  if (YYMAXDEPTH <= yystacksize)
1522  goto yyexhaustedlab;
1523  yystacksize *= 2;
1524  if (YYMAXDEPTH < yystacksize)
1525  yystacksize = YYMAXDEPTH;
1526 
1527  {
1528  yytype_int16 *yyss1 = yyss;
1529  union yyalloc *yyptr =
1530  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1531  if (! yyptr)
1532  goto yyexhaustedlab;
1533  YYSTACK_RELOCATE (yyss_alloc, yyss);
1534  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1535 # undef YYSTACK_RELOCATE
1536  if (yyss1 != yyssa)
1537  YYSTACK_FREE (yyss1);
1538  }
1539 # endif
1540 #endif /* no yyoverflow */
1541 
1542  yyssp = yyss + yysize - 1;
1543  yyvsp = yyvs + yysize - 1;
1544 
1545  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1546  (unsigned long int) yystacksize));
1547 
1548  if (yyss + yystacksize - 1 <= yyssp)
1549  YYABORT;
1550  }
1551 
1552  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1553 
1554  if (yystate == YYFINAL)
1555  YYACCEPT;
1556 
1557  goto yybackup;
1558 
1559 /*-----------.
1560 | yybackup. |
1561 `-----------*/
1562 yybackup:
1563 
1564  /* Do appropriate processing given the current state. Read a
1565  lookahead token if we need one and don't already have one. */
1566 
1567  /* First try to decide what to do without reference to lookahead token. */
1568  yyn = yypact[yystate];
1569  if (yypact_value_is_default (yyn))
1570  goto yydefault;
1571 
1572  /* Not known => get a lookahead token if don't already have one. */
1573 
1574  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1575  if (yychar == YYEMPTY)
1576  {
1577  YYDPRINTF ((stderr, "Reading a token: "));
1578  yychar = yylex (&yylval, parm);
1579  }
1580 
1581  if (yychar <= YYEOF)
1582  {
1583  yychar = yytoken = YYEOF;
1584  YYDPRINTF ((stderr, "Now at end of input.\n"));
1585  }
1586  else
1587  {
1588  yytoken = YYTRANSLATE (yychar);
1589  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1590  }
1591 
1592  /* If the proper action on seeing token YYTOKEN is to reduce or to
1593  detect an error, take that action. */
1594  yyn += yytoken;
1595  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1596  goto yydefault;
1597  yyn = yytable[yyn];
1598  if (yyn <= 0)
1599  {
1600  if (yytable_value_is_error (yyn))
1601  goto yyerrlab;
1602  yyn = -yyn;
1603  goto yyreduce;
1604  }
1605 
1606  /* Count tokens shifted since error; after three, turn off error
1607  status. */
1608  if (yyerrstatus)
1609  yyerrstatus--;
1610 
1611  /* Shift the lookahead token. */
1612  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1613 
1614  /* Discard the shifted token. */
1615  yychar = YYEMPTY;
1616 
1617  yystate = yyn;
1619  *++yyvsp = yylval;
1621 
1622  goto yynewstate;
1623 
1624 
1625 /*-----------------------------------------------------------.
1626 | yydefault -- do the default action for the current state. |
1627 `-----------------------------------------------------------*/
1628 yydefault:
1629  yyn = yydefact[yystate];
1630  if (yyn == 0)
1631  goto yyerrlab;
1632  goto yyreduce;
1633 
1634 
1635 /*-----------------------------.
1636 | yyreduce -- Do a reduction. |
1637 `-----------------------------*/
1638 yyreduce:
1639  /* yyn is the number of a rule to reduce with. */
1640  yylen = yyr2[yyn];
1641 
1642  /* If YYLEN is nonzero, implement the default value of the action:
1643  '$$ = $1'.
1644 
1645  Otherwise, the following line sets YYVAL to garbage.
1646  This behavior is undocumented and Bison
1647  users should not rely upon it. Assigning to YYVAL
1648  unconditionally makes the parser a bit smaller, and it avoids a
1649  GCC warning that YYVAL may be used uninitialized. */
1650  yyval = yyvsp[1-yylen];
1651 
1652 
1653  YY_REDUCE_PRINT (yyn);
1654  switch (yyn)
1655  {
1656  case 2:
1657 #line 157 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1658  {
1659  ((naslctxt*)parm)->tree = (yyvsp[0].node);
1660  }
1661 #line 1662 "nasl_grammar.tab.c" /* yacc.c:1646 */
1662  break;
1663 
1664  case 3:
1665 #line 162 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1666  {
1667  (yyval.node) = alloc_typed_cell (NODE_INSTR_L);
1668  (yyval.node)->line_nb = LNB;
1669  (yyval.node)->link[0] = (yyvsp[0].node);
1670  }
1671 #line 1672 "nasl_grammar.tab.c" /* yacc.c:1646 */
1672  break;
1673 
1674  case 4:
1675 #line 168 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1676  {
1677  (yyval.node) = alloc_typed_cell (NODE_INSTR_L);
1678  (yyval.node)->line_nb = LNB;
1679  (yyval.node)->link[0] = (yyvsp[-1].node);
1680  (yyval.node)->link[1] = (yyvsp[0].node);
1681  }
1682 #line 1683 "nasl_grammar.tab.c" /* yacc.c:1646 */
1683  break;
1684 
1685  case 7:
1686 #line 178 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1687  {
1688  nasl_set_function_filename ((yyvsp[-4].str));
1689  (yyval.node) = alloc_typed_cell (NODE_FUN_DEF);
1690  (yyval.node)->line_nb = LNB;
1691  (yyval.node)->x.str_val = (yyvsp[-4].str);
1692  (yyval.node)->link[0] = (yyvsp[-2].node);
1693  (yyval.node)->link[1] = (yyvsp[0].node);
1694  }
1695 #line 1696 "nasl_grammar.tab.c" /* yacc.c:1646 */
1696  break;
1697 
1698  case 8:
1699 #line 187 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1700  { (yyval.node) = NULL; }
1701 #line 1702 "nasl_grammar.tab.c" /* yacc.c:1646 */
1702  break;
1703 
1704  case 9:
1705 #line 187 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1706  { (yyval.node) = (yyvsp[0].node); }
1707 #line 1708 "nasl_grammar.tab.c" /* yacc.c:1646 */
1708  break;
1709 
1710  case 10:
1711 #line 189 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1712  {
1713  (yyval.node) = alloc_typed_cell (NODE_DECL);
1714  (yyval.node)->line_nb = LNB;
1715  (yyval.node)->x.str_val = (yyvsp[0].str);
1716  }
1717 #line 1718 "nasl_grammar.tab.c" /* yacc.c:1646 */
1718  break;
1719 
1720  case 11:
1721 #line 195 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1722  {
1723  (yyval.node) = alloc_typed_cell (NODE_DECL);
1724  (yyval.node)->line_nb = LNB;
1725  (yyval.node)->x.str_val = (yyvsp[-2].str);
1726  (yyval.node)->link[0] = (yyvsp[0].node);
1727  }
1728 #line 1729 "nasl_grammar.tab.c" /* yacc.c:1646 */
1729  break;
1730 
1731  case 12:
1732 #line 203 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1733  { (yyval.node) = (yyvsp[-1].node); }
1734 #line 1735 "nasl_grammar.tab.c" /* yacc.c:1646 */
1735  break;
1736 
1737  case 13:
1738 #line 203 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1739  { (yyval.node) = NULL; }
1740 #line 1741 "nasl_grammar.tab.c" /* yacc.c:1646 */
1741  break;
1742 
1743  case 15:
1744 #line 206 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1745  {
1746  if ((yyvsp[-1].node) == NULL)
1747  (yyval.node) = (yyvsp[0].node);
1748  else
1749  {
1750  (yyval.node) = alloc_typed_cell (NODE_INSTR_L);
1751  (yyval.node)->line_nb = LNB;
1752  (yyval.node)->link[0] = (yyvsp[-1].node);
1753  (yyval.node)->link[1] = (yyvsp[0].node);
1754  }
1755  }
1756 #line 1757 "nasl_grammar.tab.c" /* yacc.c:1646 */
1757  break;
1758 
1759  case 16:
1760 #line 219 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1761  { (yyval.node) = (yyvsp[-1].node); }
1762 #line 1763 "nasl_grammar.tab.c" /* yacc.c:1646 */
1763  break;
1764 
1765  case 28:
1766 #line 224 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1767  {
1768  (yyval.node) = alloc_typed_cell (NODE_BREAK);
1769  (yyval.node)->line_nb = LNB;
1770  }
1771 #line 1772 "nasl_grammar.tab.c" /* yacc.c:1646 */
1772  break;
1773 
1774  case 29:
1775 #line 228 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1776  {
1777  (yyval.node) = alloc_typed_cell (NODE_CONTINUE);
1778  (yyval.node)->line_nb = LNB;
1779  }
1780 #line 1781 "nasl_grammar.tab.c" /* yacc.c:1646 */
1781  break;
1782 
1783  case 30:
1784 #line 232 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1785  { (yyval.node) = NULL; }
1786 #line 1787 "nasl_grammar.tab.c" /* yacc.c:1646 */
1787  break;
1788 
1789  case 31:
1790 #line 236 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1791  {
1792  (yyval.node) = alloc_typed_cell (NODE_RETURN);
1793  (yyval.node)->line_nb = LNB;
1794  (yyval.node)->link[0] = (yyvsp[0].node);
1795  }
1796 #line 1797 "nasl_grammar.tab.c" /* yacc.c:1646 */
1797  break;
1798 
1799  case 32:
1800 #line 242 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1801  {
1802  (yyval.node) = alloc_typed_cell (NODE_RETURN);
1803  (yyval.node)->line_nb = LNB;
1804  }
1805 #line 1806 "nasl_grammar.tab.c" /* yacc.c:1646 */
1806  break;
1807 
1808  case 33:
1809 #line 249 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1810  {
1811  (yyval.node) = alloc_typed_cell (NODE_IF_ELSE);
1812  (yyval.node)->line_nb = LNB;
1813  (yyval.node)->link[0] = (yyvsp[-2].node); (yyval.node)->link[1] = (yyvsp[0].node);
1814  }
1815 #line 1816 "nasl_grammar.tab.c" /* yacc.c:1646 */
1816  break;
1817 
1818  case 34:
1819 #line 255 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1820  {
1821  (yyval.node) = alloc_typed_cell (NODE_IF_ELSE);
1822  (yyval.node)->line_nb = LNB;
1823  (yyval.node)->link[0] = (yyvsp[-4].node); (yyval.node)->link[1] = (yyvsp[-2].node); (yyval.node)->link[2] = (yyvsp[0].node);
1824  }
1825 #line 1826 "nasl_grammar.tab.c" /* yacc.c:1646 */
1826  break;
1827 
1828  case 39:
1829 #line 264 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1830  {
1831  (yyval.node) = alloc_typed_cell (NODE_FOR);
1832  (yyval.node)->line_nb = LNB;
1833  (yyval.node)->link[0] = (yyvsp[-6].node);
1834  (yyval.node)->link[1] = (yyvsp[-4].node);
1835  (yyval.node)->link[2] = (yyvsp[-2].node);
1836  (yyval.node)->link[3] = (yyvsp[0].node);
1837  }
1838 #line 1839 "nasl_grammar.tab.c" /* yacc.c:1646 */
1839  break;
1840 
1841  case 40:
1842 #line 274 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1843  {
1844  (yyval.node) = alloc_typed_cell (NODE_WHILE);
1845  (yyval.node)->line_nb = LNB;
1846  (yyval.node)->link[0] = (yyvsp[-2].node);
1847  (yyval.node)->link[1] = (yyvsp[0].node);
1848  }
1849 #line 1850 "nasl_grammar.tab.c" /* yacc.c:1646 */
1850  break;
1851 
1852  case 41:
1853 #line 281 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1854  {
1856  (yyval.node)->line_nb = LNB;
1857  (yyval.node)->link[0] = (yyvsp[-3].node);
1858  (yyval.node)->link[1] = (yyvsp[-1].node);
1859  }
1860 #line 1861 "nasl_grammar.tab.c" /* yacc.c:1646 */
1861  break;
1862 
1863  case 42:
1864 #line 289 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1865  {
1866  (yyval.node) = alloc_typed_cell (NODE_FOREACH);
1867  (yyval.node)->line_nb = LNB;
1868  (yyval.node)->x.str_val = (yyvsp[-4].str);
1869  (yyval.node)->link[0] = (yyvsp[-2].node);
1870  (yyval.node)->link[1] = (yyvsp[0].node);
1871  }
1872 #line 1873 "nasl_grammar.tab.c" /* yacc.c:1646 */
1873  break;
1874 
1875  case 46:
1876 #line 298 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1877  { (yyval.node) = NULL; }
1878 #line 1879 "nasl_grammar.tab.c" /* yacc.c:1646 */
1879  break;
1880 
1881  case 47:
1882 #line 302 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1883  {
1884  (yyval.node) = alloc_typed_cell (NODE_REPEATED);
1885  (yyval.node)->line_nb = LNB;
1886  (yyval.node)->link[0] = (yyvsp[-2].node);
1887  (yyval.node)->link[1] = (yyvsp[0].node);
1888  }
1889 #line 1890 "nasl_grammar.tab.c" /* yacc.c:1646 */
1890  break;
1891 
1892  case 48:
1893 #line 309 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1894  { (yyval.str) = (yyvsp[0].data).val; }
1895 #line 1896 "nasl_grammar.tab.c" /* yacc.c:1646 */
1896  break;
1897 
1898  case 50:
1899 #line 313 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1900  {
1901  char *tmp;
1902  naslctxt subctx;
1903 
1904  bzero (&subctx, sizeof (subctx));
1905  subctx.always_signed = ((naslctxt*)parm)->always_signed;
1906  subctx.kb = ((naslctxt *) parm)->kb;
1907  subctx.tree = ((naslctxt*) parm)->tree;
1908  (yyval.node) = NULL;
1909  tmp = g_strdup (nasl_get_filename (NULL));
1910  nasl_set_filename ((yyvsp[-1].str));
1911  if (!includes_hash)
1912  includes_hash = g_hash_table_new_full
1913  (g_str_hash, g_str_equal, g_free,
1914  (GDestroyNotify) deref_cell);
1915 
1916  if ((subctx.tree = g_hash_table_lookup (includes_hash, (yyvsp[-1].str))))
1917  {
1918  (yyval.node) = subctx.tree;
1919  ref_cell ((yyval.node));
1920  g_free ((yyvsp[-1].str));
1921  }
1922  else if (init_nasl_ctx (&subctx, (yyvsp[-1].str)) >= 0)
1923  {
1924  if (!naslparse (&subctx))
1925  {
1926  (yyval.node) = subctx.tree;
1927  g_hash_table_insert (includes_hash, (yyvsp[-1].str), (yyval.node));
1928  ref_cell ((yyval.node));
1929  }
1930  else
1931  {
1932  nasl_perror (NULL, "%s: Parse error at or near line %d\n", (yyvsp[-1].str),
1933  subctx.line_nb);
1934  g_free ((yyvsp[-1].str));
1935  }
1936  g_free (subctx.buffer);
1937  }
1938  else
1939  {
1940  g_free((yyvsp[-1].str));
1941  g_free (tmp);
1942  return -2;
1943  }
1944  nasl_set_filename (tmp);
1945  g_free (tmp);
1946  }
1947 #line 1948 "nasl_grammar.tab.c" /* yacc.c:1646 */
1948  break;
1949 
1950  case 51:
1951 #line 363 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1952  {
1953  (yyval.node) = alloc_typed_cell (NODE_FUN_CALL);
1954  (yyval.node)->line_nb = LNB;
1955  (yyval.node)->x.str_val = (yyvsp[-3].str);
1956  (yyval.node)->link[0] = (yyvsp[-1].node);
1957  }
1958 #line 1959 "nasl_grammar.tab.c" /* yacc.c:1646 */
1959  break;
1960 
1961  case 53:
1962 #line 370 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1963  { (yyval.node) = NULL; }
1964 #line 1965 "nasl_grammar.tab.c" /* yacc.c:1646 */
1965  break;
1966 
1967  case 55:
1968 #line 372 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1969  {
1970  (yyvsp[-2].node)->link[1] = (yyvsp[0].node);
1971  (yyval.node) = (yyvsp[-2].node);
1972  }
1973 #line 1974 "nasl_grammar.tab.c" /* yacc.c:1646 */
1974  break;
1975 
1976  case 56:
1977 #line 378 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1978  {
1979  (yyval.node) = alloc_typed_cell (NODE_ARG);
1980  (yyval.node)->line_nb = LNB;
1981  (yyval.node)->link[0] = (yyvsp[0].node);
1982  }
1983 #line 1984 "nasl_grammar.tab.c" /* yacc.c:1646 */
1984  break;
1985 
1986  case 57:
1987 #line 384 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1988  {
1989  (yyval.node) = alloc_typed_cell (NODE_ARG);
1990  (yyval.node)->line_nb = LNB;
1991  (yyval.node)->x.str_val = (yyvsp[-2].str);
1992  (yyval.node)->link[0] = (yyvsp[0].node);
1993  }
1994 #line 1995 "nasl_grammar.tab.c" /* yacc.c:1646 */
1995  break;
1996 
1997  case 58:
1998 #line 393 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
1999  {
2000  (yyval.node) = alloc_expr_cell(LNB, NODE_AFF, (yyvsp[-2].node), (yyvsp[0].node));
2001  }
2002 #line 2003 "nasl_grammar.tab.c" /* yacc.c:1646 */
2003  break;
2004 
2005  case 59:
2006 #line 396 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2007  { (yyval.node) = alloc_expr_cell(LNB, NODE_PLUS_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2008 #line 2009 "nasl_grammar.tab.c" /* yacc.c:1646 */
2009  break;
2010 
2011  case 60:
2012 #line 397 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2013  { (yyval.node) = alloc_expr_cell(LNB, NODE_MINUS_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2014 #line 2015 "nasl_grammar.tab.c" /* yacc.c:1646 */
2015  break;
2016 
2017  case 61:
2018 #line 398 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2019  { (yyval.node) = alloc_expr_cell(LNB, NODE_MULT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2020 #line 2021 "nasl_grammar.tab.c" /* yacc.c:1646 */
2021  break;
2022 
2023  case 62:
2024 #line 399 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2025  { (yyval.node) = alloc_expr_cell(LNB, NODE_DIV_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2026 #line 2027 "nasl_grammar.tab.c" /* yacc.c:1646 */
2027  break;
2028 
2029  case 63:
2030 #line 400 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2031  { (yyval.node) = alloc_expr_cell(LNB, NODE_MODULO_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2032 #line 2033 "nasl_grammar.tab.c" /* yacc.c:1646 */
2033  break;
2034 
2035  case 64:
2036 #line 401 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2037  { (yyval.node) = alloc_expr_cell(LNB, NODE_R_SHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2038 #line 2039 "nasl_grammar.tab.c" /* yacc.c:1646 */
2039  break;
2040 
2041  case 65:
2042 #line 402 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2043  { (yyval.node) = alloc_expr_cell(LNB, NODE_R_USHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2044 #line 2045 "nasl_grammar.tab.c" /* yacc.c:1646 */
2045  break;
2046 
2047  case 66:
2048 #line 403 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2049  { (yyval.node) = alloc_expr_cell(LNB, NODE_L_SHIFT_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2050 #line 2051 "nasl_grammar.tab.c" /* yacc.c:1646 */
2051  break;
2052 
2053  case 67:
2054 #line 407 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2055  { (yyval.node) = alloc_typed_cell (NODE_VAR);
2056  (yyval.node)->line_nb = LNB;
2057  (yyval.node)->x.str_val = (yyvsp[0].str);
2058  }
2059 #line 2060 "nasl_grammar.tab.c" /* yacc.c:1646 */
2060  break;
2061 
2062  case 70:
2063 #line 412 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2064  { (yyval.str) = strdup("x"); }
2065 #line 2066 "nasl_grammar.tab.c" /* yacc.c:1646 */
2066  break;
2067 
2068  case 71:
2069 #line 415 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2070  {
2071  (yyval.node) = alloc_typed_cell (NODE_ARRAY_EL);
2072  (yyval.node)->line_nb = LNB;
2073  (yyval.node)->x.str_val = (yyvsp[-3].str);
2074  (yyval.node)->link[0] = (yyvsp[-1].node);
2075  }
2076 #line 2077 "nasl_grammar.tab.c" /* yacc.c:1646 */
2077  break;
2078 
2079  case 73:
2080 #line 425 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2081  { (yyval.node) = alloc_expr_cell(LNB, EXPR_INCR, NULL, (yyvsp[0].node)); }
2082 #line 2083 "nasl_grammar.tab.c" /* yacc.c:1646 */
2083  break;
2084 
2085  case 74:
2086 #line 426 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2087  {(yyval.node) = alloc_expr_cell(LNB, EXPR_DECR, NULL, (yyvsp[0].node)); }
2088 #line 2089 "nasl_grammar.tab.c" /* yacc.c:1646 */
2089  break;
2090 
2091  case 75:
2092 #line 427 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2093  { (yyval.node)= alloc_expr_cell(LNB, EXPR_INCR, (yyvsp[-1].node), NULL); }
2094 #line 2095 "nasl_grammar.tab.c" /* yacc.c:1646 */
2095  break;
2096 
2097  case 76:
2098 #line 428 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2099  { (yyval.node)= alloc_expr_cell(LNB, EXPR_DECR, (yyvsp[-1].node), NULL); }
2100 #line 2101 "nasl_grammar.tab.c" /* yacc.c:1646 */
2101  break;
2102 
2103  case 77:
2104 #line 432 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2105  { (yyval.node) = (yyvsp[-1].node); }
2106 #line 2107 "nasl_grammar.tab.c" /* yacc.c:1646 */
2107  break;
2108 
2109  case 78:
2110 #line 433 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2111  { (yyval.node) = alloc_expr_cell(LNB, EXPR_AND, (yyvsp[-2].node), (yyvsp[0].node)); }
2112 #line 2113 "nasl_grammar.tab.c" /* yacc.c:1646 */
2113  break;
2114 
2115  case 79:
2116 #line 434 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2117  { (yyval.node) = alloc_expr_cell(LNB, EXPR_NOT, (yyvsp[0].node), NULL); }
2118 #line 2119 "nasl_grammar.tab.c" /* yacc.c:1646 */
2119  break;
2120 
2121  case 80:
2122 #line 435 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2123  { (yyval.node) = alloc_expr_cell(LNB, EXPR_OR, (yyvsp[-2].node), (yyvsp[0].node)); }
2124 #line 2125 "nasl_grammar.tab.c" /* yacc.c:1646 */
2125  break;
2126 
2127  case 81:
2128 #line 436 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2129  { (yyval.node) = alloc_expr_cell(LNB, EXPR_PLUS, (yyvsp[-2].node), (yyvsp[0].node)); }
2130 #line 2131 "nasl_grammar.tab.c" /* yacc.c:1646 */
2131  break;
2132 
2133  case 82:
2134 #line 437 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2135  { (yyval.node) = alloc_expr_cell(LNB, EXPR_MINUS, (yyvsp[-2].node), (yyvsp[0].node)); }
2136 #line 2137 "nasl_grammar.tab.c" /* yacc.c:1646 */
2137  break;
2138 
2139  case 83:
2140 #line 438 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2141  { (yyval.node) = alloc_expr_cell(LNB, EXPR_U_MINUS, (yyvsp[0].node), NULL);}
2142 #line 2143 "nasl_grammar.tab.c" /* yacc.c:1646 */
2143  break;
2144 
2145  case 84:
2146 #line 439 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2147  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_NOT, (yyvsp[0].node), NULL);}
2148 #line 2149 "nasl_grammar.tab.c" /* yacc.c:1646 */
2149  break;
2150 
2151  case 85:
2152 #line 440 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2153  { (yyval.node) = alloc_expr_cell(LNB, EXPR_MULT, (yyvsp[-2].node), (yyvsp[0].node)); }
2154 #line 2155 "nasl_grammar.tab.c" /* yacc.c:1646 */
2155  break;
2156 
2157  case 86:
2158 #line 441 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2159  { (yyval.node) = alloc_expr_cell(LNB, EXPR_EXPO, (yyvsp[-2].node), (yyvsp[0].node)); }
2160 #line 2161 "nasl_grammar.tab.c" /* yacc.c:1646 */
2161  break;
2162 
2163  case 87:
2164 #line 442 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2165  { (yyval.node) = alloc_expr_cell(LNB, EXPR_DIV, (yyvsp[-2].node), (yyvsp[0].node)); }
2166 #line 2167 "nasl_grammar.tab.c" /* yacc.c:1646 */
2167  break;
2168 
2169  case 88:
2170 #line 443 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2171  { (yyval.node) = alloc_expr_cell(LNB, EXPR_MODULO, (yyvsp[-2].node), (yyvsp[0].node)); }
2172 #line 2173 "nasl_grammar.tab.c" /* yacc.c:1646 */
2173  break;
2174 
2175  case 89:
2176 #line 444 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2177  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_AND, (yyvsp[-2].node), (yyvsp[0].node)); }
2178 #line 2179 "nasl_grammar.tab.c" /* yacc.c:1646 */
2179  break;
2180 
2181  case 90:
2182 #line 445 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2183  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_XOR, (yyvsp[-2].node), (yyvsp[0].node)); }
2184 #line 2185 "nasl_grammar.tab.c" /* yacc.c:1646 */
2185  break;
2186 
2187  case 91:
2188 #line 446 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2189  { (yyval.node) = alloc_expr_cell(LNB, EXPR_BIT_OR, (yyvsp[-2].node), (yyvsp[0].node)); }
2190 #line 2191 "nasl_grammar.tab.c" /* yacc.c:1646 */
2191  break;
2192 
2193  case 92:
2194 #line 447 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2195  { (yyval.node) = alloc_expr_cell(LNB, EXPR_R_SHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2196 #line 2197 "nasl_grammar.tab.c" /* yacc.c:1646 */
2197  break;
2198 
2199  case 93:
2200 #line 448 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2201  { (yyval.node) = alloc_expr_cell(LNB, EXPR_R_USHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2202 #line 2203 "nasl_grammar.tab.c" /* yacc.c:1646 */
2203  break;
2204 
2205  case 94:
2206 #line 449 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2207  { (yyval.node) = alloc_expr_cell(LNB, EXPR_L_SHIFT, (yyvsp[-2].node), (yyvsp[0].node)); }
2208 #line 2209 "nasl_grammar.tab.c" /* yacc.c:1646 */
2209  break;
2210 
2211  case 96:
2212 #line 451 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2213  { (yyval.node) = alloc_expr_cell(LNB, COMP_MATCH, (yyvsp[-2].node), (yyvsp[0].node)); }
2214 #line 2215 "nasl_grammar.tab.c" /* yacc.c:1646 */
2215  break;
2216 
2217  case 97:
2218 #line 452 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2219  { (yyval.node) = alloc_expr_cell(LNB, COMP_NOMATCH, (yyvsp[-2].node), (yyvsp[0].node)); }
2220 #line 2221 "nasl_grammar.tab.c" /* yacc.c:1646 */
2221  break;
2222 
2223  case 98:
2224 #line 453 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2225  { (yyval.node) = alloc_RE_cell(LNB, COMP_RE_MATCH, (yyvsp[-2].node), (yyvsp[0].str)); }
2226 #line 2227 "nasl_grammar.tab.c" /* yacc.c:1646 */
2227  break;
2228 
2229  case 99:
2230 #line 454 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2231  { (yyval.node) = alloc_RE_cell(LNB, COMP_RE_NOMATCH, (yyvsp[-2].node), (yyvsp[0].str)); }
2232 #line 2233 "nasl_grammar.tab.c" /* yacc.c:1646 */
2233  break;
2234 
2235  case 100:
2236 #line 455 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2237  { (yyval.node) = alloc_expr_cell(LNB, COMP_LT, (yyvsp[-2].node), (yyvsp[0].node)); }
2238 #line 2239 "nasl_grammar.tab.c" /* yacc.c:1646 */
2239  break;
2240 
2241  case 101:
2242 #line 456 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2243  { (yyval.node) = alloc_expr_cell(LNB, COMP_GT, (yyvsp[-2].node), (yyvsp[0].node)); }
2244 #line 2245 "nasl_grammar.tab.c" /* yacc.c:1646 */
2245  break;
2246 
2247  case 102:
2248 #line 457 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2249  { (yyval.node) = alloc_expr_cell(LNB, COMP_EQ, (yyvsp[-2].node), (yyvsp[0].node)); }
2250 #line 2251 "nasl_grammar.tab.c" /* yacc.c:1646 */
2251  break;
2252 
2253  case 103:
2254 #line 458 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2255  { (yyval.node) = alloc_expr_cell(LNB, COMP_NE, (yyvsp[-2].node), (yyvsp[0].node)); }
2256 #line 2257 "nasl_grammar.tab.c" /* yacc.c:1646 */
2257  break;
2258 
2259  case 104:
2260 #line 459 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2261  { (yyval.node) = alloc_expr_cell(LNB, COMP_GE, (yyvsp[-2].node), (yyvsp[0].node)); }
2262 #line 2263 "nasl_grammar.tab.c" /* yacc.c:1646 */
2263  break;
2264 
2265  case 105:
2266 #line 460 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2267  { (yyval.node) = alloc_expr_cell(LNB, COMP_LE, (yyvsp[-2].node), (yyvsp[0].node)); }
2268 #line 2269 "nasl_grammar.tab.c" /* yacc.c:1646 */
2269  break;
2270 
2271  case 111:
2272 #line 464 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2273  { (yyval.node) = make_array_from_elems((yyvsp[-1].node)); }
2274 #line 2275 "nasl_grammar.tab.c" /* yacc.c:1646 */
2275  break;
2276 
2277  case 112:
2278 #line 466 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2279  { (yyval.node) = (yyvsp[0].node); }
2280 #line 2281 "nasl_grammar.tab.c" /* yacc.c:1646 */
2281  break;
2282 
2283  case 113:
2284 #line 467 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2285  {
2286  (yyvsp[-2].node)->link[1] = (yyvsp[0].node); (yyval.node) = (yyvsp[-2].node);
2287  }
2288 #line 2289 "nasl_grammar.tab.c" /* yacc.c:1646 */
2289  break;
2290 
2291  case 114:
2292 #line 471 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2293  {
2294  (yyval.node) = alloc_typed_cell(ARRAY_ELEM);
2295  (yyval.node)->link[0] = (yyvsp[0].node);
2296  }
2297 #line 2298 "nasl_grammar.tab.c" /* yacc.c:1646 */
2298  break;
2299 
2300  case 115:
2301 #line 474 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2302  {
2303  (yyval.node) = alloc_typed_cell(ARRAY_ELEM);
2304  (yyval.node)->link[0] = (yyvsp[0].node);
2305  (yyval.node)->x.str_val = (yyvsp[-2].str);
2306  }
2307 #line 2308 "nasl_grammar.tab.c" /* yacc.c:1646 */
2308  break;
2309 
2310  case 116:
2311 #line 480 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2312  { (yyval.node) = alloc_typed_cell(CONST_INT); (yyval.node)->x.i_val = (yyvsp[0].num); }
2313 #line 2314 "nasl_grammar.tab.c" /* yacc.c:1646 */
2314  break;
2315 
2316  case 117:
2317 #line 481 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2318  {
2319  (yyval.node) = alloc_typed_cell(CONST_STR); (yyval.node)->x.str_val = (yyvsp[0].str);
2320  (yyval.node)->size = strlen((yyvsp[0].str));
2321  }
2322 #line 2323 "nasl_grammar.tab.c" /* yacc.c:1646 */
2323  break;
2324 
2325  case 118:
2326 #line 485 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2327  {
2328  (yyval.node) = alloc_typed_cell(CONST_DATA); (yyval.node)->x.str_val = (yyvsp[0].data).val;
2329  (yyval.node)->size = (yyvsp[0].data).len;
2330  }
2331 #line 2332 "nasl_grammar.tab.c" /* yacc.c:1646 */
2332  break;
2333 
2334  case 120:
2335 #line 493 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2336  {
2337  (yyval.node) = alloc_typed_cell (NODE_VAR);
2338  (yyval.node)->line_nb = LNB;
2339  (yyval.node)->x.str_val = (yyvsp[0].str);
2340  }
2341 #line 2342 "nasl_grammar.tab.c" /* yacc.c:1646 */
2342  break;
2343 
2344  case 124:
2345 #line 503 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2346  {
2347  char *s = g_strdup_printf ("%ld.%ld.%ld.%ld", (yyvsp[-6].num), (yyvsp[-4].num), (yyvsp[-2].num), (yyvsp[0].num));
2348  (yyval.node) = alloc_typed_cell (CONST_STR);
2349  (yyval.node)->line_nb = LNB;
2350  (yyval.node)->x.str_val = s;
2351  (yyval.node)->size = strlen(s);
2352  }
2353 #line 2354 "nasl_grammar.tab.c" /* yacc.c:1646 */
2354  break;
2355 
2356  case 125:
2357 #line 513 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2358  {
2359  (yyval.node) = alloc_typed_cell (NODE_LOCAL);
2360  (yyval.node)->line_nb = LNB;
2361  (yyval.node)->link[0] = (yyvsp[0].node);
2362  }
2363 #line 2364 "nasl_grammar.tab.c" /* yacc.c:1646 */
2364  break;
2365 
2366  case 126:
2367 #line 521 "/builddir/build/BUILD/openvas-7.0.1/nasl/nasl_grammar.y" /* yacc.c:1646 */
2368  {
2369  (yyval.node) = alloc_typed_cell (NODE_GLOBAL);
2370  (yyval.node)->line_nb = LNB;
2371  (yyval.node)->link[0] = (yyvsp[0].node);
2372  }
2373 #line 2374 "nasl_grammar.tab.c" /* yacc.c:1646 */
2374  break;
2375 
2376 
2377 #line 2378 "nasl_grammar.tab.c" /* yacc.c:1646 */
2378  default: break;
2379  }
2380  /* User semantic actions sometimes alter yychar, and that requires
2381  that yytoken be updated with the new translation. We take the
2382  approach of translating immediately before every use of yytoken.
2383  One alternative is translating here after every semantic action,
2384  but that translation would be missed if the semantic action invokes
2385  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2386  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2387  incorrect destructor might then be invoked immediately. In the
2388  case of YYERROR or YYBACKUP, subsequent parser actions might lead
2389  to an incorrect destructor call or verbose syntax error message
2390  before the lookahead is translated. */
2391  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2392 
2393  YYPOPSTACK (yylen);
2394  yylen = 0;
2395  YY_STACK_PRINT (yyss, yyssp);
2396 
2397  *++yyvsp = yyval;
2398 
2399  /* Now 'shift' the result of the reduction. Determine what state
2400  that goes to, based on the state we popped back to and the rule
2401  number reduced by. */
2402 
2403  yyn = yyr1[yyn];
2404 
2405  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2406  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2407  yystate = yytable[yystate];
2408  else
2409  yystate = yydefgoto[yyn - YYNTOKENS];
2410 
2411  goto yynewstate;
2412 
2413 
2414 /*--------------------------------------.
2415 | yyerrlab -- here on detecting error. |
2416 `--------------------------------------*/
2417 yyerrlab:
2418  /* Make sure we have latest lookahead translation. See comments at
2419  user semantic actions for why this is necessary. */
2420  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2421 
2422  /* If not already recovering from an error, report this error. */
2423  if (!yyerrstatus)
2424  {
2425  ++yynerrs;
2426 #if ! YYERROR_VERBOSE
2427  yyerror (parm, YY_("syntax error"));
2428 #else
2429 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2430  yyssp, yytoken)
2431  {
2432  char const *yymsgp = YY_("syntax error");
2433  int yysyntax_error_status;
2434  yysyntax_error_status = YYSYNTAX_ERROR;
2435  if (yysyntax_error_status == 0)
2436  yymsgp = yymsg;
2437  else if (yysyntax_error_status == 1)
2438  {
2439  if (yymsg != yymsgbuf)
2440  YYSTACK_FREE (yymsg);
2441  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2442  if (!yymsg)
2443  {
2444  yymsg = yymsgbuf;
2445  yymsg_alloc = sizeof yymsgbuf;
2446  yysyntax_error_status = 2;
2447  }
2448  else
2449  {
2450  yysyntax_error_status = YYSYNTAX_ERROR;
2451  yymsgp = yymsg;
2452  }
2453  }
2454  yyerror (parm, yymsgp);
2455  if (yysyntax_error_status == 2)
2456  goto yyexhaustedlab;
2457  }
2458 # undef YYSYNTAX_ERROR
2459 #endif
2460  }
2461 
2462 
2463 
2464  if (yyerrstatus == 3)
2465  {
2466  /* If just tried and failed to reuse lookahead token after an
2467  error, discard it. */
2468 
2469  if (yychar <= YYEOF)
2470  {
2471  /* Return failure if at end of input. */
2472  if (yychar == YYEOF)
2473  YYABORT;
2474  }
2475  else
2476  {
2477  yydestruct ("Error: discarding",
2478  yytoken, &yylval, parm);
2479  yychar = YYEMPTY;
2480  }
2481  }
2482 
2483  /* Else will try to reuse lookahead token after shifting the error
2484  token. */
2485  goto yyerrlab1;
2486 
2487 
2488 /*---------------------------------------------------.
2489 | yyerrorlab -- error raised explicitly by YYERROR. |
2490 `---------------------------------------------------*/
2491 yyerrorlab:
2492 
2493  /* Pacify compilers like GCC when the user code never invokes
2494  YYERROR and the label yyerrorlab therefore never appears in user
2495  code. */
2496  if (/*CONSTCOND*/ 0)
2497  goto yyerrorlab;
2498 
2499  /* Do not reclaim the symbols of the rule whose action triggered
2500  this YYERROR. */
2501  YYPOPSTACK (yylen);
2502  yylen = 0;
2503  YY_STACK_PRINT (yyss, yyssp);
2504  yystate = *yyssp;
2505  goto yyerrlab1;
2506 
2507 
2508 /*-------------------------------------------------------------.
2509 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2510 `-------------------------------------------------------------*/
2511 yyerrlab1:
2512  yyerrstatus = 3; /* Each real token shifted decrements this. */
2513 
2514  for (;;)
2515  {
2516  yyn = yypact[yystate];
2517  if (!yypact_value_is_default (yyn))
2518  {
2519  yyn += YYTERROR;
2520  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2521  {
2522  yyn = yytable[yyn];
2523  if (0 < yyn)
2524  break;
2525  }
2526  }
2527 
2528  /* Pop the current state because it cannot handle the error token. */
2529  if (yyssp == yyss)
2530  YYABORT;
2531 
2532 
2533  yydestruct ("Error: popping",
2534  yystos[yystate], yyvsp, parm);
2535  YYPOPSTACK (1);
2536  yystate = *yyssp;
2537  YY_STACK_PRINT (yyss, yyssp);
2538  }
2539 
2541  *++yyvsp = yylval;
2543 
2544 
2545  /* Shift the error token. */
2546  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
2547 
2548  yystate = yyn;
2549  goto yynewstate;
2550 
2551 
2552 /*-------------------------------------.
2553 | yyacceptlab -- YYACCEPT comes here. |
2554 `-------------------------------------*/
2555 yyacceptlab:
2556  yyresult = 0;
2557  goto yyreturn;
2558 
2559 /*-----------------------------------.
2560 | yyabortlab -- YYABORT comes here. |
2561 `-----------------------------------*/
2562 yyabortlab:
2563  yyresult = 1;
2564  goto yyreturn;
2565 
2566 #if !defined yyoverflow || YYERROR_VERBOSE
2567 /*-------------------------------------------------.
2568 | yyexhaustedlab -- memory exhaustion comes here. |
2569 `-------------------------------------------------*/
2570 yyexhaustedlab:
2571  yyerror (parm, YY_("memory exhausted"));
2572  yyresult = 2;
2573  /* Fall through. */
2574 #endif
2575 
2576 yyreturn:
2577  if (yychar != YYEMPTY)
2578  {
2579  /* Make sure we have latest lookahead translation. See comments at
2580  user semantic actions for why this is necessary. */
2581  yytoken = YYTRANSLATE (yychar);
2582  yydestruct ("Cleanup: discarding lookahead",
2583  yytoken, &yylval, parm);
2584  }
2585  /* Do not reclaim the symbols of the rule whose action triggered
2586  this YYABORT or YYACCEPT. */
2587  YYPOPSTACK (yylen);
2588  YY_STACK_PRINT (yyss, yyssp);
2589  while (yyssp != yyss)
2590  {
2591  yydestruct ("Cleanup: popping",
2592  yystos[*yyssp], yyvsp, parm);
2593  YYPOPSTACK (1);
2594  }
2595 #ifndef yyoverflow
2596  if (yyss != yyssa)
2597  YYSTACK_FREE (yyss);
2598 #endif
2599 #if YYERROR_VERBOSE
2600  if (yymsg != yymsgbuf)
2601  YYSTACK_FREE (yymsg);
2602 #endif
2603  return yyresult;
2604 }
#define YYSYNTAX_ERROR
#define YY_INITIAL_VALUE(Value)
#define YYSTACK_BYTES(N)
const char * nasl_get_filename(const char *function)
Definition: nasl_debug.c:69
void ref_cell(tree_cell *c)
Definition: nasl_tree.c:178
#define YY_(Msgid)
#define YYFINAL
#define YYTERROR
#define YYSTACK_FREE
#define YYMAXDEPTH
#define YYEMPTY
#define YYPOPSTACK(N)
char * buffer
#define YYINITDEPTH
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
tree_cell * tree
#define yyerror
char * str_val
Definition: nasl_tree.h:112
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, naslctxt *parm)
#define YYSTACK_ALLOC
static const yytype_int16 yypgoto[]
static const yytype_int16 yypact[]
tree_cell * make_array_from_elems(tree_cell *el)
Definition: nasl_var.c:1332
static const yytype_int16 yycheck[]
void deref_cell(tree_cell *c)
Definition: nasl_tree.c:192
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define yylex
#define YYLAST
#define yypact_value_is_default(Yystate)
#define yytable_value_is_error(Yytable_value)
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
void nasl_set_filename(const char *filename)
Definition: nasl_debug.c:97
static const yytype_uint8 yystos[]
#define LNB
short int yytype_int16
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
tree_cell * alloc_typed_cell(int typ)
Definition: nasl_tree.c:40
static const yytype_uint8 yyr2[]
tree_cell * alloc_RE_cell(int lnb, int t, tree_cell *l, char *re_str)
Definition: nasl_tree.c:48
static const yytype_uint8 yydefact[]
yytype_int16 yyss_alloc
#define YY_REDUCE_PRINT(Rule)
static const yytype_int16 yytable[]
YYSTYPE yyvs_alloc
#define YYACCEPT
#define YYTRANSLATE(YYX)
static const yytype_int16 yydefgoto[]
#define yynerrs
void nasl_perror(lex_ctxt *lexic, char *msg,...)
Definition: nasl_debug.c:120
int naslparse(naslctxt *parm)
static const yytype_uint8 yyr1[]
long int i_val
Definition: nasl_tree.h:113
#define YYNTOKENS
#define YYSIZE_T
#define YYABORT
void nasl_set_function_filename(const char *function)
Definition: nasl_debug.c:108
tree_cell * node
#define YYDPRINTF(Args)
tree_cell * alloc_expr_cell(int lnb, int t, tree_cell *l, tree_cell *r)
Definition: nasl_tree.c:74
#define YYEOF
GHashTable * includes_hash
#define YY_STACK_PRINT(Bottom, Top)
int init_nasl_ctx(naslctxt *pc, const char *name)
Initialize a NASL context for a NASL file.
Here is the call graph for this function:

◆ yystpcpy()

static char* yystpcpy ( char *  yydest,
const char *  yysrc 
)
static

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

Referenced by yytnamerr().

1187 {
1188  char *yyd = yydest;
1189  const char *yys = yysrc;
1190 
1191  while ((*yyd++ = *yys++) != '\0')
1192  continue;
1193 
1194  return yyd - 1;
1195 }
Here is the caller graph for this function:

◆ yystrlen()

static YYSIZE_T yystrlen ( const char *  yystr)
static

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

References YYSIZE_T.

Referenced by yysyntax_error(), and yytnamerr().

1170 {
1171  YYSIZE_T yylen;
1172  for (yylen = 0; yystr[yylen]; yylen++)
1173  continue;
1174  return yylen;
1175 }
#define YYSIZE_T
Here is the caller graph for this function:

◆ yysyntax_error()

static int yysyntax_error ( YYSIZE_T yymsg_alloc,
char **  yymsg,
yytype_int16 yyssp,
int  yytoken 
)
static

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

References YY_, YY_NULLPTR, YYCASE_, yycheck, YYEMPTY, YYLAST, YYNTOKENS, yypact, yypact_value_is_default, YYSIZE_T, YYSTACK_ALLOC_MAXIMUM, yystrlen(), yytable, yytable_value_is_error, YYTERROR, yytname, and yytnamerr().

1258 {
1259  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1260  YYSIZE_T yysize = yysize0;
1261  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1262  /* Internationalized format string. */
1263  const char *yyformat = YY_NULLPTR;
1264  /* Arguments of yyformat. */
1265  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1266  /* Number of reported tokens (one for the "unexpected", one per
1267  "expected"). */
1268  int yycount = 0;
1269 
1270  /* There are many possibilities here to consider:
1271  - If this state is a consistent state with a default action, then
1272  the only way this function was invoked is if the default action
1273  is an error action. In that case, don't check for expected
1274  tokens because there are none.
1275  - The only way there can be no lookahead present (in yychar) is if
1276  this state is a consistent state with a default action. Thus,
1277  detecting the absence of a lookahead is sufficient to determine
1278  that there is no unexpected or expected token to report. In that
1279  case, just report a simple "syntax error".
1280  - Don't assume there isn't a lookahead just because this state is a
1281  consistent state with a default action. There might have been a
1282  previous inconsistent state, consistent state with a non-default
1283  action, or user semantic action that manipulated yychar.
1284  - Of course, the expected token list depends on states to have
1285  correct lookahead information, and it depends on the parser not
1286  to perform extra reductions after fetching a lookahead from the
1287  scanner and before detecting a syntax error. Thus, state merging
1288  (from LALR or IELR) and default reductions corrupt the expected
1289  token list. However, the list is correct for canonical LR with
1290  one exception: it will still contain any token that will not be
1291  accepted due to an error action in a later state.
1292  */
1293  if (yytoken != YYEMPTY)
1294  {
1295  int yyn = yypact[*yyssp];
1296  yyarg[yycount++] = yytname[yytoken];
1297  if (!yypact_value_is_default (yyn))
1298  {
1299  /* Start YYX at -YYN if negative to avoid negative indexes in
1300  YYCHECK. In other words, skip the first -YYN actions for
1301  this state because they are default actions. */
1302  int yyxbegin = yyn < 0 ? -yyn : 0;
1303  /* Stay within bounds of both yycheck and yytname. */
1304  int yychecklim = YYLAST - yyn + 1;
1305  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1306  int yyx;
1307 
1308  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1309  if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1310  && !yytable_value_is_error (yytable[yyx + yyn]))
1311  {
1312  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1313  {
1314  yycount = 1;
1315  yysize = yysize0;
1316  break;
1317  }
1318  yyarg[yycount++] = yytname[yyx];
1319  {
1320  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1321  if (! (yysize <= yysize1
1322  && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1323  return 2;
1324  yysize = yysize1;
1325  }
1326  }
1327  }
1328  }
1329 
1330  switch (yycount)
1331  {
1332 # define YYCASE_(N, S) \
1333  case N: \
1334  yyformat = S; \
1335  break
1336  YYCASE_(0, YY_("syntax error"));
1337  YYCASE_(1, YY_("syntax error, unexpected %s"));
1338  YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1339  YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1340  YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1341  YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1342 # undef YYCASE_
1343  }
1344 
1345  {
1346  YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1347  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1348  return 2;
1349  yysize = yysize1;
1350  }
1351 
1352  if (*yymsg_alloc < yysize)
1353  {
1354  *yymsg_alloc = 2 * yysize;
1355  if (! (yysize <= *yymsg_alloc
1356  && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1357  *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1358  return 1;
1359  }
1360 
1361  /* Avoid sprintf, as that infringes on the user's name space.
1362  Don't have undefined behavior even if the translation
1363  produced a string with the wrong number of "%s"s. */
1364  {
1365  char *yyp = *yymsg;
1366  int yyi = 0;
1367  while ((*yyp = *yyformat) != '\0')
1368  if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1369  {
1370  yyp += yytnamerr (yyp, yyarg[yyi++]);
1371  yyformat += 2;
1372  }
1373  else
1374  {
1375  yyp++;
1376  yyformat++;
1377  }
1378  }
1379  return 0;
1380 }
#define YY_(Msgid)
#define YYTERROR
#define YYEMPTY
static const yytype_int16 yypact[]
static const yytype_int16 yycheck[]
#define YYLAST
#define yypact_value_is_default(Yystate)
static YYSIZE_T yystrlen(const char *yystr)
#define yytable_value_is_error(Yytable_value)
static const yytype_int16 yytable[]
static const char *const yytname[]
#define YY_NULLPTR
static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
#define YYNTOKENS
#define YYSIZE_T
#define YYSTACK_ALLOC_MAXIMUM
#define YYCASE_(N, S)
Here is the call graph for this function:

◆ yytnamerr()

static YYSIZE_T yytnamerr ( char *  yyres,
const char *  yystr 
)
static

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

References YYSIZE_T, yystpcpy(), and yystrlen().

Referenced by yysyntax_error().

1209 {
1210  if (*yystr == '"')
1211  {
1212  YYSIZE_T yyn = 0;
1213  char const *yyp = yystr;
1214 
1215  for (;;)
1216  switch (*++yyp)
1217  {
1218  case '\'':
1219  case ',':
1220  goto do_not_strip_quotes;
1221 
1222  case '\\':
1223  if (*++yyp != '\\')
1224  goto do_not_strip_quotes;
1225  /* Fall through. */
1226  default:
1227  if (yyres)
1228  yyres[yyn] = *yyp;
1229  yyn++;
1230  break;
1231 
1232  case '"':
1233  if (yyres)
1234  yyres[yyn] = '\0';
1235  return yyn;
1236  }
1237  do_not_strip_quotes: ;
1238  }
1239 
1240  if (! yyres)
1241  return yystrlen (yystr);
1242 
1243  return yystpcpy (yyres, yystr) - yyres;
1244 }
static YYSIZE_T yystrlen(const char *yystr)
static char * yystpcpy(char *yydest, const char *yysrc)
#define YYSIZE_T
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ checksum_algorithm

int checksum_algorithm = GCRY_MD_NONE
static

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

Referenced by init_nasl_ctx(), and load_checksums().

◆ inc_dirs

GSList* inc_dirs = NULL
static

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

Referenced by add_nasl_inc_dir(), and init_nasl_ctx().

◆ includes_hash

GHashTable* includes_hash = NULL

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

Referenced by nasl_clean_inc(), and yyparse().

◆ nasldebug

int nasldebug

◆ parse_buffer

char* parse_buffer = NULL
static

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

Referenced by init_nasl_ctx(), and mylex().

◆ parse_len

int parse_len = 0
static

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

Referenced by init_nasl_ctx(), and mylex().

◆ yycheck

const yytype_int16 yycheck[]
static

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

Referenced by yyparse(), and yysyntax_error().

◆ yydebug

int yydebug

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

◆ yydefact

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

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

Referenced by yyparse().

◆ yydefgoto

const yytype_int16 yydefgoto[]
static
Initial value:
=
{
-1, 18, 19, 20, 21, 68, 69, 22, 76, 23,
24, 25, 26, 27, 28, 29, 30, 31, 96, 32,
110, 33, 56, 157, 158, 159, 57, 36, 58, 59,
162, 60, 161, 62, 111, 112, 63, 114, 64, 65,
66, 40, 41
}

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

Referenced by yyparse().

◆ yypact

const yytype_int16 yypact[]
static
Initial value:
=
{
464, -53, -91, -50, 491, -6, -42, -91, -91, -6,
499, -40, -6, -6, -6, -6, -91, 259, 25, -91,
91, -91, -91, -91, -39, -91, -91, -91, -91, -91,
-91, -91, -91, -91, 23, -91, 553, -13, -91, -91,
-91, -91, 499, 26, 29, -30, 499, -21, -91, -91,
-18, 499, 499, 13, 499, 499, -91, -91, 961, 611,
-91, 798, -91, -91, -91, -91, -91, 19, -91, -91,
-12, -91, -91, -26, -91, -91, -9, 123, -91, -91,
-91, 499, -91, -91, 499, 499, 499, 499, 499, 499,
499, 499, 499, 499, 499, 566, -4, -91, -91, -91,
499, 499, 624, -6, 14, 37, 682, 39, 40, -91,
42, 7, 22, -91, -91, 37, 37, 499, 499, 499,
499, 499, 499, 499, 499, 499, 499, 499, 499, 19,
19, 499, 499, 499, 499, 499, 499, 499, 499, 499,
499, -91, -91, 28, -6, -91, -91, 798, 798, 798,
798, 798, 798, 798, 798, 798, 798, 35, -91, 33,
945, 798, 17, 798, 491, 499, 347, 740, 491, 36,
16, -91, 34, -91, 13, 882, 882, 882, 882, 851,
913, 882, 882, 398, 398, 398, 37, -91, -91, 882,
882, 354, 337, 415, 15, 15, 37, 37, 37, -91,
-91, -91, 499, 499, -91, 83, 409, -91, 491, -91,
27, 53, -91, -91, -91, 798, 491, 26, -91, -91,
47, -91, 38, 56, 491, -91, -91
}

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

Referenced by yyparse(), and yysyntax_error().

◆ yypgoto

const yytype_int16 yypgoto[]
static
Initial value:
=
{
-91, -91, 101, -91, -91, -11, -20, -87, 48, 12,
-91, -91, -91, -91, -91, -91, -91, -91, -90, -91,
-64, -91, 6, -91, -74, -91, 24, 60, 0, 18,
-91, 30, 209, -91, -45, -91, -52, -41, -91, -91,
-91, -91, -91
}

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

Referenced by yyparse().

◆ yyr1

const yytype_uint8 yyr1[]
static
Initial value:
=
{
0, 73, 74, 75, 75, 76, 76, 77, 78, 78,
79, 79, 80, 80, 81, 81, 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 942 of file nasl_grammar.tab.c.

Referenced by yyparse().

◆ yyr2

const yytype_uint8 yyr2[]
static
Initial value:
=
{
0, 2, 1, 1, 2, 1, 1, 6, 0, 1,
1, 3, 3, 2, 1, 2, 2, 1, 1, 1,
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 960 of file nasl_grammar.tab.c.

Referenced by yy_reduce_print(), and yyparse().

◆ yyrline

const yytype_uint16 yyrline[]
static
Initial value:
=
{
0, 156, 156, 161, 167, 174, 174, 177, 187, 187,
188, 194, 203, 203, 204, 205, 219, 219, 219, 219,
222, 222, 222, 223, 223, 223, 223, 223, 224, 228,
232, 235, 241, 248, 254, 262, 262, 262, 262, 263,
273, 280, 288, 298, 298, 298, 298, 301, 309, 309,
312, 362, 370, 370, 371, 371, 377, 383, 392, 396,
397, 398, 399, 400, 401, 402, 403, 406, 410, 412,
412, 414, 422, 425, 426, 427, 428, 432, 433, 434,
435, 436, 437, 438, 439, 440, 441, 442, 443, 444,
445, 446, 447, 448, 449, 450, 451, 452, 453, 454,
455, 456, 457, 458, 459, 460, 461, 461, 461, 461,
461, 464, 466, 467, 471, 474, 480, 481, 485, 490,
492, 498, 498, 500, 502, 512, 520
}

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

Referenced by yy_reduce_print().

◆ yystos

const yytype_uint8 yystos[]
static
Initial value:
=
{
0, 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, 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 914 of file nasl_grammar.tab.c.

Referenced by yy_reduce_print(), and yyparse().

◆ yytable

const yytype_int16 yytable[]
static

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

Referenced by yyparse(), and yysyntax_error().

◆ yytname

const char* const yytname[]
static
Initial value:
=
{
"$end", "error", "$undefined", "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 567 of file nasl_grammar.tab.c.

Referenced by yy_symbol_print(), and yysyntax_error().

◆ yytranslate

const yytype_uint8 yytranslate[]
static

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