ext/ripper/ripper.y File Reference

#include "ruby/ruby.h"
#include "ruby/st.h"
#include "ruby/encoding.h"
#include "internal.h"
#include "node.h"
#include "parse.h"
#include "id.h"
#include "regenc.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include "probes.h"
#include "id.c"
#include "ruby/regex.h"
#include "ruby/util.h"
#include "lex.c"

Go to the source code of this file.

Data Structures

struct  magic_comment
struct  reg_named_capture_assign_t
struct  symbols

Defines

#define PARSER_DEBUG   0
#define YYDEBUG   1
#define YYERROR_VERBOSE   1
#define YYSTACK_USE_ALLOCA   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_OP_ID)
#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 id_type(id)   (is_notop_id(id) ? (int)((id)&ID_SCOPE_MASK) : -1)
#define is_asgn_or_id(id)
#define DEF_EXPR(n)   EXPR_##n = (1 << EXPR_##n##_bit)
#define IS_lex_state_for(x, ls)   ((x) & (ls))
#define IS_lex_state(ls)   IS_lex_state_for(lex_state, (ls))
#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 STR_NEW(p, n)   rb_enc_str_new((p),(n),current_enc)
#define STR_NEW0()   rb_enc_str_new(0,0,current_enc)
#define STR_NEW2(p)   rb_enc_str_new((p),strlen(p),current_enc)
#define STR_NEW3(p, n, e, func)   parser_str_new((p),(n),(e),(func),current_enc)
#define ENC_SINGLE(cr)   ((cr)==ENC_CODERANGE_7BIT)
#define TOK_INTERN(mb)   rb_intern3(tok(), toklen(), current_enc)
#define yyerror(msg)   parser_yyerror(parser, (msg))
#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 brace_nest   (parser->parser_brace_nest)
#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 tokline   (parser->parser_tokline)
#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 ruby_sourcefile_string   (parser->parser_ruby_sourcefile_string)
#define current_enc   (parser->enc)
#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, t)   new_args_gen(parser, (f),(o),(r),(p),(t))
#define new_args_tail(k, kr, b)   new_args_tail_gen(parser, (k),(kr),(b))
#define ret_args(node)   ret_args_gen(parser, (node))
#define new_yield(node)   new_yield_gen(parser, (node))
#define dsym_node(node)   dsym_node_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 new_attr_op_assign(lhs, type, attr, op, rhs)   new_attr_op_assign_gen(parser, (lhs), (attr), (op), (rhs))
#define new_const_op_assign(lhs, op, rhs)   new_const_op_assign_gen(parser, (lhs), (op), (rhs))
#define new_defined(expr)   NEW_DEFINED(remove_begin_all(expr))
#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 new_op_assign(lhs, op, rhs)   new_op_assign_gen(parser, (lhs), (op), (rhs))
#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), 0)
#define dvar_defined_get(id)   dvar_defined_gen(parser, (id), 1)
#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 Qnone   0
#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_warn4S(file, line, fmt, a)   rb_compile_warn((file), (line), (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_compile_error   rb_compile_error_with_enc
#define compile_error   parser->nerr++,rb_compile_error_with_enc
#define PARSER_ARG   ruby_sourcefile, ruby_sourceline, current_enc,
#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 number_literal_suffix(f)   parser_number_literal_suffix(parser, (f))
#define set_number_literal(v, t, f)   parser_set_number_literal(parser, (v), (t), (f))
#define set_integer_literal(v, f)   parser_set_integer_literal(parser, (v), (f))
#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()   (current_enc->name)
#define parser_mbclen()   mbclen((lex_p-1),lex_pend,current_enc)
#define parser_precise_mbclen()   rb_enc_precise_mbclen((lex_p-1),lex_pend,current_enc)
#define is_identchar(p, e, enc)   (rb_enc_isalnum((unsigned char)(*(p)),(enc)) || (*(p)) == '_' || !ISASCII(*(p)))
#define parser_is_identchar()   (!parser->eofp && is_identchar((lex_p-1),lex_pend,current_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 lex_eol_p()   (lex_p >= lex_pend)
#define peek(c)   peek_n((c), 0)
#define peek_n(c, n)   (lex_p+(n) < lex_pend && (c) == (unsigned char)lex_p[n])
#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 flush_string_content(enc)   ((void)(enc))
#define BIT(c, idx)   (((c) / 32 - 1 == idx) ? (1U << ((c) % 32)) : 0)
#define SPECIAL_PUNCT(idx)
#define NUM_SUFFIX_R   (1<<0)
#define NUM_SUFFIX_I   (1<<1)
#define NUM_SUFFIX_ALL   3
#define dispatch_heredoc_end()   ((void)0)
#define arg_ambiguous()   (arg_ambiguous_gen(parser), 1)
#define str_copy(_s, _p, _n)
#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)
#define IS_SPCARG(c)   (IS_ARG() && space_seen && !ISSPACE(c))
#define IS_LABEL_POSSIBLE()   ((IS_lex_state(EXPR_BEG | EXPR_ENDFN) && !cmd_state) || IS_ARG())
#define IS_LABEL_SUFFIX(n)   (peek_n(':',(n)) && !peek_n(':', (n)+1))
#define IS_AFTER_OPERATOR()   IS_lex_state(EXPR_FNAME | EXPR_DOT)
#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 LVAR_USED   ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))
#define subnodes(n1, n2)
#define op_tbl_count   numberof(op_tbl)
#define ENABLE_SELECTOR_NAMESPACE   0
#define IDSET_ATTRSET_FOR_SYNTAX   ((1U<<ID_LOCAL)|(1U<<ID_CONST))
#define IDSET_ATTRSET_FOR_INTERN   (~(~0U<<ID_SCOPE_MASK) & ~(1U<<ID_ATTRSET))
#define HEAPCNT(n, size)   ((n) * (size) / sizeof(YYSTYPE))
#define NEWHEAP()   rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser->heap, 0)
#define ADD2HEAP(n, c, p)

Typedefs

typedef long(*) rb_magic_comment_length_t (struct parser_params *parser, const char *name, long len)
typedef void(*) rb_magic_comment_setter_t (struct parser_params *parser, const char *name, const char *val)

Enumerations

enum  string_type {
  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_dword = (STR_FUNC_QWORDS|STR_FUNC_EXPAND), str_ssym = (STR_FUNC_SYMBOL), str_dsym = (STR_FUNC_SYMBOL|STR_FUNC_EXPAND)
}

Functions

top_stmts dispatch0 (stmts_new)
top_stmts dispatch0 (void_stmt))
top_stmt escape_Qundef ($1)
expr ripper_intern ("and")
 CMDARG_PUSH (1)
primary arg_new ())
numeric ripper_intern ("-@")
static int parser_regx_options (struct parser_params *)
static int parser_tokadd_string (struct parser_params *, int, int, int, long *, rb_encoding **)
static void parser_tokaddmbc (struct parser_params *parser, int c, rb_encoding *enc)
static int parser_parse_string (struct parser_params *, NODE *)
static int parser_here_document (struct parser_params *, NODE *)
static int token_info_get_column (struct parser_params *parser, const char *token)
static int token_info_has_nonspaces (struct parser_params *parser, const char *token)
static void token_info_push (struct parser_params *parser, const char *token)
static void token_info_pop (struct parser_params *parser, const char *token)
static int parser_yyerror (struct parser_params *parser, const char *msg)
static void parser_prepare (struct parser_params *parser)
static VALUE debug_lines (VALUE fname)
static VALUE coverage (VALUE fname, int n)
static int e_option_supplied (struct parser_params *parser)
static VALUE yycompile0 (VALUE arg)
static NODEyycompile (struct parser_params *parser, VALUE fname, int line)
static rb_encodingmust_be_ascii_compatible (VALUE s)
static VALUE lex_get_str (struct parser_params *parser, VALUE s)
static VALUE lex_getline (struct parser_params *parser)
static NODEparser_compile_string (volatile VALUE vparser, VALUE fname, VALUE s, int line)
NODErb_compile_string (const char *f, VALUE s, int line)
NODErb_parser_compile_string (volatile VALUE vparser, const char *f, VALUE s, int line)
NODErb_parser_compile_string_path (volatile VALUE vparser, VALUE f, VALUE s, int line)
NODErb_compile_cstr (const char *f, const char *s, int len, int line)
NODErb_parser_compile_cstr (volatile VALUE vparser, const char *f, const char *s, int len, int line)
static VALUE lex_io_gets (struct parser_params *parser, VALUE io)
NODErb_compile_file (const char *f, VALUE file, int start)
NODErb_parser_compile_file (volatile VALUE vparser, const char *f, VALUE file, int start)
NODErb_parser_compile_file_path (volatile VALUE vparser, VALUE fname, VALUE file, int start)
static VALUE parser_str_new (const char *p, long n, rb_encoding *enc, int func, rb_encoding *enc0)
static int parser_nextc (struct parser_params *parser)
static void parser_pushback (struct parser_params *parser, int c)
static char * parser_newtok (struct parser_params *parser)
static char * parser_tokspace (struct parser_params *parser, int n)
static void parser_tokadd (struct parser_params *parser, int c)
static int parser_tok_hex (struct parser_params *parser, size_t *numlen)
static int parser_tokadd_utf8 (struct parser_params *parser, rb_encoding **encp, int string_literal, int symbol_literal, int regexp_literal)
static int parser_read_escape (struct parser_params *parser, int flags, rb_encoding **encp)
static int parser_tokadd_escape (struct parser_params *parser, rb_encoding **encp)
static void dispose_string (VALUE str)
static int parser_tokadd_mbchar (struct parser_params *parser, int c)
static int simple_re_meta (int c)
static int is_global_name_punct (const int c)
static int parser_peek_variable_name (struct parser_params *parser)
static int parser_heredoc_identifier (struct parser_params *parser)
static void parser_heredoc_restore (struct parser_params *parser, NODE *here)
static int parser_whole_match_p (struct parser_params *parser, const char *eos, long len, int indent)
static int parser_number_literal_suffix (struct parser_params *parser, int mask)
static int parser_set_number_literal (struct parser_params *parser, VALUE v, int type, int suffix)
static int parser_set_integer_literal (struct parser_params *parser, VALUE v, int suffix)
static void arg_ambiguous_gen (struct parser_params *parser)
static ID formal_argument_gen (struct parser_params *parser, ID lhs)
static int lvar_defined_gen (struct parser_params *parser, ID id)
static long parser_encode_length (struct parser_params *parser, const char *name, long len)
static void parser_set_encode (struct parser_params *parser, const char *name)
static int comment_at_top (struct parser_params *parser)
static void magic_comment_encoding (struct parser_params *parser, const char *name, const char *val)
static void parser_set_token_info (struct parser_params *parser, const char *name, const char *val)
static const char * magic_comment_marker (const char *str, long len)
static int parser_magic_comment (struct parser_params *parser, const char *str, long len)
static void set_file_encoding (struct parser_params *parser, const char *str, const char *send)
static int parser_yylex (struct parser_params *parser)
 yylex (void *p)
static NODEnode_newnode (struct parser_params *parser, enum node_type type, VALUE a0, VALUE a1, VALUE a2)
static enum node_type nodetype (NODE *node)
static int nodeline (NODE *node)
static NODEnewline_node (NODE *node)
static void fixpos (NODE *node, NODE *orig)
static void parser_warning (struct parser_params *parser, NODE *node, const char *mesg)
static void parser_warn (struct parser_params *parser, NODE *node, const char *mesg)
static NODEblock_append_gen (struct parser_params *parser, NODE *head, NODE *tail)
static NODElist_append_gen (struct parser_params *parser, NODE *list, NODE *item)
static NODElist_concat_gen (struct parser_params *parser, NODE *head, NODE *tail)
static int literal_concat0 (struct parser_params *parser, VALUE head, VALUE tail)
static NODEliteral_concat_gen (struct parser_params *parser, NODE *head, NODE *tail)
static NODEevstr2dstr_gen (struct parser_params *parser, NODE *node)
static NODEnew_evstr_gen (struct parser_params *parser, NODE *node)
static NODEcall_bin_op_gen (struct parser_params *parser, NODE *recv, ID id, NODE *arg1)
static NODEcall_uni_op_gen (struct parser_params *parser, NODE *recv, ID id)
static NODEmatch_op_gen (struct parser_params *parser, NODE *node1, NODE *node2)
static NODEgettable_gen (struct parser_params *parser, ID id)
static NODEassignable_gen (struct parser_params *parser, ID id, NODE *val)
static int is_private_local_id (ID name)
static int shadowing_lvar_0 (struct parser_params *parser, ID name)
static ID shadowing_lvar_gen (struct parser_params *parser, ID name)
static void new_bv_gen (struct parser_params *parser, ID name)
static NODEaryset_gen (struct parser_params *parser, NODE *recv, NODE *idx)
static void block_dup_check_gen (struct parser_params *parser, NODE *node1, NODE *node2)
ID rb_id_attrset (ID id)
static NODEattrset_gen (struct parser_params *parser, NODE *recv, ID id)
static void rb_backref_error_gen (struct parser_params *parser, NODE *node)
static NODEarg_concat_gen (struct parser_params *parser, NODE *node1, NODE *node2)
static NODEarg_append_gen (struct parser_params *parser, NODE *node1, NODE *node2)
static NODEsplat_array (NODE *node)
static NODEnode_assign_gen (struct parser_params *parser, NODE *lhs, NODE *rhs)
static int value_expr_gen (struct parser_params *parser, NODE *node)
static void void_expr_gen (struct parser_params *parser, NODE *node)
static void void_stmts_gen (struct parser_params *parser, NODE *node)
static NODEremove_begin (NODE *node)
static NODEremove_begin_all (NODE *node)
static void reduce_nodes_gen (struct parser_params *parser, NODE **body)
static int is_static_content (NODE *node)
static int assign_in_cond (struct parser_params *parser, NODE *node)
static void warn_unless_e_option (struct parser_params *parser, NODE *node, const char *str)
static void warning_unless_e_option (struct parser_params *parser, NODE *node, const char *str)
static void fixup_nodes (NODE **rootnode)
static NODEcond0 (struct parser_params *, NODE *)
static NODErange_op (struct parser_params *parser, NODE *node)
static int literal_node (NODE *node)
static NODEcond_gen (struct parser_params *parser, NODE *node)
static NODElogop_gen (struct parser_params *parser, enum node_type type, NODE *left, NODE *right)
static void no_blockarg (struct parser_params *parser, NODE *node)
static NODEret_args_gen (struct parser_params *parser, NODE *node)
static NODEnew_yield_gen (struct parser_params *parser, NODE *node)
static NODEnegate_lit (NODE *node)
static NODEarg_blk_pass (NODE *node1, NODE *node2)
static NODEnew_args_gen (struct parser_params *parser, NODE *m, NODE *o, ID r, NODE *p, NODE *tail)
static NODEnew_args_tail_gen (struct parser_params *parser, NODE *k, ID kr, ID b)
static NODEdsym_node_gen (struct parser_params *parser, NODE *node)
static NODEnew_op_assign_gen (struct parser_params *parser, NODE *lhs, ID op, NODE *rhs)
static NODEnew_attr_op_assign_gen (struct parser_params *parser, NODE *lhs, ID attr, ID op, NODE *rhs)
static NODEnew_const_op_assign_gen (struct parser_params *parser, NODE *lhs, ID op, NODE *rhs)
static void warn_unused_var (struct parser_params *parser, struct local_vars *local)
static void local_push_gen (struct parser_params *parser, int inherit_dvars)
static void local_pop_gen (struct parser_params *parser)
static IDlocal_tbl_gen (struct parser_params *parser)
static int arg_var_gen (struct parser_params *parser, ID id)
static int local_var_gen (struct parser_params *parser, ID id)
static int local_id_gen (struct parser_params *parser, ID id)
static struct vtabledyna_push_gen (struct parser_params *parser)
static void dyna_pop_1 (struct parser_params *parser)
static void dyna_pop_gen (struct parser_params *parser, const struct vtable *lvargs)
static int dyna_in_block_gen (struct parser_params *parser)
static int dvar_defined_gen (struct parser_params *parser, ID id, int get)
static int dvar_curr_gen (struct parser_params *parser, ID id)
static void reg_fragment_setenc_gen (struct parser_params *parser, VALUE str, int options)
static int reg_fragment_check_gen (struct parser_params *parser, VALUE str, int options)
static int reg_named_capture_assign_iter (const OnigUChar *name, const OnigUChar *name_end, int back_num, int *back_refs, OnigRegex regex, void *arg0)
static NODEreg_named_capture_assign_gen (struct parser_params *parser, VALUE regexp, NODE *match)
static VALUE reg_compile_gen (struct parser_params *parser, VALUE str, int options)
void rb_gc_mark_parser (void)
NODErb_parser_append_print (VALUE vparser, NODE *node)
NODErb_parser_while_loop (VALUE vparser, NODE *node, int chop, int split)
void Init_sym (void)
void rb_gc_mark_symbols (int full_mark)
static ID internal_id_gen (struct parser_params *parser)
static int is_special_global_name (const char *m, const char *e, rb_encoding *enc)
int rb_symname_p (const char *name)
int rb_enc_symname_p (const char *name, rb_encoding *enc)
static int rb_enc_symname_type (const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset)
int rb_enc_symname2_p (const char *name, long len, rb_encoding *enc)
static int rb_str_symname_type (VALUE name, unsigned int allowed_attrset)
static ID register_symid (ID id, const char *name, long len, rb_encoding *enc)
static ID register_symid_str (ID id, VALUE str)
static int sym_check_asciionly (VALUE str)
static ID intern_str (VALUE str)
static VALUE setup_fake_str (struct RString *fake_str, const char *name, long len)
ID rb_intern3 (const char *name, long len, rb_encoding *enc)
ID rb_intern2 (const char *name, long len)
ID rb_intern (const char *name)
ID rb_intern_str (VALUE str)
VALUE rb_id2str (ID id)
const char * rb_id2name (ID id)
static int symbols_i (VALUE sym, ID value, VALUE ary)
VALUE rb_sym_all_symbols (void)
int rb_is_const_id (ID id)
int rb_is_class_id (ID id)
int rb_is_global_id (ID id)
int rb_is_instance_id (ID id)
int rb_is_attrset_id (ID id)
int rb_is_local_id (ID id)
int rb_is_junk_id (ID id)
ID rb_check_id (volatile VALUE *namep)
 Returns ID for the given name if it is interned already, or 0.
ID rb_check_id_cstr (const char *ptr, long len, rb_encoding *enc)
int rb_is_const_name (VALUE name)
int rb_is_class_name (VALUE name)
int rb_is_global_name (VALUE name)
int rb_is_instance_name (VALUE name)
int rb_is_attrset_name (VALUE name)
int rb_is_local_name (VALUE name)
int rb_is_method_name (VALUE name)
int rb_is_junk_name (VALUE name)
static void parser_initialize (struct parser_params *parser)
static void parser_mark (void *ptr)
static void parser_free (void *ptr)
static size_t parser_memsize (const void *ptr)
kwtablerb_reserved_word (const char *str, unsigned int len)
static struct parser_paramsparser_new (void)
VALUE rb_parser_new (void)
VALUE rb_parser_end_seen_p (VALUE vparser)
VALUE rb_parser_encoding (VALUE vparser)
VALUE rb_parser_get_yydebug (VALUE self)
VALUE rb_parser_set_yydebug (VALUE self, VALUE flag)
void * rb_parser_malloc (struct parser_params *parser, size_t size)
void * rb_parser_calloc (struct parser_params *parser, size_t nelem, size_t size)
void * rb_parser_realloc (struct parser_params *parser, void *ptr, size_t size)
void rb_parser_free (struct parser_params *parser, void *ptr)

Variables

top_compstmt __pad0__
top_stmts __pad1__
top_stmt __pad2__
top_stmt bodystmt
compstmt __pad3__
stmts __pad4__
stmt_or_begin __pad5__
command_asgn __pad6__
command_asgn lhs
expr __pad7__
expr_value __pad8__
command_call __pad9__
block_command __pad10__
block_command cmd_brace_block = method_arg($$, $4)
fcall __pad11__
command __pad12__
mlhs __pad13__
mlhs mlhs_inner
mlhs mlhs_basic
mlhs_item __pad14__
mlhs_item mlhs_head
mlhs_post __pad15__
mlhs_post mlhs_post
mlhs_node __pad16__
lhs __pad17__
cname __pad18__ = dispatch1(var_field, $$)
cname tCONSTANT
cpath __pad19__
fname __pad20__
fsym __pad21__ = $1
fitem __pad22__
fitem dsym
undef_list __pad23__
undef_list undef_list
op __pad24__
reswords __pad25__
arg __pad26__
arg lhs
arg_value __pad27__
aref_args __pad28__
 args
paren_args __pad29__
opt_paren_args __pad30__
opt_call_args __pad31__
call_args __pad32__
command_args __pad33__
block_arg __pad34__
opt_block_arg __pad35__
args __pad36__
mrhs_arg __pad37__
mrhs __pad38__
primary __pad39__
primary_value __pad40__
k_begin __pad41__
k_if __pad42__
k_unless __pad43__
k_while __pad44__
k_until __pad45__
k_case __pad46__
k_for __pad47__
k_class __pad48__
k_module __pad49__
k_def __pad50__
k_end __pad51__
then __pad52__
do __pad53__
 keyword_do_cond
if_tail __pad54__
opt_else __pad55__
opt_else for_var
f_marg __pad56__
f_marg_list __pad57__ = dispatch1(mlhs_paren, $$)
f_marg_list f_marg_list
f_margs __pad58__
 f_marg_list
block_args_tail __pad59__
opt_block_args_tail __pad60__
block_param __pad61__
block_param f_block_optarg
opt_block_param __pad62__
block_param_def __pad63__
block_param_def Qnil
block_param_def Qnil
block_param_def Qnil
block_param_def Qnil
block_param_def Qnil
block_param_def Qnil
opt_bv_decl __pad64__
 opt_nl
bv_decls __pad65__
bv_decls bv_decls
bvar __pad66__
lambda __pad67__ = get_value($1)
f_larglist __pad68__
lambda_body __pad69__
do_block __pad70__
block_call __pad71__
method_call __pad72__
brace_block __pad73__
case_body __pad74__
cases __pad75__
opt_rescue __pad76__
 none
exc_list __pad77__
exc_var __pad78__
 none
opt_ensure __pad79__
opt_ensure none
literal __pad80__
literal dsym
strings __pad81__
string __pad82__
string string1
string xstring
string regexp
string words
word_list __pad83__ = dispatch1(array, $$)
word __pad84__
symbols __pad85__ = dispatch2(word_add, $$, $1)
symbol_list __pad86__ = dispatch1(array, $$)
qwords __pad87__
qsymbols __pad88__ = dispatch1(array, $$)
qword_list __pad89__ = dispatch1(array, $$)
qsym_list __pad90__
string_contents __pad91__
xstring_contents __pad92__
regexp_contents __pad93__
string_content __pad94__
 lex_strterm = 0
 lex_state = EXPR_BEG
string_dvar __pad95__
symbol __pad96__
sym __pad97__ = dispatch1(symbol, $2)
dsym __pad98__
numeric __pad99__ = dispatch1(dyna_symbol, $2)
numeric simple_numeric
user_variable __pad100__
keyword_variable __pad101__
var_ref __pad102__
var_lhs __pad103__
backref __pad104__ = dispatch1(var_field, $$)
superclass __pad105__
<'{lex_state=EXPR_BEG;command_start=TRUE;}expr_valueterm{$$=$3;}|errorterm{yyerrok;$$=Qnil;};f_arglist:'('f_argsrparen{$$=dispatch1(paren, $2);lex_state=EXPR_BEG;command_start=TRUE;}|{$<
num > parser 
parser_in_kwarg = parser->parser_in_kwarg 1
args_tail __pad106__
opt_args_tail __pad107__
f_args __pad108__
f_args f_optarg
f_bad_arg __pad109__
f_norm_arg __pad110__
f_arg_item __pad111__ = $1
f_arg __pad112__ = get_value($1)
f_arg f_arg
f_label __pad113__
f_kw __pad114__ = $1
f_block_kw __pad115__ = rb_assoc_new($$, $2)
f_block_kwarg __pad116__ = rb_assoc_new($$, $2)
f_block_kwarg f_block_kwarg
f_kwarg __pad117__
f_kwarg f_kwarg
kwrest_mark __pad118__
f_kwrest __pad119__
f_opt __pad120__ = $2
f_block_opt __pad121__ = assignable($1, $3) rb_assoc_new($$, $3)
f_block_optarg __pad122__ = assignable($1, $3) rb_assoc_new($$, $3)
f_block_optarg f_block_optarg
f_optarg __pad123__
f_optarg f_optarg
restarg_mark __pad124__
f_rest_arg __pad125__
blkarg_mark __pad126__ = dispatch1(rest_param, $2)
f_block_arg __pad127__
opt_f_block_arg __pad128__ = dispatch1(blockarg, $2)
singleton __pad129__
assoc_list __pad130__
assoc_list assocs
assoc_list assocs
assoc __pad131__
operation __pad132__
operation2 __pad133__
operation3 __pad134__
dot_or_colon __pad135__
opt_terms __pad136__
opt_nl __pad137__
rparen __pad138__
rbracket __pad139__
trailer __pad140__
trailer term
terms __pad141__
none __pad142__
static const rb_data_type_t parser_data_type
RUBY_FUNC_EXPORTED const unsigned
int 
ruby_global_name_punct_bits [(0x7e-0x20+31)/32]
static struct magic_comment magic_comments []
static const char id_type_names [][9]
struct {
   ID   token
   const char *   name
op_tbl []
static struct symbols global_symbols
static struct st_hash_type symhash
static const rb_data_type_t parser_data_type


Define Documentation

#define ADD2HEAP ( n,
c,
 ) 

Value:

((parser->heap = (n))->u1.node = (p), \
                           (n)->u3.cnt = (c), (p))

Definition at line 11070 of file ripper.y.

#define ambiguous_operator ( 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 6938 of file ripper.y.

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

Definition at line 6602 of file ripper.y.

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

#define arg_concat ( h,
 )     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)

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

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

Definition at line 6200 of file ripper.y.

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

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

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

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

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

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

#define brace_nest   (parser->parser_brace_nest)

#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 (  )     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_with_enc

#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 (  )     BITSTACK_PUSH(cond_stack, (n))

#define cond_stack   (parser->parser_cond_stack)

#define cur_mid   (parser->parser_cur_mid)

#define current_enc   (parser->enc)

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

#define deferred_nodes   (parser->parser_deferred_nodes)

 
#define dispatch_heredoc_end (  )     ((void)0)

Definition at line 6485 of file ripper.y.

#define dsym_node ( node   )     dsym_node_gen(parser, (node))

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

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

#define dvar_defined_get ( id   )     dvar_defined_gen(parser, (id), 1)

#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

Definition at line 10121 of file ripper.y.

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

#define ESCAPE_CONTROL   1

Definition at line 5794 of file ripper.y.

#define ESCAPE_META   2

Definition at line 5795 of file ripper.y.

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

#define flush_string_content ( enc   )     ((void)(enc))

Definition at line 6193 of file ripper.y.

#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 HEAPCNT ( n,
size   )     ((n) * (size) / sizeof(YYSTYPE))

Definition at line 11068 of file ripper.y.

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

Definition at line 13694 of file ripper.y.

#define heredoc_end   (parser->parser_heredoc_end)

 
#define heredoc_identifier (  )     parser_heredoc_identifier(parser)

Definition at line 13695 of file ripper.y.

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

Definition at line 13696 of file ripper.y.

#define id_type ( id   )     (is_notop_id(id) ? (int)((id)&ID_SCOPE_MASK) : -1)

#define IDSET_ATTRSET_FOR_INTERN   (~(~0U<<ID_SCOPE_MASK) & ~(1U<<ID_ATTRSET))

Definition at line 10248 of file ripper.y.

#define IDSET_ATTRSET_FOR_SYNTAX   ((1U<<ID_LOCAL)|(1U<<ID_CONST))

Definition at line 10247 of file ripper.y.

#define ifndef_ripper (  )     (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_AFTER_OPERATOR (  )     IS_lex_state(EXPR_FNAME | EXPR_DOT)

Definition at line 6935 of file ripper.y.

 
#define IS_ARG (  )     IS_lex_state(EXPR_ARG_ANY)

Definition at line 6929 of file ripper.y.

#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 (  )     IS_lex_state(EXPR_BEG_ANY)

Definition at line 6931 of file ripper.y.

#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 (  )     IS_lex_state(EXPR_END_ANY)

Definition at line 6930 of file ripper.y.

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

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

Definition at line 5150 of file ripper.y.

#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_LABEL_POSSIBLE (  )     ((IS_lex_state(EXPR_BEG | EXPR_ENDFN) && !cmd_state) || IS_ARG())

Definition at line 6933 of file ripper.y.

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

Definition at line 6934 of file ripper.y.

#define IS_lex_state ( ls   )     IS_lex_state_for(lex_state, (ls))

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

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

#define is_notop_id ( id   )     ((id)>tLAST_OP_ID)

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

Definition at line 6932 of file ripper.y.

 
#define lex_eol_p (  )     (lex_p >= lex_pend)

Definition at line 5584 of file ripper.y.

#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)

Definition at line 5583 of file ripper.y.

#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,
 )     list_append_gen(parser,(l),(i))

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

#define literal_concat ( h,
 )     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 LVAR_USED   ((ID)1 << (sizeof(ID) * CHAR_BIT - 1))

Definition at line 8755 of file ripper.y.

#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,
 )     new_args_gen(parser, (f),(o),(r),(p),(t))

#define new_args_tail ( k,
kr,
 )     new_args_tail_gen(parser, (k),(kr),(b))

#define new_attr_op_assign ( lhs,
type,
attr,
op,
rhs   )     new_attr_op_assign_gen(parser, (lhs), (attr), (op), (rhs))

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

#define new_const_op_assign ( lhs,
op,
rhs   )     new_const_op_assign_gen(parser, (lhs), (op), (rhs))

#define new_defined ( expr   )     NEW_DEFINED(remove_begin_all(expr))

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

#define new_op_assign ( lhs,
op,
rhs   )     new_op_assign_gen(parser, (lhs), (op), (rhs))

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

Definition at line 6174 of file ripper.y.

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

 
#define NEWHEAP (  )     rb_node_newnode(NODE_ALLOCA, 0, (VALUE)parser->heap, 0)

Definition at line 11069 of file ripper.y.

 
#define newtok (  )     parser_newtok(parser)

Definition at line 13684 of file ripper.y.

 
#define nextc (  )     parser_nextc(parser)

Definition at line 13682 of file ripper.y.

 
#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 NUM_SUFFIX_ALL   3

Definition at line 6420 of file ripper.y.

#define NUM_SUFFIX_I   (1<<1)

Definition at line 6419 of file ripper.y.

#define NUM_SUFFIX_R   (1<<0)

Definition at line 6418 of file ripper.y.

#define number_literal_suffix (  )     parser_number_literal_suffix(parser, (f))

Definition at line 13698 of file ripper.y.

#define op_tbl_count   numberof(op_tbl)

Definition at line 10118 of file ripper.y.

#define paren_nest   (parser->parser_paren_nest)

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

Definition at line 13692 of file ripper.y.

#define PARSER_ARG   ruby_sourcefile, ruby_sourceline, current_enc,

#define PARSER_DEBUG   0

 
#define parser_encoding_name (  )     (current_enc->name)

Definition at line 5147 of file ripper.y.

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

Definition at line 5151 of file ripper.y.

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

Definition at line 5153 of file ripper.y.

 
#define parser_mbclen (  )     mbclen((lex_p-1),lex_pend,current_enc)

Definition at line 5148 of file ripper.y.

 
#define parser_precise_mbclen (  )     rb_enc_precise_mbclen((lex_p-1),lex_pend,current_enc)

Definition at line 5149 of file ripper.y.

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

Definition at line 8318 of file ripper.y.

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

Definition at line 8311 of file ripper.y.

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

Definition at line 5585 of file ripper.y.

#define peek_n ( c,
 )     (lex_p+(n) < lex_pend && (c) == (unsigned char)lex_p[n])

Definition at line 5586 of file ripper.y.

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

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

Definition at line 13683 of file ripper.y.

#define Qnone   0

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

#define rb_compile_error   rb_compile_error_with_enc

#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_warn4S ( file,
line,
fmt,
 )     rb_compile_warn((file), (line), (fmt), (a))

#define rb_warnI ( fmt,
 )     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,
 )     rb_compile_warning(ruby_sourcefile, ruby_sourceline, (fmt), (a))

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

#define RE_OPTION_ARG_ENCODING_NONE   32

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

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

#define RE_OPTION_ENCODING_NONE (  )     ((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,
 )     parser_read_escape(parser, (flags), (e))

Definition at line 13688 of file ripper.y.

#define realloc   YYREALLOC

#define reduce_nodes (  )     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)

Definition at line 13690 of file ripper.y.

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

#define ripper_flush (  )     (void)(p)

Definition at line 13726 of file ripper.y.

#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_sourcefile_string   (parser->parser_ruby_sourcefile_string)

#define ruby_sourceline   (parser->parser_ruby_sourceline)

#define set_integer_literal ( v,
 )     parser_set_integer_literal(parser, (v), (f))

Definition at line 13700 of file ripper.y.

#define set_number_literal ( v,
t,
 )     parser_set_number_literal(parser, (v), (t), (f))

Definition at line 13699 of file ripper.y.

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

Definition at line 13705 of file ripper.y.

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

Definition at line 13707 of file ripper.y.

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

Definition at line 13706 of file ripper.y.

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

Definition at line 13708 of file ripper.y.

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

Definition at line 13704 of file ripper.y.

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

Definition at line 13703 of file ripper.y.

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

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

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

Definition at line 5144 of file ripper.y.

#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 6201 of file ripper.y.

#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))))

#define STR_FUNC_ESCAPE   0x01

Definition at line 5548 of file ripper.y.

#define STR_FUNC_EXPAND   0x02

Definition at line 5549 of file ripper.y.

#define STR_FUNC_INDENT   0x20

Definition at line 5553 of file ripper.y.

#define STR_FUNC_QWORDS   0x08

Definition at line 5551 of file ripper.y.

#define STR_FUNC_REGEXP   0x04

Definition at line 5550 of file ripper.y.

#define STR_FUNC_SYMBOL   0x10

Definition at line 5552 of file ripper.y.

#define STR_NEW ( p,
 )     rb_enc_str_new((p),(n),current_enc)

 
#define STR_NEW0 (  )     rb_enc_str_new(0,0,current_enc)

#define STR_NEW2 (  )     rb_enc_str_new((p),strlen(p),current_enc)

#define STR_NEW3 ( p,
n,
e,
func   )     parser_str_new((p),(n),(e),(func),current_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

Definition at line 5663 of file ripper.y.

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

Definition at line 13687 of file ripper.y.

#define TOK_INTERN ( mb   )     rb_intern3(tok(), toklen(), current_enc)

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

Definition at line 13686 of file ripper.y.

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

Definition at line 13689 of file ripper.y.

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

Definition at line 6025 of file ripper.y.

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

Definition at line 13691 of file ripper.y.

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

Definition at line 13693 of file ripper.y.

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

Definition at line 5719 of file ripper.y.

#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')

Definition at line 5662 of file ripper.y.

#define tokidx   (parser->parser_tokidx)

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

Definition at line 5665 of file ripper.y.

 
#define toklen (  )     tokidx

Definition at line 5664 of file ripper.y.

#define tokline   (parser->parser_tokline)

#define toksiz   (parser->parser_toksiz)

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

Definition at line 13685 of file ripper.y.

#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:

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

Definition at line 6944 of file ripper.y.

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

Definition at line 5660 of file ripper.y.

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

Definition at line 13697 of file ripper.y.

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

#define yydebug   (parser->parser_yydebug)

#define YYDEBUG   1

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

#define YYERROR_VERBOSE   1

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

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

Definition at line 13673 of file ripper.y.

 
#define yylval_id (  )     (yylval.id)

Definition at line 13709 of file ripper.y.

#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


Typedef Documentation

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

Definition at line 6687 of file ripper.y.

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

Definition at line 6688 of file ripper.y.


Enumeration Type Documentation

enum string_type

Enumerator:
str_squote 
str_dquote 
str_xquote 
str_regexp 
str_sword 
str_dword 
str_ssym 
str_dsym 

Definition at line 5555 of file ripper.y.


Function Documentation

static void arg_ambiguous_gen ( struct parser_params parser  )  [static]

Definition at line 6594 of file ripper.y.

References arg_ambiguous, dispatch0(), and rb_warning0.

static NODE* arg_append_gen ( struct parser_params parser,
NODE node1,
NODE node2 
) [static]

Definition at line 8906 of file ripper.y.

References arg_append, list_append, nd_set_type, nd_type, NEW_ARGSPUSH, NEW_LIST, NODE_ARGSCAT, NODE_ARGSPUSH, NODE_ARRAY, and NODE_BLOCK_PASS.

static NODE* arg_blk_pass ( NODE node1,
NODE node2 
) [static]

Definition at line 9478 of file ripper.y.

static NODE* arg_concat_gen ( struct parser_params parser,
NODE node1,
NODE node2 
) [static]

Definition at line 8881 of file ripper.y.

References arg_concat, list_concat, nd_set_type, nd_type, NEW_ARGSCAT, NEW_LIST, NODE_ARGSCAT, NODE_ARGSPUSH, NODE_ARRAY, and NODE_BLOCK_PASS.

primary arg_new (  ) 

Referenced by yyparse().

static int arg_var_gen ( struct parser_params parser,
ID  id 
) [static]

Definition at line 9726 of file ripper.y.

References lvtbl, vtable_add(), and vtable_size().

static NODE* aryset_gen ( struct parser_params parser,
NODE recv,
NODE idx 
) [static]

Definition at line 8804 of file ripper.y.

References nd_type, NEW_ATTRASGN, NODE_SELF, and tASET.

static int assign_in_cond ( struct parser_params parser,
NODE node 
) [static]

Definition at line 9228 of file ripper.y.

References is_static_content(), nd_type, node, NODE_DASGN, NODE_DASGN_CURR, NODE_GASGN, NODE_IASGN, NODE_LASGN, NODE_MASGN, parser_warn, and yyerror.

static NODE* assignable_gen ( struct parser_params parser,
ID  id,
NODE val 
) [static]

Definition at line 8666 of file ripper.y.

References assignable_result, compile_error, dvar_curr, dvar_defined, dyna_in_block, dyna_var, get_id, ID_CLASS, ID_CONST, ID_GLOBAL, ID_INSTANCE, ID_LOCAL, id_type, in_def, in_single, keyword__ENCODING__, keyword__FILE__, keyword__LINE__, keyword_false, keyword_nil, keyword_self, keyword_true, local_id, local_var, NEW_CDECL, NEW_CVASGN, NEW_DASGN, NEW_DASGN_CURR, NEW_GASGN, NEW_IASGN, NEW_LASGN, PARSER_ARG, rb_id2name(), and yyerror.

static NODE* attrset_gen ( struct parser_params parser,
NODE recv,
ID  id 
) [static]

Definition at line 8860 of file ripper.y.

References nd_type, NEW_ATTRASGN, NODE_SELF, and rb_id_attrset().

static NODE* block_append_gen ( struct parser_params parser,
NODE head,
NODE tail 
) [static]

Definition at line 8321 of file ripper.y.

References fixpos(), head, nd_type, NEW_BLOCK, NODE_BLOCK, NODE_BREAK, NODE_FALSE, NODE_LIT, NODE_NEXT, NODE_NIL, NODE_REDO, NODE_RETRY, NODE_RETURN, NODE_SELF, NODE_STR, NODE_TRUE, parser_warning, RTEST, ruby_verbose, and tail.

static void block_dup_check_gen ( struct parser_params parser,
NODE node1,
NODE node2 
) [static]

Definition at line 8812 of file ripper.y.

References compile_error, nd_type, NODE_BLOCK_PASS, and PARSER_ARG.

static NODE* call_bin_op_gen ( struct parser_params parser,
NODE recv,
ID  id,
NODE arg1 
) [static]

Definition at line 8540 of file ripper.y.

References NEW_CALL, NEW_LIST, and value_expr.

static NODE* call_uni_op_gen ( struct parser_params parser,
NODE recv,
ID  id 
) [static]

Definition at line 8548 of file ripper.y.

References NEW_CALL, and value_expr.

CMDARG_PUSH (  ) 

static int comment_at_top ( struct parser_params parser  )  [static]

Definition at line 6675 of file ripper.y.

References parser_params::has_shebang, ISSPACE, lex_p, lex_pbeg, and parser_params::line_count.

static NODE * cond0 ( struct parser_params ,
NODE  
) [static]

Definition at line 9335 of file ripper.y.

References assign_in_cond(), cond0(), e_option_supplied(), literal_node(), nd_set_type, nd_type, NEW_GVAR, NEW_MATCH2, node, NODE_AND, NODE_DOT2, NODE_DOT3, NODE_DREGX, NODE_DREGX_ONCE, NODE_DSTR, NODE_DSYM, NODE_EVSTR, NODE_FLIP2, NODE_FLIP3, NODE_LIT, NODE_MATCH, NODE_OR, NODE_STR, parser_warn, parser_warning, range_op(), rb_intern, RB_TYPE_P, rb_warn0, RTEST, ruby_verbose, T_REGEXP, warn_unless_e_option(), and warning_unless_e_option().

static NODE* cond_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 9392 of file ripper.y.

References cond0(), and node.

static VALUE coverage ( VALUE  fname,
int  n 
) [static]

Definition at line 5311 of file ripper.y.

References Qnil, RARRAY, RARRAY_ASET, rb_ary_new2, rb_get_coverages(), rb_hash_aset(), RBASIC, RBASIC_CLEAR_CLASS, RTEST, and VALUE.

static VALUE debug_lines ( VALUE  fname  )  [static]

Definition at line 5295 of file ripper.y.

References CONST_ID, hash(), rb_ary_new(), rb_cObject, rb_const_defined_at(), rb_const_get_at(), rb_hash_aset(), RB_TYPE_P, T_HASH, and VALUE.

stmts dispatch0 ( void_stmt   ) 

stmts dispatch0 ( stmts_new   ) 

Referenced by arg_ambiguous_gen(), and yyparse().

static void dispose_string ( VALUE  str  )  [static]

Definition at line 6005 of file ripper.y.

References rb_gc_force_recycle(), and rb_str_free().

static NODE* dsym_node_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 9541 of file ripper.y.

References ID2SYM, idNULL, NEW_LIT, node, and VALUE.

static int dvar_curr_gen ( struct parser_params parser,
ID  id 
) [static]

Definition at line 9851 of file ripper.y.

References lvtbl, and vtable_included().

static int dvar_defined_gen ( struct parser_params parser,
ID  id,
int  get 
) [static]

Definition at line 9820 of file ripper.y.

References args, DVARS_INHERIT, LVAR_USED, lvtbl, POINTER_P, vtable::prev, rb_dvar_defined(), vtable::tbl, and vtable_included().

static int dyna_in_block_gen ( struct parser_params parser  )  [static]

Definition at line 9814 of file ripper.y.

References lvtbl, and POINTER_P.

static void dyna_pop_1 ( struct parser_params parser  )  [static]

Definition at line 9782 of file ripper.y.

References lvtbl, vtable_free(), and warn_unused_var().

static void dyna_pop_gen ( struct parser_params parser,
const struct vtable lvargs 
) [static]

Definition at line 9800 of file ripper.y.

References dyna_pop_1(), lvtbl, and xfree.

static struct vtable* dyna_push_gen ( struct parser_params parser  )  [static]

Definition at line 9771 of file ripper.y.

References lvtbl, and vtable_alloc().

static int e_option_supplied ( struct parser_params parser  )  [static]

Definition at line 5327 of file ripper.y.

References ruby_sourcefile.

opt_rescue escape_Qundef ( 1  ) 

Referenced by yyparse().

static NODE* evstr2dstr_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 8517 of file ripper.y.

References list_append, nd_type, NEW_DSTR, node, NODE_EVSTR, and Qnil.

static void fixpos ( NODE node,
NODE orig 
) [static]

Definition at line 8298 of file ripper.y.

References nd_line, nd_set_line, and node.

static void fixup_nodes ( NODE **  rootnode  )  [static]

Definition at line 9267 of file ripper.y.

References head, nd_set_type, nd_type, node, NODE_DOT2, NODE_DOT3, NODE_LIT, rb_gc_force_recycle(), rb_range_new(), type, and VALUE.

static ID formal_argument_gen ( struct parser_params parser,
ID  lhs 
) [static]

Definition at line 6605 of file ripper.y.

References is_local_id, shadowing_lvar, and yyerror.

static NODE* gettable_gen ( struct parser_params parser,
ID  id 
) [static]

Definition at line 8589 of file ripper.y.

References compile_error, current_enc, dvar_defined, dyna_in_block, ID_CLASS, ID_CONST, ID_GLOBAL, ID_INSTANCE, ID_LOCAL, id_type, INT2FIX, keyword__ENCODING__, keyword__FILE__, keyword__LINE__, keyword_false, keyword_nil, keyword_self, keyword_true, local_id, NEW_CONST, NEW_CVAR, NEW_DVAR, NEW_FALSE, NEW_GVAR, NEW_IVAR, NEW_LIT, NEW_LVAR, NEW_NIL, NEW_SELF, NEW_STR, NEW_TRUE, NEW_VCALL, PARSER_ARG, rb_enc_from_encoding(), rb_id2name(), rb_str_dup(), ruby_sourcefile_string, and tokline.

void Init_sym ( void   ) 

Definition at line 10169 of file ripper.y.

References global_symbols, symbols::id_str, Init_id(), nodeline(), nodetype(), st_init_numtable_with_size(), st_init_table_with_size(), symbols::sym_id, and symhash.

static ID intern_str ( VALUE  str  )  [static]

Definition at line 10433 of file ripper.y.

References ID_GLOBAL, ID_JUNK, is_special_global_name(), last, rb_cString, rb_enc_asciicompat, rb_enc_get(), rb_usascii_encoding(), and RSTRING_GETMEM.

static ID internal_id_gen ( struct parser_params parser  )  [static]

Definition at line 10201 of file ripper.y.

References ID_INTERNAL, ID_SCOPE_SHIFT, lvtbl, tLAST_TOKEN, and vtable_size().

static int is_global_name_punct ( const int  c  )  [inline, static]

Definition at line 6218 of file ripper.y.

static int is_private_local_id ( ID  name  )  [static]

Definition at line 8745 of file ripper.y.

References is_local_id, rb_id2str(), RSTRING_PTR, and VALUE.

static int is_special_global_name ( const char *  m,
const char *  e,
rb_encoding enc 
) [static]

Definition at line 10210 of file ripper.y.

References is_global_name_punct(), is_identchar, ISASCII, rb_enc_isdigit, and rb_enc_mbclen().

static int is_static_content ( NODE node  )  [static]

Definition at line 9204 of file ripper.y.

References is_static_content(), nd_type, node, NODE_ARRAY, NODE_FALSE, NODE_HASH, NODE_LIT, NODE_NIL, NODE_STR, NODE_TRUE, and NODE_ZARRAY.

static VALUE lex_get_str ( struct parser_params parser,
VALUE  s 
) [static]

Definition at line 5414 of file ripper.y.

References parser_params::enc, lex_gets_ptr, must_be_ascii_compatible(), Qnil, rb_enc_str_new(), RSTRING_LEN, and RSTRING_PTR.

static VALUE lex_getline ( struct parser_params parser  )  [static]

Definition at line 5434 of file ripper.y.

References current_enc, must_be_ascii_compatible(), NIL_P, parser_params::parser_lex_gets, parser_params::parser_lex_input, Qnil, rb_ary_push(), rb_enc_associate(), ruby_coverage, ruby_debug_lines, and VALUE.

static VALUE lex_io_gets ( struct parser_params parser,
VALUE  io 
) [static]

Definition at line 5510 of file ripper.y.

References rb_io_gets().

static NODE* list_append_gen ( struct parser_params parser,
NODE list,
NODE item 
) [static]

Definition at line 8375 of file ripper.y.

References last, list, and NEW_LIST.

static NODE* list_concat_gen ( struct parser_params parser,
NODE head,
NODE tail 
) [static]

Definition at line 8395 of file ripper.y.

References head, last, and tail.

static int literal_concat0 ( struct parser_params parser,
VALUE  head,
VALUE  tail 
) [static]

Definition at line 8419 of file ripper.y.

References compile_error, NIL_P, PARSER_ARG, rb_enc_compatible(), rb_enc_get(), rb_enc_name, rb_str_buf_append(), and rb_str_resize().

static NODE* literal_concat_gen ( struct parser_params parser,
NODE head,
NODE tail 
) [static]

Definition at line 8436 of file ripper.y.

References head, list_append, list_concat, literal_concat0(), nd_set_type, nd_type, NEW_DSTR, NEW_STR, NIL_P, node, NODE_ARRAY, NODE_DSTR, NODE_EVSTR, NODE_STR, Qnil, rb_gc_force_recycle(), tail, and VALUE.

static int literal_node ( NODE node  )  [static]

Definition at line 9314 of file ripper.y.

References nd_type, node, NODE_DREGX, NODE_DREGX_ONCE, NODE_DSTR, NODE_DSYM, NODE_EVSTR, NODE_FALSE, NODE_LIT, NODE_NIL, NODE_STR, and NODE_TRUE.

static int local_id_gen ( struct parser_params parser,
ID  id 
) [static]

Definition at line 9743 of file ripper.y.

References args, DVARS_INHERIT, LVAR_USED, lvtbl, POINTER_P, vtable::prev, rb_local_defined(), vtable::tbl, and vtable_included().

static void local_pop_gen ( struct parser_params parser  )  [static]

Definition at line 9685 of file ripper.y.

References cmdarg_stack, lvtbl, vtable_free(), warn_unused_var(), and xfree.

static void local_push_gen ( struct parser_params parser,
int  inherit_dvars 
) [static]

Definition at line 9668 of file ripper.y.

References ALLOC, local_vars::args, DVARS_INHERIT, DVARS_TOPSCOPE, lvtbl, local_vars::prev, local_vars::used, local_vars::vars, and vtable_alloc().

static ID* local_tbl_gen ( struct parser_params parser  )  [static]

Definition at line 9701 of file ripper.y.

References ALLOC_N, cnt, if(), lvtbl, MEMCPY, vtable_included(), and vtable_size().

static int local_var_gen ( struct parser_params parser,
ID  id 
) [static]

Definition at line 9733 of file ripper.y.

References lvtbl, ruby_sourceline, vtable_add(), and vtable_size().

static NODE* logop_gen ( struct parser_params parser,
enum node_type  type,
NODE left,
NODE right 
) [static]

Definition at line 9399 of file ripper.y.

References nd_type, NEW_NODE, node, and value_expr.

static int lvar_defined_gen ( struct parser_params parser,
ID  id 
) [static]

Definition at line 6616 of file ripper.y.

References dvar_defined_get, dyna_in_block, and local_id.

static void magic_comment_encoding ( struct parser_params parser,
const char *  name,
const char *  val 
) [static]

Definition at line 6691 of file ripper.y.

References comment_at_top(), and parser_set_encode().

static const char* magic_comment_marker ( const char *  str,
long  len 
) [static]

Definition at line 6735 of file ripper.y.

static NODE* match_op_gen ( struct parser_params parser,
NODE node1,
NODE node2 
) [static]

Definition at line 8555 of file ripper.y.

References nd_type, NEW_CALL, NEW_LIST, NEW_MATCH2, NEW_MATCH3, NODE_DREGX, NODE_DREGX_ONCE, NODE_LIT, RB_TYPE_P, T_REGEXP, tMATCH, and value_expr.

static rb_encoding* must_be_ascii_compatible ( VALUE  s  )  [static]

Definition at line 5404 of file ripper.y.

References parser_params::enc, rb_eArgError, rb_enc_asciicompat, rb_enc_get(), and rb_raise().

static NODE* negate_lit ( NODE node  )  [static]

Definition at line 9447 of file ripper.y.

References DBL2NUM, FIX2LONG, FLONUM_P, LONG2FIX, node, rb_bug(), rb_funcall(), RFLOAT, RFLOAT_VALUE, T_BIGNUM, T_COMPLEX, T_FIXNUM, T_FLOAT, T_RATIONAL, tUMINUS, and TYPE.

static NODE* new_args_gen ( struct parser_params parser,
NODE m,
NODE o,
ID  r,
NODE p,
NODE tail 
) [static]

Definition at line 9489 of file ripper.y.

References args, rb_long2int, ruby_sourceline, and tail.

static NODE* new_args_tail_gen ( struct parser_params parser,
NODE k,
ID  kr,
ID  b 
) [static]

Definition at line 9511 of file ripper.y.

References ALLOC, arg_var, args, internal_id, rb_args_info::kw_rest_arg, MEMZERO, NEW_DVAR, NEW_NODE, node, NODE_ARGS, and ruby_sourceline.

static NODE* new_attr_op_assign_gen ( struct parser_params parser,
NODE lhs,
ID  attr,
ID  op,
NODE rhs 
) [static]

Definition at line 9597 of file ripper.y.

References fixpos(), lhs, NEW_OP_ASGN2, tANDOP, and tOROP.

static void new_bv_gen ( struct parser_params parser,
ID  name 
) [static]

Definition at line 8790 of file ripper.y.

References compile_error, dyna_var, is_local_id, PARSER_ARG, rb_id2name(), and shadowing_lvar_0().

static NODE* new_const_op_assign_gen ( struct parser_params parser,
NODE lhs,
ID  op,
NODE rhs 
) [static]

Definition at line 9613 of file ripper.y.

References fixpos(), lhs, NEW_BEGIN, NEW_OP_CDECL, tANDOP, and tOROP.

static NODE* new_evstr_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 8526 of file ripper.y.

References head, nd_type, NEW_EVSTR, node, NODE_DSTR, NODE_EVSTR, and NODE_STR.

static NODE* new_op_assign_gen ( struct parser_params parser,
NODE lhs,
ID  op,
NODE rhs 
) [static]

Definition at line 9568 of file ripper.y.

References gettable, is_asgn_or_id, lhs, NEW_OP_ASGN_OR, and tOROP.

static NODE* new_yield_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 9439 of file ripper.y.

References NEW_YIELD, no_blockarg(), and node.

static NODE* newline_node ( NODE node  )  [static]

Definition at line 8288 of file ripper.y.

References RNode::flags, node, NODE_FL_NEWLINE, and remove_begin().

static void no_blockarg ( struct parser_params parser,
NODE node 
) [static]

Definition at line 9414 of file ripper.y.

References compile_error, nd_type, node, NODE_BLOCK_PASS, and PARSER_ARG.

static NODE* node_assign_gen ( struct parser_params parser,
NODE lhs,
NODE rhs 
) [static]

Definition at line 8932 of file ripper.y.

References arg_append, lhs, nd_type, NODE_ATTRASGN, NODE_CALL, NODE_CDECL, NODE_CVASGN, NODE_DASGN, NODE_DASGN_CURR, NODE_GASGN, NODE_IASGN, NODE_IASGN2, NODE_LASGN, and NODE_MASGN.

static NODE* node_newnode ( struct parser_params parser,
enum node_type  type,
VALUE  a0,
VALUE  a1,
VALUE  a2 
) [static]

Definition at line 8268 of file ripper.y.

References nd_set_line, rb_node_newnode, and ruby_sourceline.

static int nodeline ( NODE node  )  [static]

Definition at line 8282 of file ripper.y.

References nd_line, and node.

static enum node_type nodetype ( NODE node  )  [static]

Definition at line 8276 of file ripper.y.

References nd_type, and node.

static NODE* parser_compile_string ( volatile VALUE  vparser,
VALUE  fname,
VALUE  s,
int  line 
) [static]

Definition at line 5457 of file ripper.y.

References compile_for_eval, lex_get_str(), lex_gets, lex_gets_ptr, lex_input, lex_p, lex_pbeg, lex_pend, node, parser_data_type, RB_GC_GUARD, rb_parse_in_eval(), TypedData_Get_Struct, and yycompile().

static long parser_encode_length ( struct parser_params parser,
const char *  name,
long  len 
) [static]

Definition at line 6623 of file ripper.y.

References rb_memcicmp().

static void parser_free ( void *  ptr  )  [static]

Definition at line 10932 of file ripper.y.

References parser_params::parser_lvtbl, parser_params::parser_tokenbuf, local_vars::prev, prev, local_vars::vars, and xfree.

static int parser_here_document ( struct parser_params ,
NODE  
) [static]

Definition at line 6489 of file ripper.y.

References compile_error, current_enc, dispatch_heredoc_end, dispose_string(), parser_params::enc, parser_params::eofp, flush_string_content, func, heredoc_restore, len, lex_goto_eol, lex_lastline, lex_p, lex_pend, lex_strterm, NEW_STRTERM, newtok, nextc, NIL_P, NULL, PARSER_ARG, parser_peek_variable_name(), pushback, rb_str_append(), rb_str_cat(), RSTRING_LEN, RSTRING_PTR, set_yylval_str, STR_FUNC_EXPAND, STR_FUNC_INDENT, STR_NEW, STR_NEW3, tok, tokadd, tokadd_string, toklen, tSTRING_CONTENT, tSTRING_END, VALUE, was_bol, and whole_match_p.

static int parser_heredoc_identifier ( struct parser_params parser  )  [static]

Definition at line 6319 of file ripper.y.

References compile_error, func, len, lex_goto_eol, lex_lastline, lex_p, lex_pbeg, lex_strterm, nd_set_line, newtok, nextc, NODE_HEREDOC, PARSER_ARG, parser_is_identchar, pushback, rb_node_newnode, ripper_flush, ruby_sourceline, str_dquote, STR_FUNC_INDENT, STR_NEW, str_squote, str_xquote, term, tHEREDOC_BEG, tok, tokadd, tokadd_mbchar, tokfix, toklen, tSTRING_BEG, and tXSTRING_BEG.

static void parser_heredoc_restore ( struct parser_params parser,
NODE here 
) [static]

Definition at line 6382 of file ripper.y.

References dispose_string(), heredoc_end, lex_lastline, lex_p, lex_pbeg, lex_pend, lex_strterm, nd_line, rb_gc_force_recycle(), ripper_flush, RSTRING_LEN, RSTRING_PTR, ruby_sourceline, and VALUE.

static void parser_initialize ( struct parser_params parser  )  [static]

Definition at line 10852 of file ripper.y.

References parser_params::enc, parser_params::eofp, parser_params::heap, parser_params::is_ripper, NULL, parser_params::parser_brace_nest, parser_params::parser_class_nest, parser_params::parser_cmdarg_stack, parser_params::parser_command_start, parser_params::parser_compile_for_eval, parser_params::parser_cond_stack, parser_params::parser_cur_mid, parser_params::parser_deferred_nodes, parser_params::parser_eval_tree, parser_params::parser_eval_tree_begin, parser_params::parser_heredoc_end, parser_params::parser_in_def, parser_params::parser_in_defined, parser_params::parser_in_kwarg, parser_params::parser_in_single, parser_params::parser_lex_p, parser_params::parser_lex_pbeg, parser_params::parser_lex_pend, parser_params::parser_lex_strterm, parser_params::parser_lpar_beg, parser_params::parser_lvtbl, parser_params::parser_paren_nest, parser_params::parser_ruby__end__seen, parser_params::parser_ruby_sourcefile, parser_params::parser_ruby_sourcefile_string, parser_params::parser_tokenbuf, parser_params::parser_tokidx, parser_params::parser_toksiz, Qfalse, Qnil, rb_utf8_encoding(), and TRUE.

static int parser_magic_comment ( struct parser_params parser,
const char *  str,
long  len 
) [static]

Definition at line 6768 of file ripper.y.

References FALSE, magic_comment::func, if(), ISSPACE, magic_comment::length, magic_comment_marker(), magic_comments, magic_comment::name, RSTRING_PTR, str_copy, STRNCASECMP, val, and VALUE.

static void parser_mark ( void *  ptr  )  [static]

Definition at line 10906 of file ripper.y.

References parser_params::debug_lines, parser_params::heap, parser_params::parser_deferred_nodes, parser_params::parser_eval_tree, parser_params::parser_eval_tree_begin, parser_params::parser_lex_input, parser_params::parser_lex_lastline, parser_params::parser_lex_nextline, parser_params::parser_lex_strterm, parser_params::parser_ruby_sourcefile_string, rb_gc_mark(), and VALUE.

static size_t parser_memsize ( const void *  ptr  )  [static]

Definition at line 10949 of file ripper.y.

References vtable::capa, parser_params::parser_lvtbl, parser_params::parser_toksiz, local_vars::prev, size, and local_vars::vars.

static struct parser_params* parser_new ( void   )  [static]

Definition at line 10988 of file ripper.y.

References ALLOC_N, MEMZERO, and parser_initialize().

static char* parser_newtok ( struct parser_params parser  )  [static]

Definition at line 5668 of file ripper.y.

References ALLOC_N, REALLOC_N, ruby_sourceline, tokenbuf, tokidx, tokline, and toksiz.

static int parser_nextc ( struct parser_params parser  )  [inline, static]

Definition at line 5589 of file ripper.y.

References current_enc, parser_params::eofp, heredoc_end, parser_params::last_cr_line, lex_getline(), lex_goto_eol, lex_input, lex_lastline, lex_nextline, lex_p, lex_pbeg, lex_pend, parser_params::line_count, NIL_P, peek, Qtrue, rb_compile_warn(), rb_enc_associate(), rb_str_buf_cat(), rb_str_buf_new(), ripper_flush, RSTRING_LEN, RSTRING_PTR, ruby_sourcefile, ruby_sourceline, and VALUE.

static int parser_number_literal_suffix ( struct parser_params parser,
int  mask 
) [static]

Definition at line 6423 of file ripper.y.

References ISALPHA, ISASCII, lex_p, nextc, NUM_SUFFIX_I, NUM_SUFFIX_R, pushback, and result.

static int parser_parse_string ( struct parser_params ,
NODE  
) [static]

Definition at line 6261 of file ripper.y.

References compile_error, current_enc, parser_params::enc, parser_params::eofp, flush_string_content, func, ISSPACE, nd_line, nd_paren, nd_term, newtok, nextc, PARSER_ARG, parser_peek_variable_name(), pushback, regx_options, ruby_sourceline, set_yylval_num, set_yylval_str, STR_FUNC_EXPAND, STR_FUNC_QWORDS, STR_FUNC_REGEXP, STR_NEW3, term, tok, tokadd, tokadd_string, tokfix, toklen, tREGEXP_END, tSTRING_CONTENT, and tSTRING_END.

static int parser_peek_variable_name ( struct parser_params parser  )  [static]

Definition at line 6225 of file ripper.y.

References command_start, is_global_name_punct(), ISALPHA, ISASCII, ISDIGIT, lex_p, lex_pend, TRUE, tSTRING_DBEG, and tSTRING_DVAR.

static void parser_prepare ( struct parser_params parser  )  [static]

Definition at line 6905 of file ripper.y.

References parser_params::enc, EOF, parser_params::has_shebang, lex_lastline, lex_p, lex_pbeg, lex_pend, nextc, peek, pushback, rb_enc_get(), and rb_utf8_encoding().

static void parser_pushback ( struct parser_params parser,
int  c 
) [static]

Definition at line 5651 of file ripper.y.

References lex_p, and lex_pbeg.

static int parser_read_escape ( struct parser_params parser,
int  flags,
rb_encoding **  encp 
) [static]

Definition at line 5798 of file ripper.y.

References ESCAPE_CONTROL, ESCAPE_META, ISASCII, lex_p, nextc, peek, pushback, read_escape, scan_oct, tok_hex, and yyerror.

static int parser_regx_options ( struct parser_params  )  [static]

Definition at line 5969 of file ripper.y.

References compile_error, ISALPHA, newtok, nextc, PARSER_ARG, pushback, rb_ascii8bit_encindex, rb_char_to_option_kcode(), RE_OPTION_ENCODING, tok, tokadd, tokfix, and toklen.

static void parser_set_encode ( struct parser_params parser,
const char *  name 
) [static]

Definition at line 6643 of file ripper.y.

References parser_params::enc, RARRAY_AREF, RARRAY_LEN, rb_ary_unshift(), rb_eArgError, rb_enc_asciicompat, rb_enc_associate_index(), rb_enc_find_index(), rb_enc_from_index(), rb_enc_name, rb_exc_raise(), rb_make_backtrace(), rb_make_exception(), rb_sprintf(), ruby_debug_lines, ruby_sourcefile, ruby_sourceline, and VALUE.

static int parser_set_integer_literal ( struct parser_params parser,
VALUE  v,
int  suffix 
) [static]

Definition at line 6463 of file ripper.y.

References NUM_SUFFIX_R, rb_rational_raw1, set_number_literal, tINTEGER, tRATIONAL, and type.

static int parser_set_number_literal ( struct parser_params parser,
VALUE  v,
int  type,
int  suffix 
) [static]

Definition at line 6452 of file ripper.y.

References INT2FIX, NUM_SUFFIX_I, rb_complex_raw(), set_yylval_literal, and tIMAGINARY.

static void parser_set_token_info ( struct parser_params parser,
const char *  name,
const char *  val 
) [static]

Definition at line 6700 of file ripper.y.

References FALSE, parser_params::parser_token_info_enabled, rb_compile_warning(), ruby_sourcefile, ruby_sourceline, strcasecmp, and TRUE.

static VALUE parser_str_new ( const char *  p,
long  n,
rb_encoding enc,
int  func,
rb_encoding enc0 
) [static]

Definition at line 5567 of file ripper.y.

References parser_params::enc, ENC_CODERANGE_7BIT, rb_ascii8bit_encoding(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_str_coderange(), rb_enc_str_new(), rb_usascii_encoding(), rb_utf8_encoding(), STR_FUNC_REGEXP, and VALUE.

static int parser_tok_hex ( struct parser_params parser,
size_t *  numlen 
) [static]

Definition at line 5706 of file ripper.y.

References lex_p, scan_hex, and yyerror.

static void parser_tokadd ( struct parser_params parser,
int  c 
) [static]

Definition at line 5696 of file ripper.y.

References REALLOC_N, tokenbuf, tokidx, and toksiz.

static int parser_tokadd_escape ( struct parser_params parser,
rb_encoding **  encp 
) [static]

Definition at line 5896 of file ripper.y.

References ESCAPE_CONTROL, ESCAPE_META, lex_p, nextc, pushback, ruby_scan_oct(), tok_hex, tokadd, tokcopy, and yyerror.

static int parser_tokadd_mbchar ( struct parser_params parser,
int  c 
) [static]

Definition at line 6012 of file ripper.y.

References compile_error, len, lex_p, MBCLEN_CHARFOUND_P, PARSER_ARG, parser_encoding_name, parser_precise_mbclen, tokadd, and tokcopy.

static int parser_tokadd_string ( struct parser_params ,
int  ,
int  ,
int  ,
long *  ,
rb_encoding **   
) [static]

Definition at line 6041 of file ripper.y.

References parser_params::enc, ISASCII, ISSPACE, lex_p, lex_pend, mixed_error, mixed_escape, nextc, parser_isascii, parser_tokadd_utf8(), pushback, read_escape, simple_re_meta(), STR_FUNC_ESCAPE, STR_FUNC_EXPAND, STR_FUNC_QWORDS, STR_FUNC_REGEXP, STR_FUNC_SYMBOL, tokadd, tokadd_escape, and tokadd_mbchar.

static int parser_tokadd_utf8 ( struct parser_params parser,
rb_encoding **  encp,
int  string_literal,
int  symbol_literal,
int  regexp_literal 
) [static]

Definition at line 5723 of file ripper.y.

References lex_p, nextc, peek, rb_utf8_encoding(), scan_hex, tokadd, tokaddmbc, tokcopy, and yyerror.

static void parser_tokaddmbc ( struct parser_params parser,
int  c,
rb_encoding enc 
) [static]

Definition at line 5889 of file ripper.y.

References parser_params::enc, len, rb_enc_codelen(), rb_enc_mbcput, and tokspace.

static char* parser_tokspace ( struct parser_params parser,
int  n 
) [static]

Definition at line 5684 of file ripper.y.

References REALLOC_N, tokenbuf, tokidx, and toksiz.

static void parser_warn ( struct parser_params parser,
NODE node,
const char *  mesg 
) [static]

Definition at line 8314 of file ripper.y.

References nd_line, node, rb_compile_warn(), and ruby_sourcefile.

static void parser_warning ( struct parser_params parser,
NODE node,
const char *  mesg 
) [static]

Definition at line 8307 of file ripper.y.

References nd_line, node, rb_compile_warning(), and ruby_sourcefile.

static int parser_whole_match_p ( struct parser_params parser,
const char *  eos,
long  len,
int  indent 
) [static]

Definition at line 6400 of file ripper.y.

References FALSE, ISSPACE, lex_pbeg, and lex_pend.

static int parser_yyerror ( struct parser_params parser,
const char *  msg 
) [static]

Definition at line 5230 of file ripper.y.

References ALLOCA_N, compile_error, current_enc, len, lex_lastline, lex_p, lex_pbeg, lex_pend, MEMCPY, NULL, PARSER_ARG, rb_compile_error_append(), rb_compile_error_with_enc(), rb_enc_get(), rb_enc_prev_char, and STR_NEW2.

static int parser_yylex ( struct parser_params parser  )  [static]

Definition at line 6950 of file ripper.y.

References arg_ambiguous, brace_nest, CMDARG_LEXPOP, CMDARG_P, CMDARG_PUSH, command_start, comment_at_top(), compile_error, COND_LEXPOP, COND_P, COND_PUSH, current_enc, DBL2NUM, ENC_CODERANGE_7BIT, ENC_CODERANGE_UNKNOWN, ENC_SINGLE, parser_params::eofp, errno, EXPR_ARG_ANY, EXPR_BEG_ANY, FALSE, here_document, heredoc_identifier, kwtable::id, INT2FIX, IS_AFTER_OPERATOR, IS_ARG, IS_BEG, IS_END, is_identchar, IS_LABEL_POSSIBLE, IS_LABEL_SUFFIX, IS_lex_state, IS_lex_state_for, is_local_id, IS_SPCARG, ISALNUM, ISASCII, ISDIGIT, ISSPACE, ISUPPER, ISXDIGIT, k__END__, keyword_do, keyword_do_block, keyword_do_cond, keyword_do_LAMBDA, lex_eol_p, lex_goto_eol, lex_lastline, lex_nextline, lex_p, lex_pend, lex_state, lex_strterm, lpar_beg, lvar_defined, memmove(), kwtable::name, nd_type, NEW_BACK_REF, NEW_NTH_REF, NEW_STRTERM, newtok, nextc, no_digits, NODE_HEREDOC, NUM_SUFFIX_ALL, NUM_SUFFIX_I, NUM_SUFFIX_R, number_literal_suffix, paren_nest, parse_string, PARSER_ARG, parser_params::parser_in_kwarg, parser_is_identchar, parser_isascii, parser_magic_comment(), parser_tokadd_utf8(), peek, peek_n, pushback, Qtrue, rb_cstr_to_inum(), rb_enc_isalnum, rb_enc_isspace, rb_gc_force_recycle(), rb_int_positive_pow(), rb_intern, rb_intern3(), rb_rational_new(), rb_reserved_word, rb_warnI, rb_warning0, rb_warningS, read_escape, result, ruby__end__seen, ruby_sourceline, set_file_encoding(), set_integer_literal, set_number_literal, set_yylval_id, set_yylval_name, set_yylval_node, set_yylval_str, snprintf, kwtable::state, str_dquote, str_dsym, str_dword, STR_NEW3, str_regexp, str_squote, str_ssym, str_sword, str_xquote, strtod, tAMPER, tANDOP, tAREF, tASET, tASSOC, tBACK_REF, tCHAR, tCMP, tCOLON2, tCOLON3, tCOMMENT, tCONSTANT, tCVAR, tDOT2, tDOT3, tDSTAR, tEMBDOC, tEMBDOC_BEG, tEMBDOC_END, tEQ, tEQQ, term, tFID, tFLOAT, tGEQ, tGVAR, tIDENTIFIER, tIGNORED_NL, tIVAR, tLABEL, tLAMBDA, tLAMBEG, tLBRACE, tLBRACE_ARG, tLBRACK, tLEQ, tLPAREN, tLPAREN_ARG, tLSHFT, tMATCH, tNEQ, tNMATCH, tNTH_REF, tok, TOK_INTERN, tokadd, tokadd_mbchar, tokaddmbc, token, tokfix, tokidx, toklast, toklen, tOP_ASGN, tOROP, tPOW, tQSYMBOLS_BEG, tQWORDS_BEG, tRATIONAL, tREGEXP_BEG, tREGEXP_END, tRSHFT, TRUE, tSP, tSTAR, tSTRING_BEG, tSTRING_DEND, tSTRING_END, tSYMBEG, tSYMBOLS_BEG, tUMINUS, tUMINUS_NUM, tUPLUS, tWORDS_BEG, tXSTRING_BEG, type, VALUE, warn_balanced, was_bol, whole_match_p, and yyerror.

static NODE* range_op ( struct parser_params parser,
NODE node 
) [static]

Definition at line 9298 of file ripper.y.

References cond0(), FIXNUM_P, nd_type, NEW_CALL, NEW_GVAR, NEW_LIST, node, NODE_LIT, rb_intern, tEQ, type, value_expr, and warn_unless_e_option().

static void rb_backref_error_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 8868 of file ripper.y.

References compile_error, nd_type, node, NODE_BACK_REF, NODE_NTH_REF, and PARSER_ARG.

ID rb_check_id ( volatile VALUE *  namep  ) 

Returns ID for the given name if it is interned already, or 0.

Parameters:
namep the pointer to the name object
Returns:
the ID for *namep
Precondition:
the object referred by namep must be a Symbol or a String, or possible to convert with to_str method.
Postcondition:
the object referred by namep is a Symbol or a String if non-zero value is returned, or is a String if 0 is returned.

Definition at line 10733 of file ripper.y.

References global_symbols, NIL_P, OBJ_FREEZE, rb_check_string_type(), rb_enc_copy(), rb_eTypeError, RB_GC_GUARD, rb_id_attrset(), rb_inspect(), rb_is_attrset_name(), rb_raise(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, setup_fake_str(), st_data_t, st_lookup(), SYM2ID, sym_check_asciionly(), symbols::sym_id, SYMBOL_P, T_STRING, and VALUE.

ID rb_check_id_cstr ( const char *  ptr,
long  len,
rb_encoding enc 
)

Definition at line 10775 of file ripper.y.

References RString::as, global_symbols, RString::heap, rb_enc_associate(), rb_id_attrset(), rb_is_attrset_name(), setup_fake_str(), st_data_t, st_lookup(), sym_check_asciionly(), symbols::sym_id, and VALUE.

NODE* rb_compile_cstr ( const char *  f,
const char *  s,
int  len,
int  line 
)

Definition at line 5496 of file ripper.y.

References parser_compile_string(), rb_filesystem_str_new_cstr(), rb_parser_new(), rb_str_new(), and VALUE.

NODE* rb_compile_file ( const char *  f,
VALUE  file,
int  start 
)

Definition at line 5516 of file ripper.y.

References rb_parser_compile_file(), rb_parser_new(), and VALUE.

NODE* rb_compile_string ( const char *  f,
VALUE  s,
int  line 
)

Definition at line 5476 of file ripper.y.

References must_be_ascii_compatible(), parser_compile_string(), rb_filesystem_str_new_cstr(), and rb_parser_new().

int rb_enc_symname2_p ( const char *  name,
long  len,
rb_encoding enc 
)

Definition at line 10347 of file ripper.y.

References IDSET_ATTRSET_FOR_SYNTAX, and rb_enc_symname_type().

int rb_enc_symname_p ( const char *  name,
rb_encoding enc 
)

Definition at line 10242 of file ripper.y.

References rb_enc_symname2_p(), and strlen().

static int rb_enc_symname_type ( const char *  name,
long  len,
rb_encoding enc,
unsigned int  allowed_attrset 
) [static]

Definition at line 10251 of file ripper.y.

References ID_ATTRSET, ID_CLASS, ID_CONST, ID_GLOBAL, ID_INSTANCE, ID_JUNK, ID_LOCAL, is_identchar, is_special_global_name(), ISASCII, rb_enc_isalpha, rb_enc_isupper, rb_enc_mbclen(), and type.

void rb_gc_mark_parser ( void   ) 

Definition at line 10016 of file ripper.y.

void rb_gc_mark_symbols ( int  full_mark  ) 

Definition at line 10188 of file ripper.y.

References global_symbols, symbols::id_str, symbols::minor_marked, numberof, symbols::op_sym, rb_gc_mark_locations, and rb_mark_tbl().

const char* rb_id2name ( ID  id  ) 

Definition at line 10639 of file ripper.y.

References rb_id2str(), RSTRING_PTR, and VALUE.

VALUE rb_id2str ( ID  id  ) 

Definition at line 10569 of file ripper.y.

References global_symbols, symbols::minor_marked, OBJ_FREEZE, symbols::op_sym, rb_fstring(), rb_ispunct(), rb_usascii_str_new(), st_data_t, tLAST_TOKEN, and VALUE.

ID rb_id_attrset ( ID  id  ) 

Definition at line 8831 of file ripper.y.

References ID2SYM, ID_ATTRSET, ID_CLASS, ID_CONST, ID_GLOBAL, ID_INSTANCE, ID_JUNK, ID_LOCAL, is_notop_id, PRIsVALUE, rb_id2name(), rb_name_error(), tAREF, and tASET.

ID rb_intern ( const char *  name  ) 

Definition at line 10553 of file ripper.y.

References rb_intern, rb_intern2(), and strlen().

ID rb_intern2 ( const char *  name,
long  len 
)

Definition at line 10546 of file ripper.y.

References rb_intern3(), and rb_usascii_encoding().

ID rb_intern3 ( const char *  name,
long  len,
rb_encoding enc 
)

Definition at line 10417 of file ripper.y.

References global_symbols, intern_str(), OBJ_FREEZE, rb_enc_associate(), rb_enc_str_new(), setup_fake_str(), st_data_t, st_lookup(), symbols::sym_id, and VALUE.

ID rb_intern_str ( VALUE  str  ) 

Definition at line 10559 of file ripper.y.

References global_symbols, intern_str(), rb_str_dup(), st_data_t, st_lookup(), and symbols::sym_id.

int rb_is_attrset_id ( ID  id  ) 

Definition at line 10704 of file ripper.y.

References is_attrset_id.

int rb_is_attrset_name ( VALUE  name  ) 

Definition at line 10822 of file ripper.y.

References ID_ATTRSET, IDSET_ATTRSET_FOR_INTERN, and rb_str_symname_type().

int rb_is_class_id ( ID  id  ) 

Definition at line 10686 of file ripper.y.

References is_class_id.

int rb_is_class_name ( VALUE  name  ) 

Definition at line 10804 of file ripper.y.

References ID_CLASS, and rb_str_symname_type().

int rb_is_const_id ( ID  id  ) 

Definition at line 10680 of file ripper.y.

References is_const_id.

int rb_is_const_name ( VALUE  name  ) 

Definition at line 10798 of file ripper.y.

References ID_CONST, and rb_str_symname_type().

int rb_is_global_id ( ID  id  ) 

Definition at line 10692 of file ripper.y.

References is_global_id.

int rb_is_global_name ( VALUE  name  ) 

Definition at line 10810 of file ripper.y.

References ID_GLOBAL, and rb_str_symname_type().

int rb_is_instance_id ( ID  id  ) 

Definition at line 10698 of file ripper.y.

References is_instance_id.

int rb_is_instance_name ( VALUE  name  ) 

Definition at line 10816 of file ripper.y.

References ID_INSTANCE, and rb_str_symname_type().

int rb_is_junk_id ( ID  id  ) 

Definition at line 10716 of file ripper.y.

References is_junk_id.

int rb_is_junk_name ( VALUE  name  ) 

Definition at line 10844 of file ripper.y.

References IDSET_ATTRSET_FOR_SYNTAX, and rb_str_symname_type().

int rb_is_local_id ( ID  id  ) 

Definition at line 10710 of file ripper.y.

References is_local_id.

int rb_is_local_name ( VALUE  name  ) 

Definition at line 10828 of file ripper.y.

References ID_LOCAL, and rb_str_symname_type().

int rb_is_method_name ( VALUE  name  ) 

Definition at line 10834 of file ripper.y.

References FALSE, ID_ATTRSET, ID_JUNK, ID_LOCAL, rb_str_symname_type(), and TRUE.

NODE* rb_parser_append_print ( VALUE  vparser,
NODE node 
)

Definition at line 10021 of file ripper.y.

References node, parser_data_type, and TypedData_Get_Struct.

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

Definition at line 11084 of file ripper.y.

References ADD2HEAP, cnt, HEAPCNT, NEWHEAP, and xcalloc.

NODE* rb_parser_compile_cstr ( volatile VALUE  vparser,
const char *  f,
const char *  s,
int  len,
int  line 
)

Definition at line 5503 of file ripper.y.

References parser_compile_string(), rb_filesystem_str_new_cstr(), rb_str_new(), and VALUE.

NODE* rb_parser_compile_file ( volatile VALUE  vparser,
const char *  f,
VALUE  file,
int  start 
)

Definition at line 5524 of file ripper.y.

References rb_filesystem_str_new_cstr(), and rb_parser_compile_file_path().

NODE* rb_parser_compile_file_path ( volatile VALUE  vparser,
VALUE  fname,
VALUE  file,
int  start 
)

Definition at line 5530 of file ripper.y.

References compile_for_eval, lex_gets, lex_input, lex_io_gets(), lex_p, lex_pbeg, lex_pend, node, parser_data_type, RB_GC_GUARD, rb_parse_in_eval(), TypedData_Get_Struct, and yycompile().

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

Definition at line 5483 of file ripper.y.

References rb_filesystem_str_new_cstr(), and rb_parser_compile_string_path().

NODE* rb_parser_compile_string_path ( volatile VALUE  vparser,
VALUE  f,
VALUE  s,
int  line 
)

Definition at line 5489 of file ripper.y.

References must_be_ascii_compatible(), and parser_compile_string().

VALUE rb_parser_encoding ( VALUE  vparser  ) 

Definition at line 11028 of file ripper.y.

References current_enc, parser_data_type, rb_enc_from_encoding(), and TypedData_Get_Struct.

VALUE rb_parser_end_seen_p ( VALUE  vparser  ) 

Definition at line 11013 of file ripper.y.

void rb_parser_free ( struct parser_params parser,
void *  ptr 
)

Definition at line 11114 of file ripper.y.

References parser_params::heap, RNode::node, NULL, prev, rb_gc_force_recycle(), RNode::u1, RNode::u2, VALUE, and xfree.

VALUE rb_parser_get_yydebug ( VALUE  self  ) 

Definition at line 11043 of file ripper.y.

References parser_data_type, Qfalse, Qtrue, TypedData_Get_Struct, and yydebug.

void* rb_parser_malloc ( struct parser_params parser,
size_t  size 
)

Definition at line 11074 of file ripper.y.

References ADD2HEAP, cnt, HEAPCNT, NEWHEAP, and xmalloc.

VALUE rb_parser_new ( void   ) 

Definition at line 10999 of file ripper.y.

References parser_data_type, parser_new(), and TypedData_Wrap_Struct.

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

Definition at line 11094 of file ripper.y.

References cnt, and HEAPCNT.

VALUE rb_parser_set_yydebug ( VALUE  self,
VALUE  flag 
)

Definition at line 11058 of file ripper.y.

References parser_data_type, RTEST, TypedData_Get_Struct, and yydebug.

NODE* rb_parser_while_loop ( VALUE  vparser,
NODE node,
int  chop,
int  split 
)

Definition at line 10053 of file ripper.y.

References block_append, nd_type, NEW_CALL, NEW_GASGN, NEW_GVAR, NEW_OPT_N, node, NODE_PRELUDE, parser_data_type, rb_intern, and TypedData_Get_Struct.

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

Definition at line 10982 of file ripper.y.

References reserved_word().

static int rb_str_symname_type ( VALUE  name,
unsigned int  allowed_attrset 
) [static]

Definition at line 10353 of file ripper.y.

References rb_enc_get(), rb_enc_symname_type(), RB_GC_GUARD, RSTRING_LEN, StringValuePtr, and type.

VALUE rb_sym_all_symbols ( void   ) 

Definition at line 10671 of file ripper.y.

References RString::ary, global_symbols, st_table::num_entries, rb_ary_new2, st_foreach(), symbols::sym_id, symbols_i(), and VALUE.

int rb_symname_p ( const char *  name  ) 

Definition at line 10236 of file ripper.y.

static void reduce_nodes_gen ( struct parser_params parser,
NODE **  body 
) [static]

Definition at line 9143 of file ripper.y.

References RNode::flags, nd_body, nd_else, nd_head, nd_next, nd_resq, nd_type, NEW_NIL, node, NODE_BEGIN, NODE_BLOCK, NODE_CASE, NODE_ENSURE, NODE_FL_NEWLINE, NODE_IF, NODE_NIL, NODE_RESCUE, NODE_RETURN, NODE_WHEN, and subnodes.

static VALUE reg_compile_gen ( struct parser_params parser,
VALUE  str,
int  options 
) [static]

Definition at line 9992 of file ripper.y.

References compile_error, err, NIL_P, PARSER_ARG, PRIsVALUE, Qnil, rb_attr_get(), rb_errinfo, rb_intern, rb_reg_compile(), rb_set_errinfo(), rb_str_append(), rb_str_cat(), reg_fragment_setenc, ruby_sourcefile, ruby_sourceline, and VALUE.

static int reg_fragment_check_gen ( struct parser_params parser,
VALUE  str,
int  options 
) [static]

Definition at line 9898 of file ripper.y.

References err, Qnil, rb_obj_as_string(), rb_reg_check_preprocess(), reg_fragment_setenc, and VALUE.

static void reg_fragment_setenc_gen ( struct parser_params parser,
VALUE  str,
int  options 
) [static]

Definition at line 9859 of file ripper.y.

References compile_error, current_enc, ENC_CODERANGE_7BIT, ENCODING_GET, ENCODING_IS_ASCII8BIT, ENCODING_SET, PARSER_ARG, rb_ascii8bit_encoding(), rb_char_to_option_kcode(), rb_enc_associate(), rb_enc_get(), rb_enc_name, rb_enc_str_coderange(), rb_usascii_encoding(), RE_OPTION_ENCODING_IDX, and RE_OPTION_ENCODING_NONE.

static NODE* reg_named_capture_assign_gen ( struct parser_params parser,
VALUE  regexp,
NODE match 
) [static]

Definition at line 9960 of file ripper.y.

References reg_named_capture_assign_t::enc, reg_named_capture_assign_t::fail_block, match(), reg_named_capture_assign_t::num, onig_foreach_name(), reg_named_capture_assign_t::parser, rb_enc_get(), reg_named_capture_assign_iter(), RREGEXP, and reg_named_capture_assign_t::succ_block.

static int reg_named_capture_assign_iter ( const OnigUChar name,
const OnigUChar name_end,
int  back_num,
int *  back_refs,
OnigRegex  regex,
void *  arg0 
) [static]

Definition at line 9920 of file ripper.y.

References reg_named_capture_assign_t::enc, parser_params::enc, len, NEW_BEGIN, reg_named_capture_assign_t::num, reg_named_capture_assign_t::parser, and reg_named_capture_assign_t::succ_block.

static ID register_symid ( ID  id,
const char *  name,
long  len,
rb_encoding enc 
) [static]

Definition at line 10363 of file ripper.y.

References rb_enc_str_new(), register_symid_str(), and VALUE.

static ID register_symid_str ( ID  id,
VALUE  str 
) [static]

Definition at line 10370 of file ripper.y.

References global_symbols, symbols::id_str, symbols::minor_marked, OBJ_FREEZE, rb_fstring(), rb_sourcefile, rb_sourceline(), RSTRING_PTR, RUBY_DTRACE_SYMBOL_CREATE, RUBY_DTRACE_SYMBOL_CREATE_ENABLED, st_add_direct(), st_data_t, and symbols::sym_id.

static NODE* remove_begin ( NODE node  )  [static]

Definition at line 9123 of file ripper.y.

References nd_type, node, and NODE_BEGIN.

static NODE* remove_begin_all ( NODE node  )  [static]

Definition at line 9133 of file ripper.y.

References nd_type, node, and NODE_BEGIN.

static NODE* ret_args_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 9422 of file ripper.y.

References nd_set_type, nd_type, no_blockarg(), node, NODE_ARRAY, and NODE_VALUES.

numeric ripper_intern ( "-@"   ) 

expr ripper_intern ( "and"   ) 

Referenced by yyparse().

static void set_file_encoding ( struct parser_params parser,
const char *  str,
const char *  send 
) [static]

Definition at line 6862 of file ripper.y.

References ISALNUM, ISSPACE, parser_encode_length(), parser_set_encode(), rb_str_new(), rb_str_resize(), RSTRING_PTR, STRNCASECMP, and VALUE.

static VALUE setup_fake_str ( struct RString fake_str,
const char *  name,
long  len 
) [static]

Definition at line 10406 of file ripper.y.

References RString::basic, RBasic::flags, rb_cString, RBASIC_SET_CLASS_RAW, RSTRING_NOEMBED, T_STRING, and VALUE.

static int shadowing_lvar_0 ( struct parser_params parser,
ID  name 
) [static]

Definition at line 8758 of file ripper.y.

References dvar_curr, dvar_defined_get, dyna_in_block, is_private_local_id(), local_id, LVAR_USED, lvtbl, rb_id2name(), rb_warningS, ruby_sourceline, vtable_add(), and yyerror.

static ID shadowing_lvar_gen ( struct parser_params parser,
ID  name 
) [static]

Definition at line 8783 of file ripper.y.

References shadowing_lvar_0().

static int simple_re_meta ( int  c  )  [inline, static]

Definition at line 6028 of file ripper.y.

References FALSE, and TRUE.

static NODE* splat_array ( NODE node  )  [static]

Definition at line 8924 of file ripper.y.

References nd_type, node, NODE_ARRAY, and NODE_SPLAT.

static int sym_check_asciionly ( VALUE  str  )  [static]

Definition at line 10386 of file ripper.y.

References ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, FALSE, rb_eEncodingError, rb_enc_asciicompat, rb_enc_get(), rb_enc_str_coderange(), rb_raise(), and TRUE.

static int symbols_i ( VALUE  sym,
ID  value,
VALUE  ary 
) [static]

Definition at line 10648 of file ripper.y.

References ID2SYM, rb_ary_push(), and ST_CONTINUE.

static int token_info_get_column ( struct parser_params parser,
const char *  token 
) [static]

Definition at line 5157 of file ripper.y.

References lex_p, lex_pbeg, and strlen().

static int token_info_has_nonspaces ( struct parser_params parser,
const char *  token 
) [static]

Definition at line 5171 of file ripper.y.

References lex_p, lex_pbeg, and strlen().

static void token_info_pop ( struct parser_params parser,
const char *  token 
) [static]

Definition at line 5201 of file ripper.y.

References token_info::column, token_info::linenum, token_info::next, token_info::nonspc, parser_params::parser_token_info, parser_params::parser_token_info_enabled, rb_compile_warn(), ruby_sourcefile, ruby_sourceline, token_info::token, token_info_get_column(), token_info_has_nonspaces(), and xfree.

static void token_info_push ( struct parser_params parser,
const char *  token 
) [static]

Definition at line 5184 of file ripper.y.

References ALLOC, token_info::column, token_info::linenum, token_info::next, token_info::nonspc, parser_params::parser_token_info, parser_params::parser_token_info_enabled, ruby_sourceline, token_info::token, token_info_get_column(), and token_info_has_nonspaces().

static int value_expr_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 8963 of file ripper.y.

References cond, FALSE, nd_type, node, NODE_AND, NODE_BEGIN, NODE_BLOCK, NODE_BREAK, NODE_IF, NODE_NEXT, NODE_OR, NODE_REDO, NODE_RETRY, NODE_RETURN, rb_warning0, TRUE, value_expr, and yyerror.

static void void_expr_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 9020 of file ripper.y.

References nd_line, nd_type, node, NODE_BACK_REF, NODE_CALL, NODE_COLON2, NODE_COLON3, NODE_CONST, NODE_CVAR, NODE_DEFINED, NODE_DOT2, NODE_DOT3, NODE_DREGX, NODE_DREGX_ONCE, NODE_DSTR, NODE_DVAR, NODE_FALSE, NODE_GVAR, NODE_IVAR, NODE_LIT, NODE_LVAR, NODE_NIL, NODE_NTH_REF, NODE_SELF, NODE_STR, NODE_TRUE, rb_id2name(), rb_warnS, RTEST, ruby_sourceline, ruby_verbose, tCMP, tEQ, tGEQ, tLEQ, tNEQ, tPOW, tUMINUS, and tUPLUS.

static void void_stmts_gen ( struct parser_params parser,
NODE node 
) [static]

Definition at line 9109 of file ripper.y.

References nd_type, node, NODE_BLOCK, RTEST, ruby_verbose, and void_expr0.

static void warn_unless_e_option ( struct parser_params parser,
NODE node,
const char *  str 
) [static]

Definition at line 9255 of file ripper.y.

References e_option_supplied(), node, and parser_warn.

static void warn_unused_var ( struct parser_params parser,
struct local_vars local 
) [static]

Definition at line 9648 of file ripper.y.

References cnt, is_private_local_id(), LVAR_USED, vtable::pos, rb_bug(), rb_id2name(), rb_warn4S, ruby_sourcefile, vtable::tbl, local_vars::used, and local_vars::vars.

static void warning_unless_e_option ( struct parser_params parser,
NODE node,
const char *  str 
) [static]

Definition at line 9261 of file ripper.y.

References e_option_supplied(), node, and parser_warning.

static NODE* yycompile ( struct parser_params parser,
VALUE  fname,
int  line 
) [static]

Definition at line 5394 of file ripper.y.

References rb_str_new_frozen(), rb_suppress_tracing(), RSTRING_PTR, ruby_sourcefile, ruby_sourcefile_string, ruby_sourceline, VALUE, and yycompile0().

static VALUE yycompile0 ( VALUE  arg  )  [static]

Definition at line 5333 of file ripper.y.

References compile_for_eval, coverage(), debug_lines(), deferred_nodes, e_option_supplied(), parser_params::last_cr_line, lex_lastline, lex_nextline, lex_p, lex_pbeg, lex_pend, lex_strterm, NEW_NIL, NEW_PRELUDE, parser_prepare(), parser_params::parser_ruby_sourcefile, parser_params::parser_ruby_sourceline, parser_params::parser_token_info_enabled, rb_ary_push(), rb_safe_level, RTEST, ruby_coverage, ruby_debug_lines, RUBY_DTRACE_PARSE_BEGIN, RUBY_DTRACE_PARSE_BEGIN_ENABLED, RUBY_DTRACE_PARSE_END, RUBY_DTRACE_PARSE_END_ENABLED, ruby_eval_tree, ruby_eval_tree_begin, ruby_sourcefile_string, ruby_sourceline, ruby_verbose, STR_NEW0, VALUE, and yyparse.

yylex ( void *  p  ) 

Definition at line 8243 of file ripper.y.

References NIL_P, parser_yylex(), parser_params::parser_yylval, Qundef, and YYSTYPE::val.


Variable Documentation

top_compstmt __pad0__

Definition at line 9538 of file ripper.y.

user_variable __pad100__

Definition at line 12966 of file ripper.y.

keyword_variable __pad101__

Definition at line 12968 of file ripper.y.

var_ref __pad102__

Definition at line 12975 of file ripper.y.

var_lhs __pad103__

Definition at line 12975 of file ripper.y.

backref __pad104__ = dispatch1(var_field, $$)

Definition at line 13005 of file ripper.y.

superclass __pad105__

Definition at line 13027 of file ripper.y.

args_tail __pad106__

Definition at line 13072 of file ripper.y.

opt_args_tail __pad107__

Definition at line 13072 of file ripper.y.

f_args __pad108__

Definition at line 13072 of file ripper.y.

f_bad_arg __pad109__

Definition at line 13072 of file ripper.y.

block_command __pad10__

Definition at line 9986 of file ripper.y.

f_norm_arg __pad110__

Definition at line 13072 of file ripper.y.

f_arg_item __pad111__ = $1

Definition at line 13207 of file ripper.y.

f_arg __pad112__ = get_value($1)

Definition at line 13217 of file ripper.y.

f_label __pad113__

Definition at line 13217 of file ripper.y.

f_kw __pad114__ = $1

Definition at line 13263 of file ripper.y.

f_block_kw __pad115__ = rb_assoc_new($$, $2)

Definition at line 13273 of file ripper.y.

f_block_kwarg __pad116__ = rb_assoc_new($$, $2)

Definition at line 13293 of file ripper.y.

f_kwarg __pad117__

Definition at line 13293 of file ripper.y.

kwrest_mark __pad118__

Definition at line 13293 of file ripper.y.

f_kwrest __pad119__

Definition at line 13362 of file ripper.y.

fcall __pad11__

Definition at line 10012 of file ripper.y.

f_opt __pad120__ = $2

Definition at line 13363 of file ripper.y.

f_block_opt __pad121__ = assignable($1, $3) rb_assoc_new($$, $3)

Definition at line 13378 of file ripper.y.

f_block_optarg __pad122__ = assignable($1, $3) rb_assoc_new($$, $3)

Definition at line 13390 of file ripper.y.

f_optarg __pad123__

Definition at line 13390 of file ripper.y.

restarg_mark __pad124__

Definition at line 13390 of file ripper.y.

f_rest_arg __pad125__

Definition at line 13453 of file ripper.y.

blkarg_mark __pad126__ = dispatch1(rest_param, $2)

Definition at line 13457 of file ripper.y.

f_block_arg __pad127__

Definition at line 13483 of file ripper.y.

opt_f_block_arg __pad128__ = dispatch1(blockarg, $2)

Definition at line 13487 of file ripper.y.

singleton __pad129__

Definition at line 13487 of file ripper.y.

command __pad12__

Definition at line 10030 of file ripper.y.

assoc_list __pad130__

Definition at line 13543 of file ripper.y.

assoc __pad131__

Definition at line 13543 of file ripper.y.

operation __pad132__

Definition at line 13543 of file ripper.y.

operation2 __pad133__

Definition at line 13614 of file ripper.y.

operation3 __pad134__

Definition at line 13619 of file ripper.y.

dot_or_colon __pad135__

Definition at line 13624 of file ripper.y.

opt_terms __pad136__

Definition at line 13631 of file ripper.y.

opt_nl __pad137__

Definition at line 13639 of file ripper.y.

rparen __pad138__

Definition at line 13642 of file ripper.y.

rbracket __pad139__

Definition at line 13645 of file ripper.y.

mlhs __pad13__

Definition at line 10030 of file ripper.y.

trailer __pad140__

Definition at line 13649 of file ripper.y.

terms __pad141__

Definition at line 13654 of file ripper.y.

none __pad142__

Definition at line 13658 of file ripper.y.

mlhs_item __pad14__

Definition at line 10238 of file ripper.y.

mlhs_post __pad15__

Definition at line 10238 of file ripper.y.

mlhs_node __pad16__

Definition at line 10238 of file ripper.y.

lhs __pad17__

Definition at line 10238 of file ripper.y.

cname __pad18__ = dispatch1(var_field, $$)

Definition at line 10367 of file ripper.y.

cpath __pad19__

Definition at line 10464 of file ripper.y.

top_stmts __pad1__

Definition at line 9549 of file ripper.y.

fname __pad20__

Definition at line 10464 of file ripper.y.

fsym __pad21__ = $1

Definition at line 10491 of file ripper.y.

fitem __pad22__

Definition at line 10513 of file ripper.y.

undef_list __pad23__

Definition at line 10524 of file ripper.y.

op __pad24__

Definition at line 10524 of file ripper.y.

reswords __pad25__

Definition at line 10567 of file ripper.y.

arg __pad26__

Definition at line 10589 of file ripper.y.

arg_value __pad27__

Definition at line 10978 of file ripper.y.

aref_args __pad28__

Definition at line 10981 of file ripper.y.

paren_args __pad29__

Definition at line 10988 of file ripper.y.

top_stmt __pad2__

Definition at line 9580 of file ripper.y.

opt_paren_args __pad30__

Definition at line 11014 of file ripper.y.

opt_call_args __pad31__

Definition at line 11022 of file ripper.y.

call_args __pad32__

Definition at line 11022 of file ripper.y.

command_args __pad33__

Definition at line 11022 of file ripper.y.

block_arg __pad34__

Definition at line 11099 of file ripper.y.

opt_block_arg __pad35__

Definition at line 11109 of file ripper.y.

args __pad36__

Definition at line 11109 of file ripper.y.

mrhs_arg __pad37__

Definition at line 11109 of file ripper.y.

mrhs __pad38__

Definition at line 11171 of file ripper.y.

primary __pad39__

Definition at line 11171 of file ripper.y.

compstmt __pad3__

Definition at line 9635 of file ripper.y.

primary_value __pad40__

Definition at line 11679 of file ripper.y.

k_begin __pad41__

Definition at line 11691 of file ripper.y.

k_if __pad42__

Definition at line 11697 of file ripper.y.

k_unless __pad43__

Definition at line 11703 of file ripper.y.

k_while __pad44__

Definition at line 11709 of file ripper.y.

k_until __pad45__

Definition at line 11715 of file ripper.y.

k_case __pad46__

Definition at line 11721 of file ripper.y.

k_for __pad47__

Definition at line 11727 of file ripper.y.

k_class __pad48__

Definition at line 11733 of file ripper.y.

k_module __pad49__

Definition at line 11739 of file ripper.y.

stmts __pad4__

Definition at line 9646 of file ripper.y.

k_def __pad50__

Definition at line 11745 of file ripper.y.

k_end __pad51__

Definition at line 11755 of file ripper.y.

then __pad52__

Definition at line 11761 of file ripper.y.

do __pad53__

Definition at line 11774 of file ripper.y.

if_tail __pad54__

Definition at line 11793 of file ripper.y.

opt_else __pad55__

Definition at line 11796 of file ripper.y.

f_marg __pad56__

Definition at line 11815 of file ripper.y.

f_marg_list __pad57__ = dispatch1(mlhs_paren, $$)

Definition at line 11818 of file ripper.y.

f_margs __pad58__

Definition at line 11818 of file ripper.y.

block_args_tail __pad59__

Definition at line 11857 of file ripper.y.

stmt_or_begin __pad5__

Definition at line 9677 of file ripper.y.

opt_block_args_tail __pad60__

Definition at line 11857 of file ripper.y.

block_param __pad61__

Definition at line 11857 of file ripper.y.

opt_block_param __pad62__

Definition at line 11857 of file ripper.y.

block_param_def __pad63__

Definition at line 12030 of file ripper.y.

opt_bv_decl __pad64__

Definition at line 12058 of file ripper.y.

bv_decls __pad65__

Definition at line 12073 of file ripper.y.

bvar __pad66__

Definition at line 12073 of file ripper.y.

lambda __pad67__ = get_value($1)

Definition at line 12096 of file ripper.y.

f_larglist __pad68__

Definition at line 12127 of file ripper.y.

lambda_body __pad69__

Definition at line 12127 of file ripper.y.

command_asgn __pad6__

Definition at line 9905 of file ripper.y.

do_block __pad70__

Definition at line 12151 of file ripper.y.

block_call __pad71__

Definition at line 12172 of file ripper.y.

method_call __pad72__

Definition at line 12172 of file ripper.y.

brace_block __pad73__

Definition at line 12172 of file ripper.y.

case_body __pad74__

Definition at line 12376 of file ripper.y.

cases __pad75__

Definition at line 12388 of file ripper.y.

opt_rescue __pad76__

Definition at line 12406 of file ripper.y.

exc_list __pad77__

Definition at line 12421 of file ripper.y.

exc_var __pad78__

Definition at line 12421 of file ripper.y.

opt_ensure __pad79__

Definition at line 12447 of file ripper.y.

expr __pad7__

Definition at line 9934 of file ripper.y.

literal __pad80__

Definition at line 12459 of file ripper.y.

strings __pad81__

Definition at line 12477 of file ripper.y.

string __pad82__

Definition at line 12480 of file ripper.y.

word_list __pad83__ = dispatch1(array, $$)

Definition at line 12602 of file ripper.y.

word __pad84__

Definition at line 12631 of file ripper.y.

symbols __pad85__ = dispatch2(word_add, $$, $1)

Definition at line 12638 of file ripper.y.

symbol_list __pad86__ = dispatch1(array, $$)

Definition at line 12657 of file ripper.y.

qwords __pad87__

Definition at line 12688 of file ripper.y.

qsymbols __pad88__ = dispatch1(array, $$)

Definition at line 12696 of file ripper.y.

qword_list __pad89__ = dispatch1(array, $$)

Definition at line 12715 of file ripper.y.

expr_value __pad8__

Definition at line 9934 of file ripper.y.

qsym_list __pad90__

Definition at line 12744 of file ripper.y.

string_contents __pad91__

Definition at line 12766 of file ripper.y.

xstring_contents __pad92__

Definition at line 12784 of file ripper.y.

regexp_contents __pad93__

Definition at line 12802 of file ripper.y.

string_content __pad94__

Definition at line 12839 of file ripper.y.

string_dvar __pad95__

Definition at line 12887 of file ripper.y.

symbol __pad96__

Definition at line 12887 of file ripper.y.

sym __pad97__ = dispatch1(symbol, $2)

Definition at line 12922 of file ripper.y.

dsym __pad98__

Definition at line 12935 of file ripper.y.

numeric __pad99__ = dispatch1(dyna_symbol, $2)

Definition at line 12939 of file ripper.y.

command_call __pad9__

Definition at line 9974 of file ripper.y.

args

Definition at line 10988 of file ripper.y.

Referenced by ary_join_1(), assoc_i(), autoload_const_set(), basic_obj_respond_to(), bind_eval(), chdir_restore(), chdir_yield(), check_exec_options_i_extract(), check_funcall_exec(), check_funcall_failed(), check_funcall_missing(), check_funcall_respond_to(), chown_internal(), console_dev(), copy_stream_body(), create_ip_exc(), date_strftime_with_tmx(), dir_s_chdir(), drop_i(), drop_while_i(), dvar_defined_gen(), each_cons_i(), enc_names(), enum_zip(), enumerator_each(), file_s_fnmatch(), gc_mark_children(), generator_each(), glob_func_caller(), grep_i(), grep_iter_i(), hash2kv(), hash2kv_enc(), initialize(), inject_op_i(), int_ossl_asn1_decode0_cons(), int_ossl_asn1_decode0_prim(), interrupt_init(), ip_ruby_cmd(), iseq_compile_each(), iseq_data_to_ary(), iseq_load(), iseq_set_arguments(), key_i(), lazy_drop_func(), lazy_init_iterator(), lazy_take_func(), lib_eventloop_launcher(), local_id_gen(), lookup2_call(), make_curry_proc(), make_no_method_exception(), mark(), max_by_i(), max_i(), max_ii(), member_i(), min_by_i(), min_i(), min_ii(), name_err_mesg_to_str(), new_args_gen(), new_args_tail_gen(), next_ii(), nometh_err_initialize(), obj_respond_to(), objspace_each_objects(), onig_snprintf_with_pattern(), onig_syntax_warn(), open_key_args(), ossl_call_verify_cb_proc(), ossl_debug(), ossl_exc_new(), ossl_raise(), ossl_tmp_dh_callback(), ossl_verify_cb(), ossl_x509name_init_i(), ossl_x509name_initialize(), parse(), path_binread(), path_binwrite(), path_each_entry(), path_each_line(), path_open(), path_opendir(), path_read(), path_readlines(), path_s_glob(), path_sysopen(), path_write(), pipe_open(), process_sflag(), protected_alias(), protected_end_document(), protected_scalar(), protected_start_document(), protected_start_mapping(), protected_start_sequence(), protected_start_stream(), push_glob(), queue_do_pop(), range_each(), range_init(), range_step(), rassoc_i(), rb_autoload_load(), rb_bug(), rb_compile_bug(), rb_compile_error(), rb_compile_error_append(), rb_compile_error_with_enc(), rb_compile_warn(), rb_compile_warning(), rb_condvar_wait(), rb_deflate_s_deflate(), rb_enc_raise(), rb_execarg_extract_options(), rb_exit(), rb_f_abort(), rb_f_select(), rb_fatal(), rb_fiber_start(), rb_file_join(), rb_file_s_utime(), rb_glob2(), rb_glob_caller(), rb_hash_assoc(), rb_hash_key(), rb_hash_rassoc(), rb_inflate_s_inflate(), rb_io_s_pipe(), rb_iseq_parameters(), rb_loaderror(), rb_loaderror_with_path(), rb_name_error(), rb_name_error_str(), rb_obj_respond_to(), rb_objspace_each_objects(), rb_proc_exec_n(), rb_raise(), rb_reg_s_union(), rb_rescue2(), rb_str_upto(), rb_strftime_with_timespec(), rb_struct_new(), rb_szqueue_push(), rb_wait_for_single_fd(), rb_warn(), rb_warning(), rb_yield_values(), rgengc_report_body(), ruby_brace_glob0(), run_finalizer(), run_single_final(), select_single(), select_single_cleanup(), setup_args(), take_i(), take_items(), warn_printf(), wmap_keys(), wmap_values(), yyparse(), zip_ary(), zip_i(), zstream_run(), zstream_run_func(), and zstream_unblock_func().

assoc_list assocs

Definition at line 13543 of file ripper.y.

assoc_list assocs

Definition at line 13543 of file ripper.y.

top_stmt bodystmt

Definition at line 9580 of file ripper.y.

Referenced by yyparse().

bv_decls bv_decls

Definition at line 12073 of file ripper.y.

block_command cmd_brace_block = method_arg($$, $4)

Definition at line 9987 of file ripper.y.

literal dsym

Definition at line 12459 of file ripper.y.

fitem dsym

Definition at line 10513 of file ripper.y.

f_arg f_arg

Definition at line 13217 of file ripper.y.

Referenced by nucomp_expt(), nucomp_polar(), and numeric_polar().

f_block_kwarg f_block_kwarg

Definition at line 13293 of file ripper.y.

f_block_optarg f_block_optarg

Definition at line 13390 of file ripper.y.

block_param f_block_optarg

Definition at line 11857 of file ripper.y.

f_kwarg f_kwarg

Definition at line 13293 of file ripper.y.

f_marg_list

Definition at line 11857 of file ripper.y.

f_marg_list f_marg_list

Definition at line 11818 of file ripper.y.

f_optarg f_optarg

Definition at line 13390 of file ripper.y.

f_args f_optarg

Definition at line 13072 of file ripper.y.

opt_else for_var

Definition at line 11796 of file ripper.y.

struct symbols global_symbols [static]

const char id_type_names[][9] [static]

Initial value:

 {
    "LOCAL",
    "INSTANCE",
    "",                         
    "GLOBAL",
    "ATTRSET",
    "CONST",
    "CLASS",
    "JUNK",
}

Definition at line 8819 of file ripper.y.

keyword_do_cond

Definition at line 11782 of file ripper.y.

Referenced by parser_yylex().

lex_state = EXPR_BEG

Definition at line 12846 of file ripper.y.

lex_strterm = 0

Definition at line 12845 of file ripper.y.

arg lhs

Definition at line 10592 of file ripper.y.

command_asgn lhs

Initial value:

' command_asgn
                    {




                        $$ = dispatch2(assign, $1, $3);

                    }

Definition at line 9916 of file ripper.y.

Referenced by new_attr_op_assign_gen(), new_const_op_assign_gen(), new_op_assign_gen(), node_assign_gen(), and pruby_var_equal_to_cstr_p().

struct magic_comment magic_comments[] [static]

Initial value:

 {
    {"coding", magic_comment_encoding, parser_encode_length},
    {"encoding", magic_comment_encoding, parser_encode_length},
    {"warn_indent", parser_set_token_info},
}

Definition at line 6727 of file ripper.y.

mlhs mlhs_basic

Definition at line 10030 of file ripper.y.

mlhs_item mlhs_head

Definition at line 10238 of file ripper.y.

mlhs mlhs_inner

Definition at line 10030 of file ripper.y.

mlhs_post mlhs_post

Definition at line 10238 of file ripper.y.

const char* name

Definition at line 10095 of file ripper.y.

opt_ensure none

Definition at line 12447 of file ripper.y.

none

Definition at line 12440 of file ripper.y.

none

Definition at line 12414 of file ripper.y.

Referenced by enum_none().

struct { ... } op_tbl[] [static]

opt_nl

Definition at line 12065 of file ripper.y.

const rb_data_type_t parser_data_type [static]

Initial value:

Definition at line 10968 of file ripper.y.

const rb_data_type_t parser_data_type [static]

Definition at line 5454 of file ripper.y.

<'{lex_state=EXPR_BEG;command_start=TRUE;}expr_valueterm{$$=$3;}|errorterm{yyerrok;$$=Qnil;};f_arglist:'('f_argsrparen{$$=dispatch1(paren,$2);lex_state=EXPR_BEG;command_start=TRUE;}|{$<num> parser parser_in_kwarg = parser->parser_in_kwarg 1

Definition at line 13063 of file ripper.y.

block_param_def Qnil

Definition at line 12030 of file ripper.y.

block_param_def Qnil

Definition at line 12030 of file ripper.y.

block_param_def Qnil

Definition at line 12030 of file ripper.y.

block_param_def Qnil

Definition at line 12030 of file ripper.y.

block_param_def Qnil

Definition at line 12030 of file ripper.y.

block_param_def Qnil

Definition at line 12030 of file ripper.y.

string regexp

Definition at line 12480 of file ripper.y.

Referenced by match_aref(), match_backref_number(), match_check(), match_equal(), match_hash(), match_inspect(), match_names(), and rb_str_split_m().

const unsigned int ruby_global_name_punct_bits[]

Initial value:

Definition at line 6196 of file ripper.y.

numeric simple_numeric

Definition at line 12950 of file ripper.y.

string string1

Definition at line 12480 of file ripper.y.

struct st_hash_type symhash [static]

Initial value:

Definition at line 10136 of file ripper.y.

cname tCONSTANT

Definition at line 10367 of file ripper.y.

Referenced by parser_yylex().

trailer term

Definition at line 13649 of file ripper.y.

Referenced by ole_hresult2msg(), p_gamma(), parser_heredoc_identifier(), parser_parse_string(), parser_yylex(), and rb_str_format().

ID token

Definition at line 10094 of file ripper.y.

undef_list undef_list

Definition at line 10524 of file ripper.y.

string words

Definition at line 12480 of file ripper.y.

string xstring

Definition at line 12480 of file ripper.y.


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7