GDB (xrefs)
|
#include "defs.h"
#include <ctype.h>
#include "expression.h"
#include "value.h"
#include "parser-defs.h"
#include "language.h"
#include "c-lang.h"
#include "go-lang.h"
#include "charset.h"
#include "block.h"
#include "expop.h"
#include "yy-remap.h"
#include <limits.h>
Go to the source code of this file.
Classes | |
union | go_exp_YYSTYPE |
union | go_exp_yyalloc |
struct | go_token |
struct | go_token_and_value |
Macros | |
#define | YYBISON 30802 |
#define | YYBISON_VERSION "3.8.2" |
#define | YYSKELETON_NAME "yacc.c" |
#define | YYPURE 0 |
#define | YYPUSH 0 |
#define | YYPULL 1 |
#define | parse_type(ps) builtin_type (ps->gdbarch ()) |
#define | GDB_YY_REMAP_PREFIX go_ |
#define | YY_CAST(Type, Val) ((Type) (Val)) |
#define | YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) |
#define | YY_NULLPTRPTR ((void*)0) |
#define | YYTOKENTYPE |
#define | YYEMPTY -2 |
#define | YYEOF 0 |
#define | YYerror 256 |
#define | YYUNDEF 257 |
#define | INT 258 |
#define | FLOAT 259 |
#define | RAW_STRING 260 |
#define | STRING 261 |
#define | CHAR 262 |
#define | NAME 263 |
#define | TYPENAME 264 |
#define | COMPLETE 265 |
#define | NAME_OR_INT 266 |
#define | TRUE_KEYWORD 267 |
#define | FALSE_KEYWORD 268 |
#define | STRUCT_KEYWORD 269 |
#define | INTERFACE_KEYWORD 270 |
#define | TYPE_KEYWORD 271 |
#define | CHAN_KEYWORD 272 |
#define | SIZEOF_KEYWORD 273 |
#define | LEN_KEYWORD 274 |
#define | CAP_KEYWORD 275 |
#define | NEW_KEYWORD 276 |
#define | IOTA_KEYWORD 277 |
#define | NIL_KEYWORD 278 |
#define | CONST_KEYWORD 279 |
#define | DOTDOTDOT 280 |
#define | ENTRY 281 |
#define | ERROR 282 |
#define | BYTE_KEYWORD 283 |
#define | DOLLAR_VARIABLE 284 |
#define | ASSIGN_MODIFY 285 |
#define | ABOVE_COMMA 286 |
#define | OROR 287 |
#define | ANDAND 288 |
#define | ANDNOT 289 |
#define | EQUAL 290 |
#define | NOTEQUAL 291 |
#define | LEQ 292 |
#define | GEQ 293 |
#define | LSH 294 |
#define | RSH 295 |
#define | UNARY 296 |
#define | INCREMENT 297 |
#define | DECREMENT 298 |
#define | LEFT_ARROW 299 |
#define | go_exp_YYSTYPE_IS_TRIVIAL 1 |
#define | go_exp_YYSTYPE_IS_DECLARED 1 |
#define | YYPTRDIFF_T long |
#define | YYPTRDIFF_MAXIMUM LONG_MAX |
#define | YYSIZE_T unsigned |
#define | YYSIZE_MAXIMUM |
#define | YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) |
#define | YY_(Msgid) Msgid |
#define | YY_ATTRIBUTE_PURE |
#define | YY_ATTRIBUTE_UNUSED |
#define | YY_USE(E) ((void) (E)) |
#define | YY_INITIAL_VALUE(Value) Value |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
#define | YY_IGNORE_MAYBE_UNINITIALIZED_END |
#define | YY_IGNORE_USELESS_CAST_BEGIN |
#define | YY_IGNORE_USELESS_CAST_END |
#define | YY_ASSERT(E) ((void) (0 && (E))) |
#define | YYSTACK_ALLOC YYMALLOC |
#define | YYSTACK_FREE YYFREE |
#define | YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define | YYMALLOC xmalloc |
#define | YYFREE xfree |
#define | YYSTACK_GAP_MAXIMUM (YYSIZEOF (union go_exp_yyalloc) - 1) |
#define | YYSTACK_BYTES(N) |
#define | YYCOPY_NEEDED 1 |
#define | YYSTACK_RELOCATE(Stack_alloc, Stack) |
#define | YYCOPY(Dst, Src, Count) |
#define | YYFINAL 40 |
#define | YYLAST 451 |
#define | YYNTOKENS 68 |
#define | YYNNTS 13 |
#define | YYNRULES 69 |
#define | YYNSTATES 122 |
#define | YYMAXUTOK 299 |
#define | YYTRANSLATE(YYX) |
#define | YY_ACCESSING_SYMBOL(State) YY_CAST (go_exp_yysymbol_kind_t, yystos[State]) |
#define | YYPACT_NINF (-42) |
#define | yypact_value_is_default(Yyn) ((Yyn) == YYPACT_NINF) |
#define | YYTABLE_NINF (-1) |
#define | yytable_value_is_error(Yyn) 0 |
#define | yyerrok (yyerrstatus = 0) |
#define | yyclearin (yychar = YYEMPTY) |
#define | YYACCEPT goto yyacceptlab |
#define | YYABORT goto yyabortlab |
#define | YYERROR goto yyerrorlab |
#define | YYNOMEM goto yyexhaustedlab |
#define | YYRECOVERING() (!!yyerrstatus) |
#define | YYBACKUP(Token, Value) |
#define | YYERRCODE YYUNDEF |
#define | YYDPRINTF(Args) |
#define | YY_SYMBOL_PRINT(Title, Kind, 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 enum yytokentype | yytoken_kind_t |
typedef union go_exp_YYSTYPE | go_exp_YYSTYPE |
typedef enum go_exp_yysymbol_kind_t | go_exp_yysymbol_kind_t |
typedef signed char | yytype_int8 |
typedef short | yytype_int16 |
typedef unsigned char | yytype_uint8 |
typedef unsigned short | yytype_uint16 |
typedef yytype_int8 | yy_state_t |
typedef int | yy_state_fast_t |
Functions | |
int | yyparse (void) |
static int | yylex (void) |
static void | yyerror (const char *) |
static int | parse_number (struct parser_state *, const char *, int, int, go_exp_YYSTYPE *) |
void * | xmalloc (YYSIZE_T) |
void | xfree (void *) |
static const char * | yysymbol_name (go_exp_yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED |
static void | yy_symbol_value_print (FILE *yyo, go_exp_yysymbol_kind_t yykind, go_exp_YYSTYPE const *const yyvaluep) |
static void | yy_symbol_print (FILE *yyo, go_exp_yysymbol_kind_t yykind, go_exp_YYSTYPE const *const yyvaluep) |
static void | yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) |
static void | yy_reduce_print (yy_state_t *yyssp, go_exp_YYSTYPE *yyvsp, int yyrule) |
static void | yydestruct (const char *yymsg, go_exp_yysymbol_kind_t yykind, go_exp_YYSTYPE *yyvaluep) |
static int | parse_string_or_char (const char *tokptr, const char **outptr, struct typed_stoken *value, int *host_chars) |
static int | lex_one_token (struct parser_state *par_state) |
static struct stoken | build_packaged_name (const char *package, int package_len, const char *name, int name_len) |
static int | package_name_p (const char *name, const struct block *block) |
static int | classify_unsafe_function (struct stoken function_name) |
static int | classify_packaged_name (const struct block *block) |
static int | classify_name (struct parser_state *par_state, const struct block *block) |
Variables | |
static struct parser_state * | pstate = NULL |
int | yydebug |
go_exp_YYSTYPE | yylval |
static const yytype_int8 | yytranslate [] |
static const yytype_int16 | yyrline [] |
static const char *const | yytname [] |
static const yytype_int16 | yypact [] |
static const yytype_int8 | yydefact [] |
static const yytype_int8 | yypgoto [] |
static const yytype_int8 | yydefgoto [] |
static const yytype_int8 | yytable [] |
static const yytype_int8 | yycheck [] |
static const yytype_int8 | yystos [] |
static const yytype_int8 | yyr1 [] |
static const yytype_int8 | yyr2 [] |
int | yychar |
int | yynerrs |
static struct obstack | tempbuf |
static int | tempbuf_init |
static const struct go_token | tokentab3 [] |
static const struct go_token | tokentab2 [] |
static const struct go_token | ident_tokens [] |
static int | saw_name_at_eof |
static int | last_was_structop |
static int | paren_depth |
static std::vector< go_token_and_value > | token_fifo |
static int | popping |
static auto_obstack | name_obstack |
#define CHAR 262 |
Definition at line 199 of file go-exp.c.
Referenced by lex_one_token(), and parse_string_or_char().
#define COMPLETE 265 |
Definition at line 202 of file go-exp.c.
Referenced by lex_one_token().
#define DOLLAR_VARIABLE 284 |
Definition at line 221 of file go-exp.c.
Referenced by lex_one_token().
#define ENTRY 281 |
Definition at line 218 of file go-exp.c.
Referenced by lex_one_token().
#define ERROR 282 |
Definition at line 219 of file go-exp.c.
Referenced by lex_one_token(), and parse_number().
#define FLOAT 259 |
Definition at line 196 of file go-exp.c.
Referenced by parse_number().
#define INT 258 |
Definition at line 195 of file go-exp.c.
Referenced by classify_name(), and parse_number().
#define NAME 263 |
Definition at line 200 of file go-exp.c.
Referenced by classify_name(), classify_packaged_name(), lex_one_token(), and yylex().
#define NAME_OR_INT 266 |
Definition at line 203 of file go-exp.c.
Referenced by classify_name().
#define parse_type | ( | ps | ) | builtin_type (ps->gdbarch ()) |
Definition at line 85 of file go-exp.c.
Referenced by parse_number(), and yyparse().
#define SIZEOF_KEYWORD 273 |
Definition at line 210 of file go-exp.c.
Referenced by classify_unsafe_function().
#define STRING 261 |
Definition at line 198 of file go-exp.c.
Referenced by parse_string_or_char().
#define TYPENAME 264 |
Definition at line 201 of file go-exp.c.
Referenced by classify_name().
#define YY_ACCESSING_SYMBOL | ( | State | ) | YY_CAST (go_exp_yysymbol_kind_t, yystos[State]) |
Accessing symbol of state STATE.
Definition at line 774 of file go-exp.c.
Referenced by yy_reduce_print(), and yyparse().
#define YY_ASSERT | ( | E | ) | ((void) (0 && (E))) |
#define YY_CAST | ( | Type, | |
Val ) ((Type) (Val)) |
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
Definition at line 550 of file go-exp.c.
Referenced by yy_symbol_value_print(), yydestruct(), and yyparse().
#define YY_IGNORE_MAYBE_UNINITIALIZED_END |
Definition at line 551 of file go-exp.c.
Referenced by yy_symbol_value_print(), yydestruct(), and yyparse().
#define YY_IGNORE_USELESS_CAST_BEGIN |
#define YY_IGNORE_USELESS_CAST_END |
#define YY_REDUCE_PRINT | ( | Rule | ) |
#define YY_STACK_PRINT | ( | Bottom, | |
Top ) |
#define YY_SYMBOL_PRINT | ( | Title, | |
Kind, | |||
Value, | |||
Location ) |
Definition at line 1070 of file go-exp.c.
Referenced by yydestruct(), and yyparse().
#define YY_USE | ( | E | ) | ((void) (E)) |
Definition at line 527 of file go-exp.c.
Referenced by yy_symbol_value_print(), and yydestruct().
#define YYACCEPT goto yyacceptlab |
#define YYBACKUP | ( | Token, | |
Value ) |
#define YYCOPY | ( | Dst, | |
Src, | |||
Count ) |
#define YYDPRINTF | ( | Args | ) |
#define YYNOMEM goto yyexhaustedlab |
#define YYNTOKENS 68 |
Definition at line 704 of file go-exp.c.
Referenced by yy_symbol_print(), and yyparse().
#define yypact_value_is_default | ( | Yyn | ) | ((Yyn) == YYPACT_NINF) |
#define YYSIZE_MAXIMUM |
#define YYSIZEOF | ( | X | ) | YY_CAST (YYPTRDIFF_T, sizeof (X)) |
#define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
#define YYSTACK_BYTES | ( | N | ) |
#define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union go_exp_yyalloc) - 1) |
#define YYSTACK_RELOCATE | ( | Stack_alloc, | |
Stack ) |
Definition at line 665 of file go-exp.c.
Referenced by yyparse().
#define yytable_value_is_error | ( | Yyn | ) | 0 |
#define YYTRANSLATE | ( | YYX | ) |
typedef enum go_exp_yysymbol_kind_t go_exp_yysymbol_kind_t |
typedef int yy_state_fast_t |
typedef yytype_int8 yy_state_t |
typedef enum yytokentype yytoken_kind_t |
typedef short yytype_int16 |
typedef signed char yytype_int8 |
typedef unsigned short yytype_uint16 |
typedef unsigned char yytype_uint8 |
enum yytokentype |
|
static |
Definition at line 2831 of file go-exp.c.
References stoken::length, name, name_obstack, and stoken::ptr.
Referenced by classify_name(), and yylex().
|
static |
Definition at line 2919 of file go-exp.c.
References block_symbol::block, build_packaged_name(), copy_name(), expr_builder::gdbarch(), go_block_package_name(), input_radix, INT, symtoken::is_a_field_of_this, expr_builder::language(), language_lookup_primitive_type(), stoken::length, lookup_symbol(), NAME, NAME_OR_INT, parse_number(), stoken::ptr, go_exp_YYSTYPE::ssym, symtoken::stoken, go_exp_YYSTYPE::sval, symtoken::sym, block_symbol::symbol, go_exp_YYSTYPE::tsym, type, ttype::type, field_of_this_result::type, TYPENAME, VAR_DOMAIN, and yylval.
Referenced by yylex().
|
static |
Definition at line 2892 of file go-exp.c.
References copy_name(), symtoken::is_a_field_of_this, lookup_symbol(), NAME, go_exp_YYSTYPE::ssym, go_exp_YYSTYPE::sval, symtoken::sym, block_symbol::symbol, field_of_this_result::type, VAR_DOMAIN, and yylval.
Referenced by yylex().
|
static |
Definition at line 2872 of file go-exp.c.
References copy_name(), SIZEOF_KEYWORD, go_exp_YYSTYPE::sval, and yylval.
Referenced by yylex().
|
static |
Definition at line 2536 of file go-exp.c.
References CHAR, parser_state::comma_terminates, COMPLETE, copy_name(), DOLLAR_VARIABLE, ENTRY, ERROR, ident_tokens, input_radix, last_was_structop, stoken::length, parser_state::lexptr, NAME, go_exp_YYSTYPE::opcode, paren_depth, parser_state::parse_completion, parse_number(), parse_string_or_char(), parser_state::prev_lexptr, pstate, stoken::ptr, saw_name_at_eof, go_exp_YYSTYPE::sval, token, tokentab2, tokentab3, go_exp_YYSTYPE::tsval, and yylval.
Referenced by yylex().
|
static |
Definition at line 2852 of file go-exp.c.
References symbol::aclass(), type::code(), LOC_TYPEDEF, lookup_symbol(), name, STRUCT_DOMAIN, block_symbol::symbol, and symbol::type().
Referenced by yylex().
|
static |
Definition at line 2205 of file go-exp.c.
References builtin_go_type::builtin_float32, builtin_go_type::builtin_float64, builtin_go_type(), ERROR, fits_in_type(), FLOAT, expr_builder::gdbarch(), gdbarch_int_bit(), gdbarch_long_bit(), gdbarch_long_long_bit(), input_radix, INT, parse_float(), parse_type, go_exp_YYSTYPE::type, go_exp_YYSTYPE::typed_val_float, go_exp_YYSTYPE::typed_val_int, and go_exp_YYSTYPE::val.
Referenced by classify_name(), lex_one_token(), and yyparse().
|
static |
Definition at line 2397 of file go-exp.c.
References C_CHAR, c_parse_escape(), C_STRING, CHAR, STRING, tempbuf, tempbuf_init, and value::type().
Referenced by lex_one_token().
void xfree | ( | void * | ) |
Referenced by yyparse().
|
static |
Definition at line 1144 of file go-exp.c.
References YY_ACCESSING_SYMBOL, yy_symbol_print(), YYFPRINTF, yyr2, yyrline, yyrule, yyssp, and yyvsp.
|
static |
|
static |
Definition at line 1105 of file go-exp.c.
References yy_symbol_value_print(), YYFPRINTF, YYNTOKENS, and yysymbol_name().
Referenced by yy_reduce_print().
|
static |
Definition at line 1087 of file go-exp.c.
References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, and YY_USE.
Referenced by yy_symbol_print().
|
static |
Definition at line 1206 of file go-exp.c.
References YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_SYMBOL_PRINT, and YY_USE.
Referenced by yyparse().
|
static |
Definition at line 3107 of file go-exp.c.
References parser_state::lexptr, parser_state::prev_lexptr, and pstate.
|
static |
Definition at line 3007 of file go-exp.c.
References build_packaged_name(), classify_name(), classify_packaged_name(), classify_unsafe_function(), copy_name(), parser_state::expression_context_block, stoken::length, lex_one_token(), NAME, package_name_p(), popping, pstate, stoken::ptr, go_exp_YYSTYPE::sval, go_token_and_value::token, token_fifo, go_token_and_value::value, and yylval.
Referenced by yyparse().
int yyparse | ( | void | ) |
Definition at line 1236 of file go-exp.c.
References parser_state::arglist_len, parser_state::block_tracker, check_typedef(), copy_name(), parser_state::end_arglist(), expr_builder::gdbarch(), have_full_symbols(), have_partial_symbols(), symbol::is_argument(), stoken_vector::len, type::length(), typed_stoken::length, lookup_bound_minimal_symbol(), lookup_pointer_type(), parser_state::mark_struct_expression(), bound_minimal_symbol::minsym, parse_number(), parse_type, parser_state::pop(), parser_state::pop_vector(), pstate, stoken::ptr, typed_stoken::ptr, parser_state::push(), parser_state::push_c_string(), parser_state::push_dollar(), parser_state::push_new(), parser_state::start_arglist(), symbol::symbol(), block_symbol::symbol, symbol_read_needs_frame(), stoken_vector::tokens, go_exp_YYSTYPE::type, typed_stoken::type, go_exp_YYSTYPE::typed_val_int, innermost_block_tracker::update(), go_exp_YYSTYPE::val, parser_state::wrap(), parser_state::wrap2(), xfree(), xmalloc(), YY_, YY_ACCESSING_SYMBOL, YY_ASSERT, YY_CAST, YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN, YY_IGNORE_MAYBE_UNINITIALIZED_END, YY_IGNORE_USELESS_CAST_BEGIN, YY_IGNORE_USELESS_CAST_END, YY_REDUCE_PRINT, YY_STACK_PRINT, YY_SYMBOL_PRINT, YYABORT, YYACCEPT, yychar, yycheck, yydefact, yydefgoto, yydestruct(), YYDPRINTF, YYEMPTY, YYEOF, YYerror, YYERROR, yyerror, YYFINAL, YYINITDEPTH, YYLAST, yylen, yylex(), yylhs, yylloc, yylval, YYMAXDEPTH, yynerrs, YYNOMEM, YYNSTATES, YYNTOKENS, yypact, yypact_value_is_default, yypgoto, YYPOPSTACK, YYPTRDIFF_T, yyr1, yyr2, YYSIZE_T, YYSIZEOF, yyss, go_exp_yyalloc::yyss_alloc, yyssp, YYSTACK_ALLOC, YYSTACK_BYTES, YYSTACK_FREE, YYSTACK_RELOCATE, yystacksize, yystate, YYSYMBOL_YYEMPTY, YYSYMBOL_YYEOF, YYSYMBOL_YYerror, yytable, yytable_value_is_error, YYTRANSLATE, YYUNDEF, yyval, yyvs, go_exp_yyalloc::yyvs_alloc, and yyvsp.
|
static |
|
static |
Definition at line 2503 of file go-exp.c.
Referenced by lex_one_token().
|
static |
Definition at line 2528 of file go-exp.c.
Referenced by lex_one_token().
|
static |
Definition at line 2824 of file go-exp.c.
Referenced by build_packaged_name().
|
static |
Definition at line 2531 of file go-exp.c.
Referenced by lex_one_token().
|
static |
|
static |
Definition at line 2523 of file go-exp.c.
Referenced by lex_one_token().
|
static |
Definition at line 2386 of file go-exp.c.
Referenced by parse_string_or_char().
|
static |
Definition at line 2387 of file go-exp.c.
Referenced by parse_string_or_char().
|
static |
|
static |
Definition at line 2477 of file go-exp.c.
Referenced by lex_one_token().
|
static |
Definition at line 2469 of file go-exp.c.
Referenced by lex_one_token().
|
static |
|
static |
Definition at line 840 of file go-exp.c.
Referenced by yyparse().
|
static |
go_exp_YYSTYPE yylval |
Definition at line 1224 of file go-exp.c.
Referenced by classify_name(), classify_packaged_name(), classify_unsafe_function(), lex_one_token(), yylex(), and yyparse().
|
static |
Definition at line 820 of file go-exp.c.
Referenced by yyparse().
|
static |
|
static |
Definition at line 994 of file go-exp.c.
Referenced by yyparse().
|
static |
Definition at line 1006 of file go-exp.c.
Referenced by yy_reduce_print(), and yyparse().
|
static |
Definition at line 761 of file go-exp.c.
Referenced by yy_reduce_print().
|
static |
|
static |
|
static |
Definition at line 783 of file go-exp.c.
Referenced by yysymbol_name().
|
static |