yosys-master
|
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "kernel/log.h"
#include "verilog_frontend.h"
#include "frontends/ast/ast.h"
#include "verilog_parser.tab.h"
#include <unistd.h>
Go to the source code of this file.
Data Structures | |
struct | yy_buffer_state |
struct | yy_trans_info |
Namespaces | |
VERILOG_FRONTEND | |
Typedefs | |
typedef signed char | flex_int8_t |
typedef short int | flex_int16_t |
typedef int | flex_int32_t |
typedef unsigned char | flex_uint8_t |
typedef unsigned short int | flex_uint16_t |
typedef unsigned int | flex_uint32_t |
typedef struct yy_buffer_state * | YY_BUFFER_STATE |
typedef size_t | yy_size_t |
typedef unsigned char | YY_CHAR |
typedef int | yy_state_type |
#define BEGIN (yy_start) = 1 + 2 * |
Definition at line 145 of file verilog_lexer.cc.
#define COMMENT 1 |
Definition at line 1022 of file verilog_lexer.cc.
#define ECHO do { if (fwrite( frontend_verilog_yytext, frontend_verilog_yyleng, 1, frontend_verilog_yyout )) {} } while (0) |
Definition at line 1116 of file verilog_lexer.cc.
#define EOB_ACT_CONTINUE_SCAN 0 |
Definition at line 188 of file verilog_lexer.cc.
#define EOB_ACT_END_OF_FILE 1 |
Definition at line 189 of file verilog_lexer.cc.
#define EOB_ACT_LAST_MATCH 2 |
Definition at line 190 of file verilog_lexer.cc.
#define FLEX_BETA |
Definition at line 33 of file verilog_lexer.cc.
#define FLEX_SCANNER |
Definition at line 28 of file verilog_lexer.cc.
#define FLEXINT_H |
Definition at line 49 of file verilog_lexer.cc.
#define frontend_verilog_yywrap | ( | n | ) | 1 |
Definition at line 376 of file verilog_lexer.cc.
#define IMPORT_DPI 5 |
Definition at line 1026 of file verilog_lexer.cc.
#define INITIAL 0 |
Definition at line 1021 of file verilog_lexer.cc.
#define INT16_MAX (32767) |
Definition at line 91 of file verilog_lexer.cc.
#define INT16_MIN (-32767-1) |
Definition at line 82 of file verilog_lexer.cc.
#define INT32_MAX (2147483647) |
Definition at line 94 of file verilog_lexer.cc.
#define INT32_MIN (-2147483647-1) |
Definition at line 85 of file verilog_lexer.cc.
#define INT8_MAX (127) |
Definition at line 88 of file verilog_lexer.cc.
#define INT8_MIN (-128) |
Definition at line 79 of file verilog_lexer.cc.
#define REJECT reject_used_but_not_detected |
Definition at line 939 of file verilog_lexer.cc.
#define STRING 2 |
Definition at line 1023 of file verilog_lexer.cc.
#define SV_KEYWORD | ( | _tok | ) |
Definition at line 1003 of file verilog_lexer.cc.
#define SYNOPSYS_FLAGS 4 |
Definition at line 1025 of file verilog_lexer.cc.
#define SYNOPSYS_TRANSLATE_OFF 3 |
Definition at line 1024 of file verilog_lexer.cc.
#define UINT16_MAX (65535U) |
Definition at line 100 of file verilog_lexer.cc.
#define UINT32_MAX (4294967295U) |
Definition at line 103 of file verilog_lexer.cc.
#define UINT8_MAX (255U) |
Definition at line 97 of file verilog_lexer.cc.
#define unput | ( | c | ) | yyunput( c, (yytext_ptr) ) |
Definition at line 221 of file verilog_lexer.cc.
#define YY_AT_BOL | ( | ) | (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) |
Definition at line 372 of file verilog_lexer.cc.
#define YY_BREAK break; |
Definition at line 1195 of file verilog_lexer.cc.
#define YY_BUF_SIZE 16384 |
Definition at line 171 of file verilog_lexer.cc.
#define YY_BUFFER_EOF_PENDING 2 |
Definition at line 288 of file verilog_lexer.cc.
#define YY_BUFFER_NEW 0 |
Definition at line 276 of file verilog_lexer.cc.
#define YY_BUFFER_NORMAL 1 |
Definition at line 277 of file verilog_lexer.cc.
#define yy_create_buffer frontend_verilog_yy_create_buffer |
Definition at line 9 of file verilog_lexer.cc.
#define YY_CURRENT_BUFFER |
Definition at line 304 of file verilog_lexer.cc.
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] |
Definition at line 311 of file verilog_lexer.cc.
#define YY_DECL int frontend_verilog_yylex (void) |
Definition at line 1183 of file verilog_lexer.cc.
#define YY_DECL_IS_OURS 1 |
Definition at line 1179 of file verilog_lexer.cc.
#define yy_delete_buffer frontend_verilog_yy_delete_buffer |
Definition at line 10 of file verilog_lexer.cc.
#define YY_DO_BEFORE_ACTION |
Definition at line 400 of file verilog_lexer.cc.
#define YY_END_OF_BUFFER 116 |
Definition at line 409 of file verilog_lexer.cc.
#define YY_END_OF_BUFFER_CHAR 0 |
Definition at line 160 of file verilog_lexer.cc.
#define YY_EXIT_FAILURE 2 |
Definition at line 2774 of file verilog_lexer.cc.
#define YY_EXTRA_TYPE void * |
Definition at line 1037 of file verilog_lexer.cc.
#define YY_FATAL_ERROR | ( | msg | ) | yy_fatal_error( msg ) |
Definition at line 1170 of file verilog_lexer.cc.
#define yy_flex_debug frontend_verilog_yy_flex_debug |
Definition at line 11 of file verilog_lexer.cc.
#define YY_FLEX_MAJOR_VERSION 2 |
Definition at line 29 of file verilog_lexer.cc.
#define YY_FLEX_MINOR_VERSION 5 |
Definition at line 30 of file verilog_lexer.cc.
#define YY_FLEX_SUBMINOR_VERSION 35 |
Definition at line 31 of file verilog_lexer.cc.
#define yy_flush_buffer frontend_verilog_yy_flush_buffer |
Definition at line 13 of file verilog_lexer.cc.
#define YY_FLUSH_BUFFER frontend_verilog_yy_flush_buffer(YY_CURRENT_BUFFER ) |
Definition at line 340 of file verilog_lexer.cc.
#define yy_init_buffer frontend_verilog_yy_init_buffer |
Definition at line 12 of file verilog_lexer.cc.
#define YY_INPUT | ( | buf, | |
result, | |||
max_size | |||
) | result = readsome(*VERILOG_FRONTEND::lexin, buf, max_size) |
Definition at line 1011 of file verilog_lexer.cc.
#define YY_INT_ALIGNED short int |
Definition at line 5 of file verilog_lexer.cc.
#define YY_LESS_LINENO | ( | n | ) |
Definition at line 199 of file verilog_lexer.cc.
#define yy_load_buffer_state frontend_verilog_yy_load_buffer_state |
Definition at line 14 of file verilog_lexer.cc.
#define YY_MORE_ADJ (yy_more_len) |
Definition at line 943 of file verilog_lexer.cc.
#define yy_new_buffer frontend_verilog_yy_create_buffer |
Definition at line 350 of file verilog_lexer.cc.
#define YY_NEW_FILE frontend_verilog_yyrestart(frontend_verilog_yyin ) |
Definition at line 158 of file verilog_lexer.cc.
#define YY_NULL 0 |
Definition at line 132 of file verilog_lexer.cc.
#define YY_NUM_RULES 115 |
Definition at line 408 of file verilog_lexer.cc.
#define YY_READ_BUF_SIZE 8192 |
Definition at line 1107 of file verilog_lexer.cc.
#define YY_RESTORE_YY_MORE_OFFSET |
Definition at line 944 of file verilog_lexer.cc.
#define YY_RULE_SETUP YY_USER_ACTION |
Definition at line 1198 of file verilog_lexer.cc.
#define YY_SC_TO_UI | ( | c | ) | ((unsigned int) (unsigned char) c) |
Definition at line 139 of file verilog_lexer.cc.
#define yy_set_bol | ( | at_bol | ) |
Definition at line 362 of file verilog_lexer.cc.
#define yy_set_interactive | ( | is_interactive | ) |
Definition at line 352 of file verilog_lexer.cc.
#define YY_SKIP_YYWRAP |
Definition at line 377 of file verilog_lexer.cc.
#define YY_START (((yy_start) - 1) / 2) |
Definition at line 151 of file verilog_lexer.cc.
#define YY_START_STACK_INCR 25 |
Definition at line 1165 of file verilog_lexer.cc.
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) |
Definition at line 177 of file verilog_lexer.cc.
#define YY_STATE_EOF | ( | state | ) | (YY_END_OF_BUFFER + state + 1) |
Definition at line 155 of file verilog_lexer.cc.
#define YY_STRUCT_YY_BUFFER_STATE |
Definition at line 229 of file verilog_lexer.cc.
#define yy_switch_to_buffer frontend_verilog_yy_switch_to_buffer |
Definition at line 15 of file verilog_lexer.cc.
#define YY_TYPEDEF_YY_BUFFER_STATE |
Definition at line 180 of file verilog_lexer.cc.
#define YY_TYPEDEF_YY_SIZE_T |
Definition at line 224 of file verilog_lexer.cc.
#define YY_USER_ACTION |
Definition at line 1190 of file verilog_lexer.cc.
#define yyalloc frontend_verilog_yyalloc |
Definition at line 24 of file verilog_lexer.cc.
#define yyconst |
Definition at line 128 of file verilog_lexer.cc.
#define yyfree frontend_verilog_yyfree |
Definition at line 26 of file verilog_lexer.cc.
#define yyin frontend_verilog_yyin |
Definition at line 16 of file verilog_lexer.cc.
#define yyleng frontend_verilog_yyleng |
Definition at line 17 of file verilog_lexer.cc.
#define yyless | ( | n | ) |
Definition at line 2786 of file verilog_lexer.cc.
#define yyless | ( | n | ) |
Definition at line 2786 of file verilog_lexer.cc.
#define yylex frontend_verilog_yylex |
Definition at line 18 of file verilog_lexer.cc.
#define yylineno frontend_verilog_yylineno |
Definition at line 19 of file verilog_lexer.cc.
#define yymore | ( | ) | ((yy_more_flag) = 1) |
Definition at line 942 of file verilog_lexer.cc.
#define yyout frontend_verilog_yyout |
Definition at line 20 of file verilog_lexer.cc.
#define yyrealloc frontend_verilog_yyrealloc |
Definition at line 25 of file verilog_lexer.cc.
#define yyrestart frontend_verilog_yyrestart |
Definition at line 21 of file verilog_lexer.cc.
#define YYSTATE YY_START |
Definition at line 152 of file verilog_lexer.cc.
#define YYTABLES_NAME "yytables" |
Definition at line 2979 of file verilog_lexer.cc.
#define yyterminate | ( | ) | return YY_NULL |
Definition at line 1160 of file verilog_lexer.cc.
#define yytext frontend_verilog_yytext |
Definition at line 22 of file verilog_lexer.cc.
#define yytext_ptr frontend_verilog_yytext |
Definition at line 390 of file verilog_lexer.cc.
#define yywrap frontend_verilog_yywrap |
Definition at line 23 of file verilog_lexer.cc.
typedef short int flex_int16_t |
Definition at line 71 of file verilog_lexer.cc.
typedef int flex_int32_t |
Definition at line 72 of file verilog_lexer.cc.
typedef signed char flex_int8_t |
Definition at line 70 of file verilog_lexer.cc.
typedef unsigned short int flex_uint16_t |
Definition at line 74 of file verilog_lexer.cc.
typedef unsigned int flex_uint32_t |
Definition at line 75 of file verilog_lexer.cc.
typedef unsigned char flex_uint8_t |
Definition at line 73 of file verilog_lexer.cc.
typedef struct yy_buffer_state* YY_BUFFER_STATE |
Definition at line 181 of file verilog_lexer.cc.
typedef unsigned char YY_CHAR |
Definition at line 379 of file verilog_lexer.cc.
typedef size_t yy_size_t |
Definition at line 225 of file verilog_lexer.cc.
typedef int yy_state_type |
Definition at line 383 of file verilog_lexer.cc.
void* frontend_verilog_avoid_input_warnings | ( | ) |
Definition at line 2986 of file verilog_lexer.cc.
YY_BUFFER_STATE frontend_verilog_yy_create_buffer | ( | FILE * | file, |
int | size | ||
) |
Allocate and initialize an input buffer state.
file | A readable stream. |
size | The character buffer size in bytes. When in doubt, use YY_BUF_SIZE . |
Definition at line 2487 of file verilog_lexer.cc.
void frontend_verilog_yy_delete_buffer | ( | YY_BUFFER_STATE | b | ) |
Destroy the buffer.
b | a buffer created with frontend_verilog_yy_create_buffer() |
Definition at line 2515 of file verilog_lexer.cc.
void frontend_verilog_yy_flush_buffer | ( | YY_BUFFER_STATE | b | ) |
Discard all buffered characters. On the next scan, YY_INPUT will be called.
b | the buffer state to be flushed, usually YY_CURRENT_BUFFER . |
Definition at line 2566 of file verilog_lexer.cc.
|
static |
Definition at line 2538 of file verilog_lexer.cc.
|
static |
YY_BUFFER_STATE frontend_verilog_yy_scan_buffer | ( | char * | base, |
yy_size_t | size | ||
) |
Setup the input buffer state to scan directly from a user-specified character buffer.
base | the character buffer |
size | the size in bytes of the character buffer |
Definition at line 2693 of file verilog_lexer.cc.
YY_BUFFER_STATE frontend_verilog_yy_scan_bytes | ( | yyconst char * | yybytes, |
int | _yybytes_len | ||
) |
Setup the input buffer state to scan the given bytes. The next call to frontend_verilog_yylex() will scan from a copy of bytes.
yybytes | the byte buffer to scan |
_yybytes_len | the number of bytes in the buffer pointed to by bytes. |
Definition at line 2743 of file verilog_lexer.cc.
YY_BUFFER_STATE frontend_verilog_yy_scan_string | ( | yyconst char * | yystr | ) |
Setup the input buffer state to scan a string. The next call to frontend_verilog_yylex() will scan from a copy of str.
yystr | a NUL-terminated string to scan |
Definition at line 2730 of file verilog_lexer.cc.
void frontend_verilog_yy_switch_to_buffer | ( | YY_BUFFER_STATE | new_buffer | ) |
Switch to a different input buffer.
new_buffer | The new input buffer. |
Definition at line 2442 of file verilog_lexer.cc.
void * frontend_verilog_yyalloc | ( | yy_size_t | size | ) |
Definition at line 2957 of file verilog_lexer.cc.
|
static |
Definition at line 2644 of file verilog_lexer.cc.
void frontend_verilog_yyfree | ( | void * | ptr | ) |
Definition at line 2974 of file verilog_lexer.cc.
int frontend_verilog_yyget_debug | ( | void | ) |
Definition at line 2870 of file verilog_lexer.cc.
YY_EXTRA_TYPE frontend_verilog_yyget_extra | ( | void | ) |
FILE * frontend_verilog_yyget_in | ( | void | ) |
int frontend_verilog_yyget_leng | ( | void | ) |
int frontend_verilog_yyget_lineno | ( | void | ) |
Get the current line number.
Definition at line 2805 of file verilog_lexer.cc.
FILE * frontend_verilog_yyget_out | ( | void | ) |
char * frontend_verilog_yyget_text | ( | void | ) |
int frontend_verilog_yylex | ( | void | ) |
int frontend_verilog_yylex_destroy | ( | void | ) |
Definition at line 2912 of file verilog_lexer.cc.
void frontend_verilog_yypop_buffer_state | ( | void | ) |
Removes and deletes the top of the stack, if present. The next element becomes the new top.
Definition at line 2625 of file verilog_lexer.cc.
void frontend_verilog_yypush_buffer_state | ( | YY_BUFFER_STATE | new_buffer | ) |
Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.
new_buffer | The new state. |
Definition at line 2595 of file verilog_lexer.cc.
void * frontend_verilog_yyrealloc | ( | void * | ptr, |
yy_size_t | size | ||
) |
void frontend_verilog_yyrestart | ( | FILE * | input_file | ) |
Immediately switch to a different input stream.
input_file | A readable stream. |
INITIAL
. Definition at line 2425 of file verilog_lexer.cc.
void frontend_verilog_yyset_debug | ( | int | debug_flag | ) |
Definition at line 2875 of file verilog_lexer.cc.
void frontend_verilog_yyset_extra | ( | YY_EXTRA_TYPE | user_defined | ) |
void frontend_verilog_yyset_in | ( | FILE * | in_str | ) |
Set the input stream. This does not discard the current input buffer.
in_str | A readable stream. |
Definition at line 2860 of file verilog_lexer.cc.
void frontend_verilog_yyset_lineno | ( | int | line_number | ) |
Set the current line number.
line_number |
Definition at line 2848 of file verilog_lexer.cc.
void frontend_verilog_yyset_out | ( | FILE * | out_str | ) |
Definition at line 2865 of file verilog_lexer.cc.
if | ( | ! | yy_init | ) |
Definition at line 1214 of file verilog_lexer.cc.
|
static |
Definition at line 2345 of file verilog_lexer.cc.
int isatty | ( | int | ) |
while | ( | 1 | ) |
Definition at line 1240 of file verilog_lexer.cc.
|
static |
|
static |
Definition at line 2777 of file verilog_lexer.cc.
|
static |
Definition at line 2152 of file verilog_lexer.cc.
|
static |
|
static |
|
static |
int frontend_verilog_yy_flex_debug = 0 |
Definition at line 934 of file verilog_lexer.cc.
FILE * frontend_verilog_yyin = (FILE *) 0 |
Definition at line 381 of file verilog_lexer.cc.
int frontend_verilog_yyleng |
Definition at line 316 of file verilog_lexer.cc.
int frontend_verilog_yylineno = 1 |
Definition at line 387 of file verilog_lexer.cc.
FILE * frontend_verilog_yyout = (FILE *) 0 |
Definition at line 381 of file verilog_lexer.cc.
char * frontend_verilog_yytext |
Definition at line 945 of file verilog_lexer.cc.
|
static |
Definition at line 417 of file verilog_lexer.cc.
register int yy_act |
Definition at line 1207 of file verilog_lexer.cc.
|
static |
Definition at line 526 of file verilog_lexer.cc.
register char * yy_bp |
Definition at line 1206 of file verilog_lexer.cc.
|
static |
Stack as an array.
Definition at line 296 of file verilog_lexer.cc.
|
static |
capacity of stack.
Definition at line 295 of file verilog_lexer.cc.
|
static |
index of top of stack.
Definition at line 294 of file verilog_lexer.cc.
|
static |
Definition at line 319 of file verilog_lexer.cc.
|
static |
Definition at line 793 of file verilog_lexer.cc.
register char* yy_cp |
Definition at line 1206 of file verilog_lexer.cc.
YY_DECL |
The main scanner function which does all the work.
Definition at line 1204 of file verilog_lexer.cc.
|
static |
Definition at line 596 of file verilog_lexer.cc.
|
static |
Definition at line 326 of file verilog_lexer.cc.
|
static |
Definition at line 483 of file verilog_lexer.cc.
|
static |
Definition at line 314 of file verilog_lexer.cc.
|
static |
Definition at line 320 of file verilog_lexer.cc.
|
static |
Definition at line 931 of file verilog_lexer.cc.
|
static |
Definition at line 930 of file verilog_lexer.cc.
|
static |
Definition at line 515 of file verilog_lexer.cc.
|
static |
Definition at line 940 of file verilog_lexer.cc.
|
static |
Definition at line 941 of file verilog_lexer.cc.
|
static |
Definition at line 315 of file verilog_lexer.cc.
|
static |
Definition at line 666 of file verilog_lexer.cc.
|
static |
Definition at line 921 of file verilog_lexer.cc.
|
static |
Definition at line 321 of file verilog_lexer.cc.