yosys-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
verilog_parser.tab.cc File Reference
#include <list>
#include <string.h>
#include "verilog_frontend.h"
#include "kernel/log.h"
#include <stddef.h>
#include <stdio.h>
+ Include dependency graph for verilog_parser.tab.cc:

Go to the source code of this file.

Data Structures

union  YYSTYPE
 
union  yyalloc
 

Namespaces

 VERILOG_FRONTEND
 

Macros

#define YYBISON   1
 
#define YYBISON_VERSION   "3.0.2"
 
#define YYSKELETON_NAME   "yacc.c"
 
#define YYPURE   0
 
#define YYPUSH   0
 
#define YYPULL   1
 
#define yyparse   frontend_verilog_yyparse
 
#define yylex   frontend_verilog_yylex
 
#define yyerror   frontend_verilog_yyerror
 
#define yydebug   frontend_verilog_yydebug
 
#define yynerrs   frontend_verilog_yynerrs
 
#define yylval   frontend_verilog_yylval
 
#define yychar   frontend_verilog_yychar
 
#define YY_NULLPTR   0
 
#define YYERROR_VERBOSE   0
 
#define YY_FRONTEND_VERILOG_YY_FRONTENDS_VERILOG_VERILOG_PARSER_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   3
 
#define YYLAST   1179
 
#define YYNTOKENS   104
 
#define YYNNTS   156
 
#define YYNRULES   338
 
#define YYNSTATES   650
 
#define YYUNDEFTOK   2
 
#define YYMAXUTOK   332
 
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
#define YYPACT_NINF   -521
 
#define yypact_value_is_default(Yystate)   (!!((Yystate) == (-521)))
 
#define YYTABLE_NINF   -252
 
#define yytable_value_is_error(Yytable_value)   0
 
#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 YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 

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 {
  TOK_ID = 258, TOK_VALUE = 259, TOK_STRING = 260, TOK_INT = 261,
  TOK_AUTOIDX = 262, TOK_MODULE = 263, TOK_WIRE = 264, TOK_WIDTH = 265,
  TOK_INPUT = 266, TOK_OUTPUT = 267, TOK_INOUT = 268, TOK_CELL = 269,
  TOK_CONNECT = 270, TOK_SWITCH = 271, TOK_CASE = 272, TOK_ASSIGN = 273,
  TOK_SYNC = 274, TOK_LOW = 275, TOK_HIGH = 276, TOK_POSEDGE = 277,
  TOK_NEGEDGE = 278, TOK_EDGE = 279, TOK_ALWAYS = 280, TOK_INIT = 281,
  TOK_UPDATE = 282, TOK_PROCESS = 283, TOK_END = 284, TOK_INVALID = 285,
  TOK_EOL = 286, TOK_OFFSET = 287, TOK_PARAMETER = 288, TOK_ATTRIBUTE = 289,
  TOK_MEMORY = 290, TOK_SIZE = 291, TOK_SIGNED = 292, TOK_UPTO = 293,
  TOK_ID = 258, TOK_VALUE = 259, TOK_STRING = 260, TOK_INT = 261,
  TOK_AUTOIDX = 262, TOK_MODULE = 263, TOK_WIRE = 264, TOK_WIDTH = 265,
  TOK_INPUT = 266, TOK_OUTPUT = 267, TOK_INOUT = 268, TOK_CELL = 269,
  TOK_CONNECT = 270, TOK_SWITCH = 271, TOK_CASE = 272, TOK_ASSIGN = 273,
  TOK_SYNC = 274, TOK_LOW = 275, TOK_HIGH = 276, TOK_POSEDGE = 277,
  TOK_NEGEDGE = 278, TOK_EDGE = 279, TOK_ALWAYS = 280, TOK_INIT = 281,
  TOK_UPDATE = 282, TOK_PROCESS = 283, TOK_END = 284, TOK_INVALID = 285,
  TOK_EOL = 286, TOK_OFFSET = 287, TOK_PARAMETER = 288, TOK_ATTRIBUTE = 289,
  TOK_MEMORY = 290, TOK_SIZE = 291, TOK_SIGNED = 292, TOK_UPTO = 293,
  TOK_STRING = 258, TOK_ID = 259, TOK_CONST = 260, TOK_REALVAL = 261,
  TOK_PRIMITIVE = 262, ATTR_BEGIN = 263, ATTR_END = 264, DEFATTR_BEGIN = 265,
  DEFATTR_END = 266, TOK_MODULE = 267, TOK_ENDMODULE = 268, TOK_PARAMETER = 269,
  TOK_LOCALPARAM = 270, TOK_DEFPARAM = 271, TOK_INPUT = 272, TOK_OUTPUT = 273,
  TOK_INOUT = 274, TOK_WIRE = 275, TOK_REG = 276, TOK_INTEGER = 277,
  TOK_SIGNED = 278, TOK_ASSIGN = 279, TOK_ALWAYS = 280, TOK_INITIAL = 281,
  TOK_BEGIN = 282, TOK_END = 283, TOK_IF = 284, TOK_ELSE = 285,
  TOK_FOR = 286, TOK_WHILE = 287, TOK_REPEAT = 288, TOK_DPI_FUNCTION = 289,
  TOK_POSEDGE = 290, TOK_NEGEDGE = 291, TOK_OR = 292, TOK_CASE = 293,
  TOK_CASEX = 294, TOK_CASEZ = 295, TOK_ENDCASE = 296, TOK_DEFAULT = 297,
  TOK_FUNCTION = 298, TOK_ENDFUNCTION = 299, TOK_TASK = 300, TOK_ENDTASK = 301,
  TOK_GENERATE = 302, TOK_ENDGENERATE = 303, TOK_GENVAR = 304, TOK_REAL = 305,
  TOK_SYNOPSYS_FULL_CASE = 306, TOK_SYNOPSYS_PARALLEL_CASE = 307, TOK_SUPPLY0 = 308, TOK_SUPPLY1 = 309,
  TOK_TO_SIGNED = 310, TOK_TO_UNSIGNED = 311, TOK_POS_INDEXED = 312, TOK_NEG_INDEXED = 313,
  TOK_ASSERT = 314, TOK_PROPERTY = 315, OP_LOR = 316, OP_LAND = 317,
  OP_NOR = 318, OP_XNOR = 319, OP_NAND = 320, OP_EQ = 321,
  OP_NE = 322, OP_EQX = 323, OP_NEX = 324, OP_LE = 325,
  OP_GE = 326, OP_SHL = 327, OP_SHR = 328, OP_SSHL = 329,
  OP_SSHR = 330, OP_POW = 331, UNARY_OPS = 332, TOK_STRING = 258,
  TOK_ID = 259, TOK_CONST = 260, TOK_REALVAL = 261, TOK_PRIMITIVE = 262,
  ATTR_BEGIN = 263, ATTR_END = 264, DEFATTR_BEGIN = 265, DEFATTR_END = 266,
  TOK_MODULE = 267, TOK_ENDMODULE = 268, TOK_PARAMETER = 269, TOK_LOCALPARAM = 270,
  TOK_DEFPARAM = 271, TOK_INPUT = 272, TOK_OUTPUT = 273, TOK_INOUT = 274,
  TOK_WIRE = 275, TOK_REG = 276, TOK_INTEGER = 277, TOK_SIGNED = 278,
  TOK_ASSIGN = 279, TOK_ALWAYS = 280, TOK_INITIAL = 281, TOK_BEGIN = 282,
  TOK_END = 283, TOK_IF = 284, TOK_ELSE = 285, TOK_FOR = 286,
  TOK_WHILE = 287, TOK_REPEAT = 288, TOK_DPI_FUNCTION = 289, TOK_POSEDGE = 290,
  TOK_NEGEDGE = 291, TOK_OR = 292, TOK_CASE = 293, TOK_CASEX = 294,
  TOK_CASEZ = 295, TOK_ENDCASE = 296, TOK_DEFAULT = 297, TOK_FUNCTION = 298,
  TOK_ENDFUNCTION = 299, TOK_TASK = 300, TOK_ENDTASK = 301, TOK_GENERATE = 302,
  TOK_ENDGENERATE = 303, TOK_GENVAR = 304, TOK_REAL = 305, TOK_SYNOPSYS_FULL_CASE = 306,
  TOK_SYNOPSYS_PARALLEL_CASE = 307, TOK_SUPPLY0 = 308, TOK_SUPPLY1 = 309, TOK_TO_SIGNED = 310,
  TOK_TO_UNSIGNED = 311, TOK_POS_INDEXED = 312, TOK_NEG_INDEXED = 313, TOK_ASSERT = 314,
  TOK_PROPERTY = 315, OP_LOR = 316, OP_LAND = 317, OP_NOR = 318,
  OP_XNOR = 319, OP_NAND = 320, OP_EQ = 321, OP_NE = 322,
  OP_EQX = 323, OP_NEX = 324, OP_LE = 325, OP_GE = 326,
  OP_SHL = 327, OP_SHR = 328, OP_SSHL = 329, OP_SSHR = 330,
  OP_POW = 331, UNARY_OPS = 332
}
 

Functions

static YOSYS_NAMESPACE_END void append_attr (AstNode *ast, std::map< std::string, AstNode * > *al)
 
static void append_attr_clone (AstNode *ast, std::map< std::string, AstNode * > *al)
 
static void free_attr (std::map< std::string, AstNode * > *al)
 
int frontend_verilog_yyparse (void)
 
void * malloc (YYSIZE_T)
 
void free (void *)
 
static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
 
static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
 
static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 
static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
 
static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 
int yyparse (void)
 

Variables

int VERILOG_FRONTEND::port_counter
 
std::map< std::string, int > VERILOG_FRONTEND::port_stubs
 
std::map< std::string, AstNode * > VERILOG_FRONTEND::attr_list
 
std::map< std::string, AstNode * > VERILOG_FRONTEND::default_attr_list
 
std::map< std::string, AstNode * > * VERILOG_FRONTEND::albuf
 
std::vector< AstNode * > VERILOG_FRONTEND::ast_stack
 
struct AstNodeVERILOG_FRONTEND::astbuf1
 
struct AstNodeVERILOG_FRONTEND::astbuf2
 
struct AstNodeVERILOG_FRONTEND::astbuf3
 
struct AstNodeVERILOG_FRONTEND::current_function_or_task
 
struct AstNodeVERILOG_FRONTEND::current_ast_mod
 
int VERILOG_FRONTEND::current_function_or_task_port_id
 
std::vector< char > VERILOG_FRONTEND::case_type_stack
 
bool VERILOG_FRONTEND::do_not_require_port_stubs
 
int frontend_verilog_yydebug
 
YYSTYPE frontend_verilog_yylval
 
static const yytype_uint8 yytranslate []
 
static const yytype_uint16 yyrline []
 
static const char *const yytname []
 
static const yytype_int16 yypact []
 
static const yytype_uint16 yydefact []
 
static const yytype_int16 yypgoto []
 
static const yytype_int16 yydefgoto []
 
static const yytype_int16 yytable []
 
static const yytype_int16 yycheck []
 
static const yytype_uint16 yystos []
 
static const yytype_uint16 yyr1 []
 
static const yytype_uint8 yyr2 []
 
int yydebug
 
int yychar
 
YYSTYPE yylval
 
int yynerrs
 

Macro Definition Documentation

#define _Noreturn   YY_ATTRIBUTE ((__noreturn__))

Definition at line 350 of file verilog_parser.tab.cc.

#define YY_ (   Msgid)    Msgid

Definition at line 323 of file verilog_parser.tab.cc.

#define YY_ATTRIBUTE (   Spec)    /* empty */

Definition at line 333 of file verilog_parser.tab.cc.

#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))

Definition at line 338 of file verilog_parser.tab.cc.

#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))

Definition at line 342 of file verilog_parser.tab.cc.

#define YY_FRONTEND_VERILOG_YY_FRONTENDS_VERILOG_VERILOG_PARSER_TAB_H_INCLUDED

Definition at line 151 of file verilog_parser.tab.cc.

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

Definition at line 373 of file verilog_parser.tab.cc.

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Definition at line 374 of file verilog_parser.tab.cc.

#define YY_INITIAL_VALUE (   Value)    Value

Definition at line 370 of file verilog_parser.tab.cc.

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

Definition at line 1335 of file verilog_parser.tab.cc.

#define YY_NULLPTR   0

Definition at line 136 of file verilog_parser.tab.cc.

#define YY_REDUCE_PRINT (   Rule)
Value:
do { \
yy_reduce_print (yyssp, yyvsp, Rule); \
} while (0)
static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
if(!(yy_init))
Definition: ilang_lexer.cc:846
#define yydebug

Definition at line 1432 of file verilog_parser.tab.cc.

#define YY_STACK_PRINT (   Bottom,
  Top 
)
Value:
do { \
yy_stack_print ((Bottom), (Top)); \
} while (0)
if(!(yy_init))
Definition: ilang_lexer.cc:846
#define yydebug
static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)

Definition at line 1401 of file verilog_parser.tab.cc.

#define YY_SYMBOL_PRINT (   Title,
  Type,
  Value,
  Location 
)
Value:
do { \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
Type, Value); \
YYFPRINTF (stderr, "\n"); \
} \
} while (0)
if(!(yy_init))
Definition: ilang_lexer.cc:846
static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
#define YYFPRINTF
#define yydebug

Definition at line 1339 of file verilog_parser.tab.cc.

#define YYABORT   goto yyabortlab

Definition at line 1290 of file verilog_parser.tab.cc.

#define YYACCEPT   goto yyacceptlab

Definition at line 1289 of file verilog_parser.tab.cc.

#define YYBACKUP (   Token,
  Value 
)
Value:
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (YY_("syntax error: cannot back up")); \
} \
while (0)
#define yychar
#define YYEMPTY
if(!(yy_init))
Definition: ilang_lexer.cc:846
#define yyerror
while(1)
Definition: ilang_lexer.cc:872
#define YY_(Msgid)
#define YYERROR
#define yylval
#define YYPOPSTACK(N)

Definition at line 1296 of file verilog_parser.tab.cc.

#define YYBISON   1

Definition at line 44 of file verilog_parser.tab.cc.

#define YYBISON_VERSION   "3.0.2"

Definition at line 47 of file verilog_parser.tab.cc.

#define yychar   frontend_verilog_yychar

Definition at line 70 of file verilog_parser.tab.cc.

#define yyclearin   (yychar = YYEMPTY)

Definition at line 1285 of file verilog_parser.tab.cc.

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

Definition at line 497 of file verilog_parser.tab.cc.

#define YYCOPY_NEEDED   1

Definition at line 469 of file verilog_parser.tab.cc.

#define yydebug   frontend_verilog_yydebug

Definition at line 66 of file verilog_parser.tab.cc.

#define YYDEBUG   1

Definition at line 154 of file verilog_parser.tab.cc.

#define YYDPRINTF (   Args)
Value:
do { \
YYFPRINTF Args; \
} while (0)
if(!(yy_init))
Definition: ilang_lexer.cc:846
#define YYFPRINTF
#define yydebug

Definition at line 1327 of file verilog_parser.tab.cc.

#define YYEMPTY   (-2)

Definition at line 1286 of file verilog_parser.tab.cc.

#define YYEOF   0

Definition at line 1287 of file verilog_parser.tab.cc.

#define YYERRCODE   256

Definition at line 1315 of file verilog_parser.tab.cc.

#define yyerrok   (yyerrstatus = 0)

Definition at line 1284 of file verilog_parser.tab.cc.

#define yyerror   frontend_verilog_yyerror

Definition at line 65 of file verilog_parser.tab.cc.

#define YYERROR   goto yyerrorlab

Definition at line 1291 of file verilog_parser.tab.cc.

#define YYERROR_VERBOSE   0

Definition at line 145 of file verilog_parser.tab.cc.

#define YYFINAL   3

Definition at line 510 of file verilog_parser.tab.cc.

#define YYFPRINTF   fprintf

Definition at line 1324 of file verilog_parser.tab.cc.

#define YYFREE   free

Definition at line 440 of file verilog_parser.tab.cc.

#define YYINITDEPTH   200

Definition at line 1451 of file verilog_parser.tab.cc.

#define YYLAST   1179

Definition at line 512 of file verilog_parser.tab.cc.

#define yylex   frontend_verilog_yylex

Definition at line 64 of file verilog_parser.tab.cc.

#define yylval   frontend_verilog_yylval

Definition at line 69 of file verilog_parser.tab.cc.

#define YYMALLOC   malloc

Definition at line 434 of file verilog_parser.tab.cc.

#define YYMAXDEPTH   10000

Definition at line 1462 of file verilog_parser.tab.cc.

#define YYMAXUTOK   332

Definition at line 526 of file verilog_parser.tab.cc.

#define yynerrs   frontend_verilog_yynerrs

Definition at line 67 of file verilog_parser.tab.cc.

#define YYNNTS   156

Definition at line 517 of file verilog_parser.tab.cc.

#define YYNRULES   338

Definition at line 519 of file verilog_parser.tab.cc.

#define YYNSTATES   650

Definition at line 521 of file verilog_parser.tab.cc.

#define YYNTOKENS   104

Definition at line 515 of file verilog_parser.tab.cc.

#define YYPACT_NINF   -521

Definition at line 692 of file verilog_parser.tab.cc.

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

Definition at line 694 of file verilog_parser.tab.cc.

#define yyparse   frontend_verilog_yyparse

Definition at line 63 of file verilog_parser.tab.cc.

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

Definition at line 59 of file verilog_parser.tab.cc.

#define YYPURE   0

Definition at line 53 of file verilog_parser.tab.cc.

#define YYPUSH   0

Definition at line 56 of file verilog_parser.tab.cc.

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 1294 of file verilog_parser.tab.cc.

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

Definition at line 313 of file verilog_parser.tab.cc.

#define YYSIZE_T   size_t

Definition at line 307 of file verilog_parser.tab.cc.

#define YYSKELETON_NAME   "yacc.c"

Definition at line 50 of file verilog_parser.tab.cc.

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 420 of file verilog_parser.tab.cc.

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 423 of file verilog_parser.tab.cc.

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

Definition at line 465 of file verilog_parser.tab.cc.

#define YYSTACK_FREE   YYFREE

Definition at line 421 of file verilog_parser.tab.cc.

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

Definition at line 461 of file verilog_parser.tab.cc.

#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 YYCOPY(Dst, Src, Count)
#define YYSTACK_GAP_MAXIMUM
while(1)
Definition: ilang_lexer.cc:872
#define YYSIZE_T

Definition at line 476 of file verilog_parser.tab.cc.

#define YYSTYPE_IS_DECLARED   1

Definition at line 258 of file verilog_parser.tab.cc.

#define YYSTYPE_IS_TRIVIAL   1

Definition at line 257 of file verilog_parser.tab.cc.

#define YYTABLE_NINF   -252

Definition at line 697 of file verilog_parser.tab.cc.

#define yytable_value_is_error (   Yytable_value)    0

Definition at line 699 of file verilog_parser.tab.cc.

#define YYTERROR   1

Definition at line 1314 of file verilog_parser.tab.cc.

#define YYTOKENTYPE

Definition at line 162 of file verilog_parser.tab.cc.

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

Definition at line 528 of file verilog_parser.tab.cc.

#define YYUNDEFTOK   2

Definition at line 525 of file verilog_parser.tab.cc.

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

Definition at line 356 of file verilog_parser.tab.cc.

Typedef Documentation

typedef union YYSTYPE YYSTYPE

Definition at line 245 of file verilog_parser.tab.cc.

typedef short int yytype_int16

Definition at line 297 of file verilog_parser.tab.cc.

typedef signed char yytype_int8

Definition at line 285 of file verilog_parser.tab.cc.

typedef unsigned short int yytype_uint16

Definition at line 291 of file verilog_parser.tab.cc.

typedef unsigned char yytype_uint8

Definition at line 279 of file verilog_parser.tab.cc.

Enumeration Type Documentation

Enumerator
TOK_ID 
TOK_VALUE 
TOK_STRING 
TOK_INT 
TOK_AUTOIDX 
TOK_MODULE 
TOK_WIRE 
TOK_WIDTH 
TOK_INPUT 
TOK_OUTPUT 
TOK_INOUT 
TOK_CELL 
TOK_CONNECT 
TOK_SWITCH 
TOK_CASE 
TOK_ASSIGN 
TOK_SYNC 
TOK_LOW 
TOK_HIGH 
TOK_POSEDGE 
TOK_NEGEDGE 
TOK_EDGE 
TOK_ALWAYS 
TOK_INIT 
TOK_UPDATE 
TOK_PROCESS 
TOK_END 
TOK_INVALID 
TOK_EOL 
TOK_OFFSET 
TOK_PARAMETER 
TOK_ATTRIBUTE 
TOK_MEMORY 
TOK_SIZE 
TOK_SIGNED 
TOK_UPTO 
TOK_ID 
TOK_VALUE 
TOK_STRING 
TOK_INT 
TOK_AUTOIDX 
TOK_MODULE 
TOK_WIRE 
TOK_WIDTH 
TOK_INPUT 
TOK_OUTPUT 
TOK_INOUT 
TOK_CELL 
TOK_CONNECT 
TOK_SWITCH 
TOK_CASE 
TOK_ASSIGN 
TOK_SYNC 
TOK_LOW 
TOK_HIGH 
TOK_POSEDGE 
TOK_NEGEDGE 
TOK_EDGE 
TOK_ALWAYS 
TOK_INIT 
TOK_UPDATE 
TOK_PROCESS 
TOK_END 
TOK_INVALID 
TOK_EOL 
TOK_OFFSET 
TOK_PARAMETER 
TOK_ATTRIBUTE 
TOK_MEMORY 
TOK_SIZE 
TOK_SIGNED 
TOK_UPTO 
TOK_STRING 
TOK_ID 
TOK_CONST 
TOK_REALVAL 
TOK_PRIMITIVE 
ATTR_BEGIN 
ATTR_END 
DEFATTR_BEGIN 
DEFATTR_END 
TOK_MODULE 
TOK_ENDMODULE 
TOK_PARAMETER 
TOK_LOCALPARAM 
TOK_DEFPARAM 
TOK_INPUT 
TOK_OUTPUT 
TOK_INOUT 
TOK_WIRE 
TOK_REG 
TOK_INTEGER 
TOK_SIGNED 
TOK_ASSIGN 
TOK_ALWAYS 
TOK_INITIAL 
TOK_BEGIN 
TOK_END 
TOK_IF 
TOK_ELSE 
TOK_FOR 
TOK_WHILE 
TOK_REPEAT 
TOK_DPI_FUNCTION 
TOK_POSEDGE 
TOK_NEGEDGE 
TOK_OR 
TOK_CASE 
TOK_CASEX 
TOK_CASEZ 
TOK_ENDCASE 
TOK_DEFAULT 
TOK_FUNCTION 
TOK_ENDFUNCTION 
TOK_TASK 
TOK_ENDTASK 
TOK_GENERATE 
TOK_ENDGENERATE 
TOK_GENVAR 
TOK_REAL 
TOK_SYNOPSYS_FULL_CASE 
TOK_SYNOPSYS_PARALLEL_CASE 
TOK_SUPPLY0 
TOK_SUPPLY1 
TOK_TO_SIGNED 
TOK_TO_UNSIGNED 
TOK_POS_INDEXED 
TOK_NEG_INDEXED 
TOK_ASSERT 
TOK_PROPERTY 
OP_LOR 
OP_LAND 
OP_NOR 
OP_XNOR 
OP_NAND 
OP_EQ 
OP_NE 
OP_EQX 
OP_NEX 
OP_LE 
OP_GE 
OP_SHL 
OP_SHR 
OP_SSHL 
OP_SSHR 
OP_POW 
UNARY_OPS 
TOK_STRING 
TOK_ID 
TOK_CONST 
TOK_REALVAL 
TOK_PRIMITIVE 
ATTR_BEGIN 
ATTR_END 
DEFATTR_BEGIN 
DEFATTR_END 
TOK_MODULE 
TOK_ENDMODULE 
TOK_PARAMETER 
TOK_LOCALPARAM 
TOK_DEFPARAM 
TOK_INPUT 
TOK_OUTPUT 
TOK_INOUT 
TOK_WIRE 
TOK_REG 
TOK_INTEGER 
TOK_SIGNED 
TOK_ASSIGN 
TOK_ALWAYS 
TOK_INITIAL 
TOK_BEGIN 
TOK_END 
TOK_IF 
TOK_ELSE 
TOK_FOR 
TOK_WHILE 
TOK_REPEAT 
TOK_DPI_FUNCTION 
TOK_POSEDGE 
TOK_NEGEDGE 
TOK_OR 
TOK_CASE 
TOK_CASEX 
TOK_CASEZ 
TOK_ENDCASE 
TOK_DEFAULT 
TOK_FUNCTION 
TOK_ENDFUNCTION 
TOK_TASK 
TOK_ENDTASK 
TOK_GENERATE 
TOK_ENDGENERATE 
TOK_GENVAR 
TOK_REAL 
TOK_SYNOPSYS_FULL_CASE 
TOK_SYNOPSYS_PARALLEL_CASE 
TOK_SUPPLY0 
TOK_SUPPLY1 
TOK_TO_SIGNED 
TOK_TO_UNSIGNED 
TOK_POS_INDEXED 
TOK_NEG_INDEXED 
TOK_ASSERT 
TOK_PROPERTY 
OP_LOR 
OP_LAND 
OP_NOR 
OP_XNOR 
OP_NAND 
OP_EQ 
OP_NE 
OP_EQX 
OP_NEX 
OP_LE 
OP_GE 
OP_SHL 
OP_SHR 
OP_SSHL 
OP_SSHR 
OP_POW 
UNARY_OPS 

Definition at line 163 of file verilog_parser.tab.cc.

164  {
165  TOK_STRING = 258,
166  TOK_ID = 259,
167  TOK_CONST = 260,
168  TOK_REALVAL = 261,
169  TOK_PRIMITIVE = 262,
170  ATTR_BEGIN = 263,
171  ATTR_END = 264,
172  DEFATTR_BEGIN = 265,
173  DEFATTR_END = 266,
174  TOK_MODULE = 267,
175  TOK_ENDMODULE = 268,
176  TOK_PARAMETER = 269,
177  TOK_LOCALPARAM = 270,
178  TOK_DEFPARAM = 271,
179  TOK_INPUT = 272,
180  TOK_OUTPUT = 273,
181  TOK_INOUT = 274,
182  TOK_WIRE = 275,
183  TOK_REG = 276,
184  TOK_INTEGER = 277,
185  TOK_SIGNED = 278,
186  TOK_ASSIGN = 279,
187  TOK_ALWAYS = 280,
188  TOK_INITIAL = 281,
189  TOK_BEGIN = 282,
190  TOK_END = 283,
191  TOK_IF = 284,
192  TOK_ELSE = 285,
193  TOK_FOR = 286,
194  TOK_WHILE = 287,
195  TOK_REPEAT = 288,
196  TOK_DPI_FUNCTION = 289,
197  TOK_POSEDGE = 290,
198  TOK_NEGEDGE = 291,
199  TOK_OR = 292,
200  TOK_CASE = 293,
201  TOK_CASEX = 294,
202  TOK_CASEZ = 295,
203  TOK_ENDCASE = 296,
204  TOK_DEFAULT = 297,
205  TOK_FUNCTION = 298,
206  TOK_ENDFUNCTION = 299,
207  TOK_TASK = 300,
208  TOK_ENDTASK = 301,
209  TOK_GENERATE = 302,
210  TOK_ENDGENERATE = 303,
211  TOK_GENVAR = 304,
212  TOK_REAL = 305,
215  TOK_SUPPLY0 = 308,
216  TOK_SUPPLY1 = 309,
217  TOK_TO_SIGNED = 310,
218  TOK_TO_UNSIGNED = 311,
219  TOK_POS_INDEXED = 312,
220  TOK_NEG_INDEXED = 313,
221  TOK_ASSERT = 314,
222  TOK_PROPERTY = 315,
223  OP_LOR = 316,
224  OP_LAND = 317,
225  OP_NOR = 318,
226  OP_XNOR = 319,
227  OP_NAND = 320,
228  OP_EQ = 321,
229  OP_NE = 322,
230  OP_EQX = 323,
231  OP_NEX = 324,
232  OP_LE = 325,
233  OP_GE = 326,
234  OP_SHL = 327,
235  OP_SHR = 328,
236  OP_SSHL = 329,
237  OP_SSHR = 330,
238  OP_POW = 331,
239  UNARY_OPS = 332
240  };

Function Documentation

static YOSYS_NAMESPACE_END void append_attr ( AstNode ast,
std::map< std::string, AstNode * > *  al 
)
static

Definition at line 103 of file verilog_parser.tab.cc.

104 {
105  for (auto &it : *al) {
106  if (ast->attributes.count(it.first) > 0)
107  delete ast->attributes[it.first];
108  ast->attributes[it.first] = it.second;
109  }
110  delete al;
111 }
std::map< RTLIL::IdString, AstNode * > attributes
Definition: ast.h:152

+ Here is the caller graph for this function:

static void append_attr_clone ( AstNode ast,
std::map< std::string, AstNode * > *  al 
)
static

Definition at line 113 of file verilog_parser.tab.cc.

114 {
115  for (auto &it : *al) {
116  if (ast->attributes.count(it.first) > 0)
117  delete ast->attributes[it.first];
118  ast->attributes[it.first] = it.second->clone();
119  }
120 }
std::map< RTLIL::IdString, AstNode * > attributes
Definition: ast.h:152

+ Here is the caller graph for this function:

void free ( void *  )

+ Here is the caller graph for this function:

static void free_attr ( std::map< std::string, AstNode * > *  al)
static

Definition at line 122 of file verilog_parser.tab.cc.

123 {
124  for (auto &it : *al)
125  delete it.second;
126  delete al;
127 }

+ Here is the caller graph for this function:

int frontend_verilog_yyparse ( void  )
void* malloc ( YYSIZE_T  )
static void yy_reduce_print ( yytype_int16 yyssp,
YYSTYPE yyvsp,
int  yyrule 
)
static

Definition at line 1413 of file verilog_parser.tab.cc.

1414 {
1415  unsigned long int yylno = yyrline[yyrule];
1416  int yynrhs = yyr2[yyrule];
1417  int yyi;
1418  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1419  yyrule - 1, yylno);
1420  /* The symbols being reduced. */
1421  for (yyi = 0; yyi < yynrhs; yyi++)
1422  {
1423  YYFPRINTF (stderr, " $%d = ", yyi + 1);
1424  yy_symbol_print (stderr,
1425  yystos[yyssp[yyi + 1 - yynrhs]],
1426  &(yyvsp[(yyi + 1) - (yynrhs)])
1427  );
1428  YYFPRINTF (stderr, "\n");
1429  }
1430 }
static const yytype_uint16 yystos[]
static void yy_symbol_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)
#define YYFPRINTF
static const yytype_uint16 yyrline[]
static const yytype_uint8 yyr2[]

+ Here is the call graph for this function:

static void yy_stack_print ( yytype_int16 yybottom,
yytype_int16 yytop 
)
static

Definition at line 1390 of file verilog_parser.tab.cc.

1391 {
1392  YYFPRINTF (stderr, "Stack now");
1393  for (; yybottom <= yytop; yybottom++)
1394  {
1395  int yybot = *yybottom;
1396  YYFPRINTF (stderr, " %d", yybot);
1397  }
1398  YYFPRINTF (stderr, "\n");
1399 }
#define YYFPRINTF
static void yy_symbol_print ( FILE *  yyoutput,
int  yytype,
YYSTYPE const *const  yyvaluep 
)
static

Definition at line 1375 of file verilog_parser.tab.cc.

1376 {
1377  YYFPRINTF (yyoutput, "%s %s (",
1378  yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
1379 
1380  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
1381  YYFPRINTF (yyoutput, ")");
1382 }
static const char *const yytname[]
#define YYNTOKENS
#define YYFPRINTF
static void yy_symbol_value_print(FILE *yyoutput, int yytype, YYSTYPE const *const yyvaluep)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1356 of file verilog_parser.tab.cc.

1357 {
1358  FILE *yyo = yyoutput;
1359  YYUSE (yyo);
1360  if (!yyvaluep)
1361  return;
1362 # ifdef YYPRINT
1363  if (yytype < YYNTOKENS)
1364  YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1365 # endif
1366  YYUSE (yytype);
1367 }
#define YYNTOKENS
#define YYUSE(E)

+ Here is the caller graph for this function:

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

Definition at line 1693 of file verilog_parser.tab.cc.

1694 {
1695  YYUSE (yyvaluep);
1696  if (!yymsg)
1697  yymsg = "Deleting";
1698  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1699 
1701  YYUSE (yytype);
1703 }
#define YYUSE(E)
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END

+ Here is the caller graph for this function:

int yyparse ( void  )

Definition at line 1722 of file verilog_parser.tab.cc.

1723 {
1724  int yystate;
1725  /* Number of tokens to shift before error messages enabled. */
1726  int yyerrstatus;
1727 
1728  /* The stacks and their tools:
1729  'yyss': related to states.
1730  'yyvs': related to semantic values.
1731 
1732  Refer to the stacks through separate pointers, to allow yyoverflow
1733  to reallocate them elsewhere. */
1734 
1735  /* The state stack. */
1736  yytype_int16 yyssa[YYINITDEPTH];
1737  yytype_int16 *yyss;
1738  yytype_int16 *yyssp;
1739 
1740  /* The semantic value stack. */
1741  YYSTYPE yyvsa[YYINITDEPTH];
1742  YYSTYPE *yyvs;
1743  YYSTYPE *yyvsp;
1744 
1745  YYSIZE_T yystacksize;
1746 
1747  int yyn;
1748  int yyresult;
1749  /* Lookahead token as an internal (translated) token number. */
1750  int yytoken = 0;
1751  /* The variables used to return semantic value and location from the
1752  action routines. */
1753  YYSTYPE yyval;
1754 
1755 #if YYERROR_VERBOSE
1756  /* Buffer for error messages, and its allocated size. */
1757  char yymsgbuf[128];
1758  char *yymsg = yymsgbuf;
1759  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1760 #endif
1761 
1762 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1763 
1764  /* The number of symbols on the RHS of the reduced rule.
1765  Keep to zero when no symbol should be popped. */
1766  int yylen = 0;
1767 
1768  yyssp = yyss = yyssa;
1769  yyvsp = yyvs = yyvsa;
1770  yystacksize = YYINITDEPTH;
1771 
1772  YYDPRINTF ((stderr, "Starting parse\n"));
1773 
1774  yystate = 0;
1775  yyerrstatus = 0;
1776  yynerrs = 0;
1777  yychar = YYEMPTY; /* Cause a token to be read. */
1778  goto yysetstate;
1779 
1780 /*------------------------------------------------------------.
1781 | yynewstate -- Push a new state, which is found in yystate. |
1782 `------------------------------------------------------------*/
1783  yynewstate:
1784  /* In all cases, when you get here, the value and location stacks
1785  have just been pushed. So pushing a state here evens the stacks. */
1786  yyssp++;
1787 
1788  yysetstate:
1789  *yyssp = yystate;
1790 
1791  if (yyss + yystacksize - 1 <= yyssp)
1792  {
1793  /* Get the current used size of the three stacks, in elements. */
1794  YYSIZE_T yysize = yyssp - yyss + 1;
1795 
1796 #ifdef yyoverflow
1797  {
1798  /* Give user a chance to reallocate the stack. Use copies of
1799  these so that the &'s don't force the real ones into
1800  memory. */
1801  YYSTYPE *yyvs1 = yyvs;
1802  yytype_int16 *yyss1 = yyss;
1803 
1804  /* Each stack pointer address is followed by the size of the
1805  data in use in that stack, in bytes. This used to be a
1806  conditional around just the two extra args, but that might
1807  be undefined if yyoverflow is a macro. */
1808  yyoverflow (YY_("memory exhausted"),
1809  &yyss1, yysize * sizeof (*yyssp),
1810  &yyvs1, yysize * sizeof (*yyvsp),
1811  &yystacksize);
1812 
1813  yyss = yyss1;
1814  yyvs = yyvs1;
1815  }
1816 #else /* no yyoverflow */
1817 # ifndef YYSTACK_RELOCATE
1818  goto yyexhaustedlab;
1819 # else
1820  /* Extend the stack our own way. */
1821  if (YYMAXDEPTH <= yystacksize)
1822  goto yyexhaustedlab;
1823  yystacksize *= 2;
1824  if (YYMAXDEPTH < yystacksize)
1825  yystacksize = YYMAXDEPTH;
1826 
1827  {
1828  yytype_int16 *yyss1 = yyss;
1829  union yyalloc *yyptr =
1830  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1831  if (! yyptr)
1832  goto yyexhaustedlab;
1833  YYSTACK_RELOCATE (yyss_alloc, yyss);
1834  YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1835 # undef YYSTACK_RELOCATE
1836  if (yyss1 != yyssa)
1837  YYSTACK_FREE (yyss1);
1838  }
1839 # endif
1840 #endif /* no yyoverflow */
1841 
1842  yyssp = yyss + yysize - 1;
1843  yyvsp = yyvs + yysize - 1;
1844 
1845  YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1846  (unsigned long int) yystacksize));
1847 
1848  if (yyss + yystacksize - 1 <= yyssp)
1849  YYABORT;
1850  }
1851 
1852  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1853 
1854  if (yystate == YYFINAL)
1855  YYACCEPT;
1856 
1857  goto yybackup;
1858 
1859 /*-----------.
1860 | yybackup. |
1861 `-----------*/
1862 yybackup:
1863 
1864  /* Do appropriate processing given the current state. Read a
1865  lookahead token if we need one and don't already have one. */
1866 
1867  /* First try to decide what to do without reference to lookahead token. */
1868  yyn = yypact[yystate];
1869  if (yypact_value_is_default (yyn))
1870  goto yydefault;
1871 
1872  /* Not known => get a lookahead token if don't already have one. */
1873 
1874  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1875  if (yychar == YYEMPTY)
1876  {
1877  YYDPRINTF ((stderr, "Reading a token: "));
1878  yychar = yylex ();
1879  }
1880 
1881  if (yychar <= YYEOF)
1882  {
1883  yychar = yytoken = YYEOF;
1884  YYDPRINTF ((stderr, "Now at end of input.\n"));
1885  }
1886  else
1887  {
1888  yytoken = YYTRANSLATE (yychar);
1889  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1890  }
1891 
1892  /* If the proper action on seeing token YYTOKEN is to reduce or to
1893  detect an error, take that action. */
1894  yyn += yytoken;
1895  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1896  goto yydefault;
1897  yyn = yytable[yyn];
1898  if (yyn <= 0)
1899  {
1900  if (yytable_value_is_error (yyn))
1901  goto yyerrlab;
1902  yyn = -yyn;
1903  goto yyreduce;
1904  }
1905 
1906  /* Count tokens shifted since error; after three, turn off error
1907  status. */
1908  if (yyerrstatus)
1909  yyerrstatus--;
1910 
1911  /* Shift the lookahead token. */
1912  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1913 
1914  /* Discard the shifted token. */
1915  yychar = YYEMPTY;
1916 
1917  yystate = yyn;
1919  *++yyvsp = yylval;
1921 
1922  goto yynewstate;
1923 
1924 
1925 /*-----------------------------------------------------------.
1926 | yydefault -- do the default action for the current state. |
1927 `-----------------------------------------------------------*/
1928 yydefault:
1929  yyn = yydefact[yystate];
1930  if (yyn == 0)
1931  goto yyerrlab;
1932  goto yyreduce;
1933 
1934 
1935 /*-----------------------------.
1936 | yyreduce -- Do a reduction. |
1937 `-----------------------------*/
1938 yyreduce:
1939  /* yyn is the number of a rule to reduce with. */
1940  yylen = yyr2[yyn];
1941 
1942  /* If YYLEN is nonzero, implement the default value of the action:
1943  '$$ = $1'.
1944 
1945  Otherwise, the following line sets YYVAL to garbage.
1946  This behavior is undocumented and Bison
1947  users should not rely upon it. Assigning to YYVAL
1948  unconditionally makes the parser a bit smaller, and it avoids a
1949  GCC warning that YYVAL may be used uninitialized. */
1950  yyval = yyvsp[1-yylen];
1951 
1952 
1953  YY_REDUCE_PRINT (yyn);
1954  switch (yyn)
1955  {
1956  case 2:
1957 #line 141 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
1958  {
1959  ast_stack.push_back(current_ast);
1960 }
1961 #line 1962 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
1962  break;
1963 
1964  case 3:
1965 #line 143 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
1966  {
1967  ast_stack.pop_back();
1968  log_assert(GetSize(ast_stack) == 0);
1969  for (auto &it : default_attr_list)
1970  delete it.second;
1971  default_attr_list.clear();
1972 }
1973 #line 1974 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
1974  break;
1975 
1976  case 8:
1977 #line 158 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
1978  {
1979  for (auto &it : attr_list)
1980  delete it.second;
1981  attr_list.clear();
1982  for (auto &it : default_attr_list)
1983  attr_list[it.first] = it.second->clone();
1984  }
1985 #line 1986 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
1986  break;
1987 
1988  case 9:
1989 #line 164 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
1990  {
1991  std::map<std::string, AstNode*> *al = new std::map<std::string, AstNode*>;
1992  al->swap(attr_list);
1993  (yyval.al) = al;
1994  }
1995 #line 1996 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
1996  break;
1997 
1998  case 12:
1999 #line 175 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2000  {
2001  for (auto &it : default_attr_list)
2002  delete it.second;
2003  default_attr_list.clear();
2004  for (auto &it : attr_list)
2005  delete it.second;
2006  attr_list.clear();
2007  }
2008 #line 2009 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2009  break;
2010 
2011  case 13:
2012 #line 182 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2013  {
2014  default_attr_list = attr_list;
2015  attr_list.clear();
2016  }
2017 #line 2018 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2018  break;
2019 
2020  case 19:
2021 #line 195 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2022  {
2023  if (attr_list.count(*(yyvsp[0].string)) != 0)
2024  delete attr_list[*(yyvsp[0].string)];
2025  attr_list[*(yyvsp[0].string)] = AstNode::mkconst_int(1, false);
2026  delete (yyvsp[0].string);
2027  }
2028 #line 2029 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2029  break;
2030 
2031  case 20:
2032 #line 201 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2033  {
2034  if (attr_list.count(*(yyvsp[-2].string)) != 0)
2035  delete attr_list[*(yyvsp[-2].string)];
2036  attr_list[*(yyvsp[-2].string)] = (yyvsp[0].ast);
2037  delete (yyvsp[-2].string);
2038  }
2039 #line 2040 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2040  break;
2041 
2042  case 21:
2043 #line 209 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2044  {
2045  (yyval.string) = (yyvsp[0].string);
2046  }
2047 #line 2048 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2048  break;
2049 
2050  case 22:
2051 #line 212 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2052  {
2053  if ((yyvsp[0].string)->substr(0, 1) == "\\")
2054  *(yyvsp[-2].string) += "." + (yyvsp[0].string)->substr(1);
2055  else
2056  *(yyvsp[-2].string) += "." + *(yyvsp[0].string);
2057  delete (yyvsp[0].string);
2058  (yyval.string) = (yyvsp[-2].string);
2059  }
2060 #line 2061 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2061  break;
2062 
2063  case 23:
2064 #line 222 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2065  {
2066  do_not_require_port_stubs = false;
2067  AstNode *mod = new AstNode(AST_MODULE);
2068  ast_stack.back()->children.push_back(mod);
2069  ast_stack.push_back(mod);
2070  current_ast_mod = mod;
2071  port_stubs.clear();
2072  port_counter = 0;
2073  mod->str = *(yyvsp[0].string);
2074  append_attr(mod, (yyvsp[-2].al));
2075  delete (yyvsp[0].string);
2076  }
2077 #line 2078 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2078  break;
2079 
2080  case 24:
2081 #line 233 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2082  {
2083  if (port_stubs.size() != 0)
2084  frontend_verilog_yyerror("Missing details for module port `%s'.",
2085  port_stubs.begin()->first.c_str());
2086  ast_stack.pop_back();
2087  log_assert(ast_stack.size() == 1);
2089  }
2090 #line 2091 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2091  break;
2092 
2093  case 25:
2094 #line 243 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2095  { astbuf1 = nullptr; }
2096 #line 2097 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2097  break;
2098 
2099  case 26:
2100 #line 243 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2101  { if (astbuf1) delete astbuf1; }
2102 #line 2103 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2103  break;
2104 
2105  case 32:
2106 #line 251 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2107  {
2108  if (astbuf1) delete astbuf1;
2109  astbuf1 = new AstNode(AST_PARAMETER);
2110  astbuf1->children.push_back(AstNode::mkconst_int(0, true));
2111  }
2112 #line 2113 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2113  break;
2114 
2115  case 42:
2116 #line 267 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2117  {
2118  if (ast_stack.back()->children.size() > 0 && ast_stack.back()->children.back()->type == AST_WIRE) {
2119  AstNode *wire = new AstNode(AST_IDENTIFIER);
2120  wire->str = ast_stack.back()->children.back()->str;
2121  if (ast_stack.back()->children.back()->is_reg)
2122  ast_stack.back()->children.push_back(new AstNode(AST_INITIAL, new AstNode(AST_BLOCK, new AstNode(AST_ASSIGN_LE, wire, (yyvsp[0].ast)))));
2123  else
2124  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, wire, (yyvsp[0].ast)));
2125  } else
2126  frontend_verilog_yyerror("Syntax error.");
2127  }
2128 #line 2129 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2129  break;
2130 
2131  case 44:
2132 #line 281 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2133  {
2134  if (ast_stack.back()->children.size() > 0 && ast_stack.back()->children.back()->type == AST_WIRE) {
2135  AstNode *node = ast_stack.back()->children.back()->clone();
2136  node->str = *(yyvsp[0].string);
2137  node->port_id = ++port_counter;
2138  ast_stack.back()->children.push_back(node);
2139  } else {
2140  if (port_stubs.count(*(yyvsp[0].string)) != 0)
2141  frontend_verilog_yyerror("Duplicate module port `%s'.", (yyvsp[0].string)->c_str());
2142  port_stubs[*(yyvsp[0].string)] = ++port_counter;
2143  }
2144  delete (yyvsp[0].string);
2145  }
2146 #line 2147 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2147  break;
2148 
2149  case 46:
2150 #line 294 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2151  {
2152  AstNode *node = (yyvsp[-2].ast);
2153  node->str = *(yyvsp[0].string);
2154  node->port_id = ++port_counter;
2155  if ((yyvsp[-1].ast) != NULL)
2156  node->children.push_back((yyvsp[-1].ast));
2157  if (!node->is_input && !node->is_output)
2158  frontend_verilog_yyerror("Module port `%s' is neither input nor output.", (yyvsp[0].string)->c_str());
2159  if (node->is_reg && node->is_input && !node->is_output)
2160  frontend_verilog_yyerror("Input port `%s' is declared as register.", (yyvsp[0].string)->c_str());
2161  ast_stack.back()->children.push_back(node);
2162  append_attr(node, (yyvsp[-3].al));
2163  delete (yyvsp[0].string);
2164  }
2165 #line 2166 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2166  break;
2167 
2168  case 48:
2169 #line 308 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2170  {
2172  }
2173 #line 2174 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2174  break;
2175 
2176  case 49:
2177 #line 313 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2178  {
2179  astbuf3 = new AstNode(AST_WIRE);
2180  }
2181 #line 2182 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2182  break;
2183 
2184  case 50:
2185 #line 315 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2186  {
2187  (yyval.ast) = astbuf3;
2188  }
2189 #line 2190 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2190  break;
2191 
2192  case 53:
2193 #line 323 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2194  {
2195  astbuf3->is_input = true;
2196  }
2197 #line 2198 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2198  break;
2199 
2200  case 54:
2201 #line 326 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2202  {
2203  astbuf3->is_output = true;
2204  }
2205 #line 2206 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2206  break;
2207 
2208  case 55:
2209 #line 329 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2210  {
2211  astbuf3->is_input = true;
2212  astbuf3->is_output = true;
2213  }
2214 #line 2215 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2215  break;
2216 
2217  case 56:
2218 #line 333 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2219  {
2220  }
2221 #line 2222 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2222  break;
2223 
2224  case 57:
2225 #line 335 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2226  {
2227  astbuf3->is_reg = true;
2228  }
2229 #line 2230 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2230  break;
2231 
2232  case 58:
2233 #line 338 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2234  {
2235  astbuf3->is_reg = true;
2236  astbuf3->range_left = 31;
2237  astbuf3->range_right = 0;
2238  astbuf3->is_signed = true;
2239  }
2240 #line 2241 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2241  break;
2242 
2243  case 59:
2244 #line 344 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2245  {
2246  astbuf3->type = AST_GENVAR;
2247  astbuf3->is_reg = true;
2248  astbuf3->range_left = 31;
2249  astbuf3->range_right = 0;
2250  }
2251 #line 2252 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2252  break;
2253 
2254  case 60:
2255 #line 350 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2256  {
2257  astbuf3->is_signed = true;
2258  }
2259 #line 2260 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2260  break;
2261 
2262  case 61:
2263 #line 355 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2264  {
2265  (yyval.ast) = new AstNode(AST_RANGE);
2266  (yyval.ast)->children.push_back((yyvsp[-3].ast));
2267  (yyval.ast)->children.push_back((yyvsp[-1].ast));
2268  }
2269 #line 2270 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2270  break;
2271 
2272  case 62:
2273 #line 360 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2274  {
2275  (yyval.ast) = new AstNode(AST_RANGE);
2276  (yyval.ast)->children.push_back(new AstNode(AST_SUB, new AstNode(AST_ADD, (yyvsp[-3].ast)->clone(), (yyvsp[-1].ast)), AstNode::mkconst_int(1, true)));
2277  (yyval.ast)->children.push_back(new AstNode(AST_ADD, (yyvsp[-3].ast), AstNode::mkconst_int(0, true)));
2278  }
2279 #line 2280 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2280  break;
2281 
2282  case 63:
2283 #line 365 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2284  {
2285  (yyval.ast) = new AstNode(AST_RANGE);
2286  (yyval.ast)->children.push_back(new AstNode(AST_ADD, (yyvsp[-3].ast), AstNode::mkconst_int(0, true)));
2287  (yyval.ast)->children.push_back(new AstNode(AST_SUB, new AstNode(AST_ADD, (yyvsp[-3].ast)->clone(), AstNode::mkconst_int(1, true)), (yyvsp[-1].ast)));
2288  }
2289 #line 2290 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2290  break;
2291 
2292  case 64:
2293 #line 370 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2294  {
2295  (yyval.ast) = new AstNode(AST_RANGE);
2296  (yyval.ast)->children.push_back((yyvsp[-1].ast));
2297  }
2298 #line 2299 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2299  break;
2300 
2301  case 65:
2302 #line 376 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2303  {
2304  (yyval.ast) = new AstNode(AST_MULTIRANGE, (yyvsp[-1].ast), (yyvsp[0].ast));
2305  }
2306 #line 2307 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2307  break;
2308 
2309  case 66:
2310 #line 379 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2311  {
2312  (yyval.ast) = (yyvsp[-1].ast);
2313  (yyval.ast)->children.push_back((yyvsp[0].ast));
2314  }
2315 #line 2316 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2316  break;
2317 
2318  case 67:
2319 #line 385 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2320  {
2321  (yyval.ast) = (yyvsp[0].ast);
2322  }
2323 #line 2324 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2324  break;
2325 
2326  case 68:
2327 #line 388 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2328  {
2329  (yyval.ast) = NULL;
2330  }
2331 #line 2332 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2332  break;
2333 
2334  case 69:
2335 #line 393 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2336  { (yyval.ast) = (yyvsp[0].ast); }
2337 #line 2338 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2338  break;
2339 
2340  case 70:
2341 #line 394 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2342  { (yyval.ast) = (yyvsp[0].ast); }
2343 #line 2344 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2344  break;
2345 
2346  case 71:
2347 #line 397 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2348  {
2349  (yyval.ast) = (yyvsp[0].ast);
2350  }
2351 #line 2352 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2352  break;
2353 
2354  case 72:
2355 #line 400 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2356  {
2357  (yyval.ast) = new AstNode(AST_RANGE);
2358  (yyval.ast)->children.push_back(AstNode::mkconst_int(31, true));
2359  (yyval.ast)->children.push_back(AstNode::mkconst_int(0, true));
2360  (yyval.ast)->is_signed = true;
2361  }
2362 #line 2363 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2363  break;
2364 
2365  case 87:
2366 #line 418 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2367  {
2368  current_function_or_task = new AstNode(AST_DPI_FUNCTION, AstNode::mkconst_str(*(yyvsp[-1].string)), AstNode::mkconst_str(*(yyvsp[0].string)));
2369  current_function_or_task->str = *(yyvsp[0].string);
2370  append_attr(current_function_or_task, (yyvsp[-3].al));
2371  ast_stack.back()->children.push_back(current_function_or_task);
2372  delete (yyvsp[-1].string);
2373  delete (yyvsp[0].string);
2374  }
2375 #line 2376 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2376  break;
2377 
2378  case 88:
2379 #line 425 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2380  {
2382  }
2383 #line 2384 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2384  break;
2385 
2386  case 89:
2387 #line 428 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2388  {
2389  current_function_or_task = new AstNode(AST_DPI_FUNCTION, AstNode::mkconst_str(*(yyvsp[-1].string)), AstNode::mkconst_str(*(yyvsp[-3].string)));
2390  current_function_or_task->str = *(yyvsp[0].string);
2391  append_attr(current_function_or_task, (yyvsp[-5].al));
2392  ast_stack.back()->children.push_back(current_function_or_task);
2393  delete (yyvsp[-3].string);
2394  delete (yyvsp[-1].string);
2395  delete (yyvsp[0].string);
2396  }
2397 #line 2398 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2398  break;
2399 
2400  case 90:
2401 #line 436 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2402  {
2404  }
2405 #line 2406 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2406  break;
2407 
2408  case 91:
2409 #line 439 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2410  {
2411  current_function_or_task = new AstNode(AST_DPI_FUNCTION, AstNode::mkconst_str(*(yyvsp[-1].string)), AstNode::mkconst_str(*(yyvsp[-5].string) + ":" + RTLIL::unescape_id(*(yyvsp[-3].string))));
2412  current_function_or_task->str = *(yyvsp[0].string);
2413  append_attr(current_function_or_task, (yyvsp[-7].al));
2414  ast_stack.back()->children.push_back(current_function_or_task);
2415  delete (yyvsp[-5].string);
2416  delete (yyvsp[-3].string);
2417  delete (yyvsp[-1].string);
2418  delete (yyvsp[0].string);
2419  }
2420 #line 2421 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2421  break;
2422 
2423  case 92:
2424 #line 448 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2425  {
2427  }
2428 #line 2429 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2429  break;
2430 
2431  case 93:
2432 #line 451 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2433  {
2435  current_function_or_task->str = *(yyvsp[0].string);
2436  append_attr(current_function_or_task, (yyvsp[-2].al));
2437  ast_stack.back()->children.push_back(current_function_or_task);
2440  delete (yyvsp[0].string);
2441  }
2442 #line 2443 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2443  break;
2444 
2445  case 94:
2446 #line 459 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2447  {
2449  ast_stack.pop_back();
2450  }
2451 #line 2452 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2452  break;
2453 
2454  case 95:
2455 #line 463 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2456  {
2458  current_function_or_task->str = *(yyvsp[0].string);
2459  append_attr(current_function_or_task, (yyvsp[-4].al));
2460  ast_stack.back()->children.push_back(current_function_or_task);
2462  AstNode *outreg = new AstNode(AST_WIRE);
2463  outreg->str = *(yyvsp[0].string);
2464  outreg->is_signed = (yyvsp[-2].boolean);
2465  if ((yyvsp[-1].ast) != NULL) {
2466  outreg->children.push_back((yyvsp[-1].ast));
2467  outreg->is_signed = (yyvsp[-2].boolean) || (yyvsp[-1].ast)->is_signed;
2468  (yyvsp[-1].ast)->is_signed = false;
2469  }
2470  current_function_or_task->children.push_back(outreg);
2472  delete (yyvsp[0].string);
2473  }
2474 #line 2475 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2475  break;
2476 
2477  case 96:
2478 #line 480 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2479  {
2481  ast_stack.pop_back();
2482  }
2483 #line 2484 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2484  break;
2485 
2486  case 97:
2487 #line 486 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2488  {
2489  current_function_or_task->children.push_back(AstNode::mkconst_str(*(yyvsp[-1].string)));
2490  delete (yyvsp[-1].string);
2491  delete (yyvsp[0].string);
2492  }
2493 #line 2494 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2494  break;
2495 
2496  case 98:
2497 #line 491 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2498  {
2499  current_function_or_task->children.push_back(AstNode::mkconst_str(*(yyvsp[0].string)));
2500  delete (yyvsp[0].string);
2501  }
2502 #line 2503 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2503  break;
2504 
2505  case 105:
2506 #line 507 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2507  {
2508  (yyval.boolean) = true;
2509  }
2510 #line 2511 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2511  break;
2512 
2513  case 106:
2514 #line 510 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2515  {
2516  (yyval.boolean) = false;
2517  }
2518 #line 2519 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2519  break;
2520 
2521  case 109:
2522 #line 515 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2523  {
2524  albuf = nullptr;
2525  astbuf1 = nullptr;
2526  astbuf2 = nullptr;
2527  }
2528 #line 2529 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2529  break;
2530 
2531  case 110:
2532 #line 519 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2533  {
2534  delete astbuf1;
2535  if (astbuf2 != NULL)
2536  delete astbuf2;
2537  free_attr(albuf);
2538  }
2539 #line 2540 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2540  break;
2541 
2542  case 114:
2543 #line 530 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2544  {
2545  if (albuf) {
2546  delete astbuf1;
2547  if (astbuf2 != NULL)
2548  delete astbuf2;
2549  free_attr(albuf);
2550  }
2551  albuf = (yyvsp[-2].al);
2552  astbuf1 = (yyvsp[-1].ast);
2553  astbuf2 = (yyvsp[0].ast);
2554  if (astbuf1->range_left >= 0 && astbuf1->range_right >= 0) {
2555  if (astbuf2) {
2556  frontend_verilog_yyerror("Syntax error.");
2557  } else {
2558  astbuf2 = new AstNode(AST_RANGE);
2559  astbuf2->children.push_back(AstNode::mkconst_int(astbuf1->range_left, true));
2560  astbuf2->children.push_back(AstNode::mkconst_int(astbuf1->range_right, true));
2561  }
2562  }
2563  if (astbuf2 && astbuf2->children.size() != 2)
2564  frontend_verilog_yyerror("Syntax error.");
2565  }
2566 #line 2567 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2567  break;
2568 
2569  case 119:
2570 #line 558 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2571  {
2572  astbuf1->is_signed = true;
2573  }
2574 #line 2575 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2575  break;
2576 
2577  case 121:
2578 #line 563 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2579  {
2580  if (astbuf1->children.size() != 1)
2581  frontend_verilog_yyerror("Syntax error.");
2582  astbuf1->children.push_back(new AstNode(AST_RANGE));
2583  astbuf1->children.back()->children.push_back(AstNode::mkconst_int(31, true));
2584  astbuf1->children.back()->children.push_back(AstNode::mkconst_int(0, true));
2585  astbuf1->is_signed = true;
2586  }
2587 #line 2588 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2588  break;
2589 
2590  case 123:
2591 #line 573 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2592  {
2593  if (astbuf1->children.size() != 1)
2594  frontend_verilog_yyerror("Syntax error.");
2595  astbuf1->children.push_back(new AstNode(AST_REALVALUE));
2596  }
2597 #line 2598 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2598  break;
2599 
2600  case 125:
2601 #line 580 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2602  {
2603  if ((yyvsp[0].ast) != NULL) {
2604  if (astbuf1->children.size() != 1)
2605  frontend_verilog_yyerror("Syntax error.");
2606  astbuf1->children.push_back((yyvsp[0].ast));
2607  }
2608  }
2609 #line 2610 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2610  break;
2611 
2612  case 126:
2613 #line 589 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2614  {
2615  astbuf1 = new AstNode(AST_PARAMETER);
2616  astbuf1->children.push_back(AstNode::mkconst_int(0, true));
2617  }
2618 #line 2619 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2619  break;
2620 
2621  case 127:
2622 #line 592 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2623  {
2624  delete astbuf1;
2625  }
2626 #line 2627 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2627  break;
2628 
2629  case 128:
2630 #line 597 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2631  {
2633  astbuf1->children.push_back(AstNode::mkconst_int(0, true));
2634  }
2635 #line 2636 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2636  break;
2637 
2638  case 129:
2639 #line 600 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2640  {
2641  delete astbuf1;
2642  }
2643 #line 2644 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2644  break;
2645 
2646  case 132:
2647 #line 608 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2648  {
2649  if (astbuf1 == nullptr)
2650  frontend_verilog_yyerror("syntax error");
2651  AstNode *node = astbuf1->clone();
2652  node->str = *(yyvsp[-2].string);
2653  delete node->children[0];
2654  node->children[0] = (yyvsp[0].ast);
2655  ast_stack.back()->children.push_back(node);
2656  delete (yyvsp[-2].string);
2657  }
2658 #line 2659 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2659  break;
2660 
2661  case 136:
2662 #line 626 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2663  {
2664  AstNode *node = new AstNode(AST_DEFPARAM);
2665  node->str = *(yyvsp[-2].string);
2666  node->children.push_back((yyvsp[0].ast));
2667  if ((yyvsp[-3].ast) != NULL)
2668  node->children.push_back((yyvsp[-3].ast));
2669  ast_stack.back()->children.push_back(node);
2670  delete (yyvsp[-2].string);
2671  }
2672 #line 2673 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2673  break;
2674 
2675  case 137:
2676 #line 637 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2677  {
2678  albuf = (yyvsp[-2].al);
2679  astbuf1 = (yyvsp[-1].ast);
2680  astbuf2 = (yyvsp[0].ast);
2681  if (astbuf1->range_left >= 0 && astbuf1->range_right >= 0) {
2682  if (astbuf2) {
2683  frontend_verilog_yyerror("Syntax error.");
2684  } else {
2685  astbuf2 = new AstNode(AST_RANGE);
2686  astbuf2->children.push_back(AstNode::mkconst_int(astbuf1->range_left, true));
2687  astbuf2->children.push_back(AstNode::mkconst_int(astbuf1->range_right, true));
2688  }
2689  }
2690  if (astbuf2 && astbuf2->children.size() != 2)
2691  frontend_verilog_yyerror("Syntax error.");
2692  }
2693 #line 2694 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2694  break;
2695 
2696  case 138:
2697 #line 652 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2698  {
2699  delete astbuf1;
2700  if (astbuf2 != NULL)
2701  delete astbuf2;
2702  free_attr(albuf);
2703  }
2704 #line 2705 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2705  break;
2706 
2707  case 140:
2708 #line 658 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2709  {
2710  ast_stack.back()->children.push_back(new AstNode(AST_WIRE));
2711  ast_stack.back()->children.back()->str = *(yyvsp[-1].string);
2712  append_attr(ast_stack.back()->children.back(), (yyvsp[-3].al));
2713  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, new AstNode(AST_IDENTIFIER), AstNode::mkconst_int(0, false, 1)));
2714  ast_stack.back()->children.back()->children[0]->str = *(yyvsp[-1].string);
2715  delete (yyvsp[-1].string);
2716  }
2717 #line 2718 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2718  break;
2719 
2720  case 141:
2721 #line 666 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2722  {
2723  ast_stack.back()->children.push_back(new AstNode(AST_WIRE));
2724  ast_stack.back()->children.back()->str = *(yyvsp[-1].string);
2725  append_attr(ast_stack.back()->children.back(), (yyvsp[-3].al));
2726  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, new AstNode(AST_IDENTIFIER), AstNode::mkconst_int(1, false, 1)));
2727  ast_stack.back()->children.back()->children[0]->str = *(yyvsp[-1].string);
2728  delete (yyvsp[-1].string);
2729  }
2730 #line 2731 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2731  break;
2732 
2733  case 145:
2734 #line 680 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2735  {
2736  AstNode *wire = new AstNode(AST_IDENTIFIER);
2737  wire->str = ast_stack.back()->children.back()->str;
2738  if (astbuf1->is_reg)
2739  ast_stack.back()->children.push_back(new AstNode(AST_INITIAL, new AstNode(AST_BLOCK, new AstNode(AST_ASSIGN_LE, wire, (yyvsp[0].ast)))));
2740  else
2741  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, wire, (yyvsp[0].ast)));
2742  }
2743 #line 2744 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2744  break;
2745 
2746  case 146:
2747 #line 690 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2748  {
2749  AstNode *node = astbuf1->clone();
2750  node->str = *(yyvsp[-1].string);
2751  append_attr_clone(node, albuf);
2752  if (astbuf2 != NULL)
2753  node->children.push_back(astbuf2->clone());
2754  if ((yyvsp[0].ast) != NULL) {
2755  if (node->is_input || node->is_output)
2756  frontend_verilog_yyerror("Syntax error.");
2757  if (!astbuf2) {
2758  AstNode *rng = new AstNode(AST_RANGE);
2759  rng->children.push_back(AstNode::mkconst_int(0, true));
2760  rng->children.push_back(AstNode::mkconst_int(0, true));
2761  node->children.push_back(rng);
2762  }
2763  node->type = AST_MEMORY;
2764  node->children.push_back((yyvsp[0].ast));
2765  }
2766  if (current_function_or_task == NULL) {
2767  if (do_not_require_port_stubs && (node->is_input || node->is_output) && port_stubs.count(*(yyvsp[-1].string)) == 0) {
2768  port_stubs[*(yyvsp[-1].string)] = ++port_counter;
2769  }
2770  if (port_stubs.count(*(yyvsp[-1].string)) != 0) {
2771  if (!node->is_input && !node->is_output)
2772  frontend_verilog_yyerror("Module port `%s' is neither input nor output.", (yyvsp[-1].string)->c_str());
2773  if (node->is_reg && node->is_input && !node->is_output)
2774  frontend_verilog_yyerror("Input port `%s' is declared as register.", (yyvsp[-1].string)->c_str());
2775  node->port_id = port_stubs[*(yyvsp[-1].string)];
2776  port_stubs.erase(*(yyvsp[-1].string));
2777  } else {
2778  if (node->is_input || node->is_output)
2779  frontend_verilog_yyerror("Module port `%s' is not declared in module header.", (yyvsp[-1].string)->c_str());
2780  }
2781  } else {
2782  if (node->is_input || node->is_output)
2784  }
2785  ast_stack.back()->children.push_back(node);
2786  delete (yyvsp[-1].string);
2787  }
2788 #line 2789 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2789  break;
2790 
2791  case 150:
2792 #line 738 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2793  {
2794  ast_stack.back()->children.push_back(new AstNode(AST_ASSIGN, (yyvsp[-2].ast), (yyvsp[0].ast)));
2795  }
2796 #line 2797 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2797  break;
2798 
2799  case 151:
2800 #line 743 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2801  {
2802  astbuf1 = new AstNode(AST_CELL);
2803  append_attr(astbuf1, (yyvsp[-1].al));
2804  astbuf1->children.push_back(new AstNode(AST_CELLTYPE));
2805  astbuf1->children[0]->str = *(yyvsp[0].string);
2806  delete (yyvsp[0].string);
2807  }
2808 #line 2809 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2809  break;
2810 
2811  case 152:
2812 #line 749 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2813  {
2814  delete astbuf1;
2815  }
2816 #line 2817 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2817  break;
2818 
2819  case 153:
2820 #line 752 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2821  {
2822  astbuf1 = new AstNode(AST_PRIMITIVE);
2823  astbuf1->str = *(yyvsp[0].string);
2824  append_attr(astbuf1, (yyvsp[-1].al));
2825  delete (yyvsp[0].string);
2826  }
2827 #line 2828 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2828  break;
2829 
2830  case 154:
2831 #line 757 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2832  {
2833  delete astbuf1;
2834  }
2835 #line 2836 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2836  break;
2837 
2838  case 155:
2839 #line 762 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2840  {
2841  (yyval.string) = (yyvsp[0].string);
2842  }
2843 #line 2844 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2844  break;
2845 
2846  case 156:
2847 #line 765 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2848  {
2849  (yyval.string) = new std::string("or");
2850  }
2851 #line 2852 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2852  break;
2853 
2854  case 159:
2855 #line 774 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2856  {
2857  astbuf2 = astbuf1->clone();
2858  if (astbuf2->type != AST_PRIMITIVE)
2859  astbuf2->str = *(yyvsp[0].string);
2860  delete (yyvsp[0].string);
2861  ast_stack.back()->children.push_back(astbuf2);
2862  }
2863 #line 2864 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2864  break;
2865 
2866  case 161:
2867 #line 781 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2868  {
2869  astbuf2 = astbuf1->clone();
2870  if (astbuf2->type != AST_PRIMITIVE)
2871  astbuf2->str = *(yyvsp[-1].string);
2872  delete (yyvsp[-1].string);
2873  ast_stack.back()->children.push_back(new AstNode(AST_CELLARRAY, (yyvsp[0].ast), astbuf2));
2874  }
2875 #line 2876 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2876  break;
2877 
2878  case 166:
2879 #line 795 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2880  {
2881  astbuf2 = astbuf1->clone();
2882  ast_stack.back()->children.push_back(astbuf2);
2883  }
2884 #line 2885 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2885  break;
2886 
2887  case 173:
2888 #line 808 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2889  {
2890  AstNode *node = new AstNode(AST_PARASET);
2891  astbuf1->children.push_back(node);
2892  node->children.push_back((yyvsp[0].ast));
2893  }
2894 #line 2895 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2895  break;
2896 
2897  case 174:
2898 #line 813 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2899  {
2900  AstNode *node = new AstNode(AST_PARASET);
2901  node->str = *(yyvsp[-3].string);
2902  astbuf1->children.push_back(node);
2903  node->children.push_back((yyvsp[-1].ast));
2904  delete (yyvsp[-3].string);
2905  }
2906 #line 2907 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2907  break;
2908 
2909  case 178:
2910 #line 824 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2911  {
2912  AstNode *node = new AstNode(AST_ARGUMENT);
2913  astbuf2->children.push_back(node);
2914  }
2915 #line 2916 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2916  break;
2917 
2918  case 180:
2919 #line 830 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2920  {
2921  AstNode *node = new AstNode(AST_ARGUMENT);
2922  astbuf2->children.push_back(node);
2923  node->children.push_back((yyvsp[0].ast));
2924  }
2925 #line 2926 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2926  break;
2927 
2928  case 181:
2929 #line 835 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2930  {
2931  AstNode *node = new AstNode(AST_ARGUMENT);
2932  node->str = *(yyvsp[-3].string);
2933  astbuf2->children.push_back(node);
2934  node->children.push_back((yyvsp[-1].ast));
2935  delete (yyvsp[-3].string);
2936  }
2937 #line 2938 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2938  break;
2939 
2940  case 182:
2941 #line 842 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2942  {
2943  AstNode *node = new AstNode(AST_ARGUMENT);
2944  node->str = *(yyvsp[-2].string);
2945  astbuf2->children.push_back(node);
2946  delete (yyvsp[-2].string);
2947  }
2948 #line 2949 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2949  break;
2950 
2951  case 183:
2952 #line 850 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2953  {
2954  AstNode *node = new AstNode(AST_ALWAYS);
2955  append_attr(node, (yyvsp[-1].al));
2956  ast_stack.back()->children.push_back(node);
2957  ast_stack.push_back(node);
2958  }
2959 #line 2960 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2960  break;
2961 
2962  case 184:
2963 #line 855 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2964  {
2965  AstNode *block = new AstNode(AST_BLOCK);
2966  ast_stack.back()->children.push_back(block);
2967  ast_stack.push_back(block);
2968  }
2969 #line 2970 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2970  break;
2971 
2972  case 185:
2973 #line 859 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2974  {
2975  ast_stack.pop_back();
2976  ast_stack.pop_back();
2977  }
2978 #line 2979 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2979  break;
2980 
2981  case 186:
2982 #line 863 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2983  {
2984  AstNode *node = new AstNode(AST_INITIAL);
2985  append_attr(node, (yyvsp[-1].al));
2986  ast_stack.back()->children.push_back(node);
2987  ast_stack.push_back(node);
2988  AstNode *block = new AstNode(AST_BLOCK);
2989  ast_stack.back()->children.push_back(block);
2990  ast_stack.push_back(block);
2991  }
2992 #line 2993 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
2993  break;
2994 
2995  case 187:
2996 #line 871 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
2997  {
2998  ast_stack.pop_back();
2999  ast_stack.pop_back();
3000  }
3001 #line 3002 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3002  break;
3003 
3004  case 197:
3005 #line 890 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3006  {
3007  AstNode *node = new AstNode(AST_POSEDGE);
3008  ast_stack.back()->children.push_back(node);
3009  node->children.push_back((yyvsp[0].ast));
3010  }
3011 #line 3012 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3012  break;
3013 
3014  case 198:
3015 #line 895 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3016  {
3017  AstNode *node = new AstNode(AST_NEGEDGE);
3018  ast_stack.back()->children.push_back(node);
3019  node->children.push_back((yyvsp[0].ast));
3020  }
3021 #line 3022 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3022  break;
3023 
3024  case 199:
3025 #line 900 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3026  {
3027  AstNode *node = new AstNode(AST_EDGE);
3028  ast_stack.back()->children.push_back(node);
3029  node->children.push_back((yyvsp[0].ast));
3030  }
3031 #line 3032 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3032  break;
3033 
3034  case 200:
3035 #line 907 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3036  {
3037  (yyval.string) = (yyvsp[0].string);
3038  }
3039 #line 3040 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3040  break;
3041 
3042  case 201:
3043 #line 910 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3044  {
3045  (yyval.string) = NULL;
3046  }
3047 #line 3048 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3048  break;
3049 
3050  case 202:
3051 #line 915 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3052  {
3053  ast_stack.back()->children.push_back(new AstNode(AST_ASSERT, (yyvsp[-2].ast)));
3054  }
3055 #line 3056 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3056  break;
3057 
3058  case 203:
3059 #line 920 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3060  {
3061  ast_stack.back()->children.push_back(new AstNode(AST_ASSERT, (yyvsp[-2].ast)));
3062  }
3063 #line 3064 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3064  break;
3065 
3066  case 204:
3067 #line 925 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3068  {
3069  AstNode *node = new AstNode(AST_ASSIGN_EQ, (yyvsp[-2].ast), (yyvsp[0].ast));
3070  ast_stack.back()->children.push_back(node);
3071  }
3072 #line 3073 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3073  break;
3074 
3075  case 205:
3076 #line 929 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3077  {
3078  AstNode *node = new AstNode(AST_ASSIGN_LE, (yyvsp[-2].ast), (yyvsp[0].ast));
3079  ast_stack.back()->children.push_back(node);
3080  }
3081 #line 3082 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3082  break;
3083 
3084  case 210:
3085 #line 938 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3086  {
3087  AstNode *node = new AstNode(AST_TCALL);
3088  node->str = *(yyvsp[-1].string);
3089  delete (yyvsp[-1].string);
3090  ast_stack.back()->children.push_back(node);
3091  ast_stack.push_back(node);
3092  append_attr(node, (yyvsp[0].al));
3093  }
3094 #line 3095 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3095  break;
3096 
3097  case 211:
3098 #line 945 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3099  {
3100  ast_stack.pop_back();
3101  }
3102 #line 3103 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3103  break;
3104 
3105  case 212:
3106 #line 948 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3107  {
3108  AstNode *node = new AstNode(AST_BLOCK);
3109  ast_stack.back()->children.push_back(node);
3110  ast_stack.push_back(node);
3111  append_attr(node, (yyvsp[-2].al));
3112  if ((yyvsp[0].string) != NULL)
3113  node->str = *(yyvsp[0].string);
3114  }
3115 #line 3116 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3116  break;
3117 
3118  case 213:
3119 #line 955 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3120  {
3121  if ((yyvsp[-4].string) != NULL && (yyvsp[0].string) != NULL && *(yyvsp[-4].string) != *(yyvsp[0].string))
3122  frontend_verilog_yyerror("Syntax error.");
3123  if ((yyvsp[-4].string) != NULL)
3124  delete (yyvsp[-4].string);
3125  if ((yyvsp[0].string) != NULL)
3126  delete (yyvsp[0].string);
3127  ast_stack.pop_back();
3128  }
3129 #line 3130 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3130  break;
3131 
3132  case 214:
3133 #line 964 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3134  {
3135  AstNode *node = new AstNode(AST_FOR);
3136  ast_stack.back()->children.push_back(node);
3137  ast_stack.push_back(node);
3138  append_attr(node, (yyvsp[-2].al));
3139  }
3140 #line 3141 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3141  break;
3142 
3143  case 215:
3144 #line 969 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3145  {
3146  ast_stack.back()->children.push_back((yyvsp[0].ast));
3147  }
3148 #line 3149 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3149  break;
3150 
3151  case 216:
3152 #line 971 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3153  {
3154  AstNode *block = new AstNode(AST_BLOCK);
3155  ast_stack.back()->children.push_back(block);
3156  ast_stack.push_back(block);
3157  }
3158 #line 3159 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3159  break;
3160 
3161  case 217:
3162 #line 975 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3163  {
3164  ast_stack.pop_back();
3165  ast_stack.pop_back();
3166  }
3167 #line 3168 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3168  break;
3169 
3170  case 218:
3171 #line 979 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3172  {
3173  AstNode *node = new AstNode(AST_WHILE);
3174  ast_stack.back()->children.push_back(node);
3175  ast_stack.push_back(node);
3176  append_attr(node, (yyvsp[-4].al));
3177  AstNode *block = new AstNode(AST_BLOCK);
3178  ast_stack.back()->children.push_back((yyvsp[-1].ast));
3179  ast_stack.back()->children.push_back(block);
3180  ast_stack.push_back(block);
3181  }
3182 #line 3183 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3183  break;
3184 
3185  case 219:
3186 #line 988 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3187  {
3188  ast_stack.pop_back();
3189  ast_stack.pop_back();
3190  }
3191 #line 3192 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3192  break;
3193 
3194  case 220:
3195 #line 992 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3196  {
3197  AstNode *node = new AstNode(AST_REPEAT);
3198  ast_stack.back()->children.push_back(node);
3199  ast_stack.push_back(node);
3200  append_attr(node, (yyvsp[-4].al));
3201  AstNode *block = new AstNode(AST_BLOCK);
3202  ast_stack.back()->children.push_back((yyvsp[-1].ast));
3203  ast_stack.back()->children.push_back(block);
3204  ast_stack.push_back(block);
3205  }
3206 #line 3207 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3207  break;
3208 
3209  case 221:
3210 #line 1001 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3211  {
3212  ast_stack.pop_back();
3213  ast_stack.pop_back();
3214  }
3215 #line 3216 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3216  break;
3217 
3218  case 222:
3219 #line 1005 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3220  {
3221  AstNode *node = new AstNode(AST_CASE);
3222  AstNode *block = new AstNode(AST_BLOCK);
3223  AstNode *cond = new AstNode(AST_COND, AstNode::mkconst_int(1, false, 1), block);
3224  ast_stack.back()->children.push_back(node);
3225  node->children.push_back(new AstNode(AST_REDUCE_BOOL, (yyvsp[-1].ast)));
3226  node->children.push_back(cond);
3227  ast_stack.push_back(node);
3228  ast_stack.push_back(block);
3229  append_attr(node, (yyvsp[-4].al));
3230  }
3231 #line 3232 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3232  break;
3233 
3234  case 223:
3235 #line 1015 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3236  {
3237  ast_stack.pop_back();
3238  ast_stack.pop_back();
3239  }
3240 #line 3241 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3241  break;
3242 
3243  case 224:
3244 #line 1019 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3245  {
3246  AstNode *node = new AstNode(AST_CASE, (yyvsp[-1].ast));
3247  ast_stack.back()->children.push_back(node);
3248  ast_stack.push_back(node);
3249  append_attr(node, (yyvsp[-4].al));
3250  }
3251 #line 3252 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3252  break;
3253 
3254  case 225:
3255 #line 1024 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3256  {
3257  case_type_stack.pop_back();
3258  ast_stack.pop_back();
3259  }
3260 #line 3261 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3261  break;
3262 
3263  case 226:
3264 #line 1030 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3265  {
3266  case_type_stack.push_back(0);
3267  }
3268 #line 3269 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3269  break;
3270 
3271  case 227:
3272 #line 1033 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3273  {
3274  case_type_stack.push_back('x');
3275  }
3276 #line 3277 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3277  break;
3278 
3279  case 228:
3280 #line 1036 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3281  {
3282  case_type_stack.push_back('z');
3283  }
3284 #line 3285 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3285  break;
3286 
3287  case 229:
3288 #line 1041 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3289  {
3290  if (ast_stack.back()->attributes.count("\\full_case") == 0)
3291  ast_stack.back()->attributes["\\full_case"] = AstNode::mkconst_int(1, false);
3292  }
3293 #line 3294 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3294  break;
3295 
3296  case 230:
3297 #line 1045 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3298  {
3299  if (ast_stack.back()->attributes.count("\\parallel_case") == 0)
3300  ast_stack.back()->attributes["\\parallel_case"] = AstNode::mkconst_int(1, false);
3301  }
3302 #line 3303 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3303  break;
3304 
3305  case 236:
3306 #line 1060 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3307  {
3308  AstNode *block = new AstNode(AST_BLOCK);
3309  AstNode *cond = new AstNode(AST_COND, new AstNode(AST_DEFAULT), block);
3310  ast_stack.pop_back();
3311  ast_stack.back()->children.push_back(cond);
3312  ast_stack.push_back(block);
3313  }
3314 #line 3315 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3315  break;
3316 
3317  case 241:
3318 #line 1074 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3319  {
3320  AstNode *node = new AstNode(AST_COND);
3321  ast_stack.back()->children.push_back(node);
3322  ast_stack.push_back(node);
3323  }
3324 #line 3325 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3325  break;
3326 
3327  case 242:
3328 #line 1078 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3329  {
3330  AstNode *block = new AstNode(AST_BLOCK);
3331  ast_stack.back()->children.push_back(block);
3332  ast_stack.push_back(block);
3333  case_type_stack.push_back(0);
3334  }
3335 #line 3336 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3336  break;
3337 
3338  case 243:
3339 #line 1083 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3340  {
3341  case_type_stack.pop_back();
3342  ast_stack.pop_back();
3343  ast_stack.pop_back();
3344  }
3345 #line 3346 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3346  break;
3347 
3348  case 246:
3349 #line 1094 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3350  {
3351  AstNode *node = new AstNode(AST_COND);
3352  ast_stack.back()->children.push_back(node);
3353  ast_stack.push_back(node);
3354  }
3355 #line 3356 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3356  break;
3357 
3358  case 247:
3359 #line 1098 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3360  {
3361  case_type_stack.push_back(0);
3362  }
3363 #line 3364 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3364  break;
3365 
3366  case 248:
3367 #line 1100 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3368  {
3369  case_type_stack.pop_back();
3370  ast_stack.pop_back();
3371  }
3372 #line 3373 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3373  break;
3374 
3375  case 251:
3376 #line 1110 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3377  {
3378  ast_stack.back()->children.push_back(new AstNode(AST_DEFAULT));
3379  }
3380 #line 3381 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3381  break;
3382 
3383  case 252:
3384 #line 1113 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3385  {
3386  ast_stack.back()->children.push_back((yyvsp[0].ast));
3387  }
3388 #line 3389 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3389  break;
3390 
3391  case 253:
3392 #line 1116 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3393  {
3394  ast_stack.back()->children.push_back((yyvsp[0].ast));
3395  }
3396 #line 3397 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3397  break;
3398 
3399  case 254:
3400 #line 1121 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3401  {
3402  (yyval.ast) = new AstNode(AST_PREFIX, (yyvsp[-3].ast), (yyvsp[0].ast));
3403  (yyval.ast)->str = *(yyvsp[-5].string);
3404  delete (yyvsp[-5].string);
3405  }
3406 #line 3407 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3407  break;
3408 
3409  case 255:
3410 #line 1126 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3411  {
3412  (yyval.ast) = new AstNode(AST_IDENTIFIER, (yyvsp[0].ast));
3413  (yyval.ast)->str = *(yyvsp[-1].string);
3414  delete (yyvsp[-1].string);
3415  }
3416 #line 3417 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3417  break;
3418 
3419  case 256:
3420 #line 1131 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3421  {
3422  (yyval.ast) = new AstNode(AST_IDENTIFIER, (yyvsp[0].ast));
3423  (yyval.ast)->str = *(yyvsp[-1].string);
3424  delete (yyvsp[-1].string);
3425  }
3426 #line 3427 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3427  break;
3428 
3429  case 257:
3430 #line 1138 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3431  {
3432  (yyval.ast) = (yyvsp[0].ast);
3433  }
3434 #line 3435 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3435  break;
3436 
3437  case 258:
3438 #line 1141 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3439  {
3440  (yyval.ast) = (yyvsp[-1].ast);
3441  }
3442 #line 3443 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3443  break;
3444 
3445  case 259:
3446 #line 1146 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3447  {
3448  (yyval.ast) = new AstNode(AST_CONCAT);
3449  (yyval.ast)->children.push_back((yyvsp[0].ast));
3450  }
3451 #line 3452 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3452  break;
3453 
3454  case 260:
3455 #line 1150 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3456  {
3457  (yyval.ast) = (yyvsp[0].ast);
3458  (yyval.ast)->children.push_back((yyvsp[-2].ast));
3459  }
3460 #line 3461 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3461  break;
3462 
3463  case 267:
3464 #line 1168 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3465  {
3466  ast_stack.back()->children.push_back((yyvsp[0].ast));
3467  }
3468 #line 3469 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3469  break;
3470 
3471  case 272:
3472 #line 1181 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3473  {
3474  AstNode *node = new AstNode(AST_GENFOR);
3475  ast_stack.back()->children.push_back(node);
3476  ast_stack.push_back(node);
3477  }
3478 #line 3479 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3479  break;
3480 
3481  case 273:
3482 #line 1185 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3483  {
3484  ast_stack.back()->children.push_back((yyvsp[0].ast));
3485  }
3486 #line 3487 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3487  break;
3488 
3489  case 274:
3490 #line 1187 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3491  {
3492  ast_stack.pop_back();
3493  }
3494 #line 3495 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3495  break;
3496 
3497  case 275:
3498 #line 1190 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3499  {
3500  AstNode *node = new AstNode(AST_GENIF);
3501  ast_stack.back()->children.push_back(node);
3502  ast_stack.push_back(node);
3503  ast_stack.back()->children.push_back((yyvsp[-1].ast));
3504  }
3505 #line 3506 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3506  break;
3507 
3508  case 276:
3509 #line 1195 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3510  {
3511  ast_stack.pop_back();
3512  }
3513 #line 3514 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3514  break;
3515 
3516  case 277:
3517 #line 1198 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3518  {
3519  AstNode *node = new AstNode(AST_GENCASE, (yyvsp[-1].ast));
3520  ast_stack.back()->children.push_back(node);
3521  ast_stack.push_back(node);
3522  }
3523 #line 3524 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3524  break;
3525 
3526  case 278:
3527 #line 1202 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3528  {
3529  case_type_stack.pop_back();
3530  ast_stack.pop_back();
3531  }
3532 #line 3533 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3533  break;
3534 
3535  case 279:
3536 #line 1206 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3537  {
3538  AstNode *node = new AstNode(AST_GENBLOCK);
3539  node->str = (yyvsp[0].string) ? *(yyvsp[0].string) : std::string();
3540  ast_stack.back()->children.push_back(node);
3541  ast_stack.push_back(node);
3542  }
3543 #line 3544 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3544  break;
3545 
3546  case 280:
3547 #line 1211 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3548  {
3549  if ((yyvsp[-4].string) != NULL)
3550  delete (yyvsp[-4].string);
3551  if ((yyvsp[0].string) != NULL)
3552  delete (yyvsp[0].string);
3553  ast_stack.pop_back();
3554  }
3555 #line 3556 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3556  break;
3557 
3558  case 281:
3559 #line 1220 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3560  {
3561  AstNode *node = new AstNode(AST_GENBLOCK);
3562  ast_stack.back()->children.push_back(node);
3563  ast_stack.push_back(node);
3564  }
3565 #line 3566 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3566  break;
3567 
3568  case 282:
3569 #line 1224 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3570  {
3571  ast_stack.pop_back();
3572  }
3573 #line 3574 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3574  break;
3575 
3576  case 287:
3577 #line 1235 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3578  {
3579  (yyval.ast) = (yyvsp[0].ast);
3580  }
3581 #line 3582 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3582  break;
3583 
3584  case 288:
3585 #line 1238 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3586  {
3587  (yyval.ast) = new AstNode(AST_TERNARY);
3588  (yyval.ast)->children.push_back((yyvsp[-5].ast));
3589  (yyval.ast)->children.push_back((yyvsp[-2].ast));
3590  (yyval.ast)->children.push_back((yyvsp[0].ast));
3591  append_attr((yyval.ast), (yyvsp[-3].al));
3592  }
3593 #line 3594 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3594  break;
3595 
3596  case 289:
3597 #line 1247 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3598  {
3599  (yyval.ast) = (yyvsp[0].ast);
3600  }
3601 #line 3602 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3602  break;
3603 
3604  case 290:
3605 #line 1250 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3606  {
3607  if ((yyvsp[0].string)->substr(0, 1) != "'")
3608  frontend_verilog_yyerror("Syntax error.");
3609  AstNode *bits = (yyvsp[-2].ast);
3610  AstNode *val = const2ast(*(yyvsp[0].string), case_type_stack.size() == 0 ? 0 : case_type_stack.back());
3611  if (val == NULL)
3612  log_error("Value conversion failed: `%s'\n", (yyvsp[0].string)->c_str());
3613  (yyval.ast) = new AstNode(AST_TO_BITS, bits, val);
3614  delete (yyvsp[0].string);
3615  }
3616 #line 3617 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3617  break;
3618 
3619  case 291:
3620 #line 1260 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3621  {
3622  if ((yyvsp[0].string)->substr(0, 1) != "'")
3623  frontend_verilog_yyerror("Syntax error.");
3624  AstNode *bits = new AstNode(AST_IDENTIFIER);
3625  bits->str = *(yyvsp[-1].string);
3626  AstNode *val = const2ast(*(yyvsp[0].string), case_type_stack.size() == 0 ? 0 : case_type_stack.back());
3627  if (val == NULL)
3628  log_error("Value conversion failed: `%s'\n", (yyvsp[0].string)->c_str());
3629  (yyval.ast) = new AstNode(AST_TO_BITS, bits, val);
3630  delete (yyvsp[-1].string);
3631  delete (yyvsp[0].string);
3632  }
3633 #line 3634 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3634  break;
3635 
3636  case 292:
3637 #line 1272 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3638  {
3639  (yyval.ast) = const2ast(*(yyvsp[-1].string) + *(yyvsp[0].string), case_type_stack.size() == 0 ? 0 : case_type_stack.back());
3640  if ((yyval.ast) == NULL || (*(yyvsp[0].string))[0] != '\'')
3641  log_error("Value conversion failed: `%s%s'\n", (yyvsp[-1].string)->c_str(), (yyvsp[0].string)->c_str());
3642  delete (yyvsp[-1].string);
3643  delete (yyvsp[0].string);
3644  }
3645 #line 3646 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3646  break;
3647 
3648  case 293:
3649 #line 1279 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3650  {
3651  (yyval.ast) = const2ast(*(yyvsp[0].string), case_type_stack.size() == 0 ? 0 : case_type_stack.back());
3652  if ((yyval.ast) == NULL)
3653  log_error("Value conversion failed: `%s'\n", (yyvsp[0].string)->c_str());
3654  delete (yyvsp[0].string);
3655  }
3656 #line 3657 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3657  break;
3658 
3659  case 294:
3660 #line 1285 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3661  {
3662  (yyval.ast) = new AstNode(AST_REALVALUE);
3663  char *p = strdup((yyvsp[0].string)->c_str()), *q;
3664  for (int i = 0, j = 0; !p[j]; j++)
3665  if (p[j] != '_')
3666  p[i++] = p[j], p[i] = 0;
3667  (yyval.ast)->realvalue = strtod(p, &q);
3668  log_assert(*q == 0);
3669  delete (yyvsp[0].string);
3670  free(p);
3671  }
3672 #line 3673 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3673  break;
3674 
3675  case 295:
3676 #line 1296 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3677  {
3678  (yyval.ast) = AstNode::mkconst_str(*(yyvsp[0].string));
3679  delete (yyvsp[0].string);
3680  }
3681 #line 3682 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3682  break;
3683 
3684  case 296:
3685 #line 1300 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3686  {
3687  AstNode *node = new AstNode(AST_FCALL);
3688  node->str = *(yyvsp[-1].string);
3689  delete (yyvsp[-1].string);
3690  ast_stack.push_back(node);
3691  append_attr(node, (yyvsp[0].al));
3692  }
3693 #line 3694 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3694  break;
3695 
3696  case 297:
3697 #line 1306 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3698  {
3699  (yyval.ast) = ast_stack.back();
3700  ast_stack.pop_back();
3701  }
3702 #line 3703 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3703  break;
3704 
3705  case 298:
3706 #line 1310 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3707  {
3708  (yyval.ast) = new AstNode(AST_TO_SIGNED, (yyvsp[-1].ast));
3709  append_attr((yyval.ast), (yyvsp[-3].al));
3710  }
3711 #line 3712 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3712  break;
3713 
3714  case 299:
3715 #line 1314 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3716  {
3717  (yyval.ast) = new AstNode(AST_TO_UNSIGNED, (yyvsp[-1].ast));
3718  append_attr((yyval.ast), (yyvsp[-3].al));
3719  }
3720 #line 3721 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3721  break;
3722 
3723  case 300:
3724 #line 1318 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3725  {
3726  (yyval.ast) = (yyvsp[-1].ast);
3727  }
3728 #line 3729 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3729  break;
3730 
3731  case 301:
3732 #line 1321 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3733  {
3734  (yyval.ast) = (yyvsp[-1].ast);
3735  }
3736 #line 3737 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3737  break;
3738 
3739  case 302:
3740 #line 1324 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3741  {
3742  (yyval.ast) = new AstNode(AST_REPLICATE, (yyvsp[-4].ast), (yyvsp[-2].ast));
3743  }
3744 #line 3745 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3745  break;
3746 
3747  case 303:
3748 #line 1327 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3749  {
3750  (yyval.ast) = new AstNode(AST_BIT_NOT, (yyvsp[0].ast));
3751  append_attr((yyval.ast), (yyvsp[-1].al));
3752  }
3753 #line 3754 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3754  break;
3755 
3756  case 304:
3757 #line 1331 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3758  {
3759  (yyval.ast) = new AstNode(AST_BIT_AND, (yyvsp[-3].ast), (yyvsp[0].ast));
3760  append_attr((yyval.ast), (yyvsp[-1].al));
3761  }
3762 #line 3763 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3763  break;
3764 
3765  case 305:
3766 #line 1335 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3767  {
3768  (yyval.ast) = new AstNode(AST_BIT_OR, (yyvsp[-3].ast), (yyvsp[0].ast));
3769  append_attr((yyval.ast), (yyvsp[-1].al));
3770  }
3771 #line 3772 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3772  break;
3773 
3774  case 306:
3775 #line 1339 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3776  {
3777  (yyval.ast) = new AstNode(AST_BIT_XOR, (yyvsp[-3].ast), (yyvsp[0].ast));
3778  append_attr((yyval.ast), (yyvsp[-1].al));
3779  }
3780 #line 3781 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3781  break;
3782 
3783  case 307:
3784 #line 1343 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3785  {
3786  (yyval.ast) = new AstNode(AST_BIT_XNOR, (yyvsp[-3].ast), (yyvsp[0].ast));
3787  append_attr((yyval.ast), (yyvsp[-1].al));
3788  }
3789 #line 3790 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3790  break;
3791 
3792  case 308:
3793 #line 1347 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3794  {
3795  (yyval.ast) = new AstNode(AST_REDUCE_AND, (yyvsp[0].ast));
3796  append_attr((yyval.ast), (yyvsp[-1].al));
3797  }
3798 #line 3799 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3799  break;
3800 
3801  case 309:
3802 #line 1351 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3803  {
3804  (yyval.ast) = new AstNode(AST_REDUCE_AND, (yyvsp[0].ast));
3805  append_attr((yyval.ast), (yyvsp[-1].al));
3806  (yyval.ast) = new AstNode(AST_LOGIC_NOT, (yyval.ast));
3807  }
3808 #line 3809 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3809  break;
3810 
3811  case 310:
3812 #line 1356 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3813  {
3814  (yyval.ast) = new AstNode(AST_REDUCE_OR, (yyvsp[0].ast));
3815  append_attr((yyval.ast), (yyvsp[-1].al));
3816  }
3817 #line 3818 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3818  break;
3819 
3820  case 311:
3821 #line 1360 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3822  {
3823  (yyval.ast) = new AstNode(AST_REDUCE_OR, (yyvsp[0].ast));
3824  append_attr((yyval.ast), (yyvsp[-1].al));
3825  (yyval.ast) = new AstNode(AST_LOGIC_NOT, (yyval.ast));
3826  }
3827 #line 3828 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3828  break;
3829 
3830  case 312:
3831 #line 1365 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3832  {
3833  (yyval.ast) = new AstNode(AST_REDUCE_XOR, (yyvsp[0].ast));
3834  append_attr((yyval.ast), (yyvsp[-1].al));
3835  }
3836 #line 3837 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3837  break;
3838 
3839  case 313:
3840 #line 1369 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3841  {
3842  (yyval.ast) = new AstNode(AST_REDUCE_XNOR, (yyvsp[0].ast));
3843  append_attr((yyval.ast), (yyvsp[-1].al));
3844  }
3845 #line 3846 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3846  break;
3847 
3848  case 314:
3849 #line 1373 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3850  {
3851  (yyval.ast) = new AstNode(AST_SHIFT_LEFT, (yyvsp[-3].ast), (yyvsp[0].ast));
3852  append_attr((yyval.ast), (yyvsp[-1].al));
3853  }
3854 #line 3855 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3855  break;
3856 
3857  case 315:
3858 #line 1377 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3859  {
3860  (yyval.ast) = new AstNode(AST_SHIFT_RIGHT, (yyvsp[-3].ast), (yyvsp[0].ast));
3861  append_attr((yyval.ast), (yyvsp[-1].al));
3862  }
3863 #line 3864 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3864  break;
3865 
3866  case 316:
3867 #line 1381 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3868  {
3869  (yyval.ast) = new AstNode(AST_SHIFT_SLEFT, (yyvsp[-3].ast), (yyvsp[0].ast));
3870  append_attr((yyval.ast), (yyvsp[-1].al));
3871  }
3872 #line 3873 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3873  break;
3874 
3875  case 317:
3876 #line 1385 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3877  {
3878  (yyval.ast) = new AstNode(AST_SHIFT_SRIGHT, (yyvsp[-3].ast), (yyvsp[0].ast));
3879  append_attr((yyval.ast), (yyvsp[-1].al));
3880  }
3881 #line 3882 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3882  break;
3883 
3884  case 318:
3885 #line 1389 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3886  {
3887  (yyval.ast) = new AstNode(AST_LT, (yyvsp[-3].ast), (yyvsp[0].ast));
3888  append_attr((yyval.ast), (yyvsp[-1].al));
3889  }
3890 #line 3891 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3891  break;
3892 
3893  case 319:
3894 #line 1393 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3895  {
3896  (yyval.ast) = new AstNode(AST_LE, (yyvsp[-3].ast), (yyvsp[0].ast));
3897  append_attr((yyval.ast), (yyvsp[-1].al));
3898  }
3899 #line 3900 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3900  break;
3901 
3902  case 320:
3903 #line 1397 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3904  {
3905  (yyval.ast) = new AstNode(AST_EQ, (yyvsp[-3].ast), (yyvsp[0].ast));
3906  append_attr((yyval.ast), (yyvsp[-1].al));
3907  }
3908 #line 3909 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3909  break;
3910 
3911  case 321:
3912 #line 1401 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3913  {
3914  (yyval.ast) = new AstNode(AST_NE, (yyvsp[-3].ast), (yyvsp[0].ast));
3915  append_attr((yyval.ast), (yyvsp[-1].al));
3916  }
3917 #line 3918 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3918  break;
3919 
3920  case 322:
3921 #line 1405 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3922  {
3923  (yyval.ast) = new AstNode(AST_EQX, (yyvsp[-3].ast), (yyvsp[0].ast));
3924  append_attr((yyval.ast), (yyvsp[-1].al));
3925  }
3926 #line 3927 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3927  break;
3928 
3929  case 323:
3930 #line 1409 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3931  {
3932  (yyval.ast) = new AstNode(AST_NEX, (yyvsp[-3].ast), (yyvsp[0].ast));
3933  append_attr((yyval.ast), (yyvsp[-1].al));
3934  }
3935 #line 3936 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3936  break;
3937 
3938  case 324:
3939 #line 1413 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3940  {
3941  (yyval.ast) = new AstNode(AST_GE, (yyvsp[-3].ast), (yyvsp[0].ast));
3942  append_attr((yyval.ast), (yyvsp[-1].al));
3943  }
3944 #line 3945 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3945  break;
3946 
3947  case 325:
3948 #line 1417 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3949  {
3950  (yyval.ast) = new AstNode(AST_GT, (yyvsp[-3].ast), (yyvsp[0].ast));
3951  append_attr((yyval.ast), (yyvsp[-1].al));
3952  }
3953 #line 3954 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3954  break;
3955 
3956  case 326:
3957 #line 1421 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3958  {
3959  (yyval.ast) = new AstNode(AST_ADD, (yyvsp[-3].ast), (yyvsp[0].ast));
3960  append_attr((yyval.ast), (yyvsp[-1].al));
3961  }
3962 #line 3963 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3963  break;
3964 
3965  case 327:
3966 #line 1425 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3967  {
3968  (yyval.ast) = new AstNode(AST_SUB, (yyvsp[-3].ast), (yyvsp[0].ast));
3969  append_attr((yyval.ast), (yyvsp[-1].al));
3970  }
3971 #line 3972 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3972  break;
3973 
3974  case 328:
3975 #line 1429 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3976  {
3977  (yyval.ast) = new AstNode(AST_MUL, (yyvsp[-3].ast), (yyvsp[0].ast));
3978  append_attr((yyval.ast), (yyvsp[-1].al));
3979  }
3980 #line 3981 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3981  break;
3982 
3983  case 329:
3984 #line 1433 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3985  {
3986  (yyval.ast) = new AstNode(AST_DIV, (yyvsp[-3].ast), (yyvsp[0].ast));
3987  append_attr((yyval.ast), (yyvsp[-1].al));
3988  }
3989 #line 3990 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3990  break;
3991 
3992  case 330:
3993 #line 1437 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
3994  {
3995  (yyval.ast) = new AstNode(AST_MOD, (yyvsp[-3].ast), (yyvsp[0].ast));
3996  append_attr((yyval.ast), (yyvsp[-1].al));
3997  }
3998 #line 3999 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
3999  break;
4000 
4001  case 331:
4002 #line 1441 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4003  {
4004  (yyval.ast) = new AstNode(AST_POW, (yyvsp[-3].ast), (yyvsp[0].ast));
4005  append_attr((yyval.ast), (yyvsp[-1].al));
4006  }
4007 #line 4008 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4008  break;
4009 
4010  case 332:
4011 #line 1445 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4012  {
4013  (yyval.ast) = new AstNode(AST_POS, (yyvsp[0].ast));
4014  append_attr((yyval.ast), (yyvsp[-1].al));
4015  }
4016 #line 4017 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4017  break;
4018 
4019  case 333:
4020 #line 1449 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4021  {
4022  (yyval.ast) = new AstNode(AST_NEG, (yyvsp[0].ast));
4023  append_attr((yyval.ast), (yyvsp[-1].al));
4024  }
4025 #line 4026 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4026  break;
4027 
4028  case 334:
4029 #line 1453 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4030  {
4031  (yyval.ast) = new AstNode(AST_LOGIC_AND, (yyvsp[-3].ast), (yyvsp[0].ast));
4032  append_attr((yyval.ast), (yyvsp[-1].al));
4033  }
4034 #line 4035 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4035  break;
4036 
4037  case 335:
4038 #line 1457 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4039  {
4040  (yyval.ast) = new AstNode(AST_LOGIC_OR, (yyvsp[-3].ast), (yyvsp[0].ast));
4041  append_attr((yyval.ast), (yyvsp[-1].al));
4042  }
4043 #line 4044 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4044  break;
4045 
4046  case 336:
4047 #line 1461 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4048  {
4049  (yyval.ast) = new AstNode(AST_LOGIC_NOT, (yyvsp[0].ast));
4050  append_attr((yyval.ast), (yyvsp[-1].al));
4051  }
4052 #line 4053 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4053  break;
4054 
4055  case 337:
4056 #line 1467 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4057  {
4058  (yyval.ast) = new AstNode(AST_CONCAT, (yyvsp[0].ast));
4059  }
4060 #line 4061 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4061  break;
4062 
4063  case 338:
4064 #line 1470 "frontends/verilog/verilog_parser.y" /* yacc.c:1646 */
4065  {
4066  (yyval.ast) = (yyvsp[0].ast);
4067  (yyval.ast)->children.push_back((yyvsp[-2].ast));
4068  }
4069 #line 4070 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4070  break;
4071 
4072 
4073 #line 4074 "frontends/verilog/verilog_parser.tab.c" /* yacc.c:1646 */
4074  default: break;
4075  }
4076  /* User semantic actions sometimes alter yychar, and that requires
4077  that yytoken be updated with the new translation. We take the
4078  approach of translating immediately before every use of yytoken.
4079  One alternative is translating here after every semantic action,
4080  but that translation would be missed if the semantic action invokes
4081  YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4082  if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4083  incorrect destructor might then be invoked immediately. In the
4084  case of YYERROR or YYBACKUP, subsequent parser actions might lead
4085  to an incorrect destructor call or verbose syntax error message
4086  before the lookahead is translated. */
4087  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4088 
4089  YYPOPSTACK (yylen);
4090  yylen = 0;
4091  YY_STACK_PRINT (yyss, yyssp);
4092 
4093  *++yyvsp = yyval;
4094 
4095  /* Now 'shift' the result of the reduction. Determine what state
4096  that goes to, based on the state we popped back to and the rule
4097  number reduced by. */
4098 
4099  yyn = yyr1[yyn];
4100 
4101  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4102  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4103  yystate = yytable[yystate];
4104  else
4105  yystate = yydefgoto[yyn - YYNTOKENS];
4106 
4107  goto yynewstate;
4108 
4109 
4110 /*--------------------------------------.
4111 | yyerrlab -- here on detecting error. |
4112 `--------------------------------------*/
4113 yyerrlab:
4114  /* Make sure we have latest lookahead translation. See comments at
4115  user semantic actions for why this is necessary. */
4116  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4117 
4118  /* If not already recovering from an error, report this error. */
4119  if (!yyerrstatus)
4120  {
4121  ++yynerrs;
4122 #if ! YYERROR_VERBOSE
4123  yyerror (YY_("syntax error"));
4124 #else
4125 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4126  yyssp, yytoken)
4127  {
4128  char const *yymsgp = YY_("syntax error");
4129  int yysyntax_error_status;
4130  yysyntax_error_status = YYSYNTAX_ERROR;
4131  if (yysyntax_error_status == 0)
4132  yymsgp = yymsg;
4133  else if (yysyntax_error_status == 1)
4134  {
4135  if (yymsg != yymsgbuf)
4136  YYSTACK_FREE (yymsg);
4137  yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4138  if (!yymsg)
4139  {
4140  yymsg = yymsgbuf;
4141  yymsg_alloc = sizeof yymsgbuf;
4142  yysyntax_error_status = 2;
4143  }
4144  else
4145  {
4146  yysyntax_error_status = YYSYNTAX_ERROR;
4147  yymsgp = yymsg;
4148  }
4149  }
4150  yyerror (yymsgp);
4151  if (yysyntax_error_status == 2)
4152  goto yyexhaustedlab;
4153  }
4154 # undef YYSYNTAX_ERROR
4155 #endif
4156  }
4157 
4158 
4159 
4160  if (yyerrstatus == 3)
4161  {
4162  /* If just tried and failed to reuse lookahead token after an
4163  error, discard it. */
4164 
4165  if (yychar <= YYEOF)
4166  {
4167  /* Return failure if at end of input. */
4168  if (yychar == YYEOF)
4169  YYABORT;
4170  }
4171  else
4172  {
4173  yydestruct ("Error: discarding",
4174  yytoken, &yylval);
4175  yychar = YYEMPTY;
4176  }
4177  }
4178 
4179  /* Else will try to reuse lookahead token after shifting the error
4180  token. */
4181  goto yyerrlab1;
4182 
4183 
4184 /*---------------------------------------------------.
4185 | yyerrorlab -- error raised explicitly by YYERROR. |
4186 `---------------------------------------------------*/
4187 yyerrorlab:
4188 
4189  /* Pacify compilers like GCC when the user code never invokes
4190  YYERROR and the label yyerrorlab therefore never appears in user
4191  code. */
4192  if (/*CONSTCOND*/ 0)
4193  goto yyerrorlab;
4194 
4195  /* Do not reclaim the symbols of the rule whose action triggered
4196  this YYERROR. */
4197  YYPOPSTACK (yylen);
4198  yylen = 0;
4199  YY_STACK_PRINT (yyss, yyssp);
4200  yystate = *yyssp;
4201  goto yyerrlab1;
4202 
4203 
4204 /*-------------------------------------------------------------.
4205 | yyerrlab1 -- common code for both syntax error and YYERROR. |
4206 `-------------------------------------------------------------*/
4207 yyerrlab1:
4208  yyerrstatus = 3; /* Each real token shifted decrements this. */
4209 
4210  for (;;)
4211  {
4212  yyn = yypact[yystate];
4213  if (!yypact_value_is_default (yyn))
4214  {
4215  yyn += YYTERROR;
4216  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4217  {
4218  yyn = yytable[yyn];
4219  if (0 < yyn)
4220  break;
4221  }
4222  }
4223 
4224  /* Pop the current state because it cannot handle the error token. */
4225  if (yyssp == yyss)
4226  YYABORT;
4227 
4228 
4229  yydestruct ("Error: popping",
4230  yystos[yystate], yyvsp);
4231  YYPOPSTACK (1);
4232  yystate = *yyssp;
4233  YY_STACK_PRINT (yyss, yyssp);
4234  }
4235 
4237  *++yyvsp = yylval;
4239 
4240 
4241  /* Shift the error token. */
4242  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4243 
4244  yystate = yyn;
4245  goto yynewstate;
4246 
4247 
4248 /*-------------------------------------.
4249 | yyacceptlab -- YYACCEPT comes here. |
4250 `-------------------------------------*/
4251 yyacceptlab:
4252  yyresult = 0;
4253  goto yyreturn;
4254 
4255 /*-----------------------------------.
4256 | yyabortlab -- YYABORT comes here. |
4257 `-----------------------------------*/
4258 yyabortlab:
4259  yyresult = 1;
4260  goto yyreturn;
4261 
4262 #if !defined yyoverflow || YYERROR_VERBOSE
4263 /*-------------------------------------------------.
4264 | yyexhaustedlab -- memory exhaustion comes here. |
4265 `-------------------------------------------------*/
4266 yyexhaustedlab:
4267  yyerror (YY_("memory exhausted"));
4268  yyresult = 2;
4269  /* Fall through. */
4270 #endif
4271 
4272 yyreturn:
4273  if (yychar != YYEMPTY)
4274  {
4275  /* Make sure we have latest lookahead translation. See comments at
4276  user semantic actions for why this is necessary. */
4277  yytoken = YYTRANSLATE (yychar);
4278  yydestruct ("Cleanup: discarding lookahead",
4279  yytoken, &yylval);
4280  }
4281  /* Do not reclaim the symbols of the rule whose action triggered
4282  this YYABORT or YYACCEPT. */
4283  YYPOPSTACK (yylen);
4284  YY_STACK_PRINT (yyss, yyssp);
4285  while (yyssp != yyss)
4286  {
4287  yydestruct ("Cleanup: popping",
4288  yystos[*yyssp], yyvsp);
4289  YYPOPSTACK (1);
4290  }
4291 #ifndef yyoverflow
4292  if (yyss != yyssa)
4293  YYSTACK_FREE (yyss);
4294 #endif
4295 #if YYERROR_VERBOSE
4296  if (yymsg != yymsgbuf)
4297  YYSTACK_FREE (yymsg);
4298 #endif
4299  return yyresult;
4300 }
static YOSYS_NAMESPACE_END void append_attr(AstNode *ast, std::map< std::string, AstNode * > *al)
std::map< std::string, AstNode * > * albuf
#define yychar
#define YYTRANSLATE(YYX)
struct AstNode * current_ast_mod
static std::string unescape_id(std::string str)
Definition: rtlil.h:257
#define YYFINAL
YOSYS_NAMESPACE_END void frontend_verilog_yyerror(char const *fmt,...)
#define YYABORT
std::vector< AstNode * > ast_stack
void log_error(const char *format,...)
Definition: log.cc:204
struct AstNode * current_function_or_task
AstNode * current_ast
Definition: ast.cc:57
static const yytype_uint16 yyr1[]
#define YYEMPTY
#define YYSTACK_FREE
#define YYNTOKENS
static const yytype_int16 yypgoto[]
struct AstNode * astbuf3
static const yytype_uint16 yystos[]
#define yypact_value_is_default(Yystate)
#define yytable_value_is_error(Yytable_value)
struct AstNode * astbuf2
int range_right
Definition: ast.h:159
static const yytype_int16 yytable[]
#define YY_REDUCE_PRINT(Rule)
yytype_int16 yyss_alloc
bool is_reg
Definition: ast.h:158
int GetSize(RTLIL::Wire *wire)
Definition: yosys.cc:334
#define YYINITDEPTH
#define log_assert(_assert_expr_)
Definition: log.h:85
#define yylex
std::map< std::string, YOSYS_NAMESPACE_PREFIX AST::AstNode * > * al
YYSTYPE yyvs_alloc
#define YYACCEPT
short int yytype_int16
static void free_attr(std::map< std::string, AstNode * > *al)
std::vector< char > case_type_stack
std::map< std::string, AstNode * > attr_list
#define YYDPRINTF(Args)
#define yyerror
#define YYSTACK_BYTES(N)
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
static void append_attr_clone(AstNode *ast, std::map< std::string, AstNode * > *al)
AstNodeType type
Definition: ast.h:146
#define YY_(Msgid)
int range_left
Definition: ast.h:159
#define YYLAST
std::map< std::string, int > port_stubs
#define YYMAXDEPTH
AstNode * clone()
Definition: ast.cc:208
#define NULL
void free(void *)
#define yynerrs
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
static const yytype_int16 yycheck[]
#define YYSIZE_T
bool is_signed
Definition: ast.h:158
std::string str
Definition: ast.h:156
std::vector< AstNode * > children
Definition: ast.h:149
AST::AstNode * const2ast(std::string code, char case_type=0, bool warn_z=false)
Definition: const2ast.cc:135
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
struct AstNode * astbuf1
static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep)
static const yytype_uint8 yyr2[]
std::map< std::string, AstNode * > default_attr_list
bool is_output
Definition: ast.h:158
#define yylval
static const yytype_uint16 yydefact[]
#define YYEOF
#define YYSTACK_ALLOC
int port_id
Definition: ast.h:159
#define YY_STACK_PRINT(Bottom, Top)
#define YYPOPSTACK(N)
static const yytype_int16 yypact[]
static const yytype_int16 yydefgoto[]
bool is_input
Definition: ast.h:158
#define YYTERROR

+ Here is the call graph for this function:

Variable Documentation

int frontend_verilog_yydebug
YYSTYPE frontend_verilog_yylval
int yychar

Definition at line 1709 of file verilog_parser.tab.cc.

const yytype_int16 yycheck[]
static

Definition at line 1012 of file verilog_parser.tab.cc.

int yydebug

Definition at line 1440 of file verilog_parser.tab.cc.

const yytype_uint16 yydefact[]
static

Definition at line 776 of file verilog_parser.tab.cc.

const yytype_int16 yydefgoto[]
static
Initial value:
=
{
-1, 1, 2, 5, 274, 7, 16, 275, 11, 31,
21, 22, 23, 65, 9, 35, 71, 187, 294, 246,
247, 293, 129, 192, 254, 297, 193, 249, 420, 356,
252, 308, 309, 41, 100, 101, 267, 43, 255, 434,
10, 72, 199, 341, 44, 138, 196, 131, 197, 28,
78, 140, 345, 207, 208, 399, 210, 370, 419, 496,
459, 329, 376, 330, 377, 568, 248, 331, 379, 380,
277, 454, 523, 488, 489, 209, 333, 381, 382, 334,
438, 441, 395, 504, 477, 511, 549, 478, 479, 480,
472, 535, 536, 554, 587, 555, 335, 439, 509, 440,
474, 545, 546, 385, 278, 336, 279, 280, 413, 447,
449, 596, 645, 520, 521, 518, 525, 337, 566, 648,
483, 595, 620, 599, 623, 624, 643, 557, 592, 593,
631, 617, 618, 66, 282, 347, 457, 287, 288, 289,
388, 435, 436, 432, 574, 500, 515, 430, 604, 531,
605, 572, 556, 68, 159, 93
}

Definition at line 867 of file verilog_parser.tab.cc.

YYSTYPE yylval

Definition at line 1712 of file verilog_parser.tab.cc.

int yynerrs

Definition at line 1714 of file verilog_parser.tab.cc.

const yytype_int16 yypact[]
static

Definition at line 704 of file verilog_parser.tab.cc.

const yytype_int16 yypgoto[]
static
Initial value:
=
{
-521, -521, -521, 111, 27, -521, -521, -1, -521, -521,
453, -521, 456, -11, -521, -521, -521, -521, -521, 200,
-521, -521, -521, -521, -194, 77, 255, -521, -521, -152,
-521, -521, 198, -51, 295, -18, -521, -521, -521, 256,
-232, -521, -521, -521, -521, -521, 244, -182, -521, -521,
379, -521, -521, -521, 243, -521, 258, -125, -166, 57,
-230, -521, -521, -521, -521, -7, -432, -521, -521, 99,
-231, -521, -521, -521, 2, -356, -521, -521, 100, -521,
-521, -521, -521, -521, -466, -521, -521, -521, 13, -521,
-521, -45, -521, -520, -521, -521, -521, -521, -521, -521,
-521, -521, -311, -338, -521, -521, -429, -318, -521, -521,
-521, -521, -521, -521, -521, -521, -521, 259, -521, -521,
-521, -521, -521, -521, -521, -521, -521, -521, -521, -521,
-521, -93, -521, -159, -521, 131, -521, 79, -521, 185,
121, 16, 298, -521, -521, -521, -521, -521, -475, -521,
-79, -521, -28, 483, -521, 403
}

Definition at line 846 of file verilog_parser.tab.cc.

const yytype_uint16 yyr1[]
static

Definition at line 1206 of file verilog_parser.tab.cc.

const yytype_uint8 yyr2[]
static

Definition at line 1245 of file verilog_parser.tab.cc.

const yytype_uint16 yyrline[]
static

Definition at line 573 of file verilog_parser.tab.cc.

const yytype_uint16 yystos[]
static

Definition at line 1136 of file verilog_parser.tab.cc.

const yytype_int16 yytable[]
static

Definition at line 890 of file verilog_parser.tab.cc.

const char* const yytname[]
static

Definition at line 615 of file verilog_parser.tab.cc.

const yytype_uint8 yytranslate[]
static

Definition at line 533 of file verilog_parser.tab.cc.