-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrubyparser.h
1397 lines (1116 loc) · 33.2 KB
/
rubyparser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef RUBY_RUBYPARSER_H
#define RUBY_RUBYPARSER_H 1
/*
* This is a header file for librubyparser interface
*/
#include <stdarg.h> /* for va_list */
#include <assert.h>
#ifdef UNIVERSAL_PARSER
#define rb_encoding const void
#define OnigCodePoint unsigned int
#include "parser_st.h"
#ifndef RUBY_RUBY_H
#include "parser_value.h"
#endif
#else
#include "ruby/encoding.h"
#endif
#ifndef FLEX_ARY_LEN
/* From internal/compilers.h */
/* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
# define FLEX_ARY_LEN /* VALUE ary[]; */
#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
# define FLEX_ARY_LEN 0 /* VALUE ary[0]; */
#else
# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */
#endif
#endif
#if defined(__GNUC__)
# if defined(__MINGW_PRINTF_FORMAT)
# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(__MINGW_PRINTF_FORMAT, string_index, argument_index)))
# else
# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((format(printf, string_index, argument_index)))
# endif
#elif defined(__clang__)
# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index) __attribute__((__format__(__printf__, string_index, argument_index)))
#else
# define RUBYPARSER_ATTRIBUTE_FORMAT(string_index, argument_index)
#endif
/*
* Parser String
*/
enum rb_parser_string_coderange_type {
/** The object's coderange is unclear yet. */
RB_PARSER_ENC_CODERANGE_UNKNOWN = 0,
RB_PARSER_ENC_CODERANGE_7BIT = 1,
RB_PARSER_ENC_CODERANGE_VALID = 2,
RB_PARSER_ENC_CODERANGE_BROKEN = 3
};
typedef struct rb_parser_string {
enum rb_parser_string_coderange_type coderange;
rb_encoding *enc;
/* Length of the string, not including terminating NUL character. */
long len;
/* Pointer to the contents of the string. */
char *ptr;
} rb_parser_string_t;
enum rb_parser_shareability {
rb_parser_shareable_none,
rb_parser_shareable_literal,
rb_parser_shareable_copy,
rb_parser_shareable_everything,
};
typedef void* rb_parser_input_data;
/*
* AST Node
*/
enum node_type {
NODE_SCOPE,
NODE_BLOCK,
NODE_IF,
NODE_UNLESS,
NODE_CASE,
NODE_CASE2,
NODE_CASE3,
NODE_WHEN,
NODE_IN,
NODE_WHILE,
NODE_UNTIL,
NODE_ITER,
NODE_FOR,
NODE_FOR_MASGN,
NODE_BREAK,
NODE_NEXT,
NODE_REDO,
NODE_RETRY,
NODE_BEGIN,
NODE_RESCUE,
NODE_RESBODY,
NODE_ENSURE,
NODE_AND,
NODE_OR,
NODE_MASGN,
NODE_LASGN,
NODE_DASGN,
NODE_GASGN,
NODE_IASGN,
NODE_CDECL,
NODE_CVASGN,
NODE_OP_ASGN1,
NODE_OP_ASGN2,
NODE_OP_ASGN_AND,
NODE_OP_ASGN_OR,
NODE_OP_CDECL,
NODE_CALL,
NODE_OPCALL,
NODE_FCALL,
NODE_VCALL,
NODE_QCALL,
NODE_SUPER,
NODE_ZSUPER,
NODE_LIST,
NODE_ZLIST,
NODE_HASH,
NODE_RETURN,
NODE_YIELD,
NODE_LVAR,
NODE_DVAR,
NODE_GVAR,
NODE_IVAR,
NODE_CONST,
NODE_CVAR,
NODE_NTH_REF,
NODE_BACK_REF,
NODE_MATCH,
NODE_MATCH2,
NODE_MATCH3,
NODE_INTEGER,
NODE_FLOAT,
NODE_RATIONAL,
NODE_IMAGINARY,
NODE_STR,
NODE_DSTR,
NODE_XSTR,
NODE_DXSTR,
NODE_EVSTR,
NODE_REGX,
NODE_DREGX,
NODE_ONCE,
NODE_ARGS,
NODE_ARGS_AUX,
NODE_OPT_ARG,
NODE_KW_ARG,
NODE_POSTARG,
NODE_ARGSCAT,
NODE_ARGSPUSH,
NODE_SPLAT,
NODE_BLOCK_PASS,
NODE_DEFN,
NODE_DEFS,
NODE_ALIAS,
NODE_VALIAS,
NODE_UNDEF,
NODE_CLASS,
NODE_MODULE,
NODE_SCLASS,
NODE_COLON2,
NODE_COLON3,
NODE_DOT2,
NODE_DOT3,
NODE_FLIP2,
NODE_FLIP3,
NODE_SELF,
NODE_NIL,
NODE_TRUE,
NODE_FALSE,
NODE_ERRINFO,
NODE_DEFINED,
NODE_POSTEXE,
NODE_SYM,
NODE_DSYM,
NODE_ATTRASGN,
NODE_LAMBDA,
NODE_ARYPTN,
NODE_HSHPTN,
NODE_FNDPTN,
NODE_ERROR,
NODE_LINE,
NODE_FILE,
NODE_ENCODING,
NODE_LAST
};
typedef struct rb_ast_id_table {
int size;
ID ids[FLEX_ARY_LEN];
} rb_ast_id_table_t;
typedef struct rb_code_position_struct {
int lineno;
int column;
} rb_code_position_t;
typedef struct rb_code_location_struct {
rb_code_position_t beg_pos;
rb_code_position_t end_pos;
} rb_code_location_t;
#define YYLTYPE rb_code_location_t
#define YYLTYPE_IS_DECLARED 1
typedef struct rb_parser_ast_token {
int id;
const char *type_name;
rb_parser_string_t *str;
rb_code_location_t loc;
} rb_parser_ast_token_t;
/*
* Array-like object for parser
*/
typedef void* rb_parser_ary_data;
enum rb_parser_ary_data_type {
PARSER_ARY_DATA_AST_TOKEN = 1,
PARSER_ARY_DATA_SCRIPT_LINE
};
typedef struct rb_parser_ary {
enum rb_parser_ary_data_type data_type;
rb_parser_ary_data *data;
long len; // current size
long capa; // capacity
} rb_parser_ary_t;
/* Header part of AST Node */
typedef struct RNode {
VALUE flags;
rb_code_location_t nd_loc;
int node_id;
} NODE;
typedef struct RNode_SCOPE {
NODE node;
rb_ast_id_table_t *nd_tbl;
struct RNode *nd_body;
struct RNode_ARGS *nd_args;
} rb_node_scope_t;
typedef struct RNode_BLOCK {
NODE node;
struct RNode *nd_head;
struct RNode *nd_end;
struct RNode *nd_next;
} rb_node_block_t;
typedef struct RNode_IF {
NODE node;
struct RNode *nd_cond;
struct RNode *nd_body;
struct RNode *nd_else;
} rb_node_if_t;
typedef struct RNode_UNLESS {
NODE node;
struct RNode *nd_cond;
struct RNode *nd_body;
struct RNode *nd_else;
} rb_node_unless_t;
typedef struct RNode_CASE {
NODE node;
struct RNode *nd_head;
struct RNode *nd_body;
} rb_node_case_t;
typedef struct RNode_CASE2 {
NODE node;
struct RNode *nd_head;
struct RNode *nd_body;
} rb_node_case2_t;
typedef struct RNode_CASE3 {
NODE node;
struct RNode *nd_head;
struct RNode *nd_body;
} rb_node_case3_t;
typedef struct RNode_WHEN {
NODE node;
struct RNode *nd_head;
struct RNode *nd_body;
struct RNode *nd_next;
} rb_node_when_t;
typedef struct RNode_IN {
NODE node;
struct RNode *nd_head;
struct RNode *nd_body;
struct RNode *nd_next;
} rb_node_in_t;
/* RNode_WHILE and RNode_UNTIL should be same structure */
typedef struct RNode_WHILE {
NODE node;
struct RNode *nd_cond;
struct RNode *nd_body;
long nd_state;
} rb_node_while_t;
typedef struct RNode_UNTIL {
NODE node;
struct RNode *nd_cond;
struct RNode *nd_body;
long nd_state;
} rb_node_until_t;
/* RNode_ITER and RNode_FOR should be same structure */
typedef struct RNode_ITER {
NODE node;
struct RNode *nd_body;
struct RNode *nd_iter;
} rb_node_iter_t;
typedef struct RNode_FOR {
NODE node;
struct RNode *nd_body;
struct RNode *nd_iter;
} rb_node_for_t;
typedef struct RNode_FOR_MASGN {
NODE node;
struct RNode *nd_var;
} rb_node_for_masgn_t;
/* RNode_BREAK, RNode_NEXT and RNode_REDO should be same structure */
typedef struct RNode_BREAK {
NODE node;
struct RNode *nd_chain;
struct RNode *nd_stts;
} rb_node_break_t;
typedef struct RNode_NEXT {
NODE node;
struct RNode *nd_chain;
struct RNode *nd_stts;
} rb_node_next_t;
typedef struct RNode_REDO {
NODE node;
struct RNode *nd_chain;
} rb_node_redo_t;
typedef struct RNode_RETRY {
NODE node;
} rb_node_retry_t;
typedef struct RNode_BEGIN {
NODE node;
struct RNode *nd_body;
} rb_node_begin_t;
typedef struct RNode_RESCUE {
NODE node;
struct RNode *nd_head;
struct RNode *nd_resq;
struct RNode *nd_else;
} rb_node_rescue_t;
typedef struct RNode_RESBODY {
NODE node;
struct RNode *nd_args;
struct RNode *nd_body;
struct RNode *nd_next;
} rb_node_resbody_t;
typedef struct RNode_ENSURE {
NODE node;
struct RNode *nd_head;
struct RNode *nd_ensr;
} rb_node_ensure_t;
/* RNode_AND and RNode_OR should be same structure */
typedef struct RNode_AND {
NODE node;
struct RNode *nd_1st;
struct RNode *nd_2nd;
} rb_node_and_t;
typedef struct RNode_OR {
NODE node;
struct RNode *nd_1st;
struct RNode *nd_2nd;
} rb_node_or_t;
typedef struct RNode_MASGN {
NODE node;
struct RNode *nd_head;
struct RNode *nd_value;
struct RNode *nd_args;
} rb_node_masgn_t;
typedef struct RNode_LASGN {
NODE node;
ID nd_vid;
struct RNode *nd_value;
} rb_node_lasgn_t;
typedef struct RNode_DASGN {
NODE node;
ID nd_vid;
struct RNode *nd_value;
} rb_node_dasgn_t;
typedef struct RNode_GASGN {
NODE node;
ID nd_vid;
struct RNode *nd_value;
} rb_node_gasgn_t;
typedef struct RNode_IASGN {
NODE node;
ID nd_vid;
struct RNode *nd_value;
} rb_node_iasgn_t;
typedef struct RNode_CDECL {
NODE node;
ID nd_vid;
struct RNode *nd_value;
struct RNode *nd_else;
enum rb_parser_shareability shareability;
} rb_node_cdecl_t;
typedef struct RNode_CVASGN {
NODE node;
ID nd_vid;
struct RNode *nd_value;
} rb_node_cvasgn_t;
typedef struct RNode_OP_ASGN1 {
NODE node;
struct RNode *nd_recv;
ID nd_mid;
struct RNode *nd_index;
struct RNode *nd_rvalue;
} rb_node_op_asgn1_t;
typedef struct RNode_OP_ASGN2 {
NODE node;
struct RNode *nd_recv;
struct RNode *nd_value;
ID nd_vid;
ID nd_mid;
bool nd_aid;
} rb_node_op_asgn2_t;
typedef struct RNode_OP_ASGN_AND {
NODE node;
struct RNode *nd_head;
struct RNode *nd_value;
} rb_node_op_asgn_and_t;
typedef struct RNode_OP_ASGN_OR {
NODE node;
struct RNode *nd_head;
struct RNode *nd_value;
} rb_node_op_asgn_or_t;
typedef struct RNode_OP_CDECL {
NODE node;
struct RNode *nd_head;
struct RNode *nd_value;
ID nd_aid;
enum rb_parser_shareability shareability;
} rb_node_op_cdecl_t;
typedef struct RNode_CALL {
NODE node;
struct RNode *nd_recv;
ID nd_mid;
struct RNode *nd_args;
} rb_node_call_t;
typedef struct RNode_OPCALL {
NODE node;
struct RNode *nd_recv;
ID nd_mid;
struct RNode *nd_args;
} rb_node_opcall_t;
typedef struct RNode_FCALL {
NODE node;
ID nd_mid;
struct RNode *nd_args;
} rb_node_fcall_t;
typedef struct RNode_VCALL {
NODE node;
ID nd_mid;
} rb_node_vcall_t;
typedef struct RNode_QCALL {
NODE node;
struct RNode *nd_recv;
ID nd_mid;
struct RNode *nd_args;
} rb_node_qcall_t;
typedef struct RNode_SUPER {
NODE node;
struct RNode *nd_args;
} rb_node_super_t;
typedef struct RNode_ZSUPER {
NODE node;
} rb_node_zsuper_t;
/*
Structure of LIST:
LIST +--> LIST
* head --> element | * head
* alen (length of list) | * nd_end (point to the last LIST)
* next -----------------+ * next
RNode_LIST and RNode_VALUES should be same structure
*/
typedef struct RNode_LIST {
NODE node;
struct RNode *nd_head; /* element */
union {
long nd_alen;
struct RNode *nd_end; /* Second list node has this structure */
} as;
struct RNode *nd_next; /* next list node */
} rb_node_list_t;
typedef struct RNode_ZLIST {
NODE node;
} rb_node_zlist_t;
typedef struct RNode_VALUES {
NODE node;
struct RNode *nd_head;
long nd_alen;
struct RNode *nd_next;
} rb_node_values_t;
typedef struct RNode_HASH {
NODE node;
struct RNode *nd_head;
long nd_brace;
} rb_node_hash_t;
typedef struct RNode_RETURN {
NODE node;
struct RNode *nd_stts;
} rb_node_return_t;
typedef struct RNode_YIELD {
NODE node;
struct RNode *nd_head;
} rb_node_yield_t;
typedef struct RNode_LVAR {
NODE node;
ID nd_vid;
} rb_node_lvar_t;
typedef struct RNode_DVAR {
NODE node;
ID nd_vid;
} rb_node_dvar_t;
typedef struct RNode_GVAR {
NODE node;
ID nd_vid;
} rb_node_gvar_t;
typedef struct RNode_IVAR {
NODE node;
ID nd_vid;
} rb_node_ivar_t;
typedef struct RNode_CONST {
NODE node;
ID nd_vid;
} rb_node_const_t;
typedef struct RNode_CVAR {
NODE node;
ID nd_vid;
} rb_node_cvar_t;
typedef struct RNode_NTH_REF {
NODE node;
long nd_nth;
} rb_node_nth_ref_t;
typedef struct RNode_BACK_REF {
NODE node;
long nd_nth;
} rb_node_back_ref_t;
/* RNode_MATCH and RNode_REGX should be same structure */
typedef struct RNode_MATCH {
NODE node;
struct rb_parser_string *string;
int options;
} rb_node_match_t;
typedef struct RNode_MATCH2 {
NODE node;
struct RNode *nd_recv;
struct RNode *nd_value;
struct RNode *nd_args;
} rb_node_match2_t;
typedef struct RNode_MATCH3 {
NODE node;
struct RNode *nd_recv;
struct RNode *nd_value;
} rb_node_match3_t;
typedef struct RNode_INTEGER {
NODE node;
char *val;
int minus;
int base;
} rb_node_integer_t;
typedef struct RNode_FLOAT {
NODE node;
char *val;
int minus;
} rb_node_float_t;
typedef struct RNode_RATIONAL {
NODE node;
char *val;
int minus;
int base;
int seen_point;
} rb_node_rational_t;
enum rb_numeric_type {
integer_literal,
float_literal,
rational_literal
};
typedef struct RNode_IMAGINARY {
NODE node;
char *val;
int minus;
int base;
int seen_point;
enum rb_numeric_type type;
} rb_node_imaginary_t;
/* RNode_STR and RNode_XSTR should be same structure */
typedef struct RNode_STR {
NODE node;
struct rb_parser_string *string;
} rb_node_str_t;
/* RNode_DSTR, RNode_DXSTR, RNode_DREGX and RNode_DSYM should be same structure */
typedef struct RNode_DSTR {
NODE node;
struct rb_parser_string *string;
union {
long nd_alen;
long nd_cflag;
struct RNode *nd_end; /* Second dstr node has this structure. See also RNode_LIST */
} as;
struct RNode_LIST *nd_next;
} rb_node_dstr_t;
typedef rb_node_str_t rb_node_xstr_t;
typedef rb_node_dstr_t rb_node_dxstr_t;
typedef struct RNode_EVSTR {
NODE node;
struct RNode *nd_body;
} rb_node_evstr_t;
typedef struct RNode_REGX {
NODE node;
struct rb_parser_string *string;
int options;
} rb_node_regx_t;
typedef rb_node_dstr_t rb_node_dregx_t;
typedef struct RNode_ONCE {
NODE node;
struct RNode *nd_body;
} rb_node_once_t;
struct rb_args_info {
NODE *pre_init;
NODE *post_init;
int pre_args_num; /* count of mandatory pre-arguments */
int post_args_num; /* count of mandatory post-arguments */
ID first_post_arg;
ID rest_arg;
ID block_arg;
struct RNode_KW_ARG *kw_args;
NODE *kw_rest_arg;
struct RNode_OPT_ARG *opt_args;
unsigned int no_kwarg: 1;
unsigned int ruby2_keywords: 1;
unsigned int forwarding: 1;
};
typedef struct RNode_ARGS {
NODE node;
struct rb_args_info nd_ainfo;
} rb_node_args_t;
typedef struct RNode_ARGS_AUX {
NODE node;
ID nd_pid;
int nd_plen;
struct RNode *nd_next;
} rb_node_args_aux_t;
typedef struct RNode_OPT_ARG {
NODE node;
struct RNode *nd_body;
struct RNode_OPT_ARG *nd_next;
} rb_node_opt_arg_t;
typedef struct RNode_KW_ARG {
NODE node;
struct RNode *nd_body;
struct RNode_KW_ARG *nd_next;
} rb_node_kw_arg_t;
typedef struct RNode_POSTARG {
NODE node;
struct RNode *nd_1st;
struct RNode *nd_2nd;
} rb_node_postarg_t;
typedef struct RNode_ARGSCAT {
NODE node;
struct RNode *nd_head;
struct RNode *nd_body;
} rb_node_argscat_t;
typedef struct RNode_ARGSPUSH {
NODE node;
struct RNode *nd_head;
struct RNode *nd_body;
} rb_node_argspush_t;
typedef struct RNode_SPLAT {
NODE node;
struct RNode *nd_head;
} rb_node_splat_t;
typedef struct RNode_BLOCK_PASS {
NODE node;
struct RNode *nd_head;
struct RNode *nd_body;
unsigned int forwarding: 1;
} rb_node_block_pass_t;
typedef struct RNode_DEFN {
NODE node;
ID nd_mid;
struct RNode *nd_defn;
} rb_node_defn_t;
typedef struct RNode_DEFS {
NODE node;
struct RNode *nd_recv;
ID nd_mid;
struct RNode *nd_defn;
} rb_node_defs_t;
typedef struct RNode_ALIAS {
NODE node;
struct RNode *nd_1st;
struct RNode *nd_2nd;
} rb_node_alias_t;
typedef struct RNode_VALIAS {
NODE node;
ID nd_alias;
ID nd_orig;
} rb_node_valias_t;
typedef struct RNode_UNDEF {
NODE node;
struct RNode *nd_undef;
} rb_node_undef_t;
typedef struct RNode_CLASS {
NODE node;
struct RNode *nd_cpath;
struct RNode *nd_body;
struct RNode *nd_super;
} rb_node_class_t;
typedef struct RNode_MODULE {
NODE node;
struct RNode *nd_cpath;
struct RNode *nd_body;
} rb_node_module_t;
typedef struct RNode_SCLASS {
NODE node;
struct RNode *nd_recv;
struct RNode *nd_body;
} rb_node_sclass_t;
typedef struct RNode_COLON2 {
NODE node;
struct RNode *nd_head;
ID nd_mid;
} rb_node_colon2_t;
typedef struct RNode_COLON3 {
NODE node;
ID nd_mid;
} rb_node_colon3_t;
/* RNode_DOT2, RNode_DOT3, RNode_FLIP2 and RNode_FLIP3 should be same structure */
typedef struct RNode_DOT2 {
NODE node;
struct RNode *nd_beg;
struct RNode *nd_end;
} rb_node_dot2_t;
typedef struct RNode_DOT3 {
NODE node;
struct RNode *nd_beg;
struct RNode *nd_end;
} rb_node_dot3_t;
typedef rb_node_dot2_t rb_node_flip2_t;
typedef rb_node_dot3_t rb_node_flip3_t;
typedef struct RNode_SELF {
NODE node;
long nd_state; /* Default 1. See NEW_SELF. */
} rb_node_self_t;
typedef struct RNode_NIL {
NODE node;
} rb_node_nil_t;
typedef struct RNode_TRUE {
NODE node;
} rb_node_true_t;
typedef struct RNode_FALSE {
NODE node;
} rb_node_false_t;
typedef struct RNode_ERRINFO {
NODE node;
} rb_node_errinfo_t;
typedef struct RNode_DEFINED {
NODE node;
struct RNode *nd_head;
} rb_node_defined_t;
typedef struct RNode_POSTEXE {
NODE node;
struct RNode *nd_body;
} rb_node_postexe_t;
typedef struct RNode_SYM {
NODE node;
struct rb_parser_string *string;
} rb_node_sym_t;
typedef rb_node_dstr_t rb_node_dsym_t;
typedef struct RNode_ATTRASGN {
NODE node;
struct RNode *nd_recv;
ID nd_mid;
struct RNode *nd_args;
} rb_node_attrasgn_t;
typedef struct RNode_LAMBDA {
NODE node;
struct RNode *nd_body;
} rb_node_lambda_t;
typedef struct RNode_ARYPTN {