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.5"
 
#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.

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

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

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

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

◆ YYBACKUP

#define YYBACKUP (   Token,
  Value 
)
Value:
do \
if (yychar == YYEMPTY) \
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (parm, 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.5"

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.

◆ YYEMPTY

#define YYEMPTY   (-2)

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

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

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

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

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

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

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

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

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

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

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

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

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

2611 {
2612  if (dir == NULL)
2613  {
2614  return 0;
2615  }
2616 
2617  // Allow initialization with empty element
2618  if (*dir == '\0')
2619  {
2620  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2621  return 0;
2622  }
2623 
2624  struct stat stat_buf;
2625 
2626  if (stat (dir, &stat_buf) != 0)
2627  return -1;
2628 
2629  if (S_ISDIR(stat_buf.st_mode) != 0)
2630  {
2631  inc_dirs = g_slist_append (inc_dirs, g_strdup((gchar *)dir));
2632  return 0;
2633  }
2634  else
2635  return -2;
2636 }

Referenced by main().

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

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

Referenced by exec_nasl_script().

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

2875 {
2876 #if 0
2877  nasl_dump_tree(c->tree);
2878 #endif
2879  deref_cell(c->tree);
2880  g_free(c->buffer);
2881  c->buffer = NULL;
2882  if (c->fp)
2883  {
2884  fclose(c->fp);
2885  c->fp = NULL;
2886  }
2887 }
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

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

Referenced by exec_nasl_script().

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

◆ nasl_clean_inc()

void nasl_clean_inc ( void  )

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

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

References includes_hash.

◆ naslparse()

int naslparse ( naslctxt parm)

◆ yyparse()

int yyparse ( naslctxt parm)

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

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

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.

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.