Ruby  2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
parse.c File Reference
#include "ruby/ruby.h"
#include "ruby/st.h"
#include "ruby/encoding.h"
#include "internal.h"
#include "node.h"
#include "parse.h"
#include "symbol.h"
#include "regenc.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include "probes.h"
#include <stddef.h>
#include "ruby/regex.h"
#include "ruby/util.h"
#include "lex.c"

Go to the source code of this file.

Data Structures

struct  vtable
 
struct  local_vars
 
struct  token_info
 
struct  parser_params
 
struct  rb_strterm_literal_struct
 
struct  rb_strterm_heredoc_struct
 
struct  rb_strterm_struct
 
union  yyalloc
 
struct  magic_comment
 
struct  reg_named_capture_assign_t
 

Macros

#define YYBISON   1
 
#define YYBISON_VERSION   "3.0.4"
 
#define YYSKELETON_NAME   "yacc.c"
 
#define YYPURE   1
 
#define YYPUSH   0
 
#define YYPULL   1
 
#define YYDEBUG   1
 
#define YYERROR_VERBOSE   1
 
#define YYSTACK_USE_ALLOCA   0
 
#define YYLTYPE   rb_code_location_t
 
#define YYLTYPE_IS_DECLARED   1
 
#define WARN_PAST_SCOPE   0
 
#define TAB_WIDTH   8
 
#define yydebug   (p->debug) /* disable the global variable definition */
 
#define YYMALLOC(size)   rb_parser_malloc(p, (size))
 
#define YYREALLOC(ptr, size)   rb_parser_realloc(p, (ptr), (size))
 
#define YYCALLOC(nelem, size)   rb_parser_calloc(p, (nelem), (size))
 
#define YYFREE(ptr)   rb_parser_free(p, (ptr))
 
#define YYFPRINTF   rb_parser_printf
 
#define YYPRINT(out, tok, val)   parser_token_value_print(p, (tok), &(val))
 
#define YY_LOCATION_PRINT(File, loc)
 
#define YYLLOC_DEFAULT(Current, Rhs, N)
 
#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC(Current)   rb_parser_set_location_from_strterm_heredoc(p, &p->lex.strterm->u.heredoc, &(Current))
 
#define RUBY_SET_YYLLOC_OF_NONE(Current)   rb_parser_set_location_of_none(p, &(Current))
 
#define RUBY_SET_YYLLOC(Current)   rb_parser_set_location(p, &(Current))
 
#define RUBY_INIT_YYLLOC()
 
#define DEF_EXPR(n)   EXPR_##n = (1 << EXPR_##n##_bit)
 
#define IS_lex_state_for(x, ls)   ((x) & (ls))
 
#define IS_lex_state_all_for(x, ls)   (((x) & (ls)) == (ls))
 
#define IS_lex_state(ls)   IS_lex_state_for(p->lex.state, (ls))
 
#define IS_lex_state_all(ls)   IS_lex_state_all_for(p->lex.state, (ls))
 
#define SET_LEX_STATE(ls)
 
#define SHOW_BITSTACK(stack, name)   (p->debug ? rb_parser_show_bitstack(p, stack, name, __LINE__) : (void)0)
 
#define BITSTACK_PUSH(stack, n)   (((p->stack) = ((p->stack)<<1)|((n)&1)), SHOW_BITSTACK(p->stack, #stack"(push)"))
 
#define BITSTACK_POP(stack)   (((p->stack) = (p->stack) >> 1), SHOW_BITSTACK(p->stack, #stack"(pop)"))
 
#define BITSTACK_SET_P(stack)   (SHOW_BITSTACK(p->stack, #stack), (p->stack)&1)
 
#define BITSTACK_SET(stack, n)   ((p->stack)=(n), SHOW_BITSTACK(p->stack, #stack"(set)"))
 
#define COND_PUSH(n)   BITSTACK_PUSH(cond_stack, (n))
 
#define COND_POP()   BITSTACK_POP(cond_stack)
 
#define COND_P()   BITSTACK_SET_P(cond_stack)
 
#define COND_SET(n)   BITSTACK_SET(cond_stack, (n))
 
#define CMDARG_PUSH(n)   BITSTACK_PUSH(cmdarg_stack, (n))
 
#define CMDARG_POP()   BITSTACK_POP(cmdarg_stack)
 
#define CMDARG_P()   BITSTACK_SET_P(cmdarg_stack)
 
#define CMDARG_SET(n)   BITSTACK_SET(cmdarg_stack, (n))
 
#define NUMPARAM_ID_P(id)   numparam_id_p(id)
 
#define NUMPARAM_ID_TO_IDX(id)   (unsigned int)(((id) >> ID_SCOPE_SHIFT) - tNUMPARAM_1 + 1)
 
#define NUMPARAM_IDX_TO_ID(idx)   TOKEN2LOCALID((tNUMPARAM_1 + (idx) - 1))
 
#define DVARS_INHERIT   ((void*)1)
 
#define DVARS_TOPSCOPE   NULL
 
#define DVARS_TERMINAL_P(tbl)   ((tbl) == DVARS_INHERIT || (tbl) == DVARS_TOPSCOPE)
 
#define intern_cstr(n, l, en)   rb_intern3(n,l,en)
 
#define STR_NEW(ptr, len)   rb_enc_str_new((ptr),(len),p->enc)
 
#define STR_NEW0()   rb_enc_str_new(0,0,p->enc)
 
#define STR_NEW2(ptr)   rb_enc_str_new((ptr),strlen(ptr),p->enc)
 
#define STR_NEW3(ptr, len, e, func)   parser_str_new((ptr),(len),(e),(func),p->enc)
 
#define TOK_INTERN()   intern_cstr(tok(p), toklen(p), p->enc)
 
#define yyerror0(msg)   parser_yyerror(p, NULL, (msg))
 
#define yyerror1(loc, msg)   parser_yyerror(p, (loc), (msg))
 
#define yyerror(yylloc, p, msg)   parser_yyerror(p, yylloc, msg)
 
#define token_flush(ptr)   ((ptr)->lex.ptok = (ptr)->lex.pcur)
 
#define compile_for_eval   (p->parent_iseq != 0)
 
#define token_column   ((int)(p->lex.ptok - p->lex.pbeg))
 
#define CALL_Q_P(q)   ((q) == TOKEN2VAL(tANDDOT))
 
#define NODE_CALL_Q(q)   (CALL_Q_P(q) ? NODE_QCALL : NODE_CALL)
 
#define NEW_QCALL(q, r, m, a, loc)   NEW_NODE(NODE_CALL_Q(q),r,m,a,loc)
 
#define lambda_beginning_p()   (p->lex.lpar_beg == p->lex.paren_nest)
 
#define rb_node_newnode(type, a1, a2, a3, loc)   node_newnode(p, (type), (a1), (a2), (a3), (loc))
 
#define yyparse   ruby_yyparse
 
#define new_nil(loc)   NEW_NIL(loc)
 
#define value_expr(node)   value_expr_gen(p, (node) = remove_begin(node))
 
#define make_list(list, loc)   ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))
 
#define get_id(id)   (id)
 
#define get_value(val)   (val)
 
#define get_num(num)   (num)
 
#define dyna_var(p, id)   local_var(p, id)
 
#define METHOD_NOT   '!'
 
#define idFWD_REST   '*'
 
#define idFWD_KWREST   0
 
#define idFWD_BLOCK   '&'
 
#define RE_OPTION_ONCE   (1<<16)
 
#define RE_OPTION_ENCODING_SHIFT   8
 
#define RE_OPTION_ENCODING(e)   (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)
 
#define RE_OPTION_ENCODING_IDX(o)   (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)
 
#define RE_OPTION_ENCODING_NONE(o)   ((o)&RE_OPTION_ARG_ENCODING_NONE)
 
#define RE_OPTION_MASK   0xff
 
#define RE_OPTION_ARG_ENCODING_NONE   32
 
#define HERETERM_LENGTH_BITS   ((SIZEOF_VALUE - 1) * CHAR_BIT - 1)
 
#define HERETERM_LENGTH_MAX   ((1U << HERETERM_LENGTH_BITS) - 1)
 
#define STRTERM_HEREDOC   IMEMO_FL_USER0
 
#define yytnamerr(yyres, yystr)   (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)
 
#define TOKEN2ID(tok)
 
#define ID2VAL(id)   (id)
 
#define TOKEN2VAL(t)   ID2VAL(t)
 
#define KWD2EID(t, v)   keyword_##t
 
#define Qnone   0
 
#define Qnull   0
 
#define ifndef_ripper(x)   (x)
 
#define rb_warn0(fmt)   WARN_CALL(WARN_ARGS(fmt, 1))
 
#define rb_warn1(fmt, a)   WARN_CALL(WARN_ARGS(fmt, 2), (a))
 
#define rb_warn2(fmt, a, b)   WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))
 
#define rb_warn3(fmt, a, b, c)   WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))
 
#define rb_warn4(fmt, a, b, c, d)   WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))
 
#define rb_warning0(fmt)   WARNING_CALL(WARNING_ARGS(fmt, 1))
 
#define rb_warning1(fmt, a)   WARNING_CALL(WARNING_ARGS(fmt, 2), (a))
 
#define rb_warning2(fmt, a, b)   WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))
 
#define rb_warning3(fmt, a, b, c)   WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))
 
#define rb_warning4(fmt, a, b, c, d)   WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))
 
#define rb_warn0L(l, fmt)   WARN_CALL(WARN_ARGS_L(l, fmt, 1))
 
#define rb_warn1L(l, fmt, a)   WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))
 
#define rb_warn2L(l, fmt, a, b)   WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))
 
#define rb_warn3L(l, fmt, a, b, c)   WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))
 
#define rb_warn4L(l, fmt, a, b, c, d)   WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
 
#define rb_warning0L(l, fmt)   WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))
 
#define rb_warning1L(l, fmt, a)   WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))
 
#define rb_warning2L(l, fmt, a, b)   WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))
 
#define rb_warning3L(l, fmt, a, b, c)   WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))
 
#define rb_warning4L(l, fmt, a, b, c, d)   WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))
 
#define WARN_S_L(s, l)   s
 
#define WARN_S(s)   s
 
#define WARN_I(i)   i
 
#define WARN_ID(i)   rb_id2name(i)
 
#define WARN_IVAL(i)   NUM2INT(i)
 
#define PRIsWARN   PRIsVALUE
 
#define WARN_ARGS(fmt, n)   WARN_ARGS_L(p->ruby_sourceline,fmt,n)
 
#define WARN_ARGS_L(l, fmt, n)   p->ruby_sourcefile, (l), (fmt)
 
#define WARN_CALL   rb_compile_warn
 
#define WARNING_ARGS(fmt, n)   WARN_ARGS(fmt,n)
 
#define WARNING_ARGS_L(l, fmt, n)   WARN_ARGS_L(l,fmt,n)
 
#define WARNING_CALL   rb_compile_warning
 
#define compile_error   parser_compile_error
 
#define WARN_EOL(tok)
 
#define YY_NULLPTR   0
 
#define YYERROR_VERBOSE   1
 
#define YY_YY_Y_TAB_H_INCLUDED
 
#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 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   13832
 
#define YYNTOKENS   154
 
#define YYNNTS   265
 
#define YYNRULES   757
 
#define YYNSTATES   1241
 
#define YYUNDEFTOK   2
 
#define YYMAXUTOK   353
 
#define YYTRANSLATE(YYX)   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
#define YYPACT_NINF   -1056
 
#define yypact_value_is_default(Yystate)   (!!((Yystate) == (-1056)))
 
#define YYTABLE_NINF   -758
 
#define yytable_value_is_error(Yytable_value)   (!!((Yytable_value) == (-758)))
 
#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 YYRHSLOC(Rhs, K)   ((Rhs)[K])
 
#define YYDPRINTF(Args)
 
#define YY_SYMBOL_PRINT(Title, Type, Value, Location)
 
#define yy_stack_print(b, t)   ruby_parser_yy_stack_print(b, t, p)
 
#define YY_STACK_PRINT(Bottom, Top)
 
#define YY_REDUCE_PRINT(Rule)
 
#define YYINITDEPTH   200
 
#define YYMAXDEPTH   10000
 
#define YYCASE_(N, S)
 
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
 
#define YYSYNTAX_ERROR
 
#define yylval   (*p->lval)
 
#define set_yylval_node(x)
 
#define set_yylval_str(x)
 
#define set_yylval_literal(x)
 
#define set_yylval_num(x)   (yylval.num = (x))
 
#define set_yylval_id(x)   (yylval.id = (x))
 
#define set_yylval_name(x)   (yylval.id = (x))
 
#define yylval_id()   (yylval.id)
 
#define set_yylval_noname()   set_yylval_id(keyword_nil)
 
#define literal_flush(p, ptr)   ((p)->lex.ptok = (ptr))
 
#define dispatch_scan_event(p, t)   ((void)0)
 
#define dispatch_delayed_token(p, t)   ((void)0)
 
#define has_delayed_token(p)   (0)
 
#define CSI_BEGIN   "\033["
 
#define CSI_SGR   "m"
 
#define vtable_alloc(prev)   vtable_alloc_gen(p, __LINE__, prev)
 
#define vtable_free(tbl)   vtable_free_gen(p, __LINE__, #tbl, tbl)
 
#define vtable_add(tbl, id)   vtable_add_gen(p, __LINE__, #tbl, tbl, id)
 
#define vtable_pop(tbl, n)   vtable_pop_gen(p, __LINE__, #tbl, tbl, n)
 
#define RUBY_DTRACE_PARSE_HOOK(name)
 
#define STR_FUNC_ESCAPE   0x01
 
#define STR_FUNC_EXPAND   0x02
 
#define STR_FUNC_REGEXP   0x04
 
#define STR_FUNC_QWORDS   0x08
 
#define STR_FUNC_SYMBOL   0x10
 
#define STR_FUNC_INDENT   0x20
 
#define STR_FUNC_LABEL   0x40
 
#define STR_FUNC_LIST   0x4000
 
#define STR_FUNC_TERM   0x8000
 
#define lex_goto_eol(p)   ((p)->lex.pcur = (p)->lex.pend)
 
#define lex_eol_p(p)   ((p)->lex.pcur >= (p)->lex.pend)
 
#define lex_eol_n_p(p, n)   ((p)->lex.pcur+(n) >= (p)->lex.pend)
 
#define peek(p, c)   peek_n(p, (c), 0)
 
#define peek_n(p, c, n)   (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])
 
#define peekc(p)   peekc_n(p, 0)
 
#define peekc_n(p, n)   (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])
 
#define add_delayed_token(p, tok, end)   ((void)(tok), (void)(end))
 
#define was_bol(p)   ((p)->lex.pcur == (p)->lex.pbeg + 1)
 
#define tokfix(p)   ((p)->tokenbuf[(p)->tokidx]='\0')
 
#define tok(p)   (p)->tokenbuf
 
#define toklen(p)   (p)->tokidx
 
#define tokcopy(p, n)   memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))
 
#define WARN_SPACE_CHAR(c, prefix)   rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))
 
#define ESCAPE_CONTROL   1
 
#define ESCAPE_META   2
 
#define mixed_error(enc1, enc2)   (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))
 
#define mixed_escape(beg, enc1, enc2)   (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))
 
#define NEW_STRTERM(func, term, paren)   new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0)
 
#define flush_string_content(p, enc)   ((void)(enc))
 
#define BIT(c, idx)   (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
 
#define SPECIAL_PUNCT(idx)
 
#define IS_ARG()   IS_lex_state(EXPR_ARG_ANY)
 
#define IS_END()   IS_lex_state(EXPR_END_ANY)
 
#define IS_BEG()   (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))
 
#define IS_SPCARG(c)   (IS_ARG() && space_seen && !ISSPACE(c))
 
#define IS_LABEL_POSSIBLE()
 
#define IS_LABEL_SUFFIX(n)   (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))
 
#define IS_AFTER_OPERATOR()   IS_lex_state(EXPR_FNAME | EXPR_DOT)
 
#define unterminated_literal(mesg)   yyerror0(mesg)
 
#define NUM_SUFFIX_R   (1<<0)
 
#define NUM_SUFFIX_I   (1<<1)
 
#define NUM_SUFFIX_ALL   3
 
#define dispatch_heredoc_end(p)   ((void)0)
 
#define str_copy(_s, _p, _n)
 
#define ambiguous_operator(tok, op, syn)
 
#define warn_balanced(tok, op, syn)
 
#define LVAR_USED   ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
 
#define nd_once_body(node)   (nd_type(node) == NODE_ONCE ? (node)->nd_body : node)
 
#define WARN_LOCATION(type)
 
#define subnodes(n1, n2)
 
#define SWITCH_BY_COND_TYPE(t, w, arg)
 
#define HEAPCNT(n, size)   ((n) * (size) / sizeof(YYSTYPE))
 
#define NEWHEAP()   rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)
 
#define ADD2HEAP(new, cnt, ptr)
 

Typedefs

typedef VALUE stack_type
 
typedef struct token_info token_info
 
typedef struct rb_strterm_struct rb_strterm_t
 
typedef struct rb_strterm_heredoc_struct rb_strterm_heredoc_t
 
typedef struct rb_strterm_literal_struct rb_strterm_literal_t
 
typedef unsigned char yytype_uint8
 
typedef signed char yytype_int8
 
typedef unsigned short int yytype_uint16
 
typedef short int yytype_int16
 
typedef long(* rb_magic_comment_length_t) (struct parser_params *p, const char *name, long len)
 
typedef void(* rb_magic_comment_setter_t) (struct parser_params *p, const char *name, const char *val)
 

Enumerations

enum  lex_state_bits {
  EXPR_BEG_bit, EXPR_END_bit, EXPR_ENDARG_bit, EXPR_ENDFN_bit,
  EXPR_ARG_bit, EXPR_CMDARG_bit, EXPR_MID_bit, EXPR_FNAME_bit,
  EXPR_DOT_bit, EXPR_CLASS_bit, EXPR_LABEL_bit, EXPR_LABELED_bit,
  EXPR_FITEM_bit, EXPR_MAX_STATE, EXPR_BEG_bit, EXPR_END_bit,
  EXPR_ENDARG_bit, EXPR_ENDFN_bit, EXPR_ARG_bit, EXPR_CMDARG_bit,
  EXPR_MID_bit, EXPR_FNAME_bit, EXPR_DOT_bit, EXPR_CLASS_bit,
  EXPR_LABEL_bit, EXPR_LABELED_bit, EXPR_FITEM_bit, EXPR_MAX_STATE
}
 
enum  lex_state_e {
  DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG),
  DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG),
  DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG),
  DEF_EXPR =(BEG), DEF_EXPR =(BEG), EXPR_VALUE = EXPR_BEG, EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS),
  EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG), EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN), EXPR_NONE = 0, DEF_EXPR =(BEG),
  DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG),
  DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG),
  DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG), DEF_EXPR =(BEG),
  DEF_EXPR =(BEG), EXPR_VALUE = EXPR_BEG, EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS), EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG),
  EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN), EXPR_NONE = 0
}
 
enum  { ORDINAL_PARAM = -1, NO_PARAM = 0, NUMPARAM_MAX = 9 }
 
enum  string_type {
  str_label = STR_FUNC_LABEL, str_squote = (0), str_dquote = (STR_FUNC_EXPAND), str_xquote = (STR_FUNC_EXPAND),
  str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND), str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST), str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST), str_ssym = (STR_FUNC_SYMBOL),
  str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND), str_label = STR_FUNC_LABEL, str_squote = (0), str_dquote = (STR_FUNC_EXPAND),
  str_xquote = (STR_FUNC_EXPAND), str_regexp = (STR_FUNC_REGEXP|STR_FUNC_ESCAPE|STR_FUNC_EXPAND), str_sword = (STR_FUNC_QWORDS|STR_FUNC_LIST), str_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND|STR_FUNC_LIST),
  str_ssym = (STR_FUNC_SYMBOL), str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
}
 
enum  cond_type {
  COND_IN_OP, COND_IN_COND, COND_IN_FF, COND_IN_OP,
  COND_IN_COND, COND_IN_FF
}
 

Functions

RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_parser_reg_compile (struct parser_params *p, VALUE str, int options)
 
int rb_reg_fragment_setenc (struct parser_params *, VALUE, int)
 
enum lex_state_e rb_parser_trace_lex_state (struct parser_params *, enum lex_state_e, enum lex_state_e, int)
 
VALUE rb_parser_lex_state_name (enum lex_state_e state)
 
void rb_parser_show_bitstack (struct parser_params *, stack_type, const char *, int)
 
 PRINTF_ARGS (void rb_parser_fatal(struct parser_params *p, const char *fmt,...), 2, 3)
 
YYLTYPErb_parser_set_location_from_strterm_heredoc (struct parser_params *p, rb_strterm_heredoc_t *here, YYLTYPE *yylloc)
 
YYLTYPErb_parser_set_location_of_none (struct parser_params *p, YYLTYPE *yylloc)
 
YYLTYPErb_parser_set_location (struct parser_params *p, YYLTYPE *yylloc)
 
 STATIC_ASSERT (rb_strterm_heredoc_t, sizeof(rb_strterm_heredoc_t)<=4 *SIZEOF_VALUE)
 
void rb_strterm_mark (VALUE obj)
 
size_t rb_yytnamerr (struct parser_params *p, char *yyres, const char *yystr)
 
 PRINTF_ARGS (static void parser_compile_error(struct parser_params *, const char *fmt,...), 2, 3)
 
int yyparse (struct parser_params *p)
 
rb_ast_trb_parser_compile_string (VALUE vparser, const char *f, VALUE s, int line)
 
rb_ast_trb_parser_compile_string_path (VALUE vparser, VALUE f, VALUE s, int line)
 
VALUE rb_io_gets_internal (VALUE io)
 
rb_ast_trb_parser_compile_file_path (VALUE vparser, VALUE fname, VALUE file, int start)
 
rb_ast_trb_parser_compile_generic (VALUE vparser, VALUE(*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start)
 
void rb_parser_fatal (struct parser_params *p, const char *fmt,...)
 
void rb_parser_set_options (VALUE vparser, int print, int loop, int chomp, int split)
 
void rb_parser_warn_location (VALUE vparser, int warn)
 
void rb_init_parse (void)
 
const struct kwtablerb_reserved_word (const char *str, unsigned int len)
 
VALUE rb_parser_new (void)
 
VALUE rb_parser_set_context (VALUE vparser, const struct rb_iseq_struct *base, int main)
 
VALUE rb_parser_end_seen_p (VALUE vparser)
 
VALUE rb_parser_encoding (VALUE vparser)
 
VALUE rb_parser_set_yydebug (VALUE self, VALUE flag)
 
VALUE rb_parser_get_debug_output (VALUE self)
 
VALUE rb_parser_set_debug_output (VALUE self, VALUE output)
 
voidrb_parser_malloc (struct parser_params *p, size_t size)
 
voidrb_parser_calloc (struct parser_params *p, size_t nelem, size_t size)
 
voidrb_parser_realloc (struct parser_params *p, void *ptr, size_t size)
 
void rb_parser_free (struct parser_params *p, void *ptr)
 
void rb_parser_printf (struct parser_params *p, const char *fmt,...)
 

Variables

const RUBY_FUNC_EXPORTED unsigned int ruby_global_name_punct_bits [(0x7e - 0x20+31)/32]
 

Macro Definition Documentation

◆ _Noreturn

#define _Noreturn   YY_ATTRIBUTE ((__noreturn__))

Definition at line 1307 of file parse.c.

◆ ADD2HEAP

#define ADD2HEAP (   new,
  cnt,
  ptr 
)
Value:
((p->heap = (new))->ptr = (ptr), \
(new)->cnt = (cnt), (ptr))

Definition at line 19329 of file parse.c.

◆ add_delayed_token

#define add_delayed_token (   p,
  tok,
  end 
)    ((void)(tok), (void)(end))

Definition at line 12965 of file parse.c.

◆ ambiguous_operator

#define ambiguous_operator (   tok,
  op,
  syn 
)
Value:
( \
rb_warning0("`"op"' after local variable or literal is interpreted as binary operator"), \
rb_warning0("even though it seems like "syn""))

Definition at line 14798 of file parse.c.

◆ BIT

#define BIT (   c,
  idx 
)    (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)

Definition at line 13739 of file parse.c.

◆ BITSTACK_POP

#define BITSTACK_POP (   stack)    (((p->stack) = (p->stack) >> 1), SHOW_BITSTACK(p->stack, #stack"(pop)"))

Definition at line 189 of file parse.c.

◆ BITSTACK_PUSH

#define BITSTACK_PUSH (   stack,
  n 
)    (((p->stack) = ((p->stack)<<1)|((n)&1)), SHOW_BITSTACK(p->stack, #stack"(push)"))

Definition at line 188 of file parse.c.

◆ BITSTACK_SET

#define BITSTACK_SET (   stack,
  n 
)    ((p->stack)=(n), SHOW_BITSTACK(p->stack, #stack"(set)"))

Definition at line 191 of file parse.c.

◆ BITSTACK_SET_P

#define BITSTACK_SET_P (   stack)    (SHOW_BITSTACK(p->stack, #stack), (p->stack)&1)

Definition at line 190 of file parse.c.

◆ CALL_Q_P

#define CALL_Q_P (   q)    ((q) == TOKEN2VAL(tANDDOT))

Definition at line 427 of file parse.c.

◆ CMDARG_P

#define CMDARG_P ( )    BITSTACK_SET_P(cmdarg_stack)

Definition at line 204 of file parse.c.

◆ CMDARG_POP

#define CMDARG_POP ( )    BITSTACK_POP(cmdarg_stack)

Definition at line 203 of file parse.c.

◆ CMDARG_PUSH

#define CMDARG_PUSH (   n)    BITSTACK_PUSH(cmdarg_stack, (n))

Definition at line 202 of file parse.c.

◆ CMDARG_SET

#define CMDARG_SET (   n)    BITSTACK_SET(cmdarg_stack, (n))

Definition at line 205 of file parse.c.

◆ compile_error

#define compile_error   parser_compile_error

Definition at line 1008 of file parse.c.

◆ compile_for_eval

#define compile_for_eval   (p->parent_iseq != 0)

Definition at line 422 of file parse.c.

◆ COND_P

#define COND_P ( )    BITSTACK_SET_P(cond_stack)

Definition at line 197 of file parse.c.

◆ COND_POP

#define COND_POP ( )    BITSTACK_POP(cond_stack)

Definition at line 196 of file parse.c.

◆ COND_PUSH

#define COND_PUSH (   n)    BITSTACK_PUSH(cond_stack, (n))

Definition at line 195 of file parse.c.

◆ COND_SET

#define COND_SET (   n)    BITSTACK_SET(cond_stack, (n))

Definition at line 198 of file parse.c.

◆ CSI_BEGIN

#define CSI_BEGIN   "\033["

◆ CSI_SGR

#define CSI_SGR   "m"

◆ DEF_EXPR

#define DEF_EXPR (   n)    EXPR_##n = (1 << EXPR_##n##_bit)

Definition at line 152 of file parse.c.

◆ dispatch_delayed_token

#define dispatch_delayed_token (   p,
 
)    ((void)0)

Definition at line 12244 of file parse.c.

◆ dispatch_heredoc_end

#define dispatch_heredoc_end (   p)    ((void)0)

Definition at line 14223 of file parse.c.

◆ dispatch_scan_event

#define dispatch_scan_event (   p,
 
)    ((void)0)

Definition at line 12243 of file parse.c.

◆ DVARS_INHERIT

#define DVARS_INHERIT   ((void*)1)

Definition at line 247 of file parse.c.

◆ DVARS_TERMINAL_P

#define DVARS_TERMINAL_P (   tbl)    ((tbl) == DVARS_INHERIT || (tbl) == DVARS_TOPSCOPE)

Definition at line 249 of file parse.c.

◆ DVARS_TOPSCOPE

#define DVARS_TOPSCOPE   NULL

Definition at line 248 of file parse.c.

◆ dyna_var

#define dyna_var (   p,
  id 
)    local_var(p, id)

Definition at line 677 of file parse.c.

◆ ESCAPE_CONTROL

#define ESCAPE_CONTROL   1

Definition at line 13257 of file parse.c.

◆ ESCAPE_META

#define ESCAPE_META   2

Definition at line 13258 of file parse.c.

◆ flush_string_content

#define flush_string_content (   p,
  enc 
)    ((void)(enc))

Definition at line 13732 of file parse.c.

◆ get_id

#define get_id (   id)    (id)

Definition at line 587 of file parse.c.

◆ get_num

#define get_num (   num)    (num)

Definition at line 589 of file parse.c.

◆ get_value

#define get_value (   val)    (val)

Definition at line 588 of file parse.c.

◆ has_delayed_token

#define has_delayed_token (   p)    (0)

Definition at line 12245 of file parse.c.

◆ HEAPCNT

#define HEAPCNT (   n,
  size 
)    ((n) * (size) / sizeof(YYSTYPE))

Definition at line 19325 of file parse.c.

◆ HERETERM_LENGTH_BITS

#define HERETERM_LENGTH_BITS   ((SIZEOF_VALUE - 1) * CHAR_BIT - 1)

Definition at line 729 of file parse.c.

◆ HERETERM_LENGTH_MAX

#define HERETERM_LENGTH_MAX   ((1U << HERETERM_LENGTH_BITS) - 1)

◆ ID2VAL

#define ID2VAL (   id)    (id)

Definition at line 935 of file parse.c.

◆ idFWD_BLOCK

#define idFWD_BLOCK   '&'

Definition at line 699 of file parse.c.

◆ idFWD_KWREST

#define idFWD_KWREST   0

Definition at line 697 of file parse.c.

◆ idFWD_REST

#define idFWD_REST   '*'

Definition at line 693 of file parse.c.

◆ ifndef_ripper

#define ifndef_ripper (   x)    (x)

Definition at line 943 of file parse.c.

◆ intern_cstr

#define intern_cstr (   n,
  l,
  en 
)    rb_intern3(n,l,en)

Definition at line 375 of file parse.c.

◆ IS_AFTER_OPERATOR

#define IS_AFTER_OPERATOR ( )    IS_lex_state(EXPR_FNAME | EXPR_DOT)

Definition at line 13800 of file parse.c.

◆ IS_ARG

#define IS_ARG ( )    IS_lex_state(EXPR_ARG_ANY)

Definition at line 13792 of file parse.c.

◆ IS_BEG

#define IS_BEG ( )    (IS_lex_state(EXPR_BEG_ANY) || IS_lex_state_all(EXPR_ARG|EXPR_LABELED))

Definition at line 13794 of file parse.c.

◆ IS_END

#define IS_END ( )    IS_lex_state(EXPR_END_ANY)

Definition at line 13793 of file parse.c.

◆ IS_LABEL_POSSIBLE

#define IS_LABEL_POSSIBLE ( )
Value:
(\
(IS_lex_state(EXPR_LABEL|EXPR_ENDFN) && !cmd_state) || \
IS_ARG())

Definition at line 13796 of file parse.c.

◆ IS_LABEL_SUFFIX

#define IS_LABEL_SUFFIX (   n)    (peek_n(p, ':',(n)) && !peek_n(p, ':', (n)+1))

Definition at line 13799 of file parse.c.

◆ IS_lex_state

#define IS_lex_state (   ls)    IS_lex_state_for(p->lex.state, (ls))

Definition at line 174 of file parse.c.

◆ IS_lex_state_all

#define IS_lex_state_all (   ls)    IS_lex_state_all_for(p->lex.state, (ls))

Definition at line 175 of file parse.c.

◆ IS_lex_state_all_for

#define IS_lex_state_all_for (   x,
  ls 
)    (((x) & (ls)) == (ls))

Definition at line 173 of file parse.c.

◆ IS_lex_state_for

#define IS_lex_state_for (   x,
  ls 
)    ((x) & (ls))

Definition at line 172 of file parse.c.

◆ IS_SPCARG

#define IS_SPCARG (   c)    (IS_ARG() && space_seen && !ISSPACE(c))

Definition at line 13795 of file parse.c.

◆ KWD2EID

#define KWD2EID (   t,
  v 
)    keyword_##t

Definition at line 937 of file parse.c.

◆ lambda_beginning_p

#define lambda_beginning_p ( )    (p->lex.lpar_beg == p->lex.paren_nest)

Definition at line 431 of file parse.c.

◆ lex_eol_n_p

#define lex_eol_n_p (   p,
  n 
)    ((p)->lex.pcur+(n) >= (p)->lex.pend)

Definition at line 12943 of file parse.c.

◆ lex_eol_p

#define lex_eol_p (   p)    ((p)->lex.pcur >= (p)->lex.pend)

Definition at line 12942 of file parse.c.

◆ lex_goto_eol

#define lex_goto_eol (   p)    ((p)->lex.pcur = (p)->lex.pend)

Definition at line 12941 of file parse.c.

◆ literal_flush

#define literal_flush (   p,
  ptr 
)    ((p)->lex.ptok = (ptr))

Definition at line 12242 of file parse.c.

◆ LVAR_USED

#define LVAR_USED   ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))

Definition at line 16269 of file parse.c.

◆ make_list

#define make_list (   list,
  loc 
)    ((list) ? (nd_set_loc(list, loc), list) : NEW_ZLIST(loc))

Definition at line 567 of file parse.c.

◆ METHOD_NOT

#define METHOD_NOT   '!'

Definition at line 690 of file parse.c.

◆ mixed_error

#define mixed_error (   enc1,
  enc2 
)    (void)(erred || (parser_mixed_error(p, enc1, enc2), erred = true))

◆ mixed_escape

#define mixed_escape (   beg,
  enc1,
  enc2 
)    (void)(erred || (parser_mixed_escape(p, beg, enc1, enc2), erred = true))

◆ nd_once_body

#define nd_once_body (   node)    (nd_type(node) == NODE_ONCE ? (node)->nd_body : node)

Definition at line 16610 of file parse.c.

◆ new_nil

#define new_nil (   loc)    NEW_NIL(loc)

Definition at line 487 of file parse.c.

◆ NEW_QCALL

#define NEW_QCALL (   q,
  r,
  m,
  a,
  loc 
)    NEW_NODE(NODE_CALL_Q(q),r,m,a,loc)

Definition at line 429 of file parse.c.

◆ NEW_STRTERM

#define NEW_STRTERM (   func,
  term,
  paren 
)    new_strterm((VALUE)(func), (VALUE)(paren), (VALUE)(term), 0)

Definition at line 13707 of file parse.c.

◆ NEWHEAP

#define NEWHEAP ( )    rb_imemo_tmpbuf_parser_heap(0, p->heap, 0)

Definition at line 19328 of file parse.c.

◆ NODE_CALL_Q

#define NODE_CALL_Q (   q)    (CALL_Q_P(q) ? NODE_QCALL : NODE_CALL)

Definition at line 428 of file parse.c.

◆ NUM_SUFFIX_ALL

#define NUM_SUFFIX_ALL   3

Definition at line 14153 of file parse.c.

◆ NUM_SUFFIX_I

#define NUM_SUFFIX_I   (1<<1)

Definition at line 14152 of file parse.c.

◆ NUM_SUFFIX_R

#define NUM_SUFFIX_R   (1<<0)

Definition at line 14151 of file parse.c.

◆ NUMPARAM_ID_P

#define NUMPARAM_ID_P (   id)    numparam_id_p(id)

Definition at line 235 of file parse.c.

◆ NUMPARAM_ID_TO_IDX

#define NUMPARAM_ID_TO_IDX (   id)    (unsigned int)(((id) >> ID_SCOPE_SHIFT) - tNUMPARAM_1 + 1)

Definition at line 236 of file parse.c.

◆ NUMPARAM_IDX_TO_ID

#define NUMPARAM_IDX_TO_ID (   idx)    TOKEN2LOCALID((tNUMPARAM_1 + (idx) - 1))

Definition at line 237 of file parse.c.

◆ peek

#define peek (   p,
 
)    peek_n(p, (c), 0)

Definition at line 12944 of file parse.c.

◆ peek_n

#define peek_n (   p,
  c,
  n 
)    (!lex_eol_n_p(p, n) && (c) == (unsigned char)(p)->lex.pcur[n])

Definition at line 12945 of file parse.c.

◆ peekc

#define peekc (   p)    peekc_n(p, 0)

Definition at line 12946 of file parse.c.

◆ peekc_n

#define peekc_n (   p,
  n 
)    (lex_eol_n_p(p, n) ? -1 : (unsigned char)(p)->lex.pcur[n])

Definition at line 12947 of file parse.c.

◆ PRIsWARN

#define PRIsWARN   PRIsVALUE

Definition at line 1000 of file parse.c.

◆ Qnone

#define Qnone   0

Definition at line 941 of file parse.c.

◆ Qnull

#define Qnull   0

Definition at line 942 of file parse.c.

◆ rb_node_newnode

#define rb_node_newnode (   type,
  a1,
  a2,
  a3,
  loc 
)    node_newnode(p, (type), (a1), (a2), (a3), (loc))

Definition at line 459 of file parse.c.

◆ rb_warn0

#define rb_warn0 (   fmt)    WARN_CALL(WARN_ARGS(fmt, 1))

Definition at line 950 of file parse.c.

◆ rb_warn0L

#define rb_warn0L (   l,
  fmt 
)    WARN_CALL(WARN_ARGS_L(l, fmt, 1))

Definition at line 960 of file parse.c.

◆ rb_warn1

#define rb_warn1 (   fmt,
 
)    WARN_CALL(WARN_ARGS(fmt, 2), (a))

Definition at line 951 of file parse.c.

◆ rb_warn1L

#define rb_warn1L (   l,
  fmt,
 
)    WARN_CALL(WARN_ARGS_L(l, fmt, 2), (a))

Definition at line 961 of file parse.c.

◆ rb_warn2

#define rb_warn2 (   fmt,
  a,
 
)    WARN_CALL(WARN_ARGS(fmt, 3), (a), (b))

Definition at line 952 of file parse.c.

◆ rb_warn2L

#define rb_warn2L (   l,
  fmt,
  a,
 
)    WARN_CALL(WARN_ARGS_L(l, fmt, 3), (a), (b))

Definition at line 962 of file parse.c.

◆ rb_warn3

#define rb_warn3 (   fmt,
  a,
  b,
 
)    WARN_CALL(WARN_ARGS(fmt, 4), (a), (b), (c))

Definition at line 953 of file parse.c.

◆ rb_warn3L

#define rb_warn3L (   l,
  fmt,
  a,
  b,
 
)    WARN_CALL(WARN_ARGS_L(l, fmt, 4), (a), (b), (c))

Definition at line 963 of file parse.c.

◆ rb_warn4

#define rb_warn4 (   fmt,
  a,
  b,
  c,
 
)    WARN_CALL(WARN_ARGS(fmt, 5), (a), (b), (c), (d))

Definition at line 954 of file parse.c.

◆ rb_warn4L

#define rb_warn4L (   l,
  fmt,
  a,
  b,
  c,
 
)    WARN_CALL(WARN_ARGS_L(l, fmt, 5), (a), (b), (c), (d))

Definition at line 964 of file parse.c.

◆ rb_warning0

#define rb_warning0 (   fmt)    WARNING_CALL(WARNING_ARGS(fmt, 1))

Definition at line 955 of file parse.c.

◆ rb_warning0L

#define rb_warning0L (   l,
  fmt 
)    WARNING_CALL(WARNING_ARGS_L(l, fmt, 1))

Definition at line 965 of file parse.c.

◆ rb_warning1

#define rb_warning1 (   fmt,
 
)    WARNING_CALL(WARNING_ARGS(fmt, 2), (a))

Definition at line 956 of file parse.c.

◆ rb_warning1L

#define rb_warning1L (   l,
  fmt,
 
)    WARNING_CALL(WARNING_ARGS_L(l, fmt, 2), (a))

Definition at line 966 of file parse.c.

◆ rb_warning2

#define rb_warning2 (   fmt,
  a,
 
)    WARNING_CALL(WARNING_ARGS(fmt, 3), (a), (b))

Definition at line 957 of file parse.c.

◆ rb_warning2L

#define rb_warning2L (   l,
  fmt,
  a,
 
)    WARNING_CALL(WARNING_ARGS_L(l, fmt, 3), (a), (b))

Definition at line 967 of file parse.c.

◆ rb_warning3

#define rb_warning3 (   fmt,
  a,
  b,
 
)    WARNING_CALL(WARNING_ARGS(fmt, 4), (a), (b), (c))

Definition at line 958 of file parse.c.

◆ rb_warning3L

#define rb_warning3L (   l,
  fmt,
  a,
  b,
 
)    WARNING_CALL(WARNING_ARGS_L(l, fmt, 4), (a), (b), (c))

Definition at line 968 of file parse.c.

◆ rb_warning4

#define rb_warning4 (   fmt,
  a,
  b,
  c,
 
)    WARNING_CALL(WARNING_ARGS(fmt, 5), (a), (b), (c), (d))

Definition at line 959 of file parse.c.

◆ rb_warning4L

#define rb_warning4L (   l,
  fmt,
  a,
  b,
  c,
 
)    WARNING_CALL(WARNING_ARGS_L(l, fmt, 5), (a), (b), (c), (d))

Definition at line 969 of file parse.c.

◆ RE_OPTION_ARG_ENCODING_NONE

#define RE_OPTION_ARG_ENCODING_NONE   32

Definition at line 707 of file parse.c.

◆ RE_OPTION_ENCODING

#define RE_OPTION_ENCODING (   e)    (((e)&0xff)<<RE_OPTION_ENCODING_SHIFT)

Definition at line 703 of file parse.c.

◆ RE_OPTION_ENCODING_IDX

#define RE_OPTION_ENCODING_IDX (   o)    (((o)>>RE_OPTION_ENCODING_SHIFT)&0xff)

Definition at line 704 of file parse.c.

◆ RE_OPTION_ENCODING_NONE

#define RE_OPTION_ENCODING_NONE (   o)    ((o)&RE_OPTION_ARG_ENCODING_NONE)

Definition at line 705 of file parse.c.

◆ RE_OPTION_ENCODING_SHIFT

#define RE_OPTION_ENCODING_SHIFT   8

Definition at line 702 of file parse.c.

◆ RE_OPTION_MASK

#define RE_OPTION_MASK   0xff

Definition at line 706 of file parse.c.

◆ RE_OPTION_ONCE

#define RE_OPTION_ONCE   (1<<16)

Definition at line 701 of file parse.c.

◆ RUBY_DTRACE_PARSE_HOOK

#define RUBY_DTRACE_PARSE_HOOK (   name)
Value:
if (RUBY_DTRACE_PARSE_##name##_ENABLED()) { \
RUBY_DTRACE_PARSE_##name(p->ruby_sourcefile, p->ruby_sourceline); \
}

◆ RUBY_INIT_YYLLOC

#define RUBY_INIT_YYLLOC ( )
Value:
{ \
{p->ruby_sourceline, (int)(p->lex.ptok - p->lex.pbeg)}, \
{p->ruby_sourceline, (int)(p->lex.pcur - p->lex.pbeg)}, \
}

Definition at line 128 of file parse.c.

◆ RUBY_SET_YYLLOC

#define RUBY_SET_YYLLOC (   Current)    rb_parser_set_location(p, &(Current))

Definition at line 126 of file parse.c.

◆ RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC

#define RUBY_SET_YYLLOC_FROM_STRTERM_HEREDOC (   Current)    rb_parser_set_location_from_strterm_heredoc(p, &p->lex.strterm->u.heredoc, &(Current))

Definition at line 122 of file parse.c.

◆ RUBY_SET_YYLLOC_OF_NONE

#define RUBY_SET_YYLLOC_OF_NONE (   Current)    rb_parser_set_location_of_none(p, &(Current))

Definition at line 124 of file parse.c.

◆ SET_LEX_STATE

#define SET_LEX_STATE (   ls)
Value:
(p->lex.state = \
(p->debug ? \
rb_parser_trace_lex_state(p, p->lex.state, (ls), __LINE__) : \
(enum lex_state_e)(ls)))

Definition at line 177 of file parse.c.

◆ set_yylval_id

#define set_yylval_id (   x)    (yylval.id = (x))

Definition at line 12220 of file parse.c.

◆ set_yylval_literal

#define set_yylval_literal (   x)
Value:
do { \
set_yylval_node(NEW_LIT(x, &_cur_loc)); \
RB_OBJ_WRITTEN(p->ast, Qnil, x); \
} while(0)

Definition at line 12214 of file parse.c.

◆ set_yylval_name

#define set_yylval_name (   x)    (yylval.id = (x))

Definition at line 12221 of file parse.c.

◆ set_yylval_node

#define set_yylval_node (   x)
Value:
{ \
YYLTYPE _cur_loc; \
rb_parser_set_location(p, &_cur_loc); \
yylval.node = (x); \
}

Definition at line 12204 of file parse.c.

◆ set_yylval_noname

#define set_yylval_noname ( )    set_yylval_id(keyword_nil)

Definition at line 12239 of file parse.c.

◆ set_yylval_num

#define set_yylval_num (   x)    (yylval.num = (x))

Definition at line 12219 of file parse.c.

◆ set_yylval_str

#define set_yylval_str (   x)
Value:
do { \
set_yylval_node(NEW_STR(x, &_cur_loc)); \
RB_OBJ_WRITTEN(p->ast, Qnil, x); \
} while(0)

Definition at line 12209 of file parse.c.

◆ SHOW_BITSTACK

#define SHOW_BITSTACK (   stack,
  name 
)    (p->debug ? rb_parser_show_bitstack(p, stack, name, __LINE__) : (void)0)

Definition at line 187 of file parse.c.

◆ SPECIAL_PUNCT

#define SPECIAL_PUNCT (   idx)
Value:
( \
BIT('~', idx) | BIT('*', idx) | BIT('$', idx) | BIT('?', idx) | \
BIT('!', idx) | BIT('@', idx) | BIT('/', idx) | BIT('\\', idx) | \
BIT(';', idx) | BIT(',', idx) | BIT('.', idx) | BIT('=', idx) | \
BIT(':', idx) | BIT('<', idx) | BIT('>', idx) | BIT('\"', idx) | \
BIT('&', idx) | BIT('`', idx) | BIT('\'', idx) | BIT('+', idx) | \
BIT('0', idx))

Definition at line 13740 of file parse.c.

◆ str_copy

#define str_copy (   _s,
  _p,
  _n 
)
Value:
((_s) \
? (void)(rb_str_resize((_s), (_n)), \
MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
: (void)((_s) = STR_NEW((_p), (_n))))

◆ STR_FUNC_ESCAPE

#define STR_FUNC_ESCAPE   0x01

Definition at line 12902 of file parse.c.

◆ STR_FUNC_EXPAND

#define STR_FUNC_EXPAND   0x02

Definition at line 12903 of file parse.c.

◆ STR_FUNC_INDENT

#define STR_FUNC_INDENT   0x20

Definition at line 12907 of file parse.c.

◆ STR_FUNC_LABEL

#define STR_FUNC_LABEL   0x40

Definition at line 12908 of file parse.c.

◆ STR_FUNC_LIST

#define STR_FUNC_LIST   0x4000

Definition at line 12909 of file parse.c.

◆ STR_FUNC_QWORDS

#define STR_FUNC_QWORDS   0x08

Definition at line 12905 of file parse.c.

◆ STR_FUNC_REGEXP

#define STR_FUNC_REGEXP   0x04

Definition at line 12904 of file parse.c.

◆ STR_FUNC_SYMBOL

#define STR_FUNC_SYMBOL   0x10

Definition at line 12906 of file parse.c.

◆ STR_FUNC_TERM

#define STR_FUNC_TERM   0x8000

Definition at line 12910 of file parse.c.

◆ STR_NEW

#define STR_NEW (   ptr,
  len 
)    rb_enc_str_new((ptr),(len),p->enc)

Definition at line 377 of file parse.c.

◆ STR_NEW0

#define STR_NEW0 ( )    rb_enc_str_new(0,0,p->enc)

Definition at line 378 of file parse.c.

◆ STR_NEW2

#define STR_NEW2 (   ptr)    rb_enc_str_new((ptr),strlen(ptr),p->enc)

Definition at line 379 of file parse.c.

◆ STR_NEW3

#define STR_NEW3 (   ptr,
  len,
  e,
  func 
)    parser_str_new((ptr),(len),(e),(func),p->enc)

Definition at line 380 of file parse.c.

◆ STRTERM_HEREDOC

#define STRTERM_HEREDOC   IMEMO_FL_USER0

Definition at line 753 of file parse.c.

◆ subnodes

#define subnodes (   n1,
  n2 
)
Value:
((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
(!node->n2) ? (body = &node->n1, 1) : \
(reduce_nodes(p, &node->n1), body = &node->n2, 1))

◆ SWITCH_BY_COND_TYPE

#define SWITCH_BY_COND_TYPE (   t,
  w,
  arg 
)
Value:
switch (t) { \
case COND_IN_OP: break; \
case COND_IN_COND: rb_##w##0(arg "literal in condition"); break; \
case COND_IN_FF: rb_##w##0(arg "literal in flip-flop"); break; \
}

Definition at line 17824 of file parse.c.

◆ TAB_WIDTH

#define TAB_WIDTH   8

Definition at line 94 of file parse.c.

◆ tok

#define tok (   p)    (p)->tokenbuf

Definition at line 13051 of file parse.c.

◆ TOK_INTERN

#define TOK_INTERN ( )    intern_cstr(tok(p), toklen(p), p->enc)

Definition at line 381 of file parse.c.

◆ tokcopy

#define tokcopy (   p,
  n 
)    memcpy(tokspace(p, n), (p)->lex.pcur - (n), (n))

Definition at line 13121 of file parse.c.

◆ TOKEN2ID

#define TOKEN2ID (   tok)

◆ TOKEN2VAL

#define TOKEN2VAL (   t)    ID2VAL(t)

Definition at line 936 of file parse.c.

◆ token_column

#define token_column   ((int)(p->lex.ptok - p->lex.pbeg))

Definition at line 425 of file parse.c.

◆ token_flush

#define token_flush (   ptr)    ((ptr)->lex.ptok = (ptr)->lex.pcur)

Definition at line 417 of file parse.c.

◆ tokfix

#define tokfix (   p)    ((p)->tokenbuf[(p)->tokidx]='\0')

Definition at line 13050 of file parse.c.

◆ toklen

#define toklen (   p)    (p)->tokidx

Definition at line 13052 of file parse.c.

◆ unterminated_literal

#define unterminated_literal (   mesg)    yyerror0(mesg)

◆ value_expr

#define value_expr (   node)    value_expr_gen(p, (node) = remove_begin(node))

Definition at line 499 of file parse.c.

◆ vtable_add

#define vtable_add (   tbl,
  id 
)    vtable_add_gen(p, __LINE__, #tbl, tbl, id)

Definition at line 12633 of file parse.c.

◆ vtable_alloc

#define vtable_alloc (   prev)    vtable_alloc_gen(p, __LINE__, prev)

Definition at line 12593 of file parse.c.

◆ vtable_free

#define vtable_free (   tbl)    vtable_free_gen(p, __LINE__, #tbl, tbl)

Definition at line 12611 of file parse.c.

◆ vtable_pop

#define vtable_pop (   tbl,
  n 
)    vtable_pop_gen(p, __LINE__, #tbl, tbl, n)

Definition at line 12650 of file parse.c.

◆ WARN_ARGS

#define WARN_ARGS (   fmt,
  n 
)    WARN_ARGS_L(p->ruby_sourceline,fmt,n)

Definition at line 1001 of file parse.c.

◆ WARN_ARGS_L

#define WARN_ARGS_L (   l,
  fmt,
  n 
)    p->ruby_sourcefile, (l), (fmt)

Definition at line 1002 of file parse.c.

◆ warn_balanced

#define warn_balanced (   tok,
  op,
  syn 
)
Value:
((void) \
(!IS_lex_state_for(last_state, EXPR_CLASS|EXPR_DOT|EXPR_FNAME|EXPR_ENDFN) && \
space_seen && !ISSPACE(c) && \
(ambiguous_operator(tok, op, syn), 0)), \
(enum yytokentype)(tok))

Definition at line 14805 of file parse.c.

◆ WARN_CALL

#define WARN_CALL   rb_compile_warn

Definition at line 1003 of file parse.c.

◆ WARN_EOL

#define WARN_EOL (   tok)
Value:
(looking_at_eol_p(p) ? \
(void)rb_warning0("`" tok "' at the end of line without an expression") : \
(void)0)

Definition at line 1016 of file parse.c.

◆ WARN_I

#define WARN_I (   i)    i

Definition at line 997 of file parse.c.

◆ WARN_ID

#define WARN_ID (   i)    rb_id2name(i)

Definition at line 998 of file parse.c.

◆ WARN_IVAL

#define WARN_IVAL (   i)    NUM2INT(i)

Definition at line 999 of file parse.c.

◆ WARN_LOCATION

#define WARN_LOCATION (   type)
Value:
do { \
if (p->warn_location) { \
int line; \
VALUE file = rb_source_location(&line); \
rb_warn3(type" in eval may not return location in binding;" \
" use Binding#source_location instead\n" \
"%"PRIsWARN":%d: warning: in `%"PRIsWARN"'", \
file, WARN_I(line), rb_id2str(rb_frame_this_func())); \
} \
} while (0)

Definition at line 16672 of file parse.c.

◆ WARN_PAST_SCOPE

#define WARN_PAST_SCOPE   0

Definition at line 91 of file parse.c.

◆ WARN_S

#define WARN_S (   s)    s

Definition at line 996 of file parse.c.

◆ WARN_S_L

#define WARN_S_L (   s,
 
)    s

Definition at line 995 of file parse.c.

◆ WARN_SPACE_CHAR

#define WARN_SPACE_CHAR (   c,
  prefix 
)    rb_warn1("invalid character syntax; use "prefix"\\%c", WARN_I(c2))

Definition at line 13150 of file parse.c.

◆ WARNING_ARGS

#define WARNING_ARGS (   fmt,
  n 
)    WARN_ARGS(fmt,n)

Definition at line 1004 of file parse.c.

◆ WARNING_ARGS_L

#define WARNING_ARGS_L (   l,
  fmt,
  n 
)    WARN_ARGS_L(l,fmt,n)

Definition at line 1005 of file parse.c.

◆ WARNING_CALL

#define WARNING_CALL   rb_compile_warning

Definition at line 1006 of file parse.c.

◆ was_bol

#define was_bol (   p)    ((p)->lex.pcur == (p)->lex.pbeg + 1)

Definition at line 13048 of file parse.c.

◆ YY_

#define YY_ (   Msgid)    Msgid

Definition at line 1280 of file parse.c.

◆ YY_ATTRIBUTE

#define YY_ATTRIBUTE (   Spec)    /* empty */

Definition at line 1290 of file parse.c.

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))

Definition at line 1295 of file parse.c.

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED   YY_ATTRIBUTE ((__unused__))

Definition at line 1299 of file parse.c.

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

Definition at line 1330 of file parse.c.

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Definition at line 1331 of file parse.c.

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE (   Value)    Value

Definition at line 1327 of file parse.c.

◆ YY_LOCATION_PRINT

#define YY_LOCATION_PRINT (   File,
  loc 
)
Value:
rb_parser_printf(p, "%d.%d-%d.%d", \
(loc).beg_pos.lineno, (loc).beg_pos.column,\
(loc).end_pos.lineno, (loc).end_pos.column)

Definition at line 104 of file parse.c.

◆ YY_NULLPTR

#define YY_NULLPTR   0

Definition at line 1028 of file parse.c.

◆ YY_REDUCE_PRINT

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

Definition at line 5354 of file parse.c.

◆ yy_stack_print

#define yy_stack_print (   b,
 
)    ruby_parser_yy_stack_print(b, t, p)

◆ YY_STACK_PRINT

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

Definition at line 5323 of file parse.c.

◆ YY_SYMBOL_PRINT

#define YY_SYMBOL_PRINT (   Title,
  Type,
  Value,
  Location 
)
Value:
do { \
if (yydebug) \
{ \
YYFPRINTF (p, "%s ", Title); \
yy_symbol_print (stderr, \
Type, Value, Location, p); \
YYFPRINTF (p, "\n"); \
} \
} while (0)

Definition at line 5256 of file parse.c.

◆ YY_YY_Y_TAB_H_INCLUDED

#define YY_YY_Y_TAB_H_INCLUDED

Definition at line 1043 of file parse.c.

◆ YYABORT

#define YYABORT   goto yyabortlab

Definition at line 5142 of file parse.c.

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 5141 of file parse.c.

◆ YYBACKUP

#define YYBACKUP (   Token,
  Value 
)
Value:
if (yychar == YYEMPTY) \
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (&yylloc, p, YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (0)

Definition at line 5148 of file parse.c.

◆ YYBISON

#define YYBISON   1

Definition at line 44 of file parse.c.

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.0.4"

Definition at line 47 of file parse.c.

◆ YYCALLOC

#define YYCALLOC (   nelem,
  size 
)    rb_parser_calloc(p, (nelem), (size))

Definition at line 100 of file parse.c.

◆ YYCASE_

#define YYCASE_ (   N,
  S 
)
Value:
case N: \
yyformat = S; \
break

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

Definition at line 5137 of file parse.c.

◆ YYCOPY

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

Definition at line 1456 of file parse.c.

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

Definition at line 1428 of file parse.c.

◆ YYDEBUG

#define YYDEBUG   1

Definition at line 71 of file parse.c.

◆ yydebug

#define yydebug   (p->debug) /* disable the global variable definition */

Definition at line 96 of file parse.c.

◆ YYDPRINTF

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

Definition at line 5205 of file parse.c.

◆ YYEMPTY

#define YYEMPTY   (-2)

Definition at line 5138 of file parse.c.

◆ YYEOF

#define YYEOF   0

Definition at line 5139 of file parse.c.

◆ YYERRCODE

#define YYERRCODE   256

Definition at line 5167 of file parse.c.

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

Definition at line 5136 of file parse.c.

◆ yyerror

#define yyerror (   yylloc,
  p,
  msg 
)    parser_yyerror(p, yylloc, msg)

Definition at line 416 of file parse.c.

◆ YYERROR

#define YYERROR   goto yyerrorlab

Definition at line 5143 of file parse.c.

◆ yyerror0

#define yyerror0 (   msg)    parser_yyerror(p, NULL, (msg))

Definition at line 414 of file parse.c.

◆ yyerror1

#define yyerror1 (   loc,
  msg 
)    parser_yyerror(p, (loc), (msg))

Definition at line 415 of file parse.c.

◆ YYERROR_VERBOSE [1/2]

#define YYERROR_VERBOSE   1

Definition at line 1035 of file parse.c.

◆ YYERROR_VERBOSE [2/2]

#define YYERROR_VERBOSE   1

Definition at line 1035 of file parse.c.

◆ YYFINAL

#define YYFINAL   3

Definition at line 1469 of file parse.c.

◆ YYFPRINTF

#define YYFPRINTF   rb_parser_printf

Definition at line 102 of file parse.c.

◆ YYFREE

#define YYFREE (   ptr)    rb_parser_free(p, (ptr))

Definition at line 101 of file parse.c.

◆ YYINITDEPTH

#define YYINITDEPTH   200

Definition at line 5375 of file parse.c.

◆ YYLAST

#define YYLAST   13832

Definition at line 1471 of file parse.c.

◆ YYLLOC_DEFAULT

#define YYLLOC_DEFAULT (   Current,
  Rhs,
  N 
)
Value:
if (N) \
{ \
(Current).beg_pos = YYRHSLOC(Rhs, 1).beg_pos; \
(Current).end_pos = YYRHSLOC(Rhs, N).end_pos; \
} \
else \
{ \
(Current).beg_pos = YYRHSLOC(Rhs, 0).end_pos; \
(Current).end_pos = YYRHSLOC(Rhs, 0).end_pos; \
} \
while (0)

Definition at line 108 of file parse.c.

◆ YYLTYPE

Definition at line 74 of file parse.c.

◆ YYLTYPE_IS_DECLARED

#define YYLTYPE_IS_DECLARED   1

Definition at line 75 of file parse.c.

◆ yylval

#define yylval   (*p->lval)

Definition at line 12195 of file parse.c.

◆ yylval_id

#define yylval_id ( )    (yylval.id)

Definition at line 12222 of file parse.c.

◆ YYMALLOC

#define YYMALLOC (   size)    rb_parser_malloc(p, (size))

Definition at line 98 of file parse.c.

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

Definition at line 5386 of file parse.c.

◆ YYMAXUTOK

#define YYMAXUTOK   353

Definition at line 1485 of file parse.c.

◆ YYNNTS

#define YYNNTS   265

Definition at line 1476 of file parse.c.

◆ YYNRULES

#define YYNRULES   757

Definition at line 1478 of file parse.c.

◆ YYNSTATES

#define YYNSTATES   1241

Definition at line 1480 of file parse.c.

◆ YYNTOKENS

#define YYNTOKENS   154

Definition at line 1474 of file parse.c.

◆ YYPACT_NINF

#define YYPACT_NINF   -1056

Definition at line 1726 of file parse.c.

◆ yypact_value_is_default

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

Definition at line 1728 of file parse.c.

◆ yyparse

#define yyparse   ruby_yyparse

Definition at line 483 of file parse.c.

◆ YYPOPSTACK

#define YYPOPSTACK (   N)    (yyvsp -= (N), yyssp -= (N), yylsp -= (N))

◆ YYPRINT

#define YYPRINT (   out,
  tok,
  val 
)    parser_token_value_print(p, (tok), &(val))

Definition at line 103 of file parse.c.

◆ YYPULL

#define YYPULL   1

Definition at line 59 of file parse.c.

◆ YYPURE

#define YYPURE   1

Definition at line 53 of file parse.c.

◆ YYPUSH

#define YYPUSH   0

Definition at line 56 of file parse.c.

◆ YYREALLOC

#define YYREALLOC (   ptr,
  size 
)    rb_parser_realloc(p, (ptr), (size))

Definition at line 99 of file parse.c.

◆ YYRECOVERING

#define YYRECOVERING ( )    (!!yyerrstatus)

Definition at line 5146 of file parse.c.

◆ YYRHSLOC

#define YYRHSLOC (   Rhs,
 
)    ((Rhs)[K])

Definition at line 5194 of file parse.c.

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM   ((YYSIZE_T) -1)

Definition at line 1270 of file parse.c.

◆ YYSIZE_T

#define YYSIZE_T   size_t

Definition at line 1264 of file parse.c.

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

Definition at line 50 of file parse.c.

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 1377 of file parse.c.

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 1380 of file parse.c.

◆ YYSTACK_BYTES

#define YYSTACK_BYTES (   N)
Value:
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \

Definition at line 1424 of file parse.c.

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

Definition at line 1378 of file parse.c.

◆ YYSTACK_GAP_MAXIMUM

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

Definition at line 1420 of file parse.c.

◆ YYSTACK_RELOCATE

#define YYSTACK_RELOCATE (   Stack_alloc,
  Stack 
)
Value:
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
while (0)

Definition at line 1435 of file parse.c.

◆ YYSTACK_USE_ALLOCA

#define YYSTACK_USE_ALLOCA   0

Definition at line 73 of file parse.c.

◆ YYSYNTAX_ERROR

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

◆ YYTABLE_NINF

#define YYTABLE_NINF   -758

Definition at line 1731 of file parse.c.

◆ yytable_value_is_error

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

Definition at line 1733 of file parse.c.

◆ YYTERROR

#define YYTERROR   1

Definition at line 5166 of file parse.c.

◆ yytnamerr

#define yytnamerr (   yyres,
  yystr 
)    (YYSIZE_T)rb_yytnamerr(p, yyres, yystr)

Definition at line 775 of file parse.c.

◆ YYTRANSLATE

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

Definition at line 1487 of file parse.c.

◆ YYUNDEFTOK

#define YYUNDEFTOK   2

Definition at line 1484 of file parse.c.

◆ YYUSE

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

Definition at line 1313 of file parse.c.

Typedef Documentation

◆ rb_magic_comment_length_t

typedef long(* rb_magic_comment_length_t) (struct parser_params *p, const char *name, long len)

Definition at line 14509 of file parse.c.

◆ rb_magic_comment_setter_t

typedef void(* rb_magic_comment_setter_t) (struct parser_params *p, const char *name, const char *val)

Definition at line 14510 of file parse.c.

◆ rb_strterm_heredoc_t

Definition at line 643 of file parse.c.

◆ rb_strterm_literal_t

◆ rb_strterm_t

Definition at line 259 of file parse.c.

◆ stack_type

typedef VALUE stack_type

Definition at line 183 of file parse.c.

◆ token_info

typedef struct token_info token_info

◆ yytype_int16

Definition at line 1254 of file parse.c.

◆ yytype_int8

Definition at line 1242 of file parse.c.

◆ yytype_uint16

Definition at line 1248 of file parse.c.

◆ yytype_uint8

Definition at line 1236 of file parse.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ORDINAL_PARAM 
NO_PARAM 
NUMPARAM_MAX 

Definition at line 229 of file parse.c.

◆ cond_type

enum cond_type
Enumerator
COND_IN_OP 
COND_IN_COND 
COND_IN_FF 
COND_IN_OP 
COND_IN_COND 
COND_IN_FF 

Definition at line 17818 of file parse.c.

◆ lex_state_bits

Enumerator
EXPR_BEG_bit 
EXPR_END_bit 
EXPR_ENDARG_bit 
EXPR_ENDFN_bit 
EXPR_ARG_bit 
EXPR_CMDARG_bit 
EXPR_MID_bit 
EXPR_FNAME_bit 
EXPR_DOT_bit 
EXPR_CLASS_bit 
EXPR_LABEL_bit 
EXPR_LABELED_bit 
EXPR_FITEM_bit 
EXPR_MAX_STATE 
EXPR_BEG_bit 
EXPR_END_bit 
EXPR_ENDARG_bit 
EXPR_ENDFN_bit 
EXPR_ARG_bit 
EXPR_CMDARG_bit 
EXPR_MID_bit 
EXPR_FNAME_bit 
EXPR_DOT_bit 
EXPR_CLASS_bit 
EXPR_LABEL_bit 
EXPR_LABELED_bit 
EXPR_FITEM_bit 
EXPR_MAX_STATE 

Definition at line 134 of file parse.c.

◆ lex_state_e

Enumerator
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
EXPR_VALUE 
EXPR_BEG_ANY 
EXPR_ARG_ANY 
EXPR_END_ANY 
EXPR_NONE 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
DEF_EXPR 
EXPR_VALUE 
EXPR_BEG_ANY 
EXPR_ARG_ANY 
EXPR_END_ANY 
EXPR_NONE 

Definition at line 151 of file parse.c.

◆ string_type

Enumerator
str_label 
str_squote 
str_dquote 
str_xquote 
str_regexp 
str_sword 
str_dword 
str_ssym 
str_dsym 
str_label 
str_squote 
str_dquote 
str_xquote 
str_regexp 
str_sword 
str_dword 
str_ssym 
str_dsym 

Definition at line 12912 of file parse.c.

Function Documentation

◆ PRINTF_ARGS() [1/2]

PRINTF_ARGS ( static void   parser_compile_errorstruct parser_params *, const char *fmt,...,
,
 
)

◆ PRINTF_ARGS() [2/2]

PRINTF_ARGS ( void   rb_parser_fatalstruct parser_params *p, const char *fmt,...,
,
 
)

◆ rb_init_parse()

void rb_init_parse ( void  )

Definition at line 19044 of file parse.c.

References void.

◆ rb_io_gets_internal()

VALUE rb_io_gets_internal ( VALUE  io)

Definition at line 3579 of file io.c.

References GetOpenFile, and getline_arg::io.

◆ rb_parser_calloc()

void* rb_parser_calloc ( struct parser_params p,
size_t  nelem,
size_t  size 
)

Definition at line 19343 of file parse.c.

References ADD2HEAP, cnt, HEAPCNT, n, NEWHEAP, ptr, size, and xcalloc.

◆ rb_parser_compile_file_path()

rb_ast_t* rb_parser_compile_file_path ( VALUE  vparser,
VALUE  fname,
VALUE  file,
int  start 
)

Definition at line 12867 of file parse.c.

References TypedData_Get_Struct.

◆ rb_parser_compile_generic()

rb_ast_t* rb_parser_compile_generic ( VALUE  vparser,
VALUE(*)(VALUE, int lex_gets,
VALUE  fname,
VALUE  input,
int  start 
)

Definition at line 12887 of file parse.c.

References TypedData_Get_Struct.

◆ rb_parser_compile_string()

rb_ast_t* rb_parser_compile_string ( VALUE  vparser,
const char f,
VALUE  s,
int  line 
)

Definition at line 12846 of file parse.c.

References f, rb_filesystem_str_new_cstr(), and rb_parser_compile_string_path().

◆ rb_parser_compile_string_path()

rb_ast_t* rb_parser_compile_string_path ( VALUE  vparser,
VALUE  f,
VALUE  s,
int  line 
)

Definition at line 12852 of file parse.c.

Referenced by rb_parser_compile_string().

◆ rb_parser_encoding()

VALUE rb_parser_encoding ( VALUE  vparser)

Definition at line 19252 of file parse.c.

References TypedData_Get_Struct.

◆ rb_parser_end_seen_p()

VALUE rb_parser_end_seen_p ( VALUE  vparser)

Definition at line 19237 of file parse.c.

References TypedData_Get_Struct.

◆ rb_parser_fatal()

void rb_parser_fatal ( struct parser_params p,
const char fmt,
  ... 
)

Definition at line 17087 of file parse.c.

References fmt, rb_str_new_cstr, rb_str_vcatf(), va_end, and va_start.

◆ rb_parser_free()

void rb_parser_free ( struct parser_params p,
void ptr 
)

Definition at line 19373 of file parse.c.

References parser_params::heap, n, NULL, ptr, rb_gc_force_recycle(), and xfree.

◆ rb_parser_get_debug_output()

VALUE rb_parser_get_debug_output ( VALUE  self)

Definition at line 19300 of file parse.c.

References TypedData_Get_Struct.

◆ rb_parser_lex_state_name()

VALUE rb_parser_lex_state_name ( enum lex_state_e  state)

Definition at line 17058 of file parse.c.

References rb_fstring().

◆ rb_parser_malloc()

void* rb_parser_malloc ( struct parser_params p,
size_t  size 
)

Definition at line 19333 of file parse.c.

References ADD2HEAP, cnt, HEAPCNT, n, NEWHEAP, ptr, size, and xmalloc.

◆ rb_parser_new()

VALUE rb_parser_new ( void  )

Definition at line 19179 of file parse.c.

References TypedData_Make_Struct.

◆ rb_parser_printf()

void rb_parser_printf ( struct parser_params p,
const char fmt,
  ... 
)

◆ rb_parser_realloc()

void* rb_parser_realloc ( struct parser_params p,
void ptr,
size_t  size 
)

Definition at line 19353 of file parse.c.

References ADD2HEAP, cnt, parser_params::heap, HEAPCNT, n, NEWHEAP, NULL, ptr, size, and xrealloc.

◆ rb_parser_reg_compile()

RUBY_SYMBOL_EXPORT_BEGIN VALUE rb_parser_reg_compile ( struct parser_params p,
VALUE  str,
int  options 
)

Definition at line 18950 of file parse.c.

◆ rb_parser_set_context()

VALUE rb_parser_set_context ( VALUE  vparser,
const struct rb_iseq_struct base,
int  main 
)

Definition at line 19189 of file parse.c.

References TypedData_Get_Struct.

◆ rb_parser_set_debug_output()

VALUE rb_parser_set_debug_output ( VALUE  self,
VALUE  output 
)

Definition at line 19315 of file parse.c.

◆ rb_parser_set_location()

YYLTYPE* rb_parser_set_location ( struct parser_params p,
YYLTYPE yylloc 
)

◆ rb_parser_set_location_from_strterm_heredoc()

YYLTYPE* rb_parser_set_location_from_strterm_heredoc ( struct parser_params p,
rb_strterm_heredoc_t here,
YYLTYPE yylloc 
)

◆ rb_parser_set_location_of_none()

YYLTYPE* rb_parser_set_location_of_none ( struct parser_params p,
YYLTYPE yylloc 
)

◆ rb_parser_set_options()

void rb_parser_set_options ( VALUE  vparser,
int  print,
int  loop,
int  chomp,
int  split 
)

Definition at line 18991 of file parse.c.

References TypedData_Get_Struct.

◆ rb_parser_set_yydebug()

VALUE rb_parser_set_yydebug ( VALUE  self,
VALUE  flag 
)

Definition at line 19284 of file parse.c.

References TypedData_Get_Struct.

◆ rb_parser_show_bitstack()

void rb_parser_show_bitstack ( struct parser_params p,
stack_type  stack,
const char name,
int  line 
)

Definition at line 17077 of file parse.c.

References name, and rb_sprintf().

◆ rb_parser_trace_lex_state()

enum lex_state_e rb_parser_trace_lex_state ( struct parser_params p,
enum lex_state_e  from,
enum lex_state_e  to,
int  line 
)

Definition at line 17044 of file parse.c.

References rb_str_new_cstr.

◆ rb_parser_warn_location()

void rb_parser_warn_location ( VALUE  vparser,
int  warn 
)

Definition at line 19002 of file parse.c.

References TypedData_Get_Struct.

◆ rb_reg_fragment_setenc()

int rb_reg_fragment_setenc ( struct parser_params p,
VALUE  str,
int  options 
)

Definition at line 18836 of file parse.c.

◆ rb_reserved_word()

const struct kwtable* rb_reserved_word ( const char str,
unsigned int  len 
)

Definition at line 19173 of file parse.c.

◆ rb_strterm_mark()

void rb_strterm_mark ( VALUE  obj)

◆ rb_yytnamerr()

size_t rb_yytnamerr ( struct parser_params p,
char yyres,
const char yystr 
)

Definition at line 19437 of file parse.c.

References YYUSE.

◆ STATIC_ASSERT()

STATIC_ASSERT ( rb_strterm_heredoc_t  ,
sizeof(rb_strterm_heredoc_t)<=4 *  SIZEOF_VALUE 
)

◆ yyparse()

int yyparse ( struct parser_params p)

Variable Documentation

◆ ruby_global_name_punct_bits

const unsigned int ruby_global_name_punct_bits[]
Initial value:

Definition at line 13735 of file parse.c.

tTOKEN_CLASS_END
@ tTOKEN_CLASS_END
Definition: id.h:208
tTOKEN_ATTRSET_END
@ tTOKEN_ATTRSET_END
Definition: id.h:210
void
void
Definition: rb_mjit_min_header-2.7.0.h:13273
WARN_I
#define WARN_I(i)
Definition: parse.c:997
YYRHSLOC
#define YYRHSLOC(Rhs, K)
Definition: parse.c:5194
STR_NEW
#define STR_NEW(ptr, len)
Definition: parse.c:377
tTOKEN_GLOBAL_BEGIN
@ tTOKEN_GLOBAL_BEGIN
Definition: id.h:200
yydebug
#define yydebug
Definition: parse.c:96
TOKEN2LOCALID
#define TOKEN2LOCALID(tok)
Definition: id.h:71
rb_warning0
#define rb_warning0(fmt)
Definition: parse.c:955
TOKEN2CONSTID
#define TOKEN2CONSTID(tok)
Definition: id.h:74
tTOKEN_LOCAL_END
@ tTOKEN_LOCAL_END
Definition: id.h:197
RSTRING_PTR
#define RSTRING_PTR(str)
Definition: ruby.h:1009
tTOKEN_ATTRSET_BEGIN
@ tTOKEN_ATTRSET_BEGIN
Definition: id.h:209
int
__inline__ int
Definition: rb_mjit_min_header-2.7.0.h:2839
YYSTYPE
union YYSTYPE YYSTYPE
Definition: parse.h:187
NEW_STR
#define NEW_STR(s, loc)
Definition: node.h:341
yytokentype
yytokentype
Definition: parse.h:46
ptr
struct RIMemo * ptr
Definition: debug.c:74
NEW_LIT
#define NEW_LIT(l, loc)
Definition: node.h:340
rb_id2str
#define rb_id2str(id)
Definition: vm_backtrace.c:30
yytype_int16
short int yytype_int16
Definition: ripper.c:1251
rb_str_resize
VALUE rb_str_resize(VALUE, long)
Definition: string.c:2709
BIT
#define BIT(c, idx)
Definition: parse.c:13739
tTOKEN_CONST_BEGIN
@ tTOKEN_CONST_BEGIN
Definition: id.h:205
if
if((ID)(DISPID) nameid !=nameid)
Definition: win32ole.c:357
tTOKEN_INSTANCE_END
@ tTOKEN_INSTANCE_END
Definition: id.h:199
rb_frame_this_func
ID rb_frame_this_func(void)
The original name of the current method.
Definition: eval.c:1182
tTOKEN_CLASS_BEGIN
@ tTOKEN_CLASS_BEGIN
Definition: id.h:207
lex_state_e
lex_state_e
Definition: ripper.c:151
TOKEN2GLOBALID
#define TOKEN2GLOBALID(tok)
Definition: id.h:73
cnt
rb_atomic_t cnt[RUBY_NSIG]
Definition: signal.c:503
YYLTYPE
Definition: parse.h:195
stderr
#define stderr
Definition: rb_mjit_min_header-2.7.0.h:1485
YYEMPTY
#define YYEMPTY
Definition: parse.c:5138
tok
#define tok(p)
Definition: parse.c:13051
COND_IN_FF
@ COND_IN_FF
Definition: parse.c:17821
PRIsWARN
#define PRIsWARN
Definition: parse.c:1000
rb_parser_printf
void rb_parser_printf(struct parser_params *p, const char *fmt,...)
Definition: parse.c:19390
ISSPACE
#define ISSPACE(c)
Definition: ruby.h:2307
N
#define N
Definition: lgamma_r.c:20
IS_lex_state
#define IS_lex_state(ls)
Definition: parse.c:174
tTOKEN_INSTANCE_BEGIN
@ tTOKEN_INSTANCE_BEGIN
Definition: id.h:198
tTOKEN_CONST_END
@ tTOKEN_CONST_END
Definition: id.h:206
arg
VALUE arg
Definition: rb_mjit_min_header-2.7.0.h:5601
YYSTACK_GAP_MAXIMUM
#define YYSTACK_GAP_MAXIMUM
Definition: parse.c:1420
COND_IN_OP
@ COND_IN_OP
Definition: parse.c:17819
TOKEN2ATTRSETID
#define TOKEN2ATTRSETID(tok)
Definition: id.h:76
COND_IN_COND
@ COND_IN_COND
Definition: parse.c:17820
IS_ARG
#define IS_ARG()
Definition: parse.c:13792
SPECIAL_PUNCT
#define SPECIAL_PUNCT(idx)
Definition: parse.c:13740
YY_
#define YY_(Msgid)
Definition: parse.c:1280
S
#define S(s)
tTOKEN_GLOBAL_END
@ tTOKEN_GLOBAL_END
Definition: id.h:204
TOKEN2CLASSID
#define TOKEN2CLASSID(tok)
Definition: id.h:75
tPRESERVED_ID_END
@ tPRESERVED_ID_END
Definition: id.h:130
ambiguous_operator
#define ambiguous_operator(tok, op, syn)
Definition: parse.c:14798
Qnil
#define Qnil
Definition: ruby.h:469
ruby::backward::cxxanyargs::type
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:39
IS_lex_state_for
#define IS_lex_state_for(x, ls)
Definition: parse.c:172
TOKEN2INSTANCEID
#define TOKEN2INSTANCEID(tok)
Definition: id.h:72
rb_source_location
VALUE rb_source_location(int *pline)
Definition: vm.c:1360
name
const char * name
Definition: nkf.c:208