#include "ruby.h"
#include "env.h"
#include "intern.h"
#include "node.h"
#include "st.h"
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
#include "regex.h"
#include "util.h"
#include "lex.c"
Go to the source code of this file.
Data Structures | |
| struct | local_vars |
| union | yyalloc |
| union | yystype |
Defines | |
| #define | YYBISON 1 |
| #define | kCLASS 257 |
| #define | kMODULE 258 |
| #define | kDEF 259 |
| #define | kUNDEF 260 |
| #define | kBEGIN 261 |
| #define | kRESCUE 262 |
| #define | kENSURE 263 |
| #define | kEND 264 |
| #define | kIF 265 |
| #define | kUNLESS 266 |
| #define | kTHEN 267 |
| #define | kELSIF 268 |
| #define | kELSE 269 |
| #define | kCASE 270 |
| #define | kWHEN 271 |
| #define | kWHILE 272 |
| #define | kUNTIL 273 |
| #define | kFOR 274 |
| #define | kBREAK 275 |
| #define | kNEXT 276 |
| #define | kREDO 277 |
| #define | kRETRY 278 |
| #define | kIN 279 |
| #define | kDO 280 |
| #define | kDO_COND 281 |
| #define | kDO_BLOCK 282 |
| #define | kRETURN 283 |
| #define | kYIELD 284 |
| #define | kSUPER 285 |
| #define | kSELF 286 |
| #define | kNIL 287 |
| #define | kTRUE 288 |
| #define | kFALSE 289 |
| #define | kAND 290 |
| #define | kOR 291 |
| #define | kNOT 292 |
| #define | kIF_MOD 293 |
| #define | kUNLESS_MOD 294 |
| #define | kWHILE_MOD 295 |
| #define | kUNTIL_MOD 296 |
| #define | kRESCUE_MOD 297 |
| #define | kALIAS 298 |
| #define | kDEFINED 299 |
| #define | klBEGIN 300 |
| #define | klEND 301 |
| #define | k__LINE__ 302 |
| #define | k__FILE__ 303 |
| #define | tIDENTIFIER 304 |
| #define | tFID 305 |
| #define | tGVAR 306 |
| #define | tIVAR 307 |
| #define | tCONSTANT 308 |
| #define | tCVAR 309 |
| #define | tINTEGER 310 |
| #define | tFLOAT 311 |
| #define | tSTRING_CONTENT 312 |
| #define | tNTH_REF 313 |
| #define | tBACK_REF 314 |
| #define | tREGEXP_END 315 |
| #define | tUPLUS 316 |
| #define | tUMINUS 317 |
| #define | tPOW 318 |
| #define | tCMP 319 |
| #define | tEQ 320 |
| #define | tEQQ 321 |
| #define | tNEQ 322 |
| #define | tGEQ 323 |
| #define | tLEQ 324 |
| #define | tANDOP 325 |
| #define | tOROP 326 |
| #define | tMATCH 327 |
| #define | tNMATCH 328 |
| #define | tDOT2 329 |
| #define | tDOT3 330 |
| #define | tAREF 331 |
| #define | tASET 332 |
| #define | tLSHFT 333 |
| #define | tRSHFT 334 |
| #define | tCOLON2 335 |
| #define | tCOLON3 336 |
| #define | tOP_ASGN 337 |
| #define | tASSOC 338 |
| #define | tLPAREN 339 |
| #define | tLPAREN_ARG 340 |
| #define | tRPAREN 341 |
| #define | tLBRACK 342 |
| #define | tLBRACE 343 |
| #define | tLBRACE_ARG 344 |
| #define | tSTAR 345 |
| #define | tAMPER 346 |
| #define | tSYMBEG 347 |
| #define | tSTRING_BEG 348 |
| #define | tXSTRING_BEG 349 |
| #define | tREGEXP_BEG 350 |
| #define | tWORDS_BEG 351 |
| #define | tQWORDS_BEG 352 |
| #define | tSTRING_DBEG 353 |
| #define | tSTRING_DVAR 354 |
| #define | tSTRING_END 355 |
| #define | tLOWEST 356 |
| #define | tUMINUS_NUM 357 |
| #define | tLAST_TOKEN 358 |
| #define | YYDEBUG 1 |
| #define | YYERROR_VERBOSE 1 |
| #define | YYSTACK_USE_ALLOCA 0 |
| #define | YYMALLOC rb_parser_malloc |
| #define | YYREALLOC rb_parser_realloc |
| #define | YYCALLOC rb_parser_calloc |
| #define | YYFREE rb_parser_free |
| #define | malloc YYMALLOC |
| #define | realloc YYREALLOC |
| #define | calloc YYCALLOC |
| #define | free YYFREE |
| #define | yyparse ruby_yyparse |
| #define | yylex ruby_yylex |
| #define | yyerror ruby_yyerror |
| #define | yylval ruby_yylval |
| #define | yychar ruby_yychar |
| #define | yydebug ruby_yydebug |
| #define | ID_SCOPE_SHIFT 3 |
| #define | ID_SCOPE_MASK 0x07 |
| #define | ID_LOCAL 0x01 |
| #define | ID_INSTANCE 0x02 |
| #define | ID_GLOBAL 0x03 |
| #define | ID_ATTRSET 0x04 |
| #define | ID_CONST 0x05 |
| #define | ID_CLASS 0x06 |
| #define | ID_JUNK 0x07 |
| #define | ID_INTERNAL ID_JUNK |
| #define | is_notop_id(id) ((id)>tLAST_TOKEN) |
| #define | is_local_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_LOCAL) |
| #define | is_global_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_GLOBAL) |
| #define | is_instance_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_INSTANCE) |
| #define | is_attrset_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_ATTRSET) |
| #define | is_const_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CONST) |
| #define | is_class_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_CLASS) |
| #define | is_junk_id(id) (is_notop_id(id)&&((id)&ID_SCOPE_MASK)==ID_JUNK) |
| #define | is_asgn_or_id(id) |
| #define | BITSTACK_PUSH(stack, n) (stack = (stack<<1)|((n)&1)) |
| #define | BITSTACK_POP(stack) (stack >>= 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 | value_expr(node) value_expr0((node) = remove_begin(node)) |
| #define | void_expr(node) void_expr0((node) = remove_begin(node)) |
| #define | RE_OPTION_ONCE 0x80 |
| #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) ((signed short)(node)->u2.id) |
| #define | nd_paren(node) (char)((node)->u2.id >> CHAR_BIT*2) |
| #define | nd_nest u3.id |
| #define | YYSTYPE yystype |
| #define | YYSTYPE_IS_TRIVIAL 1 |
| #define | YYFINAL 895 |
| #define | YYFLAG -32768 |
| #define | YYNTBASE 132 |
| #define | YYTRANSLATE(x) ((unsigned)(x) <= 358 ? yytranslate[x] : 274) |
| #define | YYLAST 9585 |
| #define | YYSTACK_ALLOC malloc |
| #define | YYSTACK_FREE free |
| #define | YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) |
| #define | YYSTACK_BYTES(N) |
| #define | YYCOPY(To, From, Count) |
| #define | YYSTACK_RELOCATE(Stack) |
| #define | YYSIZE_T unsigned int |
| #define | yyerrok (yyerrstatus = 0) |
| #define | yyclearin (yychar = YYEMPTY) |
| #define | YYEMPTY -2 |
| #define | YYEOF 0 |
| #define | YYACCEPT goto yyacceptlab |
| #define | YYABORT goto yyabortlab |
| #define | YYERROR goto yyerrlab1 |
| #define | YYFAIL goto yyerrlab |
| #define | YYRECOVERING() (!!yyerrstatus) |
| #define | YYBACKUP(Token, Value) |
| #define | YYTERROR 1 |
| #define | YYERRCODE 256 |
| #define | YYLLOC_DEFAULT(Current, Rhs, N) |
| #define | YYLEX yylex () |
| #define | YYFPRINTF fprintf |
| #define | YYDPRINTF(Args) |
| #define | YYINITDEPTH 200 |
| #define | YYMAXDEPTH 10000 |
| #define | YYPARSE_PARAM_ARG |
| #define | YYPARSE_PARAM_DECL |
| #define | YY_DECL_NON_LSP_VARIABLES |
| #define | YY_DECL_VARIABLES YY_DECL_NON_LSP_VARIABLES |
| #define | YYPOPSTACK (yyvsp--, yyssp--) |
| #define | SIGN_EXTEND_CHAR(c) ((((unsigned char)(c)) ^ 128) - 128) |
| #define | is_identchar(c) (SIGN_EXTEND_CHAR(c)!=-1&&(ISALNUM(c) || (c) == '_' || ismbchar(c))) |
| #define | LEAVE_BS 1 |
| #define | was_bol() (lex_p == lex_pbeg + 1) |
| #define | peek(c) (lex_p != lex_pend && (c) == *lex_p) |
| #define | tokfix() (tokenbuf[tokidx]='\0') |
| #define | tok() tokenbuf |
| #define | toklen() tokidx |
| #define | toklast() (tokidx>0?tokenbuf[tokidx-1]:0) |
| #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 | NEW_STRTERM(func, term, paren) rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0) |
| #define | IS_ARG() (lex_state == EXPR_ARG || lex_state == EXPR_CMDARG) |
| #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 unsigned LONG_LONG | stack_type |
Enumerations | |
| enum | lex_state { EXPR_BEG, EXPR_END, EXPR_ARG, EXPR_CMDARG, EXPR_ENDARG, EXPR_MID, EXPR_FNAME, EXPR_DOT, EXPR_CLASS } |
| 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 | |
| void * | rb_parser_malloc (size_t) |
| void * | rb_parser_realloc (void *, size_t) |
| void * | rb_parser_calloc (size_t, size_t) |
| void | rb_parser_free (void *) |
| int | yylex () |
| int | yyerror () |
| NODE * | cond () |
| NODE * | logop () |
| int | cond_negative () |
| NODE * | newline_node () |
| void | fixpos () |
| int | value_expr0 () |
| void | void_expr0 () |
| void | void_stmts () |
| NODE * | remove_begin () |
| NODE * | block_append () |
| NODE * | list_append () |
| NODE * | list_concat () |
| NODE * | arg_concat () |
| NODE * | arg_prepend () |
| NODE * | literal_concat () |
| NODE * | new_evstr () |
| NODE * | evstr2dstr () |
| NODE * | call_op () |
| NODE * | negate_lit () |
| NODE * | ret_args () |
| NODE * | arg_blk_pass () |
| NODE * | new_call () |
| NODE * | new_fcall () |
| NODE * | new_super () |
| NODE * | new_yield () |
| NODE * | gettable () |
| NODE * | assignable () |
| NODE * | aryset () |
| NODE * | attrset () |
| void | rb_backref_error () |
| NODE * | node_assign () |
| NODE * | match_gen () |
| void | local_push () |
| void | local_pop () |
| int | local_append () |
| int | local_cnt () |
| int | local_id () |
| ID * | local_tbl () |
| ID | internal_id () |
| RVarmap * | dyna_push () |
| void | dyna_pop () |
| int | dyna_in_block () |
| NODE * | dyna_init () |
| void | top_local_init () |
| void | top_local_setup () |
| YYSIZE_T | yystrlen (char *yystr) const |
| char * | yystpcpy (char *yydest, const char *yysrc) |
| YY_DECL_VARIABLES int | yyparse (YYPARSE_PARAM_ARG) |
| int | yyerror (char *msg) const |
| NODE * | yycompile (char *f, int line) |
| VALUE | lex_get_str (VALUE s) |
| VALUE | lex_getline () |
| NODE * | rb_compile_string (char *f, VALUE s, int line) const |
| NODE * | rb_compile_cstr (char *f, char *s, int len, int line) const |
| NODE * | rb_compile_file (char *f, VALUE file, int start) const |
| int | nextc () |
| void | pushback (int c) |
| char * | newtok () |
| void | tokadd (char c) |
| int | read_escape () |
| int | tokadd_escape (int term) |
| int | regx_options () |
| void | dispose_string (VALUE str) |
| int | tokadd_string (int func, int term, int paren, int *nest) |
| int | parse_string (NODE *quote) |
| int | heredoc_identifier () |
| void | heredoc_restore (NODE *here) |
| int | whole_match_p (char *eos, int len, int indent) |
| int | here_document (NODE *here) |
| void | arg_ambiguous () |
| NODE * | rb_node_newnode (enum node_type type, VALUE a0, VALUE a1, VALUE a2) |
| enum node_type | nodetype (NODE *node) |
| int | nodeline (NODE *node) |
| NODE * | newline_node (NODE *node) |
| void | fixpos (NODE *node, NODE *orig) |
| void | parser_warning (NODE *node, const char *mesg) |
| void | parser_warn (NODE *node, const char *mesg) |
| NODE * | block_append (NODE *head, NODE *tail) |
| NODE * | list_append (NODE *list, NODE *item) |
| NODE * | list_concat (NODE *head, NODE *tail) |
| NODE * | literal_concat (NODE *head, NODE *tail) |
| NODE * | evstr2dstr (NODE *node) |
| NODE * | new_evstr (NODE *node) |
| NODE * | call_op (NODE *recv, ID id, int narg, NODE *arg1) |
| NODE * | match_gen (NODE *node1, NODE *node2) |
| NODE * | gettable (ID id) |
| NODE * | assignable (ID id, NODE *val) |
| NODE * | aryset (NODE *recv, NODE *idx) |
| ID | rb_id_attrset (ID id) |
| NODE * | attrset (NODE *recv, ID id) |
| void | rb_backref_error (NODE *node) |
| NODE * | arg_concat (NODE *node1, NODE *node2) |
| NODE * | arg_add (NODE *node1, NODE *node2) |
| NODE * | node_assign (NODE *lhs, NODE *rhs) |
| int | value_expr0 (NODE *node) |
| void | void_expr0 (NODE *node) |
| void | void_stmts (NODE *node) |
| NODE * | remove_begin (NODE *node) |
| int | assign_in_cond (NODE *node) |
| int | e_option_supplied () |
| void | warn_unless_e_option (NODE *node, const char *str) |
| void | warning_unless_e_option (NODE *node, const char *str) |
| NODE * | cond0 () |
| NODE * | range_op (NODE *node) |
| int | literal_node (NODE *node) |
| NODE * | cond0 (NODE *node) |
| NODE * | cond (NODE *node) |
| NODE * | logop (enum node_type type, NODE *left, NODE *right) |
| int | cond_negative (NODE **nodep) |
| void | no_blockarg (NODE *node) |
| NODE * | ret_args (NODE *node) |
| NODE * | new_yield (NODE *node) |
| NODE * | negate_lit (NODE *node) |
| NODE * | arg_blk_pass (NODE *node1, NODE *node2) |
| NODE * | arg_prepend (NODE *node1, NODE *node2) |
| NODE * | new_call (NODE *r, ID m, NODE *a) |
| NODE * | new_fcall (ID m, NODE *a) |
| NODE * | new_super (NODE *a) |
| void | local_push (int top) |
| int | local_append (ID id) |
| int | local_cnt (ID id) |
| int | local_id (ID id) |
| void | dyna_pop (struct RVarmap *vars) |
| NODE * | dyna_init (NODE *node, struct RVarmap *pre) |
| int | ruby_parser_stack_on_heap () |
| void | rb_gc_mark_parser () |
| void | rb_parser_append_print () |
| void | rb_parser_while_loop (int chop, int split) |
| void | Init_sym () |
| int | is_special_global_name (char *m) const |
| int | rb_symname_p (char *name) const |
| ID | rb_intern (char *name) const |
| char * | rb_id2name (ID id) |
| int | symbols_i (char *key, ID value, VALUE ary) |
| VALUE | rb_sym_all_symbols () |
| int | rb_is_const_id (ID id) |
| int | rb_is_class_id (ID id) |
| int | rb_is_instance_id (ID id) |
| int | rb_is_local_id (ID id) |
| int | rb_is_junk_id (ID id) |
| void | special_local_set (char c, VALUE val) |
| VALUE | rb_backref_get () |
| void | rb_backref_set (VALUE val) |
| VALUE | rb_lastline_get () |
| void | rb_lastline_set (VALUE val) |
Variables | |
| NODE * | ruby_eval_tree_begin = 0 |
| NODE * | ruby_eval_tree = 0 |
| char * | ruby_sourcefile |
| int | ruby_sourceline |
| enum lex_state | lex_state |
| NODE * | lex_strterm |
| stack_type | cond_stack = 0 |
| stack_type | cmdarg_stack = 0 |
| int | class_nest = 0 |
| int | in_single = 0 |
| int | in_def = 0 |
| int | compile_for_eval = 0 |
| ID | cur_mid = 0 |
| int | in_defined = 0 |
| const short | yytranslate [] |
| const short | yyprhs [] |
| const short | yyrhs [] |
| const short | yyrline [] |
| const char *const | yytname [] |
| const short | yyr1 [] |
| const short | yyr2 [] |
| const short | yydefact [] |
| const short | yydefgoto [] |
| const short | yypact [] |
| const short | yypgoto [] |
| const short | yytable [] |
| const short | yycheck [] |
| int | yydebug |
| char * | tokenbuf = NULL |
| int | tokidx |
| int | toksiz = 0 |
| VALUE(* | lex_gets )() |
| VALUE | lex_input |
| VALUE | lex_lastline |
| char * | lex_pbeg |
| char * | lex_p |
| char * | lex_pend |
| int | heredoc_end |
| int | command_start = Qtrue |
| int | ruby_in_compile = 0 |
| int | ruby__end__seen |
| VALUE | ruby_debug_lines |
| NODE * | parser_heap |
| int | lex_gets_ptr |
| local_vars * | lvtbl |
| struct { | |
| ID token | |
| char * name | |
| } | op_tbl [] |
| st_table * | sym_tbl |
| st_table * | sym_rev_tbl |
| ID | last_id = tLAST_TOKEN |
|
|
Value: ((parser_heap = (n))->u1.node = (p), \
(n)->u3.cnt = (c), (p))
Definition at line 10240 of file parse.c. Referenced by rb_parser_calloc(), rb_parser_malloc(), and rb_parser_realloc(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 214 of file parse.c. Referenced by yyparse(). |
|
|
|
|
|
|
|
|
Definition at line 212 of file parse.c. Referenced by yyparse(). |
|
|
Definition at line 208 of file parse.c. Referenced by yyparse(). |
|
|
|
|
|
Definition at line 207 of file parse.c. Referenced by yyparse(). |
|
|
Definition at line 206 of file parse.c. Referenced by yyparse(). |
|
|
|
Definition at line 10238 of file parse.c. Referenced by rb_parser_calloc(), rb_parser_malloc(), and rb_parser_realloc(). |
|
|
Definition at line 152 of file parse.c. Referenced by rb_id_attrset(), and rb_intern(). |
|
|
Definition at line 154 of file parse.c. Referenced by rb_intern(). |
|
|
Definition at line 153 of file parse.c. Referenced by rb_id2name(), and rb_intern(). |
|
|
Definition at line 151 of file parse.c. Referenced by rb_intern(). |
|
|
Definition at line 150 of file parse.c. Referenced by rb_intern(). |
|
|
Definition at line 156 of file parse.c. Referenced by internal_id(). |
|
|
Definition at line 155 of file parse.c. Referenced by rb_intern(). |
|
|
Definition at line 149 of file parse.c. Referenced by rb_id2name(), and rb_intern(). |
|
|
Definition at line 148 of file parse.c. Referenced by rb_id2name(), and rb_id_attrset(). |
|
|
Definition at line 147 of file parse.c. Referenced by internal_id(), and rb_intern(). |
|
|
|
|
|
Value: ((is_notop_id(id)) && \ (((id)&ID_SCOPE_MASK) == ID_GLOBAL || \ ((id)&ID_SCOPE_MASK) == ID_INSTANCE || \ ((id)&ID_SCOPE_MASK) == ID_CLASS)) Definition at line 167 of file parse.c. Referenced by yyparse(). |
|
|
Definition at line 162 of file parse.c. Referenced by rb_id2name(), and rb_intern(). |
|
|
Definition at line 164 of file parse.c. Referenced by assignable(), gettable(), and rb_is_class_id(). |
|
|
Definition at line 163 of file parse.c. Referenced by assignable(), gettable(), and rb_is_const_id(). |