OpenVAS Libraries  9.0.3
nasl_grammar.tab.c File Reference
#include <ctype.h>
#include <pcap.h>
#include <string.h>
#include <sys/stat.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 "../misc/openvas_logging.h"
#include "../misc/prefs.h"
#include "../base/openvas_file.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 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

int naslparse (naslctxt *parm)
 
void * malloc (YYSIZE_T)
 
void free (void *)
 
int yyparse (naslctxt *parm)
 
int add_nasl_inc_dir (const char *dir)
 Adds the given string as directory for searching for includes. 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)
 

Variables

GHashTable * includes_hash = NULL
 
int nasldebug
 
int yydebug
 

Macro Definition Documentation

◆ _Noreturn

#define _Noreturn   YY_ATTRIBUTE ((__noreturn__))

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

◆ LNB

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

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

◆ YY_

#define YY_ (   Msgid)    Msgid

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

Referenced by yyparse().

◆ YY_ATTRIBUTE

#define YY_ATTRIBUTE (   Spec)    /* empty */

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

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))

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

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))

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

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

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

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

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

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE (   Value)    Value

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

Referenced by yyparse().

◆ YY_LOCATION_PRINT

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

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

◆ YY_NASL_NASL_GRAMMAR_TAB_H_INCLUDED

#define YY_NASL_NASL_GRAMMAR_TAB_H_INCLUDED

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

◆ YY_NULLPTR

#define YY_NULLPTR   0

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

◆ YY_REDUCE_PRINT

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

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

◆ YY_STACK_PRINT

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

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

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

◆ YYABORT

#define YYABORT   goto yyabortlab

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

Referenced by yyparse().

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 971 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 978 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

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

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

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

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

◆ YYDPRINTF

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

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

Referenced by yyparse().

◆ YYEMPTY

#define YYEMPTY   (-2)

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

Referenced by yyparse().

◆ YYEOF

#define YYEOF   0

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

◆ YYERRCODE

#define YYERRCODE   256

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

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

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

◆ yyerror

#define yyerror   naslerror

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

◆ YYERROR

#define YYERROR   goto yyerrorlab

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

◆ YYERROR_VERBOSE [1/2]

#define YYERROR_VERBOSE

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

◆ YYERROR_VERBOSE [2/2]

#define YYERROR_VERBOSE   1

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

◆ YYFINAL

#define YYFINAL   78

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

Referenced by yyparse().

◆ YYFPRINTF

#define YYFPRINTF   fprintf

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

◆ YYFREE

#define YYFREE   free

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

◆ YYINITDEPTH

#define YYINITDEPTH   200

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

Referenced by yyparse().

◆ YYLAST

#define YYLAST   1029

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

◆ yylex

#define yylex   nasllex

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

◆ YYLEX_PARAM

#define YYLEX_PARAM   parm

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

◆ YYMALLOC

#define YYMALLOC   malloc

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

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

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

Referenced by yyparse().

◆ YYMAXUTOK

#define YYMAXUTOK   304

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

◆ YYNRULES

#define YYNRULES   126

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

◆ YYNSTATES

#define YYNSTATES   227

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

◆ YYNTOKENS

#define YYNTOKENS   73

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

◆ YYPACT_NINF

#define YYPACT_NINF   -91

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

◆ yypact_value_is_default

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

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

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

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

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

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

◆ YYSIZE_T

#define YYSIZE_T   size_t

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

Referenced by yyparse().

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

Referenced by yyparse().

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

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

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

Referenced by yyparse().

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

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

Referenced by yyparse().

◆ YYSTACK_GAP_MAXIMUM

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

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

Referenced by yyparse().

◆ YYSTYPE_IS_DECLARED

#define YYSTYPE_IS_DECLARED   1

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

◆ YYSTYPE_IS_TRIVIAL

#define YYSTYPE_IS_TRIVIAL   1

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

◆ YYSYNTAX_ERROR

#define YYSYNTAX_ERROR
Value:
yysyntax_error (&yymsg_alloc, &yymsg, \
yyssp, yytoken)

◆ YYTABLE_NINF

#define YYTABLE_NINF   -69

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

◆ yytable_value_is_error

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

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

◆ YYTERROR

#define YYTERROR   1

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

◆ YYTOKENTYPE

#define YYTOKENTYPE

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

◆ YYTRANSLATE

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

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

◆ YYUNDEFTOK

#define YYUNDEFTOK   2

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

◆ YYUSE

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

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

Typedef Documentation

◆ YYSTYPE

typedef union YYSTYPE YYSTYPE

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

◆ yytype_int16

typedef short int yytype_int16

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

◆ yytype_int8

typedef signed char yytype_int8

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

◆ yytype_uint16

typedef unsigned short int yytype_uint16

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

◆ yytype_uint8

typedef unsigned char yytype_uint8

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

2897  {
2898  ST_START = 0,
2899  ST_SPACE,
2900  ST_IDENT,
2901  ST_ZERO,
2902  ST_ZEROX,
2903  ST_OCT,
2904  ST_DEC,
2905  ST_HEX,
2906  ST_COMMENT,
2907  ST_SUP,
2908  ST_INF,
2909  ST_SUP_EXCL,
2910  ST_STRING1,
2912  ST_STRING2,
2913  ST_PLUS,
2914  ST_MINUS,
2915  ST_MULT,
2916  ST_DIV,
2917  ST_MODULO,
2918  ST_R_SHIFT,
2919  ST_R_USHIFT,
2920  ST_L_SHIFT,
2921  ST_NOT,
2922  ST_EQ,
2923  ST_AND,
2924  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 148 of file nasl_grammar.tab.c.

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

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

Referenced by main().

2610 {
2611  if (dir == NULL)
2612  {
2613  return 0;
2614  }
2615 
2616  // Allow initialization with empty element
2617  if (*dir == '\0')
2618  {
2619  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2620  return 0;
2621  }
2622 
2623  struct stat stat_buf;
2624 
2625  if (stat (dir, &stat_buf) != 0)
2626  return -1;
2627 
2628  if (S_ISDIR(stat_buf.st_mode) != 0)
2629  {
2630  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2631  return 0;
2632  }
2633  else
2634  return -2;
2635 }
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, pc->fp is set with the respective file descriptor -1 if either the filename was not found/accessible or the signature verification failed (provided signature checking is enabled. Also, the pc->fp is set to NULL. In any case, various elements of pc are modified (initialized);

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

Referenced by exec_nasl_script().

2773 {
2774  char *full_name = NULL, key_path[2048], *checksum, *filename, *check = NULL;
2775  GSList * inc_dir = inc_dirs; // iterator for include directories
2776 
2777  // initialize if not yet done (for openvas-server < 2.0.1)
2778  if (! inc_dirs) add_nasl_inc_dir("");
2779 
2780  pc->line_nb = 1;
2781  pc->tree = NULL;
2782  pc->buffer = g_malloc0 (80);
2783  pc->maxlen = 80;
2784  pc->fp = NULL;
2786  while (inc_dir != NULL) {
2787  if (full_name)
2788  g_free (full_name);
2789  full_name = g_build_filename(inc_dir->data, name, NULL);
2790 
2791  if ((pc->fp = fopen(full_name, "r")) != NULL)
2792  break;
2793 
2794  inc_dir = g_slist_next(inc_dir);
2795  }
2796 
2797  if (! pc->fp) {
2798  log_legacy_write ("%s: Not able to open nor to locate it in include paths",
2799  name);
2800  g_free(full_name);
2801  return -1;
2802  }
2803 
2804  if (pc->always_authenticated)
2805  {
2806  g_free(full_name);
2807  return 0;
2808  }
2809  /* Cache the checksum of signature verified files, so that commonly included
2810  * files are not verified multiple times per scan. */
2811 
2812  filename = full_name;
2813  if (strstr (full_name, ".inc"))
2814  filename = basename (full_name);
2815  init_checksum_algorithm ();
2816  if (checksum_algorithm == GCRY_MD_NONE)
2817  return -1;
2818 
2819  snprintf (key_path, sizeof (key_path), "checksum:%s", filename);
2820  checksum = kb_item_get_str (pc->kb, key_path);
2821  if (checksum)
2822  {
2823  int ret;
2824  check = file_checksum (full_name, checksum_algorithm);
2825  ret = strcmp (check, checksum);
2826  if (!ret)
2827  {
2828  /* Already checked. No need to check again. */
2829  g_free (full_name);
2830  g_free (checksum);
2831  g_free (check);
2832  return 0;
2833  }
2834  g_free (checksum);
2835  g_free (check);
2836  }
2837 
2838  load_checksums (pc->kb);
2839  if (checksum_algorithm == GCRY_MD_MD5)
2840  snprintf (key_path, sizeof (key_path), "md5sums:%s", filename);
2841  else if (checksum_algorithm == GCRY_MD_SHA256)
2842  snprintf (key_path, sizeof (key_path), "sha256sums:%s", filename);
2843  else
2844  abort ();
2845  checksum = kb_item_get_str (pc->kb, key_path);
2846  if (!checksum)
2847  {
2848  log_legacy_write ("No checksum for %s", full_name);
2849  g_free (full_name);
2850  return -1;
2851  }
2852  else
2853  {
2854  int ret;
2855 
2856  check = file_checksum (full_name, checksum_algorithm);
2857  ret = strcmp (check, checksum);
2858  if (ret)
2859  log_legacy_write ("checksum for %s not matching", full_name);
2860  else
2861  {
2862  snprintf (key_path, sizeof (key_path), "checksum:%s", filename);
2863  kb_item_set_str (pc->kb, key_path, check);
2864  }
2865  g_free (full_name);
2866  g_free (checksum);
2867  g_free (check);
2868  return ret;
2869  }
2870 }
char * buffer
tree_cell * tree
int always_authenticated
void nasl_set_filename(const char *filename)
Definition: nasl_debug.c:71
void log_legacy_write(const char *format,...)
Legacy function to write a log message.
int add_nasl_inc_dir(const char *dir)
Adds the given string as directory for searching for includes.
const char * name
Definition: nasl_init.c:524
Here is the caller graph for this function:

◆ malloc()

void* malloc ( YYSIZE_T  )

◆ nasl_clean_ctx()

void nasl_clean_ctx ( naslctxt c)

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

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

Referenced by exec_nasl_script().

2874 {
2875 #if 0
2876  nasl_dump_tree(c->tree);
2877 #endif
2878  deref_cell(c->tree);
2879  g_free(c->buffer);
2880  c->buffer = NULL;
2881  if (c->fp)
2882  {
2883  fclose(c->fp);
2884  c->fp = NULL;
2885  }
2886 }
char * buffer
tree_cell * tree
void nasl_dump_tree(const tree_cell *c)
Definition: nasl_tree.c:439
void deref_cell(tree_cell *c)
Definition: nasl_tree.c:202
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 2889 of file nasl_grammar.tab.c.

References includes_hash.

2890 {
2891  if (!includes_hash)
2892  return;
2893  g_hash_table_destroy (includes_hash);
2894  includes_hash = NULL;
2895 }
GHashTable * includes_hash

◆ naslparse()

int naslparse ( naslctxt parm)

◆ yyparse()

int yyparse ( naslctxt parm)

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

References YY_, YY_INITIAL_VALUE, YYABORT, YYACCEPT, YYDPRINTF, YYEMPTY, YYFINAL, YYINITDEPTH, YYMAXDEPTH, yynerrs, YYSIZE_T, yyalloc::yyss_alloc, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, and yyalloc::yyvs_alloc.

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

Variable Documentation

◆ includes_hash

GHashTable* includes_hash = NULL

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

Referenced by nasl_clean_inc().

◆ nasldebug

int nasldebug

◆ yydebug

int yydebug

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