Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Defines | Functions | Variables

# parse.y File Reference

`#include "ruby/ruby.h"`
`#include "ruby/st.h"`
`#include "ruby/encoding.h"`
`#include "node.h"`
`#include "parse.h"`
`#include "id.h"`
`#include "regenc.h"`
`#include <stdio.h>`
`#include <errno.h>`
`#include <ctype.h>`
`#include "id.c"`
`#include "ruby/regex.h"`
`#include "ruby/util.h"`
`#include "lex.c"`
Include dependency graph for parse.y:

Go to the source code of this file.

## Defines
#define | YYDEBUG 1
#define | YYERROR_VERBOSE 1
#define | YYSTACK_USE_ALLOCA 0
#define | numberof(array) (int)(sizeof(array) / sizeof((array)[0]))
#define | YYMALLOC(size) rb_parser_malloc(parser, size)
#define | YYREALLOC(ptr, size) rb_parser_realloc(parser, ptr, size)
#define | YYCALLOC(nelem, size) rb_parser_calloc(parser, nelem, size)
#define | YYFREE(ptr) rb_parser_free(parser, ptr)
#define | malloc YYMALLOC
#define | realloc YYREALLOC
#define | calloc YYCALLOC
#define | free YYFREE
#define | REGISTER_SYMID(id, name) register_symid(id, name, strlen(name), enc)
#define | is_notop_id(id) ((id)>tLAST_TOKEN)
#define | is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL)
#define | is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL)
#define | is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE)
#define | is_attrset_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET)
#define | is_const_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST)
#define | is_class_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS)
#define | is_junk_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK)
#define | is_asgn_or_id(id)
#define | BITSTACK_PUSH(stack, n) (stack = (stack<<1)|((n)&1))
#define | BITSTACK_POP(stack) (stack = stack >> 1)
#define | BITSTACK_LEXPOP(stack) (stack = (stack >> 1) | (stack & 1))
#define | BITSTACK_SET_P(stack) (stack&1)
#define | COND_PUSH(n) BITSTACK_PUSH(cond_stack, n)
#define | COND_POP() BITSTACK_POP(cond_stack)
#define | COND_LEXPOP() BITSTACK_LEXPOP(cond_stack)
#define | COND_P() BITSTACK_SET_P(cond_stack)
#define | CMDARG_PUSH(n) BITSTACK_PUSH(cmdarg_stack, n)
#define | CMDARG_POP() BITSTACK_POP(cmdarg_stack)
#define | CMDARG_LEXPOP() BITSTACK_LEXPOP(cmdarg_stack)
#define | CMDARG_P() BITSTACK_SET_P(cmdarg_stack)
#define | DVARS_INHERIT ((void*)1)
#define | DVARS_TOPSCOPE NULL
#define | DVARS_SPECIAL_P(tbl) (!POINTER_P(tbl))
#define | POINTER_P(val) ((VALUE)(val) & ~(VALUE)3)
#define | VTBL_DEBUG 0
#define | UTF8_ENC()
#define | STR_NEW(p, n) rb_enc_str_new((p),(n),parser->enc)
#define | STR_NEW0() rb_enc_str_new(0,0,parser->enc)
#define | STR_NEW2(p) rb_enc_str_new((p),strlen(p),parser->enc)
#define | STR_NEW3(p, n, e, func) parser_str_new((p),(n),(e),(func),parser->enc)
#define | ENC_SINGLE(cr) ((cr)==ENC_CODERANGE_7BIT)
#define | TOK_INTERN(mb) rb_intern3(tok(), toklen(), parser->enc)
#define | yyerror(msg) parser_yyerror(parser, msg)
#define | YYLEX_PARAM parser
#define | lex_strterm (parser->parser_lex_strterm)
#define | lex_state (parser->parser_lex_state)
#define | cond_stack (parser->parser_cond_stack)
#define | cmdarg_stack (parser->parser_cmdarg_stack)
#define | class_nest (parser->parser_class_nest)
#define | paren_nest (parser->parser_paren_nest)
#define | lpar_beg (parser->parser_lpar_beg)
#define | in_single (parser->parser_in_single)
#define | in_def (parser->parser_in_def)
#define | compile_for_eval (parser->parser_compile_for_eval)
#define | cur_mid (parser->parser_cur_mid)
#define | in_defined (parser->parser_in_defined)
#define | tokenbuf (parser->parser_tokenbuf)
#define | tokidx (parser->parser_tokidx)
#define | toksiz (parser->parser_toksiz)
#define | lex_input (parser->parser_lex_input)
#define | lex_lastline (parser->parser_lex_lastline)
#define | lex_nextline (parser->parser_lex_nextline)
#define | lex_pbeg (parser->parser_lex_pbeg)
#define | lex_p (parser->parser_lex_p)
#define | lex_pend (parser->parser_lex_pend)
#define | heredoc_end (parser->parser_heredoc_end)
#define | command_start (parser->parser_command_start)
#define | deferred_nodes (parser->parser_deferred_nodes)
#define | lex_gets_ptr (parser->parser_lex_gets_ptr)
#define | lex_gets (parser->parser_lex_gets)
#define | lvtbl (parser->parser_lvtbl)
#define | ruby__end__seen (parser->parser_ruby__end__seen)
#define | ruby_sourceline (parser->parser_ruby_sourceline)
#define | ruby_sourcefile (parser->parser_ruby_sourcefile)
#define | yydebug (parser->parser_yydebug)
#define | ruby_eval_tree (parser->parser_eval_tree)
#define | ruby_eval_tree_begin (parser->parser_eval_tree_begin)
#define | ruby_debug_lines (parser->debug_lines)
#define | ruby_coverage (parser->coverage)
#define | yyparse ruby_yyparse
#define | rb_node_newnode(type, a1, a2, a3) node_newnode(parser, type, a1, a2, a3)
#define | cond(node) cond_gen(parser, node)
#define | logop(type, node1, node2) logop_gen(parser, type, node1, node2)
#define | value_expr(node) value_expr_gen(parser, (node) = remove_begin(node))
#define | void_expr0(node) void_expr_gen(parser, (node))
#define | void_expr(node) void_expr0((node) = remove_begin(node))
#define | void_stmts(node) void_stmts_gen(parser, node)
#define | reduce_nodes(n) reduce_nodes_gen(parser,n)
#define | block_dup_check(n1, n2) block_dup_check_gen(parser,n1,n2)
#define | block_append(h, t) block_append_gen(parser,h,t)
#define | list_append(l, i) list_append_gen(parser,l,i)
#define | list_concat(h, t) list_concat_gen(parser,h,t)
#define | arg_append(h, t) arg_append_gen(parser,h,t)
#define | arg_concat(h, t) arg_concat_gen(parser,h,t)
#define | literal_concat(h, t) literal_concat_gen(parser,h,t)
#define | new_evstr(n) new_evstr_gen(parser,n)
#define | evstr2dstr(n) evstr2dstr_gen(parser,n)
#define | call_bin_op(recv, id, arg1) call_bin_op_gen(parser, recv,id,arg1)
#define | call_uni_op(recv, id) call_uni_op_gen(parser, recv,id)
#define | new_args(f, o, r, p, b) new_args_gen(parser, f,o,r,p,b)
#define | ret_args(node) ret_args_gen(parser, node)
#define | new_yield(node) new_yield_gen(parser, node)
#define | gettable(id) gettable_gen(parser,id)
#define | assignable(id, node) assignable_gen(parser, id, node)
#define | aryset(node1, node2) aryset_gen(parser, node1, node2)
#define | attrset(node, id) attrset_gen(parser, node, id)
#define | rb_backref_error(n) rb_backref_error_gen(parser,n)
#define | node_assign(node1, node2) node_assign_gen(parser, node1, node2)
#define | match_op(node1, node2) match_op_gen(parser, node1, node2)
#define | local_tbl() local_tbl_gen(parser)
#define | reg_compile(str, options) reg_compile_gen(parser, str, options)
#define | reg_fragment_setenc(str, options) reg_fragment_setenc_gen(parser, str, options)
#define | reg_fragment_check(str, options) reg_fragment_check_gen(parser, str, options)
#define | reg_named_capture_assign(regexp, match) reg_named_capture_assign_gen(parser,regexp,match)
#define | get_id(id) (id)
#define | get_value(val) (val)
#define | formal_argument(id) formal_argument_gen(parser, id)
#define | shadowing_lvar(name) shadowing_lvar_gen(parser, name)
#define | new_bv(id) new_bv_gen(parser, id)
#define | local_push(top) local_push_gen(parser,top)
#define | local_pop() local_pop_gen(parser)
#define | local_var(id) local_var_gen(parser, id);
#define | arg_var(id) arg_var_gen(parser, id)
#define | local_id(id) local_id_gen(parser, id)
#define | internal_id() internal_id_gen(parser)
#define | dyna_push() dyna_push_gen(parser)
#define | dyna_pop(node) dyna_pop_gen(parser, node)
#define | dyna_in_block() dyna_in_block_gen(parser)
#define | dyna_var(id) local_var(id)
#define | dvar_defined(id) dvar_defined_gen(parser, id)
#define | dvar_curr(id) dvar_curr_gen(parser, id)
#define | lvar_defined(id) lvar_defined_gen(parser, id)
#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 | NODE_STRTERM NODE_ZARRAY
#define | NODE_HEREDOC NODE_ARRAY
#define | SIGN_EXTEND(x, n) (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1))
#define | nd_func u1.id
#define | nd_term(node) SIGN_EXTEND((node)->u2.id, CHAR_BIT*2)
#define | nd_paren(node) (char)((node)->u2.id >> CHAR_BIT*2)
#define | nd_nest u3.cnt
#define | ifndef_ripper(x) x
#define | rb_warn0(fmt) rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt)
#define | rb_warnI(fmt, a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt, a)
#define | rb_warnS(fmt, a) rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt, a)
#define | rb_warning0(fmt) rb_compile_warning(ruby_sourcefile, ruby_sourceline, fmt)
#define | rb_warningS(fmt, a) rb_compile_warning(ruby_sourcefile, ruby_sourceline, fmt, a)
#define | compile_error parser->nerr++,rb_compile_error
#define | PARSER_ARG ruby_sourcefile, ruby_sourceline,
#define | token_info_push(token) (RTEST(ruby_verbose) ? token_info_push(parser, token) : (void)0)
#define | token_info_pop(token) (RTEST(ruby_verbose) ? token_info_pop(parser, token) : (void)0)
#define | yylval (*((YYSTYPE*)(parser->parser_yylval)))
#define | nextc() parser_nextc(parser)
#define | pushback(c) parser_pushback(parser, c)
#define | newtok() parser_newtok(parser)
#define | tokspace(n) parser_tokspace(parser, n)
#define | tokadd(c) parser_tokadd(parser, c)
#define | tok_hex(numlen) parser_tok_hex(parser, numlen)
#define | read_escape(flags, e) parser_read_escape(parser, flags, e)
#define | tokadd_escape(e) parser_tokadd_escape(parser, e)
#define | regx_options() parser_regx_options(parser)
#define | tokadd_string(f, t, p, n, e) parser_tokadd_string(parser,f,t,p,n,e)
#define | parse_string(n) parser_parse_string(parser,n)
#define | tokaddmbc(c, enc) parser_tokaddmbc(parser, c, enc)
#define | here_document(n) parser_here_document(parser,n)
#define | heredoc_identifier() parser_heredoc_identifier(parser)
#define | heredoc_restore(n) parser_heredoc_restore(parser,n)
#define | whole_match_p(e, l, i) parser_whole_match_p(parser,e,l,i)
#define | set_yylval_str(x) yylval.node = NEW_STR(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 | set_yylval_literal(x) yylval.node = NEW_LIT(x)
#define | set_yylval_node(x) yylval.node = x
#define | yylval_id() yylval.id
#define | ripper_flush(p) (void)(p)
#define | SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128)
#define | parser_encoding_name() (parser->enc->name)
#define | parser_mbclen() mbclen((lex_p-1),lex_pend,parser->enc)
#define | parser_precise_mbclen() rb_enc_precise_mbclen((lex_p-1),lex_pend,parser->enc)
#define | is_identchar(p, e, enc) (rb_enc_isalnum(*p,enc) || (*p) == '_' || !ISASCII(*p))
#define | parser_is_identchar() (!parser->eofp && is_identchar((lex_p-1),lex_pend,parser->enc))
#define | parser_isascii() ISASCII(*(lex_p-1))
#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 | lex_goto_eol(parser) (parser->parser_lex_p = parser->parser_lex_pend)
#define | peek(c) (lex_p < lex_pend && (c) == *lex_p)
#define | was_bol() (lex_p == lex_pbeg + 1)
#define | tokfix() (tokenbuf[tokidx]='\0')
#define | tok() tokenbuf
#define | toklen() tokidx
#define | toklast() (tokidx>0?tokenbuf[tokidx-1]:0)
#define | tokcopy(n) memcpy(tokspace(n), lex_p - (n), (n))
#define | ESCAPE_CONTROL 1
#define | ESCAPE_META 2
#define | tokadd_mbchar(c) parser_tokadd_mbchar(parser, c)
#define | mixed_error(enc1, enc2)
#define | mixed_escape(beg, enc1, enc2)
#define | NEW_STRTERM(func, term, paren) rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0)
#define | arg_ambiguous() (arg_ambiguous_gen(parser), 1)
#define | str_copy(_s, _p, _n)
#define | IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG)
#define | IS_END() (lex_state == EXPR_END || lex_state == EXPR_ENDARG || lex_state == EXPR_ENDFN)
#define | IS_BEG() (lex_state == EXPR_BEG || lex_state == EXPR_MID || lex_state == EXPR_VALUE || lex_state == EXPR_CLASS)
#define | IS_SPCARG(c) (IS_ARG() && space_seen && !ISSPACE(c))
#define | ambiguous_operator(op, syn)
#define | warn_balanced(op, syn)
#define | no_digits() do {yyerror("numeric literal without digits"); return 0;} while (0)
#define | parser_warning(node, mesg) parser_warning(parser, node, mesg)
#define | parser_warn(node, mesg) parser_warn(parser, node, mesg)
#define | assignable_result(x) x
#define | subnodes(n1, n2)
#define | op_tbl_count numberof(op_tbl)
#define | ENABLE_SELECTOR_NAMESPACE 0
## Functions
| if ($2)
| fixpos ($$, $1)
| if (!$$)$$
## Variables
top_compstmt | __pad0__
fixup_nodes & | deferred_nodes
top_stmts | __pad1__ = $1
top_stmt | __pad2__
bodystmt | __pad3__
compstmt | __pad4__
stmts | __pad5__ = $1
stmt | __pad6__
expr | __pad7__
expr_value | __pad8__
command_call | __pad9__
block_command | __pad10__
cmd_brace_block | __pad11__
command | __pad12__ = ruby_sourceline
mlhs | __pad13__
mlhs_inner | __pad14__
mlhs_inner | mlhs_basic
mlhs_item | __pad15__
mlhs_head | __pad16__
mlhs_post | __pad17__
| mlhs_post
mlhs_node | __pad18__

## Define Documentation

#define ambiguous_operator | ( |  | op,
|  |  | syn
| ) |  |

Value:

    ( \
        rb_warning0("`"op"' after local variable is interpreted as binary operator"), \
        rb_warning0("even though it seems like "syn""))

#define arg_ambiguous | ( |  | ) | (arg_ambiguous_gen(parser), 1)

#define arg_append | ( |  | h,
|  |  | t
| ) |  | arg_append_gen(parser,h,t)

#define arg_concat | ( |  | h,
|  |  | t
| ) |  | arg_concat_gen(parser,h,t)

#define arg_var | ( |  | id | ) | arg_var_gen(parser, id)

#define aryset | ( |  | node1,
|  |  | node2
| ) |  | aryset_gen(parser, node1, node2)

#define assignable | ( |  | id,
|  |  | node
| ) |  | assignable_gen(parser, id, node)

#define assignable_result | ( |  | x | ) | x

#define attrset | ( |  | node,
|  |  | id
| ) |  | attrset_gen(parser, node, id)

#define BITSTACK_LEXPOP | ( |  | stack | ) | (stack = (stack >> 1) | (stack & 1))

#define BITSTACK_POP | ( |  | stack | ) | (stack = stack >> 1)

#define BITSTACK_PUSH | ( |  | stack,
|  |  | n
| ) |  | (stack = (stack<<1)|((n)&1))

#define BITSTACK_SET_P | ( |  | stack | ) | (stack&1)

#define block_append | ( |  | h,
|  |  | t
| ) |  | block_append_gen(parser,h,t)

#define block_dup_check | ( |  | n1,
|  |  | n2
| ) |  | block_dup_check_gen(parser,n1,n2)

#define call_bin_op | ( |  | recv,
|  |  | id,
|  |  | arg1
| ) |  | call_bin_op_gen(parser, recv,id,arg1)

#define call_uni_op | ( |  | recv,
|  |  | id
| ) |  | call_uni_op_gen(parser, recv,id)

#define calloc YYCALLOC

#define class_nest (parser->parser_class_nest)

#define CMDARG_LEXPOP | ( |  | ) | BITSTACK_LEXPOP(cmdarg_stack)

#define CMDARG_P | ( |  | ) | BITSTACK_SET_P(cmdarg_stack)

#define CMDARG_POP | ( |  | ) | BITSTACK_POP(cmdarg_stack)

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

#define cmdarg_stack (parser->parser_cmdarg_stack)

#define command_start (parser->parser_command_start)

#define compile_error parser->nerr++,rb_compile_error

#define compile_for_eval (parser->parser_compile_for_eval)

#define cond | ( |  | node | ) | cond_gen(parser, node)

#define COND_LEXPOP | ( |  | ) | BITSTACK_LEXPOP(cond_stack)

#define COND_P | ( |  | ) | BITSTACK_SET_P(cond_stack)

#define COND_POP | ( |  | ) | BITSTACK_POP(cond_stack)

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

#define cond_stack (parser->parser_cond_stack)

#define cur_mid (parser->parser_cur_mid)

#define deferred_nodes (parser->parser_deferred_nodes)

#define dvar_curr | ( |  | id | ) | dvar_curr_gen(parser, id)

#define dvar_defined | ( |  | id | ) | dvar_defined_gen(parser, id)

#define DVARS_INHERIT ((void*)1)

#define DVARS_SPECIAL_P | ( |  | tbl | ) | (!POINTER_P(tbl))

#define DVARS_TOPSCOPE NULL

#define dyna_in_block | ( |  | ) | dyna_in_block_gen(parser)

#define dyna_pop | ( |  | node | ) | dyna_pop_gen(parser, node)

#define dyna_push | ( |  | ) | dyna_push_gen(parser)

#define dyna_var | ( |  | id | ) | local_var(id)

#define ENABLE_SELECTOR_NAMESPACE 0

#define ENC_SINGLE | ( |  | cr | ) | ((cr)==ENC_CODERANGE_7BIT)

#define ESCAPE_CONTROL 1

#define ESCAPE_META 2

#define evstr2dstr | ( |  | n | ) | evstr2dstr_gen(parser,n)

#define formal_argument | ( |  | id | ) | formal_argument_gen(parser, id)

#define free YYFREE

#define get_id | ( |  | id | ) | (id)

#define get_value | ( |  | val | ) | (val)

#define gettable | ( |  | id | ) | gettable_gen(parser,id)

#define here_document | ( |  | n | ) | parser_here_document(parser,n)

#define heredoc_end (parser->parser_heredoc_end)

#define heredoc_identifier | ( |  | ) | parser_heredoc_identifier(parser)

#define heredoc_restore | ( |  | n | ) | parser_heredoc_restore(parser,n)

#define ifndef_ripper | ( |  | x | ) | x

#define in_def (parser->parser_in_def)

#define in_defined (parser->parser_in_defined)

#define in_single (parser->parser_in_single)

#define internal_id | ( |  | ) | internal_id_gen(parser)

#define IS_ARG | ( |  | ) | (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG)

#define is_asgn_or_id | ( |  | id | ) |

Value:

    ((is_notop_id(id)) && \
            (((id)&ID_SCOPE_MASK) == ID_GLOBAL || \
             ((id)&ID_SCOPE_MASK) == ID_INSTANCE || \
             ((id)&ID_SCOPE_MASK) == ID_CLASS))

#define is_attrset_id | ( |  | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET)

#define IS_BEG | ( |  | ) | (lex_state == EXPR_BEG || lex_state == EXPR_MID || lex_state == EXPR_VALUE || lex_state == EXPR_CLASS)

#define is_class_id | ( |  | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS)

#define is_const_id | ( |  | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST)

#define IS_END | ( |  | ) | (lex_state == EXPR_END || lex_state == EXPR_ENDARG || lex_state == EXPR_ENDFN)

#define is_global_id | ( |  | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL)

#define is_identchar | ( |  | p,
|  |  | e,
|  |  | enc
| ) |  | (rb_enc_isalnum(*p,enc) || (*p) == '_' || !ISASCII(*p))

#define is_instance_id | ( |  | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE)

#define is_junk_id | ( |  | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK)

#define is_local_id | ( |  | id | ) | (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL)

#define is_notop_id | ( |  | id | ) | ((id)>tLAST_TOKEN)

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

#define lex_gets (parser->parser_lex_gets)

#define lex_gets_ptr (parser->parser_lex_gets_ptr)

#define lex_goto_eol | ( |  | parser | ) | (parser->parser_lex_p = parser->parser_lex_pend)

#define lex_input (parser->parser_lex_input)

#define lex_lastline (parser->parser_lex_lastline)

#define lex_nextline (parser->parser_lex_nextline)

#define lex_p (parser->parser_lex_p)

#define lex_pbeg (parser->parser_lex_pbeg)

#define lex_pend (parser->parser_lex_pend)

#define lex_state (parser->parser_lex_state)

#define lex_strterm (parser->parser_lex_strterm)

#define list_append | ( |  | l,
|  |  | i
| ) |  | list_append_gen(parser,l,i)

#define list_concat | ( |  | h,
|  |  | t
| ) |  | list_concat_gen(parser,h,t)

#define literal_concat | ( |  | h,
|  |  | t
| ) |  | literal_concat_gen(parser,h,t)

#define local_id | ( |  | id | ) | local_id_gen(parser, id)

#define local_pop | ( |  | ) | local_pop_gen(parser)

#define local_push | ( |  | top | ) | local_push_gen(parser,top)

#define local_tbl | ( |  | ) | local_tbl_gen(parser)

#define local_var | ( |  | id | ) | local_var_gen(parser, id);

#define logop | ( |  | type,
|  |  | node1,
|  |  | node2
| ) |  | logop_gen(parser, type, node1, node2)

#define lpar_beg (parser->parser_lpar_beg)

#define lvar_defined | ( |  | id | ) | lvar_defined_gen(parser, id)

#define lvtbl (parser->parser_lvtbl)

#define malloc YYMALLOC

#define match_op | ( |  | node1,
|  |  | node2
| ) |  | match_op_gen(parser, node1, node2)

#define mixed_error | ( |  | enc1,
|  |  | enc2
| ) |  |

Value:

    if (!errbuf) {  \
            size_t len = sizeof(mixed_msg) - 4;     \
            len += strlen(rb_enc_name(enc1));       \
            len += strlen(rb_enc_name(enc2));       \
            errbuf = ALLOCA_N(char, len);           \
            snprintf(errbuf, len, mixed_msg,        \
                     rb_enc_name(enc1),             \
                     rb_enc_name(enc2));            \
            yyerror(errbuf);                        \
        }

#define mixed_escape | ( |  | beg,
|  |  | enc1,
|  |  | enc2
| ) |  |

Value:

    do {    \
            const char *pos = lex_p;                \
            lex_p = beg;                            \
            mixed_error(enc1, enc2);                \
            lex_p = pos;                            \
        } while (0)

#define nd_func u1.id

#define nd_nest u3.cnt

#define nd_paren | ( |  | node | ) | (char)((node)->u2.id >> CHAR_BIT*2)

#define nd_term | ( |  | node | ) | SIGN_EXTEND((node)->u2.id, CHAR_BIT*2)

#define new_args | ( |  | f,
|  |  | o,
|  |  | r,
|  |  | p,
|  |  | b
| ) |  | new_args_gen(parser, f,o,r,p,b)

#define new_bv | ( |  | id | ) | new_bv_gen(parser, id)

#define new_evstr | ( |  | n | ) | new_evstr_gen(parser,n)

#define NEW_STRTERM | ( |  | func,
|  |  | term,
|  |  | paren
| ) |  | rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0)

#define new_yield | ( |  | node | ) | new_yield_gen(parser, node)

#define newtok | ( |  | ) | parser_newtok(parser)

#define nextc | ( |  | ) | parser_nextc(parser)

#define no_digits | ( |  | ) | do {yyerror("numeric literal without digits"); return 0;} while (0)

#define node_assign | ( |  | node1,
|  |  | node2
| ) |  | node_assign_gen(parser, node1, node2)

#define NODE_HEREDOC NODE_ARRAY

#define NODE_STRTERM NODE_ZARRAY

#define numberof | ( |  | array | ) | (int)(sizeof(array) / sizeof((array)[0]))

#define op_tbl_count numberof(op_tbl)

#define paren_nest (parser->parser_paren_nest)

#define parse_string | ( |  | n | ) | parser_parse_string(parser,n)

#define PARSER_ARG ruby_sourcefile, ruby_sourceline,

#define parser_encoding_name | ( |  | ) | (parser->enc->name)

#define parser_is_identchar | ( |  | ) | (!parser->eofp && is_identchar((lex_p-1),lex_pend,parser->enc))

#define parser_isascii | ( |  | ) | ISASCII(*(lex_p-1))

#define parser_mbclen | ( |  | ) | mbclen((lex_p-1),lex_pend,parser->enc)

#define parser_precise_mbclen | ( |  | ) | rb_enc_precise_mbclen((lex_p-1),lex_pend,parser->enc)

#define parser_warn | ( |  | node,
|  |  | mesg
| ) |  | parser_warn(parser, node, mesg)

#define parser_warning | ( |  | node,
|  |  | mesg
| ) |  | parser_warning(parser, node, mesg)

#define peek | ( |  | c | ) | (lex_p < lex_pend && (c) == *lex_p)

#define POINTER_P | ( |  | val | ) | ((VALUE)(val) & ~(VALUE)3)

#define pushback | ( |  | c | ) | parser_pushback(parser, c)

#define rb_backref_error | ( |  | n | ) | rb_backref_error_gen(parser,n)

#define rb_node_newnode | ( |  | type,
|  |  | a1,
|  |  | a2,
|  |  | a3
| ) |  | node_newnode(parser, type, a1, a2, a3)

#define rb_warn0 | ( |  | fmt | ) | rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt)

#define rb_warnI | ( |  | fmt,
|  |  | a
| ) |  | rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt, a)

#define rb_warning0 | ( |  | fmt | ) | rb_compile_warning(ruby_sourcefile, ruby_sourceline, fmt)

#define rb_warningS | ( |  | fmt,
|  |  | a
| ) |  | rb_compile_warning(ruby_sourcefile, ruby_sourceline, fmt, a)

#define rb_warnS | ( |  | fmt,
|  |  | a
| ) |  | rb_compile_warn(ruby_sourcefile, ruby_sourceline, fmt, a)

#define RE_OPTION_ARG_ENCODING_NONE 32

#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_ENCODING_SHIFT 8

#define RE_OPTION_MASK 0xff

#define RE_OPTION_ONCE (1<<16)

#define read_escape | ( |  | flags,
|  |  | e
| ) |  | parser_read_escape(parser, flags, e)

#define realloc YYREALLOC

#define reduce_nodes | ( |  | n | ) | reduce_nodes_gen(parser,n)

#define reg_compile | ( |  | str,
|  |  | options
| ) |  | reg_compile_gen(parser, str, options)

#define reg_fragment_check | ( |  | str,
|  |  | options
| ) |  | reg_fragment_check_gen(parser, str, options)

#define reg_fragment_setenc | ( |  | str,
|  |  | options
| ) |  | reg_fragment_setenc_gen(parser, str, options)

#define reg_named_capture_assign | ( |  | regexp,
|  |  | match
| ) |  | reg_named_capture_assign_gen(parser,regexp,match)

#define REGISTER_SYMID | ( |  | id,
|  |  | name
| ) |  | register_symid(id, name, strlen(name), enc)

#define regx_options | ( |  | ) | parser_regx_options(parser)

#define ret_args | ( |  | node | ) | ret_args_gen(parser, node)

#define ripper_flush | ( |  | p | ) | (void)(p)

#define ruby__end__seen (parser->parser_ruby__end__seen)

#define ruby_coverage (parser->coverage)

#define ruby_debug_lines (parser->debug_lines)

#define ruby_eval_tree (parser->parser_eval_tree)

#define ruby_eval_tree_begin (parser->parser_eval_tree_begin)

#define ruby_sourcefile (parser->parser_ruby_sourcefile)

#define ruby_sourceline (parser->parser_ruby_sourceline)

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

#define set_yylval_literal | ( |  | x | ) | yylval.node = NEW_LIT(x)

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

#define set_yylval_node | ( |  | x | ) | yylval.node = x

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

#define set_yylval_str | ( |  | x | ) | yylval.node = NEW_STR(x)

#define shadowing_lvar | ( |  | name | ) | shadowing_lvar_gen(parser, name)

#define SIGN_EXTEND | ( |  | x,
|  |  | n
| ) |  | (((1<<(n)-1)^((x)&~(~0<<(n))))-(1<<(n)-1))

#define SIGN_EXTEND_CHAR | ( |  | c | ) | ((((unsigned char)(c)) ^ 128) - 128)

#define str_copy | ( |  | _s,
|  |  | _p,
|  |  | _n
| ) |  |

Value:

    ((_s) \
            ? (rb_str_resize((_s), (_n)), \
               MEMCPY(RSTRING_PTR(_s), (_p), char, (_n)), (_s)) \
            : ((_s) = STR_NEW((_p), (_n))))

#define STR_FUNC_ESCAPE 0x01

#define STR_FUNC_EXPAND 0x02

#define STR_FUNC_INDENT 0x20

#define STR_FUNC_QWORDS 0x08

#define STR_FUNC_REGEXP 0x04

#define STR_FUNC_SYMBOL 0x10

#define STR_NEW | ( |  | p,
|  |  | n
| ) |  | rb_enc_str_new((p),(n),parser->enc)

#define STR_NEW0 | ( |  | ) | rb_enc_str_new(0,0,parser->enc)

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

#define STR_NEW3 | ( |  | p,
|  |  | n,
|  |  | e,
|  |  | func
| ) |  | parser_str_new((p),(n),(e),(func),parser->enc)

#define subnodes | ( |  | n1,
|  |  | n2
| ) |  |

Value:

    ((!node->n1) ? (node->n2 ? (body = &node->n2, 1) : 0) : \
         (!node->n2) ? (body = &node->n1, 1) : \
         (reduce_nodes(&node->n1), body = &node->n2, 1))

#define tok | ( |  | ) | tokenbuf

#define tok_hex | ( |  | numlen | ) | parser_tok_hex(parser, numlen)

#define TOK_INTERN | ( |  | mb | ) | rb_intern3(tok(), toklen(), parser->enc)

#define tokadd | ( |  | c | ) | parser_tokadd(parser, c)

#define tokadd_escape | ( |  | e | ) | parser_tokadd_escape(parser, e)

#define tokadd_mbchar | ( |  | c | ) | parser_tokadd_mbchar(parser, c)

#define tokadd_string | ( |  | f,
|  |  | t,
|  |  | p,
|  |  | n,
|  |  | e
| ) |  | parser_tokadd_string(parser,f,t,p,n,e)

#define tokaddmbc | ( |  | c,
|  |  | enc
| ) |  | parser_tokaddmbc(parser, c, enc)

#define tokcopy | ( |  | n | ) | memcpy(tokspace(n), lex_p - (n), (n))

#define token_info_pop | ( |  | token | ) | (RTEST(ruby_verbose) ? token_info_pop(parser, token) : (void)0)

#define token_info_push | ( |  | token | ) | (RTEST(ruby_verbose) ? token_info_push(parser, token) : (void)0)

#define tokenbuf (parser->parser_tokenbuf)

#define tokfix | ( |  | ) | (tokenbuf[tokidx]='\0')

#define tokidx (parser->parser_tokidx)

#define toklast | ( |  | ) | (tokidx>0?tokenbuf[tokidx-1]:0)

#define toklen | ( |  | ) | tokidx

#define toksiz (parser->parser_toksiz)

#define tokspace | ( |  | n | ) | parser_tokspace(parser, n)

#define UTF8_ENC | ( |  | ) |

Value:

    (parser->utf8 ? parser->utf8 : \
                        (parser->utf8 = rb_utf8_encoding()))

#define value_expr | ( |  | node | ) | value_expr_gen(parser, (node) = remove_begin(node))

#define void_expr | ( |  | node | ) | void_expr0((node) = remove_begin(node))

#define void_expr0 | ( |  | node | ) | void_expr_gen(parser, (node))

#define void_stmts | ( |  | node | ) | void_stmts_gen(parser, node)

#define VTBL_DEBUG 0

#define warn_balanced | ( |  | op,
|  |  | syn
| ) |  |

Value:

    (last_state != EXPR_CLASS && last_state != EXPR_DOT && \
         last_state != EXPR_FNAME && last_state != EXPR_ENDFN && \
         last_state != EXPR_ENDARG && \
         space_seen && !ISSPACE(c) && \
         (ambiguous_operator(op, syn), 0))

#define was_bol | ( |  | ) | (lex_p == lex_pbeg + 1)

#define whole_match_p | ( |  | e,
|  |  | l,
|  |  | i
| ) |  | parser_whole_match_p(parser,e,l,i)

#define YYCALLOC | ( |  | nelem,
|  |  | size
| ) |  | rb_parser_calloc(parser, nelem, size)

#define YYDEBUG 1

#define yydebug (parser->parser_yydebug)

#define yyerror | ( |  | msg | ) | parser_yyerror(parser, msg)

#define YYERROR_VERBOSE 1

#define YYFREE | ( |  | ptr | ) | rb_parser_free(parser, ptr)

#define YYLEX_PARAM parser

#define yylval (*((YYSTYPE*)(parser->parser_yylval)))

#define yylval_id | ( |  | ) | yylval.id

#define YYMALLOC | ( |  | size | ) | rb_parser_malloc(parser, size)

#define yyparse ruby_yyparse

#define YYREALLOC | ( |  | ptr,
|  |  | size
| ) |  | rb_parser_realloc(parser, ptr, size)

#define YYSTACK_USE_ALLOCA 0

## Function Documentation

command fixpos | ( | $$ | ,
|  | $ | 1
| ) |  |

if | ( | !$$ |  | ) |

if | ( | $ | 2 | ) |

Definition at line 2174 of file parse.y.

Referenced by CreateChild(), gc_mark_children(), getaddrinfo(), getnameinfo(), io_reopen(), iseq_insns_unification(), iseq_set_arguments(), name_add(), names_clear(), onig_foreach_name(), onig_memsize(), onig_names_free(), onig_number_of_names(), onig_renumber_name_table(), parse_char_class(), parse_enclose(), rb_syck_load_handler(), rb_syck_output_handler(), rb_thread_call_with_gvl(), rb_w32_select(), set_optimize_map_info(), and syck_emitter_emit().

## Variable Documentation

top_compstmt __pad0__

Definition at line 2098 of file parse.y.

block_command __pad10__

Definition at line 2573 of file parse.y.

cmd_brace_block __pad11__

Definition at line 2573 of file parse.y.

command __pad12__ = ruby_sourceline

Definition at line 2594 of file parse.y.

mlhs __pad13__

Definition at line 2717 of file parse.y.

mlhs_inner __pad14__

Definition at line 2728 of file parse.y.

mlhs_item __pad15__

Definition at line 2728 of file parse.y.

mlhs_head __pad16__

Definition at line 2833 of file parse.y.

mlhs_post __pad17__

Definition at line 2833 of file parse.y.

mlhs_node __pad18__

Definition at line 2861 of file parse.y.

top_stmts __pad1__ = $1

Definition at line 2107 of file parse.y.

top_stmt __pad2__

Definition at line 2140 of file parse.y.

bodystmt __pad3__

Definition at line 2165 of file parse.y.

compstmt __pad4__

Definition at line 2198 of file parse.y.

stmts __pad5__ = $1

Definition at line 2207 of file parse.y.

stmt __pad6__

Definition at line 2240 of file parse.y.

expr __pad7__

Definition at line 2515 of file parse.y.

expr_value __pad8__

Definition at line 2515 of file parse.y.

command_call __pad9__

Definition at line 2563 of file parse.y.

fixup_nodes& deferred_nodes

Definition at line 2104 of file parse.y.

mlhs_inner mlhs_basic

Definition at line 2728 of file parse.y.

mlhs_post

Definition at line 2861 of file parse.y.