home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / msm-1 / rtt.sit / rttsym.c < prev   
MacBinary  |  1992-09-19  |  20.4 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: rttsym.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Fri Sep 18 22:12:35 1992, modified Fri Sep 18 22:12:35 1992, creator 'MPS ', type ASCII, 20203 bytes "rttsym.c" , at 0x4f6b 428 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 72 74 74 73 79 6d | 2e 63 00 00 00 00 00 00 |..rttsym|.c......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 4e eb 00 | 00 01 ac a6 e0 3d 13 a6 |.....N..|.....=..|
|00000060| e0 3d 13 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.=......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 88 de 00 00 |........|........|
|00000080| 2f 2a 0d 20 2a 20 72 74 | 74 73 79 6d 2e 63 20 63 |/*. * rt|tsym.c c|
|00000090| 6f 6e 74 61 69 6e 73 20 | 73 79 6d 62 6f 6c 20 74 |ontains |symbol t|
|000000a0| 61 62 6c 65 20 72 6f 75 | 74 69 6e 65 73 2e 0d 20 |able rou|tines.. |
|000000b0| 2a 2f 0d 23 69 6e 63 6c | 75 64 65 20 22 72 74 74 |*/.#incl|ude "rtt|
|000000c0| 2e 68 22 0d 0d 23 64 65 | 66 69 6e 65 20 48 61 73 |.h"..#de|fine Has|
|000000d0| 68 53 69 7a 65 20 31 34 | 39 0d 0d 2f 2a 0d 20 2a |hSize 14|9../*. *|
|000000e0| 20 50 72 6f 74 6f 74 79 | 70 65 20 66 6f 72 20 73 | Prototy|pe for s|
|000000f0| 74 61 74 69 63 20 66 75 | 6e 63 74 69 6f 6e 2e 0d |tatic fu|nction..|
|00000100| 20 2a 2f 0d 68 69 64 64 | 65 6e 20 6e 6f 76 61 6c | */.hidd|en noval|
|00000110| 75 65 20 61 64 64 5f 64 | 65 66 20 20 20 20 50 61 |ue add_d|ef Pa|
|00000120| 72 61 6d 73 28 28 73 74 | 72 75 63 74 20 6e 6f 64 |rams((st|ruct nod|
|00000130| 65 20 2a 64 63 6c 74 6f | 72 29 29 3b 0d 68 69 64 |e *dclto|r));.hid|
|00000140| 64 65 6e 20 6e 6f 76 61 | 6c 75 65 20 61 64 64 5f |den nova|lue add_|
|00000150| 73 5f 70 72 6d 20 20 50 | 61 72 61 6d 73 28 28 73 |s_prm P|arams((s|
|00000160| 74 72 75 63 74 20 74 6f | 6b 65 6e 20 2a 69 64 65 |truct to|ken *ide|
|00000170| 6e 74 2c 20 69 6e 74 20 | 70 61 72 61 6d 5f 6e 75 |nt, int |param_nu|
|00000180| 6d 2c 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |m,. | |
|00000190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 69 | | i|
|000001a0| 6e 74 20 66 6c 61 67 73 | 29 29 3b 0d 68 69 64 64 |nt flags|));.hidd|
|000001b0| 65 6e 20 6e 6f 76 61 6c | 75 65 20 64 63 6c 5f 74 |en noval|ue dcl_t|
|000001c0| 79 70 20 20 20 20 50 61 | 72 61 6d 73 28 28 73 74 |yp Pa|rams((st|
|000001d0| 72 75 63 74 20 6e 6f 64 | 65 20 2a 64 63 6c 29 29 |ruct nod|e *dcl))|
|000001e0| 3b 0d 68 69 64 64 65 6e | 20 6e 6f 76 61 6c 75 65 |;.hidden| novalue|
|000001f0| 20 64 63 6c 74 6f 72 5f | 74 79 70 20 50 61 72 61 | dcltor_|typ Para|
|00000200| 6d 73 28 28 73 74 72 75 | 63 74 20 6e 6f 64 65 20 |ms((stru|ct node |
|00000210| 2a 64 63 6c 74 6f 72 2c | 20 73 74 72 75 63 74 20 |*dcltor,| struct |
|00000220| 6e 6f 64 65 20 2a 74 71 | 75 61 6c 29 29 3b 0d 0d |node *tq|ual));..|
|00000230| 77 6f 72 64 20 6c 62 6c | 5f 6e 75 6d 20 3d 20 30 |word lbl|_num = 0|
|00000240| 3b 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |; | |
|00000250| 20 20 20 20 2f 2a 20 6e | 65 78 74 20 75 6e 75 73 | /* n|ext unus|
|00000260| 65 64 20 6c 61 62 65 6c | 20 6e 75 6d 62 65 72 20 |ed label| number |
|00000270| 2a 2f 0d 73 74 72 75 63 | 74 20 6c 76 6c 5f 65 6e |*/.struc|t lvl_en|
|00000280| 74 72 79 20 2a 64 63 6c | 5f 73 74 6b 3b 20 20 20 |try *dcl|_stk; |
|00000290| 20 20 20 20 20 20 20 2f | 2a 20 73 74 61 63 6b 20 | /|* stack |
|000002a0| 6f 66 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 20 63 |of decla|ration c|
|000002b0| 6f 6e 74 65 78 74 73 20 | 2a 2f 0d 0d 63 68 61 72 |ontexts |*/..char|
|000002c0| 20 2a 73 74 72 5f 72 73 | 6c 74 3b 20 20 20 20 20 | *str_rs|lt; |
|000002d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000002e0| 2f 2a 20 73 74 72 69 6e | 67 20 22 72 65 73 75 6c |/* strin|g "resul|
|000002f0| 74 22 20 69 6e 20 73 74 | 72 69 6e 67 20 74 61 62 |t" in st|ring tab|
|00000300| 6c 65 20 2a 2f 0d 73 74 | 72 75 63 74 20 69 6e 69 |le */.st|ruct ini|
|00000310| 74 5f 74 65 6e 64 20 2a | 74 65 6e 64 5f 6c 73 74 |t_tend *|tend_lst|
|00000320| 20 3d 20 4e 55 4c 4c 3b | 20 20 2f 2a 20 6c 69 73 | = NULL;| /* lis|
|00000330| 74 20 6f 66 20 74 65 6e | 64 65 64 20 64 65 73 63 |t of ten|ded desc|
|00000340| 72 69 70 74 6f 72 73 20 | 2a 2f 0d 73 74 72 75 63 |riptors |*/.struc|
|00000350| 74 20 73 79 6d 5f 65 6e | 74 72 79 20 2a 64 65 63 |t sym_en|try *dec|
|00000360| 6c 5f 6c 73 74 20 3d 20 | 4e 55 4c 4c 3b 20 20 2f |l_lst = |NULL; /|
|00000370| 2a 20 64 65 63 6c 61 72 | 61 74 69 6f 6e 73 20 66 |* declar|ations f|
|00000380| 72 6f 6d 20 22 64 65 63 | 6c 61 72 65 20 7b 2e 2e |rom "dec|lare {..|
|00000390| 2e 7d 22 20 2a 2f 0d 73 | 74 72 75 63 74 20 73 79 |.}" */.s|truct sy|
|000003a0| 6d 5f 65 6e 74 72 79 20 | 2a 76 5f 6c 65 6e 20 3d |m_entry |*v_len =|
|000003b0| 20 4e 55 4c 4c 3b 20 20 | 20 20 20 2f 2a 20 65 6e | NULL; | /* en|
|000003c0| 74 72 79 20 66 6f 72 20 | 6c 65 6e 67 74 68 20 6f |try for |length o|
|000003d0| 66 20 76 61 72 61 72 67 | 73 20 2a 2f 0d 69 6e 74 |f vararg|s */.int|
|000003e0| 20 69 6c 5f 69 6e 64 78 | 20 3d 20 30 3b 20 20 20 | il_indx| = 0; |
|000003f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000400| 20 2f 2a 20 64 61 74 61 | 20 62 61 73 65 20 73 79 | /* data| base sy|
|00000410| 6d 62 6f 6c 20 74 61 62 | 6c 65 20 69 6e 64 65 78 |mbol tab|le index|
|00000420| 20 2a 2f 0d 0d 73 74 61 | 74 69 63 20 73 74 72 75 | */..sta|tic stru|
|00000430| 63 74 20 73 79 6d 5f 65 | 6e 74 72 79 20 2a 73 79 |ct sym_e|ntry *sy|
|00000440| 6d 5f 74 62 6c 5b 48 61 | 73 68 53 69 7a 65 5d 3b |m_tbl[Ha|shSize];|
|00000450| 20 2f 2a 20 73 79 6d 62 | 6f 6c 20 74 61 62 6c 65 | /* symb|ol table|
|00000460| 20 2a 2f 0d 0d 2f 2a 0d | 20 2a 20 54 68 65 20 66 | */../*.| * The f|
|00000470| 6f 6c 6c 6f 77 69 6e 67 | 20 73 74 72 69 6e 67 73 |ollowing| strings|
|00000480| 20 61 72 65 20 70 75 74 | 20 69 6e 20 74 68 65 20 | are put| in the |
|00000490| 73 74 72 69 6e 67 20 74 | 61 62 6c 65 20 61 6e 64 |string t|able and|
|000004a0| 20 75 73 65 64 20 66 6f | 72 0d 20 2a 20 20 72 65 | used fo|r. * re|
|000004b0| 63 6f 67 6e 69 7a 69 6e | 67 20 76 61 6c 69 64 20 |cognizin|g valid |
|000004c0| 74 65 6e 64 65 64 20 64 | 65 63 6c 61 72 61 74 69 |tended d|eclarati|
|000004d0| 6f 6e 73 2e 0d 20 2a 2f | 0d 73 74 61 74 69 63 20 |ons.. */|.static |
|000004e0| 63 68 61 72 20 2a 62 6c | 6f 63 6b 20 3d 20 22 62 |char *bl|ock = "b|
|000004f0| 6c 6f 63 6b 22 3b 0d 73 | 74 61 74 69 63 20 63 68 |lock";.s|tatic ch|
|00000500| 61 72 20 2a 64 65 73 63 | 72 69 70 20 3d 20 22 64 |ar *desc|rip = "d|
|00000510| 65 73 63 72 69 70 22 3b | 0d 0d 2f 2a 0d 20 2a 20 |escrip";|../*. * |
|00000520| 69 6e 69 74 5f 73 79 6d | 20 2d 20 69 6e 69 74 69 |init_sym| - initi|
|00000530| 61 6c 69 7a 65 20 20 73 | 79 6d 62 6f 6c 20 74 61 |alize s|ymbol ta|
|00000540| 62 6c 65 2e 0d 20 2a 2f | 0d 6e 6f 76 61 6c 75 65 |ble.. */|.novalue|
|00000550| 20 69 6e 69 74 5f 73 79 | 6d 28 29 0d 20 20 20 7b | init_sy|m(). {|
|00000560| 0d 20 20 20 73 74 61 74 | 69 63 20 69 6e 74 20 66 |. stat|ic int f|
|00000570| 69 72 73 74 5f 74 69 6d | 65 20 3d 20 31 3b 0d 20 |irst_tim|e = 1;. |
|00000580| 20 20 69 6e 74 20 68 61 | 73 68 5f 76 61 6c 3b 0d | int ha|sh_val;.|
|00000590| 20 20 20 72 65 67 69 73 | 74 65 72 20 73 74 72 75 | regis|ter stru|
|000005a0| 63 74 20 73 79 6d 5f 65 | 6e 74 72 79 20 2a 73 79 |ct sym_e|ntry *sy|
|000005b0| 6d 3b 0d 20 20 20 69 6e | 74 20 69 3b 0d 0d 20 20 |m;. in|t i;.. |
|000005c0| 20 2f 2a 0d 20 20 20 20 | 2a 20 49 6e 69 74 69 61 | /*. |* Initia|
|000005d0| 6c 69 7a 65 20 74 68 65 | 20 73 79 6d 62 6f 6c 20 |lize the| symbol |
|000005e0| 74 61 62 6c 65 20 61 6e | 64 20 64 65 63 6c 61 72 |table an|d declar|
|000005f0| 61 74 69 6f 6e 20 73 74 | 61 63 6b 2e 20 57 68 65 |ation st|ack. Whe|
|00000600| 6e 20 63 61 6c 6c 65 64 | 20 66 6f 72 0d 20 20 20 |n called| for. |
|00000610| 20 2a 20 20 74 68 65 20 | 66 69 72 73 74 20 74 69 | * the |first ti|
|00000620| 6d 65 2c 20 70 75 74 20 | 73 74 72 69 6e 67 73 20 |me, put |strings |
|00000630| 69 6e 20 73 74 72 69 6e | 67 20 74 61 62 6c 65 2e |in strin|g table.|
|00000640| 0d 20 20 20 20 2a 2f 0d | 20 20 20 69 66 20 28 66 |. */.| if (f|
|00000650| 69 72 73 74 5f 74 69 6d | 65 29 20 7b 0d 20 20 20 |irst_tim|e) {. |
|00000660| 20 20 20 66 69 72 73 74 | 5f 74 69 6d 65 20 3d 20 | first|_time = |
|00000670| 30 3b 0d 20 20 20 20 20 | 20 66 6f 72 20 28 69 20 |0;. | for (i |
|00000680| 3d 20 30 3b 20 69 20 3c | 20 48 61 73 68 53 69 7a |= 0; i <| HashSiz|
|00000690| 65 3b 20 2b 2b 69 29 0d | 20 20 20 20 20 20 20 20 |e; ++i).| |
|000006a0| 20 73 79 6d 5f 74 62 6c | 5b 69 5d 20 3d 20 4e 55 | sym_tbl|[i] = NU|
|000006b0| 4c 4c 3b 0d 20 20 20 20 | 20 20 64 63 6c 5f 73 74 |LL;. | dcl_st|
|000006c0| 6b 20 3d 20 4e 65 77 53 | 74 72 75 63 74 28 6c 76 |k = NewS|truct(lv|
|000006d0| 6c 5f 65 6e 74 72 79 29 | 3b 0d 20 20 20 20 20 20 |l_entry)|;. |
|000006e0| 64 63 6c 5f 73 74 6b 2d | 3e 6e 65 73 74 5f 6c 76 |dcl_stk-|>nest_lv|
|000006f0| 6c 20 3d 20 31 3b 0d 20 | 20 20 20 20 20 64 63 6c |l = 1;. | dcl|
|00000700| 5f 73 74 6b 2d 3e 6e 65 | 78 74 20 3d 20 4e 55 4c |_stk->ne|xt = NUL|
|00000710| 4c 3b 0d 20 20 20 20 20 | 20 62 6c 6f 63 6b 20 3d |L;. | block =|
|00000720| 20 73 70 65 63 5f 73 74 | 72 28 62 6c 6f 63 6b 29 | spec_st|r(block)|
|00000730| 3b 0d 20 20 20 20 20 20 | 64 65 73 63 72 69 70 20 |;. |descrip |
|00000740| 3d 20 73 70 65 63 5f 73 | 74 72 28 64 65 73 63 72 |= spec_s|tr(descr|
|00000750| 69 70 29 3b 0d 20 20 20 | 20 20 20 7d 0d 20 20 20 |ip);. | }. |
|00000760| 65 6c 73 65 20 7b 0d 20 | 20 20 20 20 20 66 6f 72 |else {. | for|
|00000770| 20 28 68 61 73 68 5f 76 | 61 6c 20 3d 20 30 3b 20 | (hash_v|al = 0; |
|00000780| 68 61 73 68 5f 76 61 6c | 20 3c 20 48 61 73 68 53 |hash_val| < HashS|
|00000790| 69 7a 65 3b 20 2b 2b 20 | 68 61 73 68 5f 76 61 6c |ize; ++ |hash_val|
|000007a0| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 20 66 6f 72 |) {. | for|
|000007b0| 20 28 73 79 6d 20 3d 20 | 73 79 6d 5f 74 62 6c 5b | (sym = |sym_tbl[|
|000007c0| 68 61 73 68 5f 76 61 6c | 5d 3b 20 73 79 6d 20 21 |hash_val|]; sym !|
|000007d0| 3d 20 4e 55 4c 4c 20 26 | 26 0d 20 20 20 20 20 20 |= NULL &|&. |
|000007e0| 20 20 20 20 20 73 79 6d | 2d 3e 6e 65 73 74 5f 6c | sym|->nest_l|
|000007f0| 76 6c 20 3e 20 30 3b 20 | 73 79 6d 20 3d 20 73 79 |vl > 0; |sym = sy|
|00000800| 6d 5f 74 62 6c 5b 68 61 | 73 68 5f 76 61 6c 5d 29 |m_tbl[ha|sh_val])|
|00000810| 20 7b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 73 | {. | s|
|00000820| 79 6d 5f 74 62 6c 5b 68 | 61 73 68 5f 76 61 6c 5d |ym_tbl[h|ash_val]|
|00000830| 20 3d 20 73 79 6d 2d 3e | 6e 65 78 74 3b 0d 20 20 | = sym->|next;. |
|00000840| 20 20 20 20 20 20 20 20 | 20 20 66 72 65 65 28 28 | | free((|
|00000850| 63 68 61 72 20 2a 29 73 | 79 6d 29 3b 0d 20 20 20 |char *)s|ym);. |
|00000860| 20 20 20 20 20 20 20 20 | 20 7d 0d 20 20 20 20 20 | | }. |
|00000870| 20 20 20 20 7d 0d 20 20 | 20 20 20 20 7d 0d 20 20 | }. | }. |
|00000880| 20 64 63 6c 5f 73 74 6b | 2d 3e 6b 69 6e 64 5f 64 | dcl_stk|->kind_d|
|00000890| 63 6c 20 3d 20 4f 74 68 | 65 72 44 63 6c 3b 0d 20 |cl = Oth|erDcl;. |
|000008a0| 20 20 64 63 6c 5f 73 74 | 6b 2d 3e 70 61 72 6d 73 | dcl_st|k->parms|
|000008b0| 5f 64 6f 6e 65 20 3d 20 | 30 3b 0d 20 20 20 7d 0d |_done = |0;. }.|
|000008c0| 0d 2f 2a 0d 20 2a 20 73 | 79 6d 5f 6c 6b 75 70 20 |./*. * s|ym_lkup |
|000008d0| 2d 20 6c 6f 6f 6b 20 75 | 70 20 61 20 73 74 72 69 |- look u|p a stri|
|000008e0| 6e 67 20 69 6e 20 74 68 | 65 20 73 79 6d 62 6f 6c |ng in th|e symbol|
|000008f0| 20 74 61 62 6c 65 2e 20 | 52 65 74 75 72 6e 20 4e | table. |Return N|
|00000900| 55 4c 4c 20 49 66 20 69 | 74 20 69 73 20 6e 6f 74 |ULL If i|t is not|
|00000910| 0d 20 2a 20 20 74 68 65 | 72 65 2e 0d 20 2a 2f 0d |. * the|re.. */.|
|00000920| 73 74 72 75 63 74 20 73 | 79 6d 5f 65 6e 74 72 79 |struct s|ym_entry|
|00000930| 20 2a 73 79 6d 5f 6c 6b | 75 70 28 69 6d 61 67 65 | *sym_lk|up(image|
|00000940| 29 0d 63 68 61 72 20 2a | 69 6d 61 67 65 3b 0d 20 |).char *|image;. |
|00000950| 20 20 7b 0d 20 20 20 72 | 65 67 69 73 74 65 72 20 | {. r|egister |
|00000960| 73 74 72 75 63 74 20 73 | 79 6d 5f 65 6e 74 72 79 |struct s|ym_entry|
|00000970| 20 2a 73 79 6d 3b 0d 0d | 20 20 20 66 6f 72 20 28 | *sym;..| for (|
|00000980| 73 79 6d 20 3d 20 73 79 | 6d 5f 74 62 6c 5b 28 75 |sym = sy|m_tbl[(u|
|00000990| 6e 73 69 67 6e 65 64 20 | 69 6e 74 29 69 6d 61 67 |nsigned |int)imag|
|000009a0| 65 20 25 20 48 61 73 68 | 53 69 7a 65 5d 3b 20 73 |e % Hash|Size]; s|
|000009b0| 79 6d 20 21 3d 20 4e 55 | 4c 4c 3b 0d 20 20 20 20 |ym != NU|LL;. |
|000009c0| 20 20 20 20 73 79 6d 20 | 3d 20 73 79 6d 2d 3e 6e | sym |= sym->n|
|000009d0| 65 78 74 29 0d 20 20 20 | 20 20 20 69 66 20 28 73 |ext). | if (s|
|000009e0| 79 6d 2d 3e 69 6d 61 67 | 65 20 3d 3d 20 69 6d 61 |ym->imag|e == ima|
|000009f0| 67 65 29 0d 20 20 20 20 | 20 20 20 20 20 72 65 74 |ge). | ret|
|00000a00| 75 72 6e 20 73 79 6d 3b | 0d 20 20 20 72 65 74 75 |urn sym;|. retu|
|00000a10| 72 6e 20 4e 55 4c 4c 3b | 0d 20 20 20 7d 0d 0d 2f |rn NULL;|. }../|
|00000a20| 2a 0d 20 2a 20 73 79 6d | 5f 61 64 64 20 2d 20 61 |*. * sym|_add - a|
|00000a30| 64 64 20 61 20 73 79 6d | 62 6f 6c 20 74 6f 20 74 |dd a sym|bol to t|
|00000a40| 68 65 20 73 79 6d 62 6f | 6c 20 74 61 62 6c 65 2e |he symbo|l table.|
|00000a50| 20 46 6f 72 20 73 6f 6d | 65 20 74 79 70 65 73 20 | For som|e types |
|00000a60| 6f 66 20 65 6e 74 72 69 | 65 73 0d 20 2a 20 20 69 |of entri|es. * i|
|00000a70| 74 20 69 73 20 69 6c 6c | 65 67 61 6c 20 74 6f 20 |t is ill|egal to |
|00000a80| 72 65 64 65 66 69 6e 65 | 20 74 68 65 6d 2e 20 49 |redefine| them. I|
|00000a90| 6e 20 74 68 61 74 20 63 | 61 73 65 2c 20 4e 55 4c |n that c|ase, NUL|
|00000aa0| 4c 20 69 73 20 72 65 74 | 75 72 6e 65 64 20 6f 74 |L is ret|urned ot|
|00000ab0| 68 65 72 77 69 73 65 0d | 20 2a 20 20 74 68 65 20 |herwise.| * the |
|00000ac0| 65 6e 74 72 79 20 69 73 | 20 72 65 74 75 72 6e 65 |entry is| returne|
|00000ad0| 64 2e 0d 20 2a 2f 0d 73 | 74 72 75 63 74 20 73 79 |d.. */.s|truct sy|
|00000ae0| 6d 5f 65 6e 74 72 79 20 | 2a 73 79 6d 5f 61 64 64 |m_entry |*sym_add|
|00000af0| 28 74 6f 6b 5f 69 64 2c | 20 69 6d 61 67 65 2c 20 |(tok_id,| image, |
|00000b00| 69 64 5f 74 79 70 65 2c | 20 6e 65 73 74 5f 6c 76 |id_type,| nest_lv|
|00000b10| 6c 29 0d 69 6e 74 20 74 | 6f 6b 5f 69 64 3b 0d 63 |l).int t|ok_id;.c|
|00000b20| 68 61 72 20 2a 69 6d 61 | 67 65 3b 0d 69 6e 74 20 |har *ima|ge;.int |
|00000b30| 69 64 5f 74 79 70 65 3b | 0d 69 6e 74 20 6e 65 73 |id_type;|.int nes|
|00000b40| 74 5f 6c 76 6c 3b 0d 20 | 20 20 7b 0d 20 20 20 72 |t_lvl;. | {. r|
|00000b50| 65 67 69 73 74 65 72 20 | 73 74 72 75 63 74 20 73 |egister |struct s|
|00000b60| 79 6d 5f 65 6e 74 72 79 | 20 2a 2a 73 79 6d 70 3b |ym_entry| **symp;|
|00000b70| 0d 20 20 20 72 65 67 69 | 73 74 65 72 20 73 74 72 |. regi|ster str|
|00000b80| 75 63 74 20 73 79 6d 5f | 65 6e 74 72 79 20 2a 73 |uct sym_|entry *s|
|00000b90| 79 6d 3b 0d 0d 20 20 20 | 73 79 6d 70 20 3d 20 26 |ym;.. |symp = &|
|00000ba0| 73 79 6d 5f 74 62 6c 5b | 28 75 6e 73 69 67 6e 65 |sym_tbl[|(unsigne|
|00000bb0| 64 20 69 6e 74 29 69 6d | 61 67 65 20 25 20 48 61 |d int)im|age % Ha|
|00000bc0| 73 68 53 69 7a 65 5d 3b | 0d 20 20 20 77 68 69 6c |shSize];|. whil|
|00000bd0| 65 20 28 2a 73 79 6d 70 | 20 21 3d 20 4e 55 4c 4c |e (*symp| != NULL|
|00000be0| 20 26 26 20 28 2a 73 79 | 6d 70 29 2d 3e 6e 65 73 | && (*sy|mp)->nes|
|00000bf0| 74 5f 6c 76 6c 20 3e 20 | 6e 65 73 74 5f 6c 76 6c |t_lvl > |nest_lvl|
|00000c00| 29 0d 20 20 20 20 20 20 | 73 79 6d 70 20 3d 20 26 |). |symp = &|
|00000c10| 28 28 2a 73 79 6d 70 29 | 2d 3e 6e 65 78 74 29 3b |((*symp)|->next);|
|00000c20| 0d 20 20 20 77 68 69 6c | 65 20 28 2a 73 79 6d 70 |. whil|e (*symp|
|00000c30| 20 21 3d 20 4e 55 4c 4c | 20 26 26 20 28 2a 73 79 | != NULL| && (*sy|
|00000c40| 6d 70 29 2d 3e 6e 65 73 | 74 5f 6c 76 6c 20 3d 3d |mp)->nes|t_lvl ==|
|00000c50| 20 6e 65 73 74 5f 6c 76 | 6c 29 20 7b 0d 20 20 20 | nest_lv|l) {. |
|00000c60| 20 20 20 69 66 20 28 28 | 2a 73 79 6d 70 29 2d 3e | if ((|*symp)->|
|00000c70| 69 6d 61 67 65 20 3d 3d | 20 69 6d 61 67 65 29 20 |image ==| image) |
|00000c80| 7b 0d 20 20 20 20 20 20 | 20 20 20 2f 2a 0d 20 20 |{. | /*. |
|00000c90| 20 20 20 20 20 20 20 20 | 2a 20 52 65 64 65 63 6c | |* Redecl|
|00000ca0| 61 72 61 74 69 6f 6e 3a | 0d 20 20 20 20 20 20 20 |aration:|. |
|00000cb0| 20 20 20 2a 0d 20 20 20 | 20 20 20 20 20 20 20 2a | *. | *|
|00000cc0| 20 41 6e 20 65 78 70 6c | 69 63 69 74 20 74 79 70 | An expl|icit typ|
|00000cd0| 65 64 65 66 20 6d 61 79 | 20 62 65 20 67 69 76 65 |edef may| be give|
|00000ce0| 6e 20 66 6f 72 20 61 20 | 62 75 69 6c 74 2d 69 6e |n for a |built-in|
|00000cf0| 20 74 79 70 65 64 65 66 | 0d 20 20 20 20 20 20 20 | typedef|. |
|00000d00| 20 20 20 2a 20 6e 61 6d | 65 2e 20 41 20 6c 61 62 | * nam|e. A lab|
|00000d10| 65 6c 20 61 70 70 65 61 | 72 73 20 69 6e 20 6d 75 |el appea|rs in mu|
|00000d20| 6c 74 69 70 6c 79 20 67 | 6f 74 6f 73 20 61 6e 64 |ltiply g|otos and|
|00000d30| 20 61 73 20 61 20 6c 61 | 62 65 6c 0d 20 20 20 20 | as a la|bel. |
|00000d40| 20 20 20 20 20 20 2a 20 | 6f 6e 20 61 20 73 74 61 | * |on a sta|
|00000d50| 74 65 6d 65 6e 74 2e 20 | 41 73 73 75 6d 65 20 61 |tement. |Assume a|
|00000d60| 20 67 6c 6f 62 61 6c 20 | 72 65 64 65 63 6c 61 72 | global |redeclar|
|00000d70| 61 74 69 6f 6e 20 69 73 | 20 66 6f 72 20 61 6e 0d |ation is| for an.|
|00000d80| 20 20 20 20 20 20 20 20 | 20 20 2a 20 65 78 74 65 | | * exte|
|00000d90| 72 6e 2e 20 52 65 74 75 | 72 6e 20 74 68 65 20 65 |rn. Retu|rn the e|
|00000da0| 6e 74 72 79 20 66 6f 72 | 20 74 68 65 73 65 20 73 |ntry for| these s|
|00000db0| 69 74 75 61 74 69 6f 6e | 73 20 62 75 74 20 64 6f |ituation|s but do|
|00000dc0| 6e 27 74 0d 20 20 20 20 | 20 20 20 20 20 20 2a 20 |n't. | * |
|00000dd0| 74 72 79 20 74 6f 6f 20 | 68 61 72 64 20 74 6f 20 |try too |hard to |
|00000de0| 64 65 74 65 63 74 20 65 | 72 72 6f 72 73 2e 20 49 |detect e|rrors. I|
|00000df0| 66 20 61 63 74 75 61 6c | 20 65 72 72 6f 72 73 20 |f actual| errors |
|00000e00| 61 72 65 20 6e 6f 74 0d | 20 20 20 20 20 20 20 20 |are not.| |
|00000e10| 20 20 2a 20 63 61 75 67 | 68 74 20 68 65 72 65 2c | * caug|ht here,|
|00000e20| 20 74 68 65 20 43 20 63 | 6f 6d 70 69 6c 65 72 20 | the C c|ompiler |
|00000e30| 77 69 6c 6c 20 66 69 6e | 64 20 74 68 65 6d 2e 0d |will fin|d them..|
|00000e40| 20 20 20 20 20 20 20 20 | 20 20 2a 2f 0d 20 20 20 | | */. |
|00000e50| 20 20 20 20 20 20 69 66 | 20 28 74 6f 6b 5f 69 64 | if| (tok_id|
|00000e60| 20 3d 3d 20 54 79 70 65 | 44 65 66 4e 61 6d 65 20 | == Type|DefName |
|00000e70| 26 26 20 28 28 2a 73 79 | 6d 70 29 2d 3e 74 6f 6b |&& ((*sy|mp)->tok|
|00000e80| 5f 69 64 20 3d 3d 20 43 | 5f 49 6e 74 65 67 65 72 |_id == C|_Integer|
|00000e90| 20 7c 7c 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | ||. | |
|00000ea0| 28 2a 73 79 6d 70 29 2d | 3e 74 6f 6b 5f 69 64 20 |(*symp)-|>tok_id |
|00000eb0| 3d 3d 20 54 79 70 65 44 | 65 66 4e 61 6d 65 29 29 |== TypeD|efName))|
|00000ec0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 72 65 74 |. | ret|
|00000ed0| 75 72 6e 20 2a 73 79 6d | 70 3b 0d 20 20 20 20 20 |urn *sym|p;. |
|00000ee0| 20 20 20 20 69 66 20 28 | 69 64 5f 74 79 70 65 20 | if (|id_type |
|00000ef0| 3d 3d 20 4c 61 62 65 6c | 20 26 26 20 28 2a 73 79 |== Label| && (*sy|
|00000f00| 6d 70 29 2d 3e 69 64 5f | 74 79 70 65 20 3d 3d 20 |mp)->id_|type == |
|00000f10| 4c 61 62 65 6c 29 0d 20 | 20 20 20 20 20 20 20 20 |Label). | |
|00000f20| 20 20 20 72 65 74 75 72 | 6e 20 2a 73 79 6d 70 3b | retur|n *symp;|
|00000f30| 0d 20 20 20 20 20 20 20 | 20 20 69 66 20 28 28 2a |. | if ((*|
|00000f40| 73 79 6d 70 29 2d 3e 6e | 65 73 74 5f 6c 76 6c 20 |symp)->n|est_lvl |
|00000f50| 3d 3d 20 31 29 0d 20 20 | 20 20 20 20 20 20 20 20 |== 1). | |
|00000f60| 20 20 72 65 74 75 72 6e | 20 2a 73 79 6d 70 3b 0d | return| *symp;.|
|00000f70| 20 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 | | return |
|00000f80| 4e 55 4c 4c 3b 09 2f 2a | 20 69 6c 6c 65 67 61 6c |NULL;./*| illegal|
|00000f90| 20 72 65 64 65 63 6c 61 | 72 61 74 69 6f 6e 73 20 | redecla|rations |
|00000fa0| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 7d 0d 20 20 |*/. | }. |
|00000fb0| 20 20 20 20 73 79 6d 70 | 20 3d 20 26 28 28 2a 73 | symp| = &((*s|
|00000fc0| 79 6d 70 29 2d 3e 6e 65 | 78 74 29 3b 0d 20 20 20 |ymp)->ne|xt);. |
|00000fd0| 20 20 20 7d 0d 0d 20 20 | 20 2f 2a 0d 20 20 20 20 | }.. | /*. |
|00000fe0| 2a 20 4e 6f 20 65 6e 74 | 72 79 20 65 78 69 73 74 |* No ent|ry exist|
|00000ff0| 73 20 66 6f 72 20 74 68 | 65 20 73 79 6d 62 6f 6c |s for th|e symbol|
|00001000| 2c 20 63 72 65 61 74 65 | 20 6f 6e 65 2c 20 66 69 |, create| one, fi|
|00001010| 6c 6c 20 69 6e 20 69 74 | 73 20 66 69 65 6c 64 73 |ll in it|s fields|
|00001020| 2c 20 61 6e 64 20 61 64 | 64 0d 20 20 20 20 2a 20 |, and ad|d. * |
|00001030| 20 69 74 20 74 6f 20 74 | 68 65 20 74 61 62 6c 65 | it to t|he table|
|00001040| 2e 0d 20 20 20 20 2a 2f | 0d 20 20 20 73 79 6d 20 |.. */|. sym |
|00001050| 3d 20 4e 65 77 53 74 72 | 75 63 74 28 73 79 6d 5f |= NewStr|uct(sym_|
|00001060| 65 6e 74 72 79 29 3b 0d | 20 20 20 73 79 6d 2d 3e |entry);.| sym->|
|00001070| 74 6f 6b 5f 69 64 20 3d | 20 74 6f 6b 5f 69 64 3b |tok_id =| tok_id;|
|00001080| 0d 20 20 20 73 79 6d 2d | 3e 69 6d 61 67 65 20 3d |. sym-|>image =|
|00001090| 20 69 6d 61 67 65 3b 0d | 20 20 20 73 79 6d 2d 3e | image;.| sym->|
|000010a0| 69 64 5f 74 79 70 65 20 | 3d 20 20 69 64 5f 74 79 |id_type |= id_ty|
|000010b0| 70 65 3b 0d 20 20 20 73 | 79 6d 2d 3e 6e 65 73 74 |pe;. s|ym->nest|
|000010c0| 5f 6c 76 6c 20 3d 20 6e | 65 73 74 5f 6c 76 6c 3b |_lvl = n|est_lvl;|
|000010d0| 0d 20 20 20 73 79 6d 2d | 3e 72 65 66 5f 63 6e 74 |. sym-|>ref_cnt|
|000010e0| 20 3d 20 31 3b 0d 20 20 | 20 73 79 6d 2d 3e 69 6c | = 1;. | sym->il|
|000010f0| 5f 69 6e 64 78 20 3d 20 | 2d 31 3b 0d 20 20 20 73 |_indx = |-1;. s|
|00001100| 79 6d 2d 3e 6d 61 79 5f | 6d 6f 64 20 3d 20 30 3b |ym->may_|mod = 0;|
|00001110| 0d 20 20 20 69 66 20 28 | 69 64 5f 74 79 70 65 20 |. if (|id_type |
|00001120| 3d 3d 20 4c 61 62 65 6c | 29 0d 20 20 20 20 20 20 |== Label|). |
|00001130| 73 79 6d 2d 3e 75 2e 6c | 62 6c 5f 6e 75 6d 20 3d |sym->u.l|bl_num =|
|00001140| 20 6c 62 6c 5f 6e 75 6d | 2b 2b 3b 0d 20 20 20 73 | lbl_num|++;. s|
|00001150| 79 6d 2d 3e 6e 65 78 74 | 20 3d 20 2a 73 79 6d 70 |ym->next| = *symp|
|00001160| 3b 0d 20 20 20 2a 73 79 | 6d 70 20 3d 20 73 79 6d |;. *sy|mp = sym|
|00001170| 3b 0d 0d 20 20 20 72 65 | 74 75 72 6e 20 73 79 6d |;.. re|turn sym|
|00001180| 3b 20 20 20 20 20 2f 2a | 20 73 75 63 63 65 73 73 |; /*| success|
|00001190| 20 2a 2f 0d 20 20 20 7d | 0d 0d 2f 2a 0d 20 2a 20 | */. }|../*. * |
|000011a0| 6c 62 6c 20 2d 20 6d 61 | 6b 65 20 73 75 72 65 20 |lbl - ma|ke sure |
|000011b0| 74 68 65 20 6c 61 62 65 | 6c 20 69 73 20 69 6e 20 |the labe|l is in |
|000011c0| 74 68 65 20 73 79 6d 62 | 6f 6c 20 74 61 62 6c 65 |the symb|ol table|
|000011d0| 20 61 6e 64 20 72 65 74 | 75 72 6e 20 61 20 6e 6f | and ret|urn a no|
|000011e0| 64 65 0d 20 2a 20 20 72 | 65 66 65 72 65 6e 63 69 |de. * r|eferenci|
|000011f0| 6e 67 20 74 68 65 20 73 | 79 6d 62 6f 6c 20 74 61 |ng the s|ymbol ta|
|00001200| 62 6c 65 20 65 6e 74 72 | 79 2e 0d 20 2a 2f 0d 73 |ble entr|y.. */.s|
|00001210| 74 72 75 63 74 20 6e 6f | 64 65 20 2a 6c 62 6c 28 |truct no|de *lbl(|
|00001220| 74 29 0d 73 74 72 75 63 | 74 20 74 6f 6b 65 6e 20 |t).struc|t token |
|00001230| 2a 74 3b 0d 20 20 20 7b | 0d 20 20 20 73 74 72 75 |*t;. {|. stru|
|00001240| 63 74 20 73 79 6d 5f 65 | 6e 74 72 79 20 2a 73 79 |ct sym_e|ntry *sy|
|00001250| 6d 3b 0d 20 20 20 73 74 | 72 75 63 74 20 6e 6f 64 |m;. st|ruct nod|
|00001260| 65 20 2a 6e 3b 0d 0d 20 | 20 20 73 79 6d 20 3d 20 |e *n;.. | sym = |
|00001270| 73 79 6d 5f 61 64 64 28 | 49 64 65 6e 74 69 66 69 |sym_add(|Identifi|
|00001280| 65 72 2c 20 74 2d 3e 69 | 6d 61 67 65 2c 20 4c 61 |er, t->i|mage, La|
|00001290| 62 65 6c 2c 20 32 29 3b | 0d 20 20 20 69 66 20 28 |bel, 2);|. if (|
|000012a0| 73 79 6d 20 3d 3d 20 4e | 55 4c 4c 29 0d 20 20 20 |sym == N|ULL). |
|000012b0| 20 20 20 65 72 72 74 32 | 28 74 2c 20 22 63 6f 6e | errt2|(t, "con|
|000012c0| 66 6c 69 63 74 69 6e 67 | 20 64 65 66 69 6e 69 74 |flicting| definit|
|000012d0| 69 6f 6e 73 20 66 6f 72 | 20 22 2c 20 74 2d 3e 69 |ions for| ", t->i|
|000012e0| 6d 61 67 65 29 3b 0d 20 | 20 20 6e 20 3d 20 73 79 |mage);. | n = sy|
|000012f0| 6d 5f 6e 6f 64 65 28 74 | 29 3b 0d 20 20 20 69 66 |m_node(t|);. if|
|00001300| 20 28 6e 2d 3e 75 5b 30 | 5d 2e 73 79 6d 20 21 3d | (n->u[0|].sym !=|
|00001310| 20 73 79 6d 29 0d 20 20 | 20 20 20 20 65 72 72 74 | sym). | errt|
|00001320| 32 28 74 2c 20 22 63 6f | 6e 66 6c 69 63 74 69 6e |2(t, "co|nflictin|
|00001330| 67 20 64 65 66 69 6e 69 | 74 69 6f 6e 73 20 66 6f |g defini|tions fo|
|00001340| 72 20 22 2c 20 74 2d 3e | 69 6d 61 67 65 29 3b 0d |r ", t->|image);.|
|00001350| 20 20 20 72 65 74 75 72 | 6e 20 6e 3b 0d 20 20 20 | retur|n n;. |
|00001360| 7d 0d 0d 2f 2a 0d 20 2a | 20 70 75 73 68 5f 63 6e |}../*. *| push_cn|
|00001370| 74 78 74 20 2d 20 70 75 | 73 68 20 61 20 6c 65 76 |txt - pu|sh a lev|
|00001380| 65 6c 20 6f 66 20 64 65 | 63 6c 61 72 61 74 69 6f |el of de|claratio|
|00001390| 6e 20 63 6f 6e 74 65 78 | 74 20 28 74 68 69 73 20 |n contex|t (this |
|000013a0| 6d 61 79 20 6f 72 20 6d | 61 79 20 6e 6f 74 0d 20 |may or m|ay not. |
|000013b0| 2a 20 20 62 65 20 6c 65 | 76 65 6c 20 6f 66 20 64 |* be le|vel of d|
|000013c0| 65 63 6c 61 72 61 74 69 | 6f 6e 20 6e 65 73 74 69 |eclarati|on nesti|
|000013d0| 6e 67 29 2e 0d 20 2a 2f | 0d 6e 6f 76 61 6c 75 65 |ng).. */|.novalue|
|000013e0| 20 70 75 73 68 5f 63 6e | 74 78 74 28 6c 76 6c 5f | push_cn|txt(lvl_|
|000013f0| 69 6e 63 72 29 0d 69 6e | 74 20 6c 76 6c 5f 69 6e |incr).in|t lvl_in|
|00001400| 63 72 3b 0d 20 20 20 7b | 0d 20 20 20 73 74 72 75 |cr;. {|. stru|
|00001410| 63 74 20 6c 76 6c 5f 65 | 6e 74 72 79 20 2a 65 6e |ct lvl_e|ntry *en|
|00001420| 74 72 79 3b 0d 0d 20 20 | 20 65 6e 74 72 79 20 3d |try;.. | entry =|
|00001430| 20 4e 65 77 53 74 72 75 | 63 74 28 6c 76 6c 5f 65 | NewStru|ct(lvl_e|
|00001440| 6e 74 72 79 29 3b 0d 20 | 20 20 65 6e 74 72 79 2d |ntry);. | entry-|
|00001450| 3e 6e 65 73 74 5f 6c 76 | 6c 20 3d 20 64 63 6c 5f |>nest_lv|l = dcl_|
|00001460| 73 74 6b 2d 3e 6e 65 73 | 74 5f 6c 76 6c 20 2b 20 |stk->nes|t_lvl + |
|00001470| 6c 76 6c 5f 69 6e 63 72 | 3b 0d 20 20 20 65 6e 74 |lvl_incr|;. ent|
|00001480| 72 79 2d 3e 6b 69 6e 64 | 5f 64 63 6c 20 3d 20 4f |ry->kind|_dcl = O|
|00001490| 74 68 65 72 44 63 6c 3b | 0d 20 20 20 65 6e 74 72 |therDcl;|. entr|
|000014a0| 79 2d 3e 70 61 72 6d 73 | 5f 64 6f 6e 65 20 3d 20 |y->parms|_done = |
|000014b0| 30 3b 0d 20 20 20 65 6e | 74 72 79 2d 3e 74 65 6e |0;. en|try->ten|
|000014c0| 64 65 64 20 3d 20 4e 55 | 4c 4c 3b 0d 20 20 20 65 |ded = NU|LL;. e|
|000014d0| 6e 74 72 79 2d 3e 6e 65 | 78 74 20 3d 20 64 63 6c |ntry->ne|xt = dcl|
|000014e0| 5f 73 74 6b 3b 0d 20 20 | 20 64 63 6c 5f 73 74 6b |_stk;. | dcl_stk|
|000014f0| 20 3d 20 65 6e 74 72 79 | 3b 0d 20 20 20 7d 0d 0d | = entry|;. }..|
|00001500| 2f 2a 0d 20 2a 20 70 6f | 70 5f 63 6e 74 78 74 20 |/*. * po|p_cntxt |
|00001510| 2d 20 65 6e 64 20 61 20 | 6c 65 76 65 6c 20 6f 66 |- end a |level of|
|00001520| 20 64 65 63 6c 61 72 61 | 74 69 6f 6e 20 63 6f 6e | declara|tion con|
|00001530| 74 65 78 74 0d 20 2a 2f | 0d 6e 6f 76 61 6c 75 65 |text. */|.novalue|
|00001540| 20 70 6f 70 5f 63 6e 74 | 78 74 28 29 0d 20 20 20 | pop_cnt|xt(). |
|00001550| 7b 0d 20 20 20 69 6e 74 | 20 68 61 73 68 5f 76 61 |{. int| hash_va|
|00001560| 6c 3b 0d 20 20 20 69 6e | 74 20 6f 6c 64 5f 6c 76 |l;. in|t old_lv|
|00001570| 6c 3b 0d 20 20 20 69 6e | 74 20 6e 65 77 5f 6c 76 |l;. in|t new_lv|
|00001580| 6c 3b 0d 20 20 20 72 65 | 67 69 73 74 65 72 20 73 |l;. re|gister s|
|00001590| 74 72 75 63 74 20 73 79 | 6d 5f 65 6e 74 72 79 20 |truct sy|m_entry |
|000015a0| 2a 73 79 6d 3b 0d 20 20 | 20 73 74 72 75 63 74 20 |*sym;. | struct |
|000015b0| 6c 76 6c 5f 65 6e 74 72 | 79 20 2a 65 6e 74 72 79 |lvl_entr|y *entry|
|000015c0| 3b 0d 0d 20 20 20 2f 2a | 0d 20 20 20 20 2a 20 4d |;.. /*|. * M|
|000015d0| 6f 76 65 20 74 68 65 20 | 74 6f 70 20 65 6e 74 72 |ove the |top entr|
|000015e0| 79 20 6f 66 20 74 68 65 | 20 73 74 61 63 6b 20 74 |y of the| stack t|
|000015f0| 6f 20 74 68 65 20 66 72 | 65 65 20 6c 69 73 74 2e |o the fr|ee list.|
|00001600| 0d 20 20 20 20 2a 2f 0d | 20 20 20 6f 6c 64 5f 6c |. */.| old_l|
|00001610| 76 6c 20 3d 20 64 63 6c | 5f 73 74 6b 2d 3e 6e 65 |vl = dcl|_stk->ne|
|00001620| 73 74 5f 6c 76 6c 3b 0d | 20 20 20 65 6e 74 72 79 |st_lvl;.| entry|
|00001630| 20 3d 20 64 63 6c 5f 73 | 74 6b 3b 0d 20 20 20 64 | = dcl_s|tk;. d|
|00001640| 63 6c 5f 73 74 6b 20 3d | 20 64 63 6c 5f 73 74 6b |cl_stk =| dcl_stk|
|00001650| 2d 3e 6e 65 78 74 3b 0d | 20 20 20 66 72 65 65 28 |->next;.| free(|
|00001660| 28 63 68 61 72 20 2a 29 | 65 6e 74 72 79 29 3b 0d |(char *)|entry);.|
|00001670| 0d 20 20 20 2f 2a 0d 20 | 20 20 20 2a 20 49 66 20 |. /*. | * If |
|00001680| 74 68 69 73 20 70 6f 70 | 20 72 65 64 75 63 65 64 |this pop| reduced|
|00001690| 20 74 68 65 20 64 65 63 | 6c 61 72 61 74 69 6f 6e | the dec|laration|
|000016a0| 20 6e 65 73 74 69 6e 67 | 20 6c 65 76 65 6c 2c 20 | nesting| level, |
|000016b0| 72 65 6d 6f 76 65 20 6f | 62 73 6f 6c 65 74 65 0d |remove o|bsolete.|
|000016c0| 20 20 20 20 2a 20 20 65 | 6e 74 72 69 65 73 20 66 | * e|ntries f|
|000016d0| 72 6f 6d 20 74 68 65 20 | 73 79 6d 62 6f 6c 20 74 |rom the |symbol t|
|000016e0| 61 62 6c 65 2e 0d 20 20 | 20 20 2a 2f 0d 20 20 20 |able.. | */. |
|000016f0| 6e 65 77 5f 6c 76 6c 20 | 3d 20 64 63 6c 5f 73 74 |new_lvl |= dcl_st|
|00001700| 6b 2d 3e 6e 65 73 74 5f | 6c 76 6c 3b 0d 20 20 20 |k->nest_|lvl;. |
|00001710| 69 66 20 28 6f 6c 64 5f | 6c 76 6c 20 3e 20 6e 65 |if (old_|lvl > ne|
|00001720| 77 5f 6c 76 6c 29 20 7b | 0d 20 20 20 20 20 20 66 |w_lvl) {|. f|
|00001730| 6f 72 20 28 68 61 73 68 | 5f 76 61 6c 20 3d 20 30 |or (hash|_val = 0|
|00001740| 3b 20 68 61 73 68 5f 76 | 61 6c 20 3c 20 48 61 73 |; hash_v|al < Has|
|00001750| 68 53 69 7a 65 3b 20 2b | 2b 20 68 61 73 68 5f 76 |hSize; +|+ hash_v|
|00001760| 61 6c 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 66 |al) {. | f|
|00001770| 6f 72 20 28 73 79 6d 20 | 3d 20 73 79 6d 5f 74 62 |or (sym |= sym_tb|
|00001780| 6c 5b 68 61 73 68 5f 76 | 61 6c 5d 3b 20 73 79 6d |l[hash_v|al]; sym|
|00001790| 20 21 3d 20 4e 55 4c 4c | 20 26 26 0d 20 20 20 20 | != NULL| &&. |
|000017a0| 20 20 20 20 20 20 20 73 | 79 6d 2d 3e 6e 65 73 74 | s|ym->nest|
|000017b0| 5f 6c 76 6c 20 3e 20 6e | 65 77 5f 6c 76 6c 3b 20 |_lvl > n|ew_lvl; |
|000017c0| 73 79 6d 20 3d 20 73 79 | 6d 5f 74 62 6c 5b 68 61 |sym = sy|m_tbl[ha|
|000017d0| 73 68 5f 76 61 6c 5d 29 | 20 7b 0d 20 20 20 20 20 |sh_val])| {. |
|000017e0| 20 20 20 20 20 20 20 73 | 79 6d 5f 74 62 6c 5b 68 | s|ym_tbl[h|
|000017f0| 61 73 68 5f 76 61 6c 5d | 20 3d 20 73 79 6d 2d 3e |ash_val]| = sym->|
|00001800| 6e 65 78 74 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |next;. | |
|00001810| 20 20 66 72 65 65 5f 73 | 79 6d 28 73 79 6d 29 3b | free_s|ym(sym);|
|00001820| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 7d 0d 20 |. | }. |
|00001830| 20 20 20 20 20 20 20 20 | 7d 0d 20 20 20 20 20 20 | |}. |
|00001840| 75 6e 75 73 65 28 74 65 | 6e 64 5f 6c 73 74 2c 20 |unuse(te|nd_lst, |
|00001850| 6f 6c 64 5f 6c 76 6c 29 | 3b 0d 20 20 20 20 20 20 |old_lvl)|;. |
|00001860| 7d 0d 20 20 20 7d 0d 0d | 2f 2a 0d 20 2a 20 75 6e |}. }..|/*. * un|
|00001870| 75 73 65 20 2d 20 6d 61 | 72 6b 20 74 65 6e 64 65 |use - ma|rk tende|
|00001880| 64 20 73 6c 6f 74 73 20 | 69 6e 20 61 74 20 74 68 |d slots |in at th|
|00001890| 65 20 67 69 76 65 6e 20 | 6c 65 76 65 6c 20 6f 66 |e given |level of|
|000018a0| 20 64 65 63 6c 61 72 61 | 74 69 6f 6e 73 20 6e 65 | declara|tions ne|
|000018b0| 73 74 69 6e 67 0d 20 2a | 20 20 61 73 20 62 65 69 |sting. *| as bei|
|000018c0| 6e 67 20 6e 6f 20 6c 6f | 6e 67 65 72 20 69 6e 20 |ng no lo|nger in |
|000018d0| 75 73 65 2c 20 61 6e 64 | 20 6c 65 61 76 65 20 74 |use, and| leave t|
|000018e0| 68 65 20 73 6c 6f 74 73 | 20 61 76 61 69 6c 61 62 |he slots| availab|
|000018f0| 6c 65 20 66 6f 72 20 72 | 65 75 73 65 0d 20 2a 20 |le for r|euse. * |
|00001900| 20 66 6f 72 20 64 65 63 | 6c 61 72 61 74 69 6f 6e | for dec|laration|
|00001910| 73 20 74 68 61 74 20 6f | 63 63 75 72 20 69 6e 20 |s that o|ccur in |
|00001920| 70 61 72 61 72 61 6c 6c | 65 6c 20 63 6f 6d 70 6f |pararall|el compo|
|00001930| 75 6e 64 20 73 74 61 74 | 65 6d 65 6e 74 73 2e 0d |und stat|ements..|
|00001940| 20 2a 2f 0d 6e 6f 76 61 | 6c 75 65 20 75 6e 75 73 | */.nova|lue unus|
|00001950| 65 28 74 5f 6c 73 74 2c | 20 6c 76 6c 29 0d 73 74 |e(t_lst,| lvl).st|
|00001960| 72 75 63 74 20 69 6e 69 | 74 5f 74 65 6e 64 20 2a |ruct ini|t_tend *|
|00001970| 74 5f 6c 73 74 3b 0d 69 | 6e 74 20 6c 76 6c 3b 0d |t_lst;.i|nt lvl;.|
|00001980| 20 20 20 7b 0d 20 20 20 | 77 68 69 6c 65 20 28 74 | {. |while (t|
|00001990| 5f 6c 73 74 20 21 3d 20 | 4e 55 4c 4c 29 20 7b 0d |_lst != |NULL) {.|
|000019a0| 20 20 20 20 20 20 69 66 | 20 28 74 5f 6c 73 74 2d | if| (t_lst-|
|000019b0| 3e 6e 65 73 74 5f 6c 76 | 6c 20 3e 3d 20 6c 76 6c |>nest_lv|l >= lvl|
|000019c0| 29 0d 20 20 20 20 20 20 | 20 20 20 74 5f 6c 73 74 |). | t_lst|
|000019d0| 2d 3e 69 6e 5f 75 73 65 | 20 3d 20 30 3b 0d 20 20 |->in_use| = 0;. |
|000019e0| 20 20 20 20 74 5f 6c 73 | 74 20 3d 20 74 5f 6c 73 | t_ls|t = t_ls|
|000019f0| 74 2d 3e 6e 65 78 74 3b | 0d 20 20 20 20 20 20 7d |t->next;|. }|
|00001a00| 0d 20 20 20 7d 0d 0d 2f | 2a 0d 20 2a 20 66 72 65 |. }../|*. * fre|
|00001a10| 65 5f 73 79 6d 20 2d 20 | 72 65 6d 6f 76 65 20 61 |e_sym - |remove a|
|00001a20| 20 72 65 66 65 72 65 6e | 63 65 20 74 6f 20 61 20 | referen|ce to a |
|00001a30| 73 79 6d 62 6f 6c 20 74 | 61 62 6c 65 20 65 6e 74 |symbol t|able ent|
|00001a40| 72 79 20 61 6e 64 20 66 | 72 65 65 20 73 74 6f 72 |ry and f|ree stor|
|00001a50| 61 67 65 0d 20 2a 20 20 | 72 65 6c 61 74 65 64 20 |age. * |related |
|00001a60| 74 6f 20 69 74 20 69 66 | 20 6e 6f 20 72 65 66 65 |to it if| no refe|
|00001a70| 72 65 6e 63 65 73 20 72 | 65 6d 61 69 6e 2e 0d 20 |rences r|emain.. |
|00001a80| 2a 2f 0d 6e 6f 76 61 6c | 75 65 20 66 72 65 65 5f |*/.noval|ue free_|
|00001a90| 73 79 6d 28 73 79 6d 29 | 0d 73 74 72 75 63 74 20 |sym(sym)|.struct |
|00001aa0| 73 79 6d 5f 65 6e 74 72 | 79 20 2a 73 79 6d 3b 0d |sym_entr|y *sym;.|
|00001ab0| 20 20 20 7b 0d 20 20 20 | 69 66 20 28 2d 2d 73 79 | {. |if (--sy|
|00001ac0| 6d 2d 3e 72 65 66 5f 63 | 6e 74 20 3c 3d 20 30 29 |m->ref_c|nt <= 0)|
|00001ad0| 20 7b 0d 20 20 20 20 20 | 20 73 77 69 74 63 68 20 | {. | switch |
|00001ae0| 28 73 79 6d 2d 3e 69 64 | 5f 74 79 70 65 29 20 7b |(sym->id|_type) {|
|00001af0| 0d 20 20 20 20 20 20 20 | 20 20 63 61 73 65 20 54 |. | case T|
|00001b00| 6e 64 44 65 73 63 3a 0d | 20 20 20 20 20 20 20 20 |ndDesc:.| |
|00001b10| 20 63 61 73 65 20 54 6e | 64 53 74 72 3a 0d 20 20 | case Tn|dStr:. |
|00001b20| 20 20 20 20 20 20 20 63 | 61 73 65 20 54 6e 64 42 | c|ase TndB|
|00001b30| 6c 6b 3a 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |lk:. | |
|00001b40| 66 72 65 65 5f 74 72 65 | 65 28 73 79 6d 2d 3e 75 |free_tre|e(sym->u|
|00001b50| 2e 74 6e 64 5f 76 61 72 | 2e 69 6e 69 74 29 3b 20 |.tnd_var|.init); |
|00001b60| 2f 2a 20 69 6e 69 74 69 | 61 6c 69 7a 65 72 20 65 |/* initi|alizer e|
|00001b70| 78 70 72 65 73 73 69 6f | 6e 20 2a 2f 0d 20 20 20 |xpressio|n */. |
|00001b80| 20 20 20 20 20 20 7d 0d | 20 20 20 20 20 20 66 72 | }.| fr|
|00001b90| 65 65 28 28 63 68 61 72 | 20 2a 29 73 79 6d 29 3b |ee((char| *)sym);|
|00001ba0| 0d 20 20 20 20 20 20 7d | 0d 20 20 20 7d 0d 0d 2f |. }|. }../|
|00001bb0| 2a 0d 20 2a 20 61 6c 6c | 6f 63 5f 74 6e 64 20 2d |*. * all|oc_tnd -|
|00001bc0| 20 61 6c 6c 6f 63 61 74 | 65 64 20 61 20 73 6c 6f | allocat|ed a slo|
|00001bd0| 74 20 69 6e 20 61 20 74 | 65 6e 64 65 64 20 61 72 |t in a t|ended ar|
|00001be0| 72 61 79 20 66 6f 72 20 | 61 20 76 61 72 69 61 62 |ray for |a variab|
|00001bf0| 6c 65 20 61 6e 64 20 72 | 65 74 75 72 6e 0d 20 2a |le and r|eturn. *|
|00001c00| 20 20 69 74 73 20 69 6e | 64 65 78 2e 0d 20 2a 2f | its in|dex.. */|
|00001c10| 0d 69 6e 74 20 61 6c 6c | 6f 63 5f 74 6e 64 28 74 |.int all|oc_tnd(t|
|00001c20| 79 70 2c 20 69 6e 69 74 | 2c 20 6c 76 6c 29 0d 69 |yp, init|, lvl).i|
|00001c30| 6e 74 20 74 79 70 3b 0d | 73 74 72 75 63 74 20 6e |nt typ;.|struct n|
|00001c40| 6f 64 65 20 2a 69 6e 69 | 74 3b 0d 69 6e 74 20 6c |ode *ini|t;.int l|
|00001c50| 76 6c 3b 0d 20 20 20 7b | 0d 20 20 20 72 65 67 69 |vl;. {|. regi|
|00001c60| 73 74 65 72 20 73 74 72 | 75 63 74 20 69 6e 69 74 |ster str|uct init|
|00001c70| 5f 74 65 6e 64 20 2a 74 | 6e 64 3b 0d 0d 20 20 20 |_tend *t|nd;.. |
|00001c80| 69 66 20 28 6c 76 6c 20 | 3e 20 32 29 20 7b 0d 20 |if (lvl |> 2) {. |
|00001c90| 20 20 20 20 2f 2a 0d 20 | 20 20 20 20 20 2a 20 54 | /*. | * T|
|00001ca0| 68 69 73 20 64 65 63 6c | 61 72 61 74 69 6f 6e 20 |his decl|aration |
|00001cb0| 6f 63 63 75 72 73 20 69 | 6e 20 61 6e 20 69 6e 6e |occurs i|n an inn|
|00001cc0| 65 72 20 63 6f 6d 70 6f | 75 6e 64 20 73 74 61 74 |er compo|und stat|
|00001cd0| 65 6d 65 6e 74 2e 20 54 | 68 65 72 65 0d 20 20 20 |ement. T|here. |
|00001ce0| 20 20 20 2a 20 20 6d 61 | 79 20 62 65 20 73 6c 6f | * ma|y be slo|
|00001cf0| 74 73 20 63 72 65 61 74 | 65 64 20 66 6f 72 20 70 |ts creat|ed for p|
|00001d00| 61 72 61 6c 6c 65 6c 20 | 63 6f 6d 70 6f 75 6e 64 |arallel |compound|
|00001d10| 20 73 74 61 74 65 6d 65 | 6e 74 2c 20 62 75 74 20 | stateme|nt, but |
|00001d20| 77 65 72 65 0d 20 20 20 | 20 20 20 2a 20 20 66 72 |were. | * fr|
|00001d30| 65 65 64 20 61 6e 64 20 | 63 61 6e 20 62 65 20 72 |eed and |can be r|
|00001d40| 65 75 73 65 64 20 68 65 | 72 65 2e 0d 20 20 20 20 |eused he|re.. |
|00001d50| 20 20 2a 2f 0d 20 20 20 | 20 20 74 6e 64 20 3d 20 | */. | tnd = |
|00001d60| 74 65 6e 64 5f 6c 73 74 | 3b 0d 20 20 20 20 20 77 |tend_lst|;. w|
|00001d70| 68 69 6c 65 20 28 74 6e | 64 20 21 3d 20 4e 55 4c |hile (tn|d != NUL|
|00001d80| 4c 20 26 26 20 28 74 6e | 64 2d 3e 69 6e 5f 75 73 |L && (tn|d->in_us|
|00001d90| 65 20 7c 7c 20 74 6e 64 | 2d 3e 69 6e 69 74 5f 74 |e || tnd|->init_t|
|00001da0| 79 70 20 21 3d 20 74 79 | 70 29 29 0d 20 20 20 20 |yp != ty|p)). |
|00001db0| 20 20 20 74 6e 64 20 3d | 20 74 6e 64 2d 3e 6e 65 | tnd =| tnd->ne|
|00001dc0| 78 74 3b 0d 20 20 20 20 | 20 69 66 20 28 74 6e 64 |xt;. | if (tnd|
|00001dd0| 20 21 3d 20 4e 55 4c 4c | 29 20 7b 0d 20 20 20 20 | != NULL|) {. |
|00001de0| 20 20 20 20 20 74 6e 64 | 2d 3e 69 6e 5f 75 73 65 | tnd|->in_use|
|00001df0| 20 3d 20 31 3b 0d 20 20 | 20 20 20 20 20 20 20 74 | = 1;. | t|
|00001e00| 6e 64 2d 3e 6e 65 73 74 | 5f 6c 76 6c 20 3d 20 6c |nd->nest|_lvl = l|
|00001e10| 76 6c 3b 0d 20 20 20 20 | 20 20 20 20 20 72 65 74 |vl;. | ret|
|00001e20| 75 72 6e 20 74 6e 64 2d | 3e 74 5f 69 6e 64 78 3b |urn tnd-|>t_indx;|
|00001e30| 0d 20 20 20 20 20 20 20 | 20 20 7d 0d 20 20 20 20 |. | }. |
|00001e40| 20 20 7d 0d 0d 20 20 20 | 2f 2a 0d 20 20 20 20 2a | }.. |/*. *|
|00001e50| 20 41 6c 6c 6f 63 61 74 | 65 20 61 20 6e 65 77 20 | Allocat|e a new |
|00001e60| 74 65 6e 64 65 64 20 73 | 6c 6f 74 2c 20 63 6f 6d |tended s|lot, com|
|00001e70| 70 75 74 65 20 69 74 73 | 20 69 6e 64 65 78 20 69 |pute its| index i|
|00001e80| 6e 20 74 68 65 20 61 72 | 72 61 79 2c 20 61 6e 64 |n the ar|ray, and|
|00001e90| 0d 20 20 20 20 2a 20 20 | 73 65 74 20 69 6e 69 74 |. * |set init|
|00001ea0| 69 61 6c 69 7a 61 74 69 | 6f 6e 20 61 6e 64 20 6f |ializati|on and o|
|00001eb0| 74 68 65 72 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |ther inf|ormation|
|00001ec0| 2e 0d 20 20 20 20 2a 2f | 0d 20 20 20 74 6e 64 20 |.. */|. tnd |
|00001ed0| 3d 20 4e 65 77 53 74 72 | 75 63 74 28 69 6e 69 74 |= NewStr|uct(init|
|00001ee0| 5f 74 65 6e 64 29 3b 0d | 0d 20 20 20 69 66 20 28 |_tend);.|. if (|
|00001ef0| 74 65 6e 64 5f 6c 73 74 | 20 3d 3d 20 4e 55 4c 4c |tend_lst| == NULL|
|00001f00| 29 0d 20 20 20 20 20 20 | 74 6e 64 2d 3e 74 5f 69 |). |tnd->t_i|
|00001f10| 6e 64 78 20 3d 20 30 3b | 0d 20 20 20 65 6c 73 65 |ndx = 0;|. else|
|00001f20| 0d 20 20 20 20 20 20 74 | 6e 64 2d 3e 74 5f 69 6e |. t|nd->t_in|
|00001f30| 64 78 20 3d 20 74 65 6e | 64 5f 6c 73 74 2d 3e 74 |dx = ten|d_lst->t|
|00001f40| 5f 69 6e 64 78 20 2b 20 | 31 3b 0d 20 20 20 74 6e |_indx + |1;. tn|
|00001f50| 64 2d 3e 69 6e 69 74 5f | 74 79 70 20 3d 20 74 79 |d->init_|typ = ty|
|00001f60| 70 3b 0d 20 20 20 2f 2a | 0d 20 20 20 20 2a 20 54 |p;. /*|. * T|
|00001f70| 68 65 20 69 6e 69 74 69 | 61 6c 69 7a 61 74 69 6f |he initi|alizatio|
|00001f80| 6e 20 66 72 6f 6d 20 74 | 68 65 20 64 65 63 6c 61 |n from t|he decla|
|00001f90| 72 61 74 69 6f 6e 20 77 | 69 6c 6c 20 6f 6e 6c 79 |ration w|ill only|
|00001fa0| 20 62 65 20 75 73 65 64 | 20 74 6f 20 0d 20 20 20 | be used| to . |
|00001fb0| 20 2a 20 20 73 65 74 20 | 75 70 20 74 68 65 20 74 | * set |up the t|
|00001fc0| 65 6e 64 65 64 20 6c 6f | 63 61 74 69 6f 6e 20 69 |ended lo|cation i|
|00001fd0| 66 20 74 68 65 20 64 65 | 63 6c 61 72 61 74 69 6f |f the de|claratio|
|00001fe0| 6e 20 69 73 20 69 6e 20 | 74 68 65 20 6f 75 74 65 |n is in |the oute|
|00001ff0| 72 6d 6f 73 74 0d 20 20 | 20 20 2a 20 20 22 62 6c |rmost. | * "bl|
|00002000| 6f 63 6b 22 2e 20 4f 74 | 68 65 72 77 69 73 65 20 |ock". Ot|herwise |
|00002010| 61 20 67 65 6e 65 72 69 | 63 20 69 6e 69 74 69 61 |a generi|c initia|
|00002020| 6c 69 7a 61 74 69 6f 6e | 20 77 69 6c 6c 20 62 65 |lization| will be|
|00002030| 20 64 6f 6e 65 20 64 75 | 72 69 6e 67 0d 20 20 20 | done du|ring. |
|00002040| 20 2a 20 20 74 68 65 20 | 73 65 74 20 75 70 20 61 | * the |set up a|
|00002050| 6e 64 20 74 68 65 20 6f | 6e 65 20 66 72 6f 6d 20 |nd the o|ne from |
|00002060| 74 68 65 20 64 65 63 6c | 61 72 61 74 69 6f 6e 20 |the decl|aration |
|00002070| 77 69 6c 6c 20 62 65 20 | 70 75 74 20 6f 66 66 20 |will be |put off |
|00002080| 75 6e 74 69 6c 0d 20 20 | 20 20 2a 20 20 74 68 65 |until. | * the|
|00002090| 20 62 6c 6f 63 6b 20 69 | 73 20 65 6e 74 65 72 65 | block i|s entere|
|000020a0| 64 2e 0d 20 20 20 20 2a | 2f 0d 20 20 20 69 66 20 |d.. *|/. if |
|000020b0| 28 6c 76 6c 20 3d 3d 20 | 32 29 0d 20 20 20 20 20 |(lvl == |2). |
|000020c0| 20 74 6e 64 2d 3e 69 6e | 69 74 20 3d 20 69 6e 69 | tnd->in|it = ini|
|000020d0| 74 3b 0d 20 20 20 65 6c | 73 65 0d 20 20 20 20 20 |t;. el|se. |
|000020e0| 20 74 6e 64 2d 3e 69 6e | 69 74 20 3d 20 4e 55 4c | tnd->in|it = NUL|
|000020f0| 4c 3b 0d 20 20 20 74 6e | 64 2d 3e 69 6e 5f 75 73 |L;. tn|d->in_us|
|00002100| 65 20 3d 20 31 3b 0d 20 | 20 20 74 6e 64 2d 3e 6e |e = 1;. | tnd->n|
|00002110| 65 73 74 5f 6c 76 6c 20 | 3d 20 6c 76 6c 3b 0d 20 |est_lvl |= lvl;. |
|00002120| 20 20 74 6e 64 2d 3e 6e | 65 78 74 20 3d 20 74 65 | tnd->n|ext = te|
|00002130| 6e 64 5f 6c 73 74 3b 0d | 20 20 20 74 65 6e 64 5f |nd_lst;.| tend_|
|00002140| 6c 73 74 20 3d 20 74 6e | 64 3b 0d 20 20 20 72 65 |lst = tn|d;. re|
|00002150| 74 75 72 6e 20 74 6e 64 | 2d 3e 74 5f 69 6e 64 78 |turn tnd|->t_indx|
|00002160| 3b 0d 20 20 20 7d 0d 0d | 2f 2a 0d 20 2a 20 66 72 |;. }..|/*. * fr|
|00002170| 65 65 5f 74 65 6e 64 20 | 2d 20 70 75 74 20 74 68 |ee_tend |- put th|
|00002180| 65 20 6c 69 73 74 20 6f | 66 20 74 65 6e 64 65 64 |e list o|f tended|
|00002190| 20 64 65 73 63 72 69 70 | 74 6f 72 73 20 6f 6e 20 | descrip|tors on |
|000021a0| 74 68 65 20 66 72 65 65 | 20 6c 69 73 74 2e 0d 20 |the free| list.. |
|000021b0| 2a 2f 0d 6e 6f 76 61 6c | 75 65 20 66 72 65 65 5f |*/.noval|ue free_|
|000021c0| 74 65 6e 64 28 29 0d 20 | 20 20 7b 0d 20 20 20 72 |tend(). | {. r|
|000021d0| 65 67 69 73 74 65 72 20 | 73 74 72 75 63 74 20 69 |egister |struct i|
|000021e0| 6e 69 74 5f 74 65 6e 64 | 20 2a 74 6e 64 2c 20 2a |nit_tend| *tnd, *|
|000021f0| 74 6e 64 31 3b 0d 0d 20 | 20 20 66 6f 72 20 28 74 |tnd1;.. | for (t|
|00002200| 6e 64 20 3d 20 74 65 6e | 64 5f 6c 73 74 3b 20 74 |nd = ten|d_lst; t|
|00002210| 6e 64 20 21 3d 20 4e 55 | 4c 4c 3b 20 74 6e 64 20 |nd != NU|LL; tnd |
|00002220| 3d 20 74 6e 64 31 29 20 | 7b 0d 20 20 20 20 20 20 |= tnd1) |{. |
|00002230| 74 6e 64 31 20 3d 20 74 | 6e 64 2d 3e 6e 65 78 74 |tnd1 = t|nd->next|
|00002240| 3b 0d 20 20 20 20 20 20 | 66 72 65 65 28 28 63 68 |;. |free((ch|
|00002250| 61 72 20 2a 29 74 6e 64 | 29 3b 0d 20 20 20 20 20 |ar *)tnd|);. |
|00002260| 20 7d 0d 20 20 20 74 65 | 6e 64 5f 6c 73 74 20 3d | }. te|nd_lst =|
|00002270| 20 4e 55 4c 4c 3b 0d 20 | 20 20 7d 0d 0d 2f 2a 0d | NULL;. | }../*.|
|00002280| 20 2a 20 64 73 74 5f 61 | 6c 6c 6f 63 20 2d 20 74 | * dst_a|lloc - t|
|00002290| 68 65 20 63 6f 6e 76 65 | 72 73 69 6f 6e 20 6f 66 |he conve|rsion of|
|000022a0| 20 61 20 70 61 72 61 6d | 65 74 65 72 20 69 73 20 | a param|eter is |
|000022b0| 65 6e 63 6f 75 6e 74 65 | 72 65 64 20 64 75 72 69 |encounte|red duri|
|000022c0| 6e 67 0d 20 2a 20 20 70 | 61 72 73 69 6e 67 3b 20 |ng. * p|arsing; |
|000022d0| 6d 61 6b 65 20 73 75 72 | 65 20 61 20 70 6c 61 63 |make sur|e a plac|
|000022e0| 65 20 69 73 20 61 6c 6c | 6f 63 61 74 65 64 20 74 |e is all|ocated t|
|000022f0| 6f 20 61 63 74 20 61 73 | 20 74 68 65 20 64 65 73 |o act as| the des|
|00002300| 74 69 6e 61 74 69 6f 6e | 2e 0d 20 2a 2f 0d 6e 6f |tination|.. */.no|
|00002310| 76 61 6c 75 65 20 64 73 | 74 5f 61 6c 6c 6f 63 28 |value ds|t_alloc(|
|00002320| 63 6e 76 5f 74 79 70 2c | 20 76 61 72 29 0d 73 74 |cnv_typ,| var).st|
|00002330| 72 75 63 74 20 6e 6f 64 | 65 20 2a 63 6e 76 5f 74 |ruct nod|e *cnv_t|
|00002340| 79 70 3b 0d 73 74 72 75 | 63 74 20 6e 6f 64 65 20 |yp;.stru|ct node |
|00002350| 2a 76 61 72 3b 0d 20 20 | 20 7b 0d 20 20 20 73 74 |*var;. | {. st|
|00002360| 72 75 63 74 20 73 79 6d | 5f 65 6e 74 72 79 20 2a |ruct sym|_entry *|
|00002370| 73 79 6d 3b 0d 0d 20 20 | 20 69 66 20 28 76 61 72 |sym;.. | if (var|
|00002380| 2d 3e 6e 64 5f 69 64 20 | 3d 3d 20 53 79 6d 4e 64 |->nd_id |== SymNd|
|00002390| 29 20 7b 0d 20 20 20 20 | 20 20 73 79 6d 20 3d 20 |) {. | sym = |
|000023a0| 76 61 72 2d 3e 75 5b 30 | 5d 2e 73 79 6d 3b 0d 20 |var->u[0|].sym;. |
|000023b0| 20 20 20 20 20 69 66 20 | 28 73 79 6d 2d 3e 69 64 | if |(sym->id|
|000023c0| 5f 74 79 70 65 20 26 20 | 44 72 66 50 72 6d 29 20 |_type & |DrfPrm) |
|000023d0| 7b 0d 20 20 20 20 20 20 | 20 20 20 73 77 69 74 63 |{. | switc|
|000023e0| 68 20 28 63 6e 76 5f 74 | 79 70 2d 3e 74 6f 6b 2d |h (cnv_t|yp->tok-|
|000023f0| 3e 74 6f 6b 5f 69 64 29 | 20 7b 0d 20 20 20 20 20 |>tok_id)| {. |
|00002400| 20 20 20 20 20 20 20 63 | 61 73 65 20 43 5f 49 6e | c|ase C_In|
|00002410| 74 65 67 65 72 3a 0d 20 | 20 20 20 20 20 20 20 20 |teger:. | |
|00002420| 20 20 20 20 20 20 73 79 | 6d 2d 3e 75 2e 70 61 72 | sy|m->u.par|
|00002430| 61 6d 5f 69 6e 66 6f 2e | 6e 6f 6e 5f 74 65 6e 64 |am_info.|non_tend|
|00002440| 20 7c 3d 20 50 72 6d 49 | 6e 74 3b 0d 20 20 20 20 | |= PrmI|nt;. |
|00002450| 20 20 20 20 20 20 20 20 | 20 20 20 62 72 65 61 6b | | break|
|00002460| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 63 61 |;. | ca|
|00002470| 73 65 20 43 5f 44 6f 75 | 62 6c 65 3a 0d 20 20 20 |se C_Dou|ble:. |
|00002480| 20 20 20 20 20 20 20 20 | 20 20 20 20 73 79 6d 2d | | sym-|
|00002490| 3e 75 2e 70 61 72 61 6d | 5f 69 6e 66 6f 2e 6e 6f |>u.param|_info.no|
|000024a0| 6e 5f 74 65 6e 64 20 7c | 3d 20 50 72 6d 44 62 6c |n_tend ||= PrmDbl|
|000024b0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |;. | |
|000024c0| 20 62 72 65 61 6b 3b 0d | 20 20 20 20 20 20 20 20 | break;.| |
|000024d0| 20 20 20 20 7d 0d 20 20 | 20 20 20 20 20 20 20 7d | }. | }|
|000024e0| 0d 20 20 20 20 20 20 7d | 0d 20 20 20 7d 0d 0d 2f |. }|. }../|
|000024f0| 2a 0d 20 2a 20 73 74 72 | 74 5f 64 65 66 20 2d 20 |*. * str|t_def - |
|00002500| 74 68 65 20 73 74 61 72 | 74 20 6f 66 20 61 6e 20 |the star|t of an |
|00002510| 6f 70 65 72 61 74 69 6f | 6e 20 64 65 66 69 6e 69 |operatio|n defini|
|00002520| 74 69 6f 6e 20 69 73 20 | 65 6e 63 6f 75 6e 74 65 |tion is |encounte|
|00002530| 72 65 64 20 64 75 72 69 | 6e 67 0d 20 2a 20 20 70 |red duri|ng. * p|
|00002540| 61 72 73 69 6e 67 3b 20 | 65 73 74 61 62 6c 69 73 |arsing; |establis|
|00002550| 68 20 61 6e 20 6e 65 77 | 20 64 65 63 6c 61 72 61 |h an new| declara|
|00002560| 74 69 6f 6e 20 63 6f 6e | 74 65 78 74 20 61 6e 64 |tion con|text and|
|00002570| 20 6d 61 6b 65 20 22 72 | 65 73 75 6c 74 22 0d 20 | make "r|esult". |
|00002580| 2a 20 20 61 20 73 70 65 | 63 69 61 6c 20 69 64 65 |* a spe|cial ide|
|00002590| 6e 74 69 66 69 65 72 2e | 0d 20 2a 2f 0d 6e 6f 76 |ntifier.|. */.nov|
|000025a0| 61 6c 75 65 20 73 74 72 | 74 5f 64 65 66 28 29 0d |alue str|t_def().|
|000025b0| 20 20 20 7b 0d 20 20 20 | 73 74 72 75 63 74 20 73 | {. |struct s|
|000025c0| 79 6d 5f 65 6e 74 72 79 | 20 2a 73 79 6d 3b 0d 0d |ym_entry| *sym;..|
|000025d0| 20 20 20 70 75 73 68 5f | 63 6e 74 78 74 28 31 29 | push_|cntxt(1)|
|000025e0| 3b 0d 20 20 20 73 79 6d | 20 3d 20 73 79 6d 5f 61 |;. sym| = sym_a|
|000025f0| 64 64 28 49 64 65 6e 74 | 69 66 69 65 72 2c 20 73 |dd(Ident|ifier, s|
|00002600| 74 72 5f 72 73 6c 74 2c | 20 52 73 6c 74 4c 6f 63 |tr_rslt,| RsltLoc|
|00002610| 2c 20 64 63 6c 5f 73 74 | 6b 2d 3e 6e 65 73 74 5f |, dcl_st|k->nest_|
|00002620| 6c 76 6c 29 3b 0d 20 20 | 20 73 79 6d 2d 3e 75 2e |lvl);. | sym->u.|
|00002630| 72 65 66 65 72 65 6e 63 | 65 64 20 3d 20 30 3b 0d |referenc|ed = 0;.|
|00002640| 20 20 20 7d 0d 0d 2f 2a | 0d 20 2a 20 61 64 64 5f | }../*|. * add_|
|00002650| 64 65 66 20 2d 20 75 70 | 64 61 74 65 20 74 68 65 |def - up|date the|
|00002660| 20 73 79 6d 62 6f 6c 20 | 74 61 62 6c 65 20 66 6f | symbol |table fo|
|00002670| 72 20 74 68 65 20 67 69 | 76 65 6e 20 64 65 63 6c |r the gi|ven decl|
|00002680| 61 72 61 74 6f 72 2e 0d | 20 2a 2f 0d 73 74 61 74 |arator..| */.stat|
|00002690| 69 63 20 6e 6f 76 61 6c | 75 65 20 61 64 64 5f 64 |ic noval|ue add_d|
|000026a0| 65 66 28 64 63 6c 74 6f | 72 29 0d 73 74 72 75 63 |ef(dclto|r).struc|
|000026b0| 74 20 6e 6f 64 65 20 2a | 64 63 6c 74 6f 72 3b 0d |t node *|dcltor;.|
|000026c0| 20 20 20 7b 0d 20 20 20 | 73 74 72 75 63 74 20 73 | {. |struct s|
|000026d0| 79 6d 5f 65 6e 74 72 79 | 20 2a 73 79 6d 3b 0d 20 |ym_entry| *sym;. |
|000026e0| 20 20 73 74 72 75 63 74 | 20 74 6f 6b 65 6e 20 2a | struct| token *|
|000026f0| 74 3b 0d 20 20 20 69 6e | 74 20 74 6f 6b 5f 69 64 |t;. in|t tok_id|
|00002700| 3b 0d 0d 20 20 20 2f 2a | 0d 20 20 20 20 2a 20 66 |;.. /*|. * f|
|00002710| 69 6e 64 20 74 68 65 20 | 69 64 65 6e 74 69 66 69 |ind the |identifi|
|00002720| 65 72 20 77 69 74 68 69 | 6e 20 74 68 65 20 64 65 |er withi|n the de|
|00002730| 63 6c 61 72 61 74 6f 72 | 2e 0d 20 20 20 20 2a 2f |clarator|.. */|
|00002740| 0d 20 20 20 66 6f 72 20 | 28 3b 3b 29 20 7b 0d 20 |. for |(;;) {. |
|00002750| 20 20 20 20 20 73 77 69 | 74 63 68 20 28 64 63 6c | swi|tch (dcl|
|00002760| 74 6f 72 2d 3e 6e 64 5f | 69 64 29 20 7b 20 0d 20 |tor->nd_|id) { . |
|00002770| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 42 69 6e | |case Bin|
|00002780| 72 79 4e 64 3a 0d 20 20 | 20 20 20 20 20 20 20 20 |ryNd:. | |
|00002790| 20 20 2f 2a 20 27 29 27 | 20 6f 72 20 27 5b 27 20 | /* ')'| or '[' |
|000027a0| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 64 |*/. | d|
|000027b0| 63 6c 74 6f 72 20 3d 20 | 64 63 6c 74 6f 72 2d 3e |cltor = |dcltor->|
|000027c0| 75 5b 30 5d 2e 63 68 69 | 6c 64 3b 0d 20 20 20 20 |u[0].chi|ld;. |
|000027d0| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0d 20 | |break;. |
|000027e0| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 43 6f 6e | |case Con|
|000027f0| 43 61 74 4e 64 3a 0d 20 | 20 20 20 20 20 20 20 20 |CatNd:. | |
|00002800| 20 20 20 2f 2a 20 70 6f | 69 6e 74 65 72 20 64 69 | /* po|inter di|
|00002810| 72 65 63 74 2d 64 65 63 | 6c 61 72 61 74 6f 72 20 |rect-dec|larator |
|00002820| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 64 |*/. | d|
|00002830| 63 6c 74 6f 72 20 3d 20 | 64 63 6c 74 6f 72 2d 3e |cltor = |dcltor->|
|00002840| 75 5b 31 5d 2e 63 68 69 | 6c 64 3b 0d 20 20 20 20 |u[1].chi|ld;. |
|00002850| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0d 20 | |break;. |
|00002860| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 50 72 65 | |case Pre|
|00002870| 66 78 4e 64 3a 0d 20 20 | 20 20 20 20 20 20 20 20 |fxNd:. | |
|00002880| 20 20 2f 2a 20 28 20 2e | 2e 2e 20 29 20 2a 2f 0d | /* ( .|.. ) */.|
|00002890| 20 20 20 20 20 20 20 20 | 20 20 20 20 64 63 6c 74 | | dclt|
|000028a0| 6f 72 20 3d 20 20 64 63 | 6c 74 6f 72 2d 3e 75 5b |or = dc|ltor->u[|
|000028b0| 30 5d 2e 63 68 69 6c 64 | 3b 0d 20 20 20 20 20 20 |0].child|;. |
|000028c0| 20 20 20 20 20 20 62 72 | 65 61 6b 3b 0d 20 20 20 | br|eak;. |
|000028d0| 20 20 20 20 20 20 63 61 | 73 65 20 50 72 69 6d 72 | ca|se Primr|
|000028e0| 79 4e 64 3a 0d 20 20 20 | 20 20 20 20 20 20 20 20 |yNd:. | |
|000028f0| 20 74 20 3d 20 64 63 6c | 74 6f 72 2d 3e 74 6f 6b | t = dcl|tor->tok|
|00002900| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 69 66 |;. | if|
|00002910| 20 28 74 2d 3e 74 6f 6b | 5f 69 64 20 3d 3d 20 49 | (t->tok|_id == I|
|00002920| 64 65 6e 74 69 66 69 65 | 72 20 7c 7c 20 74 2d 3e |dentifie|r || t->|
|00002930| 74 6f 6b 5f 69 64 20 3d | 3d 20 54 79 70 65 44 65 |tok_id =|= TypeDe|
|00002940| 66 4e 61 6d 65 29 20 7b | 0d 20 20 20 20 20 20 20 |fName) {|. |
|00002950| 20 20 20 20 20 20 20 20 | 2f 2a 0d 20 20 20 20 20 | |/*. |
|00002960| 20 20 20 20 20 20 20 20 | 20 20 20 2a 20 57 65 20 | | * We |
|00002970| 68 61 76 65 20 66 6f 75 | 6e 64 20 74 68 65 20 69 |have fou|nd the i|
|00002980| 64 65 6e 74 69 66 69 65 | 72 2c 20 61 64 64 20 61 |dentifie|r, add a|
|00002990| 6e 20 65 6e 74 72 79 20 | 74 6f 20 74 68 65 0d 20 |n entry |to the. |
|000029a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2a | | *|
|000029b0| 20 20 73 79 6d 62 6f 6c | 20 74 61 62 6c 65 20 62 | symbol| table b|
|000029c0| 61 73 65 64 20 6f 6e 20 | 69 6e 66 6f 72 6d 61 74 |ased on |informat|
|000029d0| 69 6f 6e 20 69 6e 20 74 | 68 65 20 64 65 63 6c 61 |ion in t|he decla|
|000029e0| 72 61 74 69 6f 6e 0d 20 | 20 20 20 20 20 20 20 20 |ration. | |
|000029f0| 20 20 20 20 20 20 20 2a | 20 20 63 6f 6e 74 65 78 | *| contex|
|00002a00| 74 2e 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t.. | |
|00002a10| 20 20 20 2a 2f 0d 20 20 | 20 20 20 20 20 20 20 20 | */. | |
|00002a20| 20 20 20 20 20 69 66 20 | 28 64 63 6c 5f 73 74 6b | if |(dcl_stk|
|00002a30| 2d 3e 6b 69 6e 64 5f 64 | 63 6c 20 3d 3d 20 49 73 |->kind_d|cl == Is|
|00002a40| 54 79 70 65 64 65 66 29 | 0d 20 20 20 20 20 20 20 |Typedef)|. |
|00002a50| 20 20 20 20 20 20 20 20 | 20 20 20 74 6f 6b 5f 69 | | tok_i|
|00002a60| 64 20 3d 20 54 79 70 65 | 44 65 66 4e 61 6d 65 3b |d = Type|DefName;|
|00002a70| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002a80| 65 6c 73 65 0d 20 20 20 | 20 20 20 20 20 20 20 20 |else. | |
|00002a90| 20 20 20 20 20 20 20 74 | 6f 6b 5f 69 64 20 3d 20 | t|ok_id = |
|00002aa0| 49 64 65 6e 74 69 66 69 | 65 72 3b 0d 20 20 20 20 |Identifi|er;. |
|00002ab0| 20 20 20 20 20 20 20 20 | 20 20 20 73 79 6d 20 3d | | sym =|
|00002ac0| 20 73 79 6d 5f 61 64 64 | 28 74 6f 6b 5f 69 64 2c | sym_add|(tok_id,|
|00002ad0| 20 74 2d 3e 69 6d 61 67 | 65 2c 20 4f 74 68 65 72 | t->imag|e, Other|
|00002ae0| 44 63 6c 2c 20 64 63 6c | 5f 73 74 6b 2d 3e 6e 65 |Dcl, dcl|_stk->ne|
|00002af0| 73 74 5f 6c 76 6c 29 3b | 0d 20 20 20 20 20 20 20 |st_lvl);|. |
|00002b00| 20 20 20 20 20 20 20 20 | 69 66 20 28 73 79 6d 20 | |if (sym |
|00002b10| 3d 3d 20 4e 55 4c 4c 29 | 0d 20 20 20 20 20 20 20 |== NULL)|. |
|00002b20| 20 20 20 20 20 20 20 20 | 20 20 20 65 72 72 74 32 | | errt2|
|00002b30| 28 74 2c 20 22 72 65 64 | 65 66 69 6e 69 74 69 6f |(t, "red|efinitio|
|00002b40| 6e 20 6f 66 20 22 2c 20 | 74 2d 3e 69 6d 61 67 65 |n of ", |t->image|
|00002b50| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |);. | |
|00002b60| 20 20 7d 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00002b70| 72 65 74 75 72 6e 3b 0d | 20 20 20 20 20 20 20 20 |return;.| |
|00002b80| 20 64 65 66 61 75 6c 74 | 3a 0d 20 20 20 20 20 20 | default|:. |
|00002b90| 20 20 20 20 20 20 72 65 | 74 75 72 6e 3b 0d 20 20 | re|turn;. |
|00002ba0| 20 20 20 20 20 20 20 7d | 0d 20 20 20 20 20 20 7d | }|. }|
|00002bb0| 0d 20 20 20 7d 0d 0d 2f | 2a 0d 20 2a 20 69 64 5f |. }../|*. * id_|
|00002bc0| 64 65 66 20 2d 20 61 20 | 64 65 63 6c 61 72 61 74 |def - a |declarat|
|00002bd0| 6f 72 20 68 61 73 20 62 | 65 65 6e 20 70 61 72 73 |or has b|een pars|
|00002be0| 65 64 2e 20 44 65 74 65 | 72 6d 69 6e 65 20 77 68 |ed. Dete|rmine wh|
|00002bf0| 61 74 20 74 6f 20 64 6f | 20 77 69 74 68 20 69 74 |at to do| with it|
|00002c00| 0d 20 2a 20 20 62 61 73 | 65 64 20 6f 6e 20 69 6e |. * bas|ed on in|
|00002c10| 66 6f 72 6d 61 74 69 6f | 6e 20 70 75 74 20 69 6e |formatio|n put in|
|00002c20| 20 74 68 65 20 64 65 63 | 6c 61 72 61 74 69 6f 6e | the dec|laration|
|00002c30| 20 63 6f 6e 74 65 78 74 | 20 77 68 69 6c 65 20 70 | context| while p|
|00002c40| 61 72 73 69 6e 67 0d 20 | 2a 20 20 74 68 65 20 22 |arsing. |* the "|
|00002c50| 73 74 6f 72 61 67 65 20 | 63 6c 61 73 73 20 74 79 |storage |class ty|
|00002c60| 70 65 20 71 75 61 6c 69 | 66 69 65 72 20 6c 69 73 |pe quali|fier lis|
|00002c70| 74 22 2e 0d 20 2a 2f 0d | 6e 6f 76 61 6c 75 65 20 |t".. */.|novalue |
|00002c80| 69 64 5f 64 65 66 28 64 | 63 6c 74 6f 72 2c 20 69 |id_def(d|cltor, i|
|00002c90| 6e 69 74 29 0d 73 74 72 | 75 63 74 20 6e 6f 64 65 |nit).str|uct node|
|00002ca0| 20 2a 64 63 6c 74 6f 72 | 3b 0d 73 74 72 75 63 74 | *dcltor|;.struct|
|00002cb0| 20 6e 6f 64 65 20 2a 69 | 6e 69 74 3b 0d 20 20 20 | node *i|nit;. |
|00002cc0| 7b 0d 20 20 20 73 74 72 | 75 63 74 20 6e 6f 64 65 |{. str|uct node|
|00002cd0| 20 2a 63 68 6c 64 30 2c | 20 2a 63 68 6c 64 31 3b | *chld0,| *chld1;|
|00002ce0| 0d 20 20 20 73 74 72 75 | 63 74 20 73 79 6d 5f 65 |. stru|ct sym_e|
|00002cf0| 6e 74 72 79 20 2a 73 79 | 6d 3b 0d 0d 20 20 20 69 |ntry *sy|m;.. i|
|00002d00| 66 20 28 64 63 6c 5f 73 | 74 6b 2d 3e 70 61 72 6d |f (dcl_s|tk->parm|
|00002d10| 73 5f 64 6f 6e 65 29 0d | 20 20 20 20 20 20 70 6f |s_done).| po|
|00002d20| 70 5f 63 6e 74 78 74 28 | 29 3b 0d 0d 20 20 20 2f |p_cntxt(|);.. /|
|00002d30| 2a 0d 20 20 20 20 2a 20 | 4c 6f 6f 6b 20 69 6e 20 |*. * |Look in |
|00002d40| 74 68 65 20 64 65 63 6c | 61 72 61 74 69 6f 6e 20 |the decl|aration |
|00002d50| 63 6f 6e 74 65 78 74 20 | 28 74 68 65 20 74 6f 70 |context |(the top|
|00002d60| 20 6f 66 20 74 68 65 20 | 64 65 63 6c 61 72 61 74 | of the |declarat|
|00002d70| 69 6f 6e 20 73 74 61 63 | 6b 29 0d 20 20 20 20 2a |ion stac|k). *|
|00002d80| 20 20 74 6f 20 73 65 65 | 20 69 66 20 74 68 69 73 | to see| if this|
|00002d90| 20 69 73 20 61 20 74 65 | 6e 64 65 64 20 64 65 63 | is a te|nded dec|
|00002da0| 6c 61 72 61 74 69 6f 6e | 2e 0d 20 20 20 20 2a 2f |laration|.. */|
|00002db0| 0d 20 20 20 73 77 69 74 | 63 68 20 28 64 63 6c 5f |. swit|ch (dcl_|
|00002dc0| 73 74 6b 2d 3e 6b 69 6e | 64 5f 64 63 6c 29 20 7b |stk->kin|d_dcl) {|
|00002dd0| 0d 20 20 20 20 20 20 63 | 61 73 65 20 54 6e 64 44 |. c|ase TndD|
|00002de0| 65 73 63 3a 0d 20 20 20 | 20 20 20 63 61 73 65 20 |esc:. | case |
|00002df0| 54 6e 64 53 74 72 3a 0d | 20 20 20 20 20 20 63 61 |TndStr:.| ca|
|00002e00| 73 65 20 54 6e 64 42 6c | 6b 3a 0d 20 20 20 20 20 |se TndBl|k:. |
|00002e10| 20 20 20 20 2f 2a 0d 20 | 20 20 20 20 20 20 20 20 | /*. | |
|00002e20| 20 2a 20 54 65 6e 64 65 | 64 20 76 61 72 69 61 62 | * Tende|d variab|
|00002e30| 6c 65 73 20 61 72 65 20 | 65 69 74 68 65 72 20 73 |les are |either s|
|00002e40| 69 6d 70 6c 65 20 69 64 | 65 6e 74 69 66 69 65 72 |imple id|entifier|
|00002e50| 73 20 6f 72 20 70 6f 69 | 6e 74 65 72 73 20 74 6f |s or poi|nters to|
|00002e60| 20 0d 20 20 20 20 20 20 | 20 20 20 20 2a 20 20 73 | . | * s|
|00002e70| 69 6d 70 6c 65 20 69 64 | 65 6e 74 69 66 69 65 72 |imple id|entifier|
|00002e80| 73 2e 0d 20 20 20 20 20 | 20 20 20 20 20 2a 2f 0d |s.. | */.|
|00002e90| 20 20 20 20 20 20 20 20 | 20 63 68 6c 64 30 20 3d | | chld0 =|
|00002ea0| 20 64 63 6c 74 6f 72 2d | 3e 75 5b 30 5d 2e 63 68 | dcltor-|>u[0].ch|
|00002eb0| 69 6c 64 3b 0d 20 20 20 | 20 20 20 20 20 20 63 68 |ild;. | ch|
|00002ec0| 6c 64 31 20 3d 20 64 63 | 6c 74 6f 72 2d 3e 75 5b |ld1 = dc|ltor->u[|
|00002ed0| 31 5d 2e 63 68 69 6c 64 | 3b 0d 20 20 20 20 20 20 |1].child|;. |
|00002ee0| 20 20 20 69 66 20 28 63 | 68 6c 64 31 2d 3e 6e 64 | if (c|hld1->nd|
|00002ef0| 5f 69 64 20 21 3d 20 50 | 72 69 6d 72 79 4e 64 20 |_id != P|rimryNd |
|00002f00| 7c 7c 20 28 63 68 6c 64 | 31 2d 3e 74 6f 6b 2d 3e ||| (chld|1->tok->|
|00002f10| 74 6f 6b 5f 69 64 20 21 | 3d 20 49 64 65 6e 74 69 |tok_id !|= Identi|
|00002f20| 66 69 65 72 20 26 26 0d | 20 20 20 20 20 20 20 20 |fier &&.| |
|00002f30| 20 20 20 63 68 6c 64 31 | 2d 3e 74 6f 6b 2d 3e 74 | chld1|->tok->t|
|00002f40| 6f 6b 5f 69 64 20 21 3d | 20 54 79 70 65 44 65 66 |ok_id !=| TypeDef|
|00002f50| 4e 61 6d 65 29 29 0d 20 | 20 20 20 20 20 20 20 20 |Name)). | |
|00002f60| 20 20 20 20 65 72 72 74 | 31 28 63 68 6c 64 31 2d | errt|1(chld1-|
|00002f70| 3e 74 6f 6b 2c 20 22 75 | 6e 73 75 70 70 6f 72 74 |>tok, "u|nsupport|
|00002f80| 65 64 20 74 65 6e 64 65 | 64 20 64 65 63 6c 61 72 |ed tende|d declar|
|00002f90| 61 74 69 6f 6e 22 29 3b | 0d 20 20 20 20 20 20 20 |ation");|. |
|00002fa0| 20 20 69 66 20 28 64 63 | 6c 5f 73 74 6b 2d 3e 6b | if (dc|l_stk->k|
|00002fb0| 69 6e 64 5f 64 63 6c 20 | 3d 3d 20 54 6e 64 44 65 |ind_dcl |== TndDe|
|00002fc0| 73 63 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |sc) {. | |
|00002fd0| 20 20 2f 2a 0d 20 20 20 | 20 20 20 20 20 20 20 20 | /*. | |
|00002fe0| 20 20 2a 20 44 65 63 6c | 61 72 65 64 20 61 73 20 | * Decl|ared as |
|00002ff0| 66 75 6c 6c 20 74 65 6e | 64 65 64 20 64 65 73 63 |full ten|ded desc|
|00003000| 72 69 70 74 6f 72 20 2d | 20 6d 75 73 74 20 6e 6f |riptor -| must no|
|00003010| 74 20 62 65 20 61 20 70 | 6f 69 6e 74 65 72 2e 0d |t be a p|ointer..|
|00003020| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 2f 0d | | */.|
|00003030| 20 20 20 20 20 20 20 20 | 20 20 20 20 69 66 20 28 | | if (|
|00003040| 63 68 6c 64 30 20 21 3d | 20 4e 55 4c 4c 29 0d 20 |chld0 !=| NULL). |
|00003050| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 65 72 | | er|
|00003060| 72 74 31 28 63 68 6c 64 | 31 2d 3e 74 6f 6b 2c 20 |rt1(chld|1->tok, |
|00003070| 22 75 6e 73 75 70 70 6f | 72 74 65 64 20 74 65 6e |"unsuppo|rted ten|
|00003080| 64 65 64 20 64 65 63 6c | 61 72 61 74 69 6f 6e 22 |ded decl|aration"|
|00003090| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 7d |);. | }|
|000030a0| 0d 20 20 20 20 20 20 20 | 20 20 65 6c 73 65 20 7b |. | else {|
|000030b0| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 2f 2a 0d |. | /*.|
|000030c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 20 4d | | * M|
|000030d0| 75 73 74 20 62 65 20 61 | 20 74 65 6e 64 65 64 20 |ust be a| tended |
|000030e0| 70 6f 69 6e 74 65 72 2e | 0d 20 20 20 20 20 20 20 |pointer.|. |
|000030f0| 20 20 20 20 20 20 2a 2f | 0d 20 20 20 20 20 20 20 | */|. |
|00003100| 20 20 20 20 20 69 66 20 | 28 63 68 6c 64 30 20 3d | if |(chld0 =|
|00003110| 3d 20 4e 55 4c 4c 20 7c | 7c 20 63 68 6c 64 30 2d |= NULL ||| chld0-|
|00003120| 3e 6e 64 5f 69 64 20 21 | 3d 20 50 72 69 6d 72 79 |>nd_id !|= Primry|
|00003130| 4e 64 29 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |Nd). | |
|00003140| 20 20 20 65 72 72 74 31 | 28 63 68 6c 64 31 2d 3e | errt1|(chld1->|
|00003150| 74 6f 6b 2c 20 22 75 6e | 73 75 70 70 6f 72 74 65 |tok, "un|supporte|
|00003160| 64 20 74 65 6e 64 65 64 | 20 64 65 63 6c 61 72 61 |d tended| declara|
|00003170| 74 69 6f 6e 22 29 3b 0d | 20 20 20 20 20 20 20 20 |tion");.| |
|00003180| 20 20 20 20 7d 0d 20 20 | 20 0d 20 20 20 20 20 20 | }. | . |
|00003190| 20 20 20 2f 2a 0d 20 20 | 20 20 20 20 20 20 20 20 | /*. | |
|000031a0| 2a 20 54 68 69 73 20 69 | 73 20 61 20 6c 65 67 61 |* This i|s a lega|
|000031b0| 6c 20 74 65 6e 64 65 64 | 20 64 65 63 6c 61 72 61 |l tended| declara|
|000031c0| 74 69 6f 6e 2c 20 6d 61 | 6b 65 20 61 20 73 79 6d |tion, ma|ke a sym|
|000031d0| 62 6f 6c 20 74 61 62 6c | 65 20 65 6e 74 72 79 0d |bol tabl|e entry.|
|000031e0| 20 20 20 20 20 20 20 20 | 20 20 2a 20 20 66 6f 72 | | * for|
|000031f0| 20 69 74 20 61 6e 64 20 | 61 6c 6c 6f 63 61 74 65 | it and |allocate|
|00003200| 64 20 61 20 74 65 6e 64 | 65 64 20 73 6c 6f 74 2e |d a tend|ed slot.|
|00003210| 20 41 64 64 20 74 68 65 | 20 73 79 6d 62 6f 6c 20 | Add the| symbol |
|00003220| 74 61 62 6c 65 0d 20 20 | 20 20 20 20 20 20 20 20 |table. | |
|00003230| 2a 20 20 65 6e 74 72 79 | 20 74 6f 20 74 68 65 20 |* entry| to the |
|00003240| 6c 69 73 74 20 6f 66 20 | 74 65 6e 64 65 64 20 76 |list of |tended v|
|00003250| 61 72 69 61 62 6c 65 73 | 20 69 6e 20 74 68 69 73 |ariables| in this|
|00003260| 20 63 6f 6e 74 65 78 74 | 2e 0d 20 20 20 20 20 20 | context|.. |
|00003270| 20 20 20 20 2a 2f 0d 20 | 20 20 20 20 20 20 20 20 | */. | |
|00003280| 73 79 6d 20 3d 20 73 79 | 6d 5f 61 64 64 28 49 64 |sym = sy|m_add(Id|
|00003290| 65 6e 74 69 66 69 65 72 | 2c 20 63 68 6c 64 31 2d |entifier|, chld1-|
|000032a0| 3e 74 6f 6b 2d 3e 69 6d | 61 67 65 2c 20 64 63 6c |>tok->im|age, dcl|
|000032b0| 5f 73 74 6b 2d 3e 6b 69 | 6e 64 5f 64 63 6c 2c 0d |_stk->ki|nd_dcl,.|
|000032c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 64 63 6c 5f | | dcl_|
|000032d0| 73 74 6b 2d 3e 6e 65 73 | 74 5f 6c 76 6c 29 3b 0d |stk->nes|t_lvl);.|
|000032e0| 20 20 20 20 20 20 20 20 | 20 69 66 20 28 73 79 6d | | if (sym|
|000032f0| 20 3d 3d 20 4e 55 4c 4c | 29 0d 20 20 20 20 20 20 | == NULL|). |
|00003300| 20 20 20 20 20 20 65 72 | 72 74 32 28 63 68 6c 64 | er|rt2(chld|
|00003310| 31 2d 3e 74 6f 6b 2c 20 | 22 72 65 64 65 66 69 6e |1->tok, |"redefin|
|00003320| 69 74 69 6f 6e 20 6f 66 | 20 22 2c 20 63 68 6c 64 |ition of| ", chld|
|00003330| 31 2d 3e 74 6f 6b 2d 3e | 69 6d 61 67 65 29 3b 0d |1->tok->|image);.|
|00003340| 20 20 20 20 20 20 20 20 | 20 73 79 6d 2d 3e 75 2e | | sym->u.|
|00003350| 74 6e 64 5f 76 61 72 2e | 62 6c 6b 5f 6e 61 6d 65 |tnd_var.|blk_name|
|00003360| 20 3d 20 64 63 6c 5f 73 | 74 6b 2d 3e 62 6c 6b 5f | = dcl_s|tk->blk_|
|00003370| 6e 61 6d 65 3b 0d 20 20 | 20 20 20 20 20 20 20 73 |name;. | s|
|00003380| 79 6d 2d 3e 75 2e 74 6e | 64 5f 76 61 72 2e 69 6e |ym->u.tn|d_var.in|
|00003390| 69 74 20 3d 20 69 6e 69 | 74 3b 0d 20 20 20 20 20 |it = ini|t;. |
|000033a0| 20 20 20 20 73 79 6d 2d | 3e 74 5f 69 6e 64 78 20 | sym-|>t_indx |
|000033b0| 3d 20 61 6c 6c 6f 63 5f | 74 6e 64 28 64 63 6c 5f |= alloc_|tnd(dcl_|
|000033c0| 73 74 6b 2d 3e 6b 69 6e | 64 5f 64 63 6c 2c 20 69 |stk->kin|d_dcl, i|
|000033d0| 6e 69 74 2c 20 64 63 6c | 5f 73 74 6b 2d 3e 6e 65 |nit, dcl|_stk->ne|
|000033e0| 73 74 5f 6c 76 6c 29 3b | 0d 20 20 20 20 20 20 20 |st_lvl);|. |
|000033f0| 20 20 73 79 6d 2d 3e 75 | 2e 74 6e 64 5f 76 61 72 | sym->u|.tnd_var|
|00003400| 2e 6e 65 78 74 20 3d 20 | 64 63 6c 5f 73 74 6b 2d |.next = |dcl_stk-|
|00003410| 3e 74 65 6e 64 65 64 3b | 0d 20 20 20 20 20 20 20 |>tended;|. |
|00003420| 20 20 64 63 6c 5f 73 74 | 6b 2d 3e 74 65 6e 64 65 | dcl_st|k->tende|
|00003430| 64 20 3d 20 73 79 6d 3b | 0d 20 20 20 20 20 20 20 |d = sym;|. |
|00003440| 20 20 2b 2b 73 79 6d 2d | 3e 72 65 66 5f 63 6e 74 | ++sym-|>ref_cnt|
|00003450| 3b 0d 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 |;. | retur|
|00003460| 6e 3b 0d 20 20 20 20 20 | 20 64 65 66 61 75 6c 74 |n;. | default|
|00003470| 3a 0d 20 20 20 20 20 20 | 20 20 20 61 64 64 5f 64 |:. | add_d|
|00003480| 65 66 28 64 63 6c 74 6f | 72 29 3b 20 2f 2a 20 6f |ef(dclto|r); /* o|
|00003490| 72 64 69 6e 61 72 79 20 | 64 65 63 6c 61 72 61 74 |rdinary |declarat|
|000034a0| 69 6f 6e 20 2a 2f 0d 20 | 20 20 20 20 20 7d 0d 20 |ion */. | }. |
|000034b0| 20 20 7d 0d 0d 2f 2a 0d | 20 2a 20 66 75 6e 63 5f | }../*.| * func_|
|000034c0| 64 65 66 20 2d 20 61 20 | 66 75 6e 63 74 69 6f 6e |def - a |function|
|000034d0| 20 68 65 61 64 65 72 20 | 68 61 73 20 62 65 65 6e | header |has been|
|000034e0| 20 70 61 72 73 65 64 2e | 20 41 64 64 20 74 68 65 | parsed.| Add the|
|000034f0| 20 69 64 65 6e 74 69 66 | 69 65 72 20 66 6f 72 0d | identif|ier for.|
|00003500| 20 2a 20 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e | * the |function|
|00003510| 20 74 6f 20 74 68 65 20 | 73 79 6d 62 6f 6c 20 74 | to the |symbol t|
|00003520| 61 62 6c 65 2e 0d 20 2a | 2f 0d 6e 6f 76 61 6c 75 |able.. *|/.novalu|
|00003530| 65 20 66 75 6e 63 5f 64 | 65 66 28 68 65 61 64 29 |e func_d|ef(head)|
|00003540| 0d 73 74 72 75 63 74 20 | 6e 6f 64 65 20 2a 68 65 |.struct |node *he|
|00003550| 61 64 3b 0d 20 20 20 7b | 0d 20 20 20 2f 2a 0d 20 |ad;. {|. /*. |
|00003560| 20 20 20 2a 20 49 66 20 | 74 68 69 73 20 69 73 20 | * If |this is |
|00003570| 72 65 61 6c 6c 79 20 61 | 20 66 75 6e 63 74 69 6f |really a| functio|
|00003580| 6e 20 68 65 61 64 65 72 | 2c 20 74 68 65 20 63 75 |n header|, the cu|
|00003590| 72 72 65 6e 74 20 64 65 | 63 6c 61 72 61 74 69 6f |rrent de|claratio|
|000035a0| 6e 0d 20 20 20 20 2a 20 | 20 63 6f 6e 74 65 78 74 |n. * | context|
|000035b0| 20 69 6e 64 69 63 61 74 | 65 73 20 74 68 61 74 20 | indicat|es that |
|000035c0| 61 20 70 61 72 61 6d 65 | 74 65 72 20 6c 69 73 74 |a parame|ter list|
|000035d0| 20 68 61 73 20 62 65 65 | 6e 20 63 6f 6d 70 6c 65 | has bee|n comple|
|000035e0| 74 65 64 2e 0d 20 20 20 | 20 2a 20 20 50 61 72 61 |ted.. | * Para|
|000035f0| 6d 65 74 65 72 20 6c 69 | 73 74 73 20 61 74 20 6f |meter li|sts at o|
|00003600| 74 68 65 72 20 74 68 61 | 6e 20 61 74 20 6e 65 73 |ther tha|n at nes|
|00003610| 74 69 6e 67 20 6c 65 76 | 65 6c 20 32 20 61 72 65 |ting lev|el 2 are|
|00003620| 20 70 61 72 74 20 6f 66 | 0d 20 20 20 20 2a 20 20 | part of|. * |
|00003630| 6e 65 73 74 65 64 20 64 | 65 63 6c 61 72 61 74 69 |nested d|eclarati|
|00003640| 6f 6e 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 61 |on infor|mation a|
|00003650| 6e 64 20 64 6f 20 6e 6f | 74 20 73 68 6f 77 20 75 |nd do no|t show u|
|00003660| 70 20 68 65 72 65 2e 20 | 54 68 65 0d 20 20 20 20 |p here. |The. |
|00003670| 2a 20 20 66 75 6e 63 74 | 69 6f 6e 20 70 61 72 61 |* funct|ion para|
|00003680| 6d 65 74 65 72 73 20 6d | 75 73 74 20 72 65 6d 61 |meters m|ust rema|
|00003690| 69 6e 20 69 6e 20 74 68 | 65 20 73 79 6d 62 6f 6c |in in th|e symbol|
|000036a0| 20 74 61 62 6c 65 2c 20 | 73 6f 20 74 68 65 0d 20 | table, |so the. |
|000036b0| 20 20 20 2a 20 20 63 6f | 6e 74 65 78 74 20 69 73 | * co|ntext is|
|000036c0| 20 6a 75 73 74 20 75 70 | 64 61 74 65 64 2c 20 6e | just up|dated, n|
|000036d0| 6f 74 20 70 6f 70 70 65 | 64 2e 0d 20 20 20 20 2a |ot poppe|d.. *|
|000036e0| 2f 0d 20 20 20 69 66 20 | 28 21 64 63 6c 5f 73 74 |/. if |(!dcl_st|
|000036f0| 6b 2d 3e 70 61 72 6d 73 | 5f 64 6f 6e 65 29 0d 20 |k->parms|_done). |
|00003700| 20 20 20 20 20 79 79 65 | 72 72 6f 72 28 22 69 6e | yye|rror("in|
|00003710| 76 61 6c 69 64 20 64 65 | 63 6c 61 72 61 74 69 6f |valid de|claratio|
|00003720| 6e 22 29 3b 0d 20 20 20 | 64 63 6c 5f 73 74 6b 2d |n");. |dcl_stk-|
|00003730| 3e 70 61 72 6d 73 5f 64 | 6f 6e 65 20 3d 20 30 3b |>parms_d|one = 0;|
|00003740| 0d 20 20 20 69 66 20 28 | 64 63 6c 5f 73 74 6b 2d |. if (|dcl_stk-|
|00003750| 3e 6e 65 78 74 2d 3e 6b | 69 6e 64 5f 64 63 6c 20 |>next->k|ind_dcl |
|00003760| 3d 3d 20 49 73 54 79 70 | 65 64 65 66 29 0d 20 20 |== IsTyp|edef). |
|00003770| 20 20 20 20 79 79 65 72 | 72 6f 72 28 22 61 20 74 | yyer|ror("a t|
|00003780| 79 70 65 64 65 66 20 6d | 61 79 20 6e 6f 74 20 62 |ypedef m|ay not b|
|00003790| 65 20 61 20 66 75 6e 63 | 74 69 6f 6e 20 64 65 66 |e a func|tion def|
|000037a0| 69 6e 69 74 69 6f 6e 22 | 29 3b 0d 20 20 20 61 64 |inition"|);. ad|
|000037b0| 64 5f 64 65 66 28 68 65 | 61 64 2d 3e 75 5b 31 5d |d_def(he|ad->u[1]|
|000037c0| 2e 63 68 69 6c 64 29 3b | 0d 20 20 20 7d 0d 0d 2f |.child);|. }../|
|000037d0| 2a 0d 20 2a 20 73 5f 70 | 72 6d 5f 64 65 66 20 2d |*. * s_p|rm_def -|
|000037e0| 20 61 64 64 20 73 79 6d | 62 6f 6c 20 74 61 62 6c | add sym|bol tabl|
|000037f0| 65 20 65 6e 74 72 69 65 | 73 20 66 6f 72 20 61 20 |e entrie|s for a |
|00003800| 70 61 72 61 6d 65 74 65 | 72 20 74 6f 20 61 6e 20 |paramete|r to an |
|00003810| 6f 70 65 72 61 74 69 6f | 6e 2e 0d 20 2a 20 20 55 |operatio|n.. * U|
|00003820| 6e 64 65 72 65 66 65 72 | 65 6e 63 65 64 20 61 6e |nderefer|enced an|
|00003830| 64 2f 6f 72 20 64 65 72 | 65 66 65 72 65 6e 63 65 |d/or der|eference|
|00003840| 64 20 76 65 72 73 69 6f | 6e 73 20 6f 66 20 74 68 |d versio|ns of th|
|00003850| 65 20 70 61 72 61 6d 65 | 74 65 72 20 6d 61 79 20 |e parame|ter may |
|00003860| 62 65 0d 20 2a 20 20 73 | 70 65 63 69 66 69 65 64 |be. * s|pecified|
|00003870| 2e 0d 20 2a 2f 0d 6e 6f | 76 61 6c 75 65 20 73 5f |.. */.no|value s_|
|00003880| 70 72 6d 5f 64 65 66 28 | 75 5f 69 64 65 6e 74 2c |prm_def(|u_ident,|
|00003890| 20 64 5f 69 64 65 6e 74 | 29 0d 73 74 72 75 63 74 | d_ident|).struct|
|000038a0| 20 74 6f 6b 65 6e 20 2a | 75 5f 69 64 65 6e 74 3b | token *|u_ident;|
|000038b0| 0d 73 74 72 75 63 74 20 | 74 6f 6b 65 6e 20 2a 64 |.struct |token *d|
|000038c0| 5f 69 64 65 6e 74 3b 0d | 20 20 20 7b 0d 20 20 20 |_ident;.| {. |
|000038d0| 69 6e 74 20 70 61 72 61 | 6d 5f 6e 75 6d 3b 0d 0d |int para|m_num;..|
|000038e0| 20 20 20 69 66 20 28 70 | 61 72 61 6d 73 20 3d 3d | if (p|arams ==|
|000038f0| 20 4e 55 4c 4c 29 0d 20 | 20 20 20 20 20 70 61 72 | NULL). | par|
|00003900| 61 6d 5f 6e 75 6d 20 3d | 20 30 3b 0d 20 20 20 65 |am_num =| 0;. e|
|00003910| 6c 73 65 0d 20 20 20 20 | 20 20 70 61 72 61 6d 5f |lse. | param_|
|00003920| 6e 75 6d 20 3d 20 70 61 | 72 61 6d 73 2d 3e 75 2e |num = pa|rams->u.|
|00003930| 70 61 72 61 6d 5f 69 6e | 66 6f 2e 70 61 72 61 6d |param_in|fo.param|
|00003940| 5f 6e 75 6d 20 2b 20 31 | 3b 0d 20 20 20 69 66 20 |_num + 1|;. if |
|00003950| 28 75 5f 69 64 65 6e 74 | 20 21 3d 20 4e 55 4c 4c |(u_ident| != NULL|
|00003960| 29 0d 20 20 20 20 20 20 | 61 64 64 5f 73 5f 70 72 |). |add_s_pr|
|00003970| 6d 28 75 5f 69 64 65 6e | 74 2c 20 70 61 72 61 6d |m(u_iden|t, param|
|00003980| 5f 6e 75 6d 2c 20 52 74 | 50 61 72 6d 29 3b 0d 20 |_num, Rt|Parm);. |
|00003990| 20 20 69 66 20 28 64 5f | 69 64 65 6e 74 20 21 3d | if (d_|ident !=|
|000039a0| 20 4e 55 4c 4c 29 0d 20 | 20 20 20 20 20 61 64 64 | NULL). | add|
|000039b0| 5f 73 5f 70 72 6d 28 64 | 5f 69 64 65 6e 74 2c 20 |_s_prm(d|_ident, |
|000039c0| 70 61 72 61 6d 5f 6e 75 | 6d 2c 20 44 72 66 50 72 |param_nu|m, DrfPr|
|000039d0| 6d 29 3b 0d 20 20 20 7d | 0d 0d 2f 2a 0d 20 2a 20 |m);. }|../*. * |
|000039e0| 61 64 64 5f 73 5f 70 72 | 6d 20 2d 20 61 64 64 20 |add_s_pr|m - add |
|000039f0| 61 20 73 79 6d 62 6f 6c | 20 74 61 62 6c 65 20 65 |a symbol| table e|
|00003a00| 6e 74 72 79 20 66 6f 72 | 20 65 69 74 68 65 72 20 |ntry for| either |
|00003a10| 61 20 64 65 72 65 66 65 | 72 65 6e 63 65 64 20 6f |a derefe|renced o|
|00003a20| 72 0d 20 2a 20 20 75 6e | 64 65 72 65 66 65 72 65 |r. * un|derefere|
|00003a30| 6e 63 65 64 20 76 65 72 | 73 69 6f 6e 20 6f 66 20 |nced ver|sion of |
|00003a40| 61 20 70 61 72 61 6d 65 | 74 65 72 2e 20 50 75 74 |a parame|ter. Put|
|00003a50| 20 69 74 20 6f 6e 20 74 | 68 65 20 63 75 72 72 65 | it on t|he curre|
|00003a60| 6e 74 0d 20 2a 20 20 6c | 69 73 74 20 6f 66 20 70 |nt. * l|ist of p|
|00003a70| 61 72 61 6d 65 74 65 72 | 73 2e 0d 20 2a 2f 0d 73 |arameter|s.. */.s|
|00003a80| 74 61 74 69 63 20 6e 6f | 76 61 6c 75 65 20 61 64 |tatic no|value ad|
|00003a90| 64 5f 73 5f 70 72 6d 28 | 69 64 65 6e 74 2c 20 70 |d_s_prm(|ident, p|
|00003aa0| 61 72 61 6d 5f 6e 75 6d | 2c 20 66 6c 61 67 73 29 |aram_num|, flags)|
|00003ab0| 0d 73 74 72 75 63 74 20 | 74 6f 6b 65 6e 20 2a 69 |.struct |token *i|
|00003ac0| 64 65 6e 74 3b 0d 69 6e | 74 20 70 61 72 61 6d 5f |dent;.in|t param_|
|00003ad0| 6e 75 6d 3b 0d 69 6e 74 | 20 66 6c 61 67 73 3b 0d |num;.int| flags;.|
|00003ae0| 20 20 20 7b 0d 20 20 20 | 73 74 72 75 63 74 20 73 | {. |struct s|
|00003af0| 79 6d 5f 65 6e 74 72 79 | 20 2a 73 79 6d 3b 0d 0d |ym_entry| *sym;..|
|00003b00| 20 20 20 73 79 6d 20 3d | 20 73 79 6d 5f 61 64 64 | sym =| sym_add|
|00003b10| 28 49 64 65 6e 74 69 66 | 69 65 72 2c 20 69 64 65 |(Identif|ier, ide|
|00003b20| 6e 74 2d 3e 69 6d 61 67 | 65 2c 20 66 6c 61 67 73 |nt->imag|e, flags|
|00003b30| 2c 20 64 63 6c 5f 73 74 | 6b 2d 3e 6e 65 73 74 5f |, dcl_st|k->nest_|
|00003b40| 6c 76 6c 29 3b 0d 20 20 | 20 69 66 20 28 73 79 6d |lvl);. | if (sym|
|00003b50| 20 3d 3d 20 4e 55 4c 4c | 29 0d 20 20 20 20 20 20 | == NULL|). |
|00003b60| 65 72 72 74 32 28 69 64 | 65 6e 74 2c 20 22 72 65 |errt2(id|ent, "re|
|00003b70| 64 65 66 69 6e 69 74 69 | 6f 6e 20 6f 66 20 22 2c |definiti|on of ",|
|00003b80| 20 69 64 65 6e 74 2d 3e | 69 6d 61 67 65 29 3b 0d | ident->|image);.|
|00003b90| 20 20 20 73 79 6d 2d 3e | 75 2e 70 61 72 61 6d 5f | sym->|u.param_|
|00003ba0| 69 6e 66 6f 2e 70 61 72 | 61 6d 5f 6e 75 6d 20 3d |info.par|am_num =|
|00003bb0| 20 70 61 72 61 6d 5f 6e | 75 6d 3b 0d 20 20 20 73 | param_n|um;. s|
|00003bc0| 79 6d 2d 3e 75 2e 70 61 | 72 61 6d 5f 69 6e 66 6f |ym->u.pa|ram_info|
|00003bd0| 2e 6e 6f 6e 5f 74 65 6e | 64 20 3d 20 30 3b 0d 20 |.non_ten|d = 0;. |
|00003be0| 20 20 73 79 6d 2d 3e 75 | 2e 70 61 72 61 6d 5f 69 | sym->u|.param_i|
|00003bf0| 6e 66 6f 2e 63 75 72 5f | 6c 6f 63 20 3d 20 50 72 |nfo.cur_|loc = Pr|
|00003c00| 6d 54 65 6e 64 3b 0d 20 | 20 20 73 79 6d 2d 3e 75 |mTend;. | sym->u|
|00003c10| 2e 70 61 72 61 6d 5f 69 | 6e 66 6f 2e 70 61 72 6d |.param_i|nfo.parm|
|00003c20| 5f 6d 6f 64 20 3d 20 30 | 3b 0d 20 20 20 73 79 6d |_mod = 0|;. sym|
|00003c30| 2d 3e 75 2e 70 61 72 61 | 6d 5f 69 6e 66 6f 2e 6e |->u.para|m_info.n|
|00003c40| 65 78 74 20 3d 20 70 61 | 72 61 6d 73 3b 0d 20 20 |ext = pa|rams;. |
|00003c50| 20 73 79 6d 2d 3e 69 6c | 5f 69 6e 64 78 20 3d 20 | sym->il|_indx = |
|00003c60| 69 6c 5f 69 6e 64 78 2b | 2b 3b 0d 20 20 20 70 61 |il_indx+|+;. pa|
|00003c70| 72 61 6d 73 20 3d 20 73 | 79 6d 3b 0d 20 20 20 2b |rams = s|ym;. +|
|00003c80| 2b 73 79 6d 2d 3e 72 65 | 66 5f 63 6e 74 3b 0d 20 |+sym->re|f_cnt;. |
|00003c90| 20 20 7d 0d 0d 2f 2a 0d | 20 2a 20 76 61 72 5f 61 | }../*.| * var_a|
|00003ca0| 72 67 73 20 2d 20 61 20 | 76 61 72 69 61 62 6c 65 |rgs - a |variable|
|00003cb0| 20 6c 65 6e 67 74 68 20 | 70 61 72 61 6d 65 74 65 | length |paramete|
|00003cc0| 72 20 6c 69 73 74 20 66 | 6f 72 20 61 6e 20 6f 70 |r list f|or an op|
|00003cd0| 65 72 61 74 69 6f 6e 20 | 69 73 20 70 61 72 73 65 |eration |is parse|
|00003ce0| 64 2e 0d 20 2a 2f 0d 6e | 6f 76 61 6c 75 65 20 76 |d.. */.n|ovalue v|
|00003cf0| 61 72 5f 61 72 67 73 28 | 69 64 65 6e 74 29 0d 73 |ar_args(|ident).s|
|00003d00| 74 72 75 63 74 20 74 6f | 6b 65 6e 20 2a 69 64 65 |truct to|ken *ide|
|00003d10| 6e 74 3b 0d 20 20 20 7b | 0d 20 20 20 73 74 72 75 |nt;. {|. stru|
|00003d20| 63 74 20 73 79 6d 5f 65 | 6e 74 72 79 20 2a 73 79 |ct sym_e|ntry *sy|
|00003d30| 6d 3b 0d 0d 20 20 20 2f | 2a 0d 20 20 20 20 2a 20 |m;.. /|*. * |
|00003d40| 54 68 65 20 6c 61 73 74 | 20 70 61 72 61 6d 65 74 |The last| paramet|
|00003d50| 65 72 20 70 72 6f 63 65 | 73 73 65 64 20 72 65 70 |er proce|ssed rep|
|00003d60| 72 65 73 65 6e 74 73 20 | 74 68 65 20 76 61 72 69 |resents |the vari|
|00003d70| 61 62 6c 65 20 70 61 72 | 74 20 6f 66 20 74 68 65 |able par|t of the|
|00003d80| 20 6c 69 73 74 3b 0d 20 | 20 20 20 2a 20 20 75 70 | list;. | * up|
|00003d90| 64 61 74 65 20 74 68 65 | 20 73 79 6d 62 6f 6c 20 |date the| symbol |
|00003da0| 74 61 62 6c 65 20 65 6e | 74 72 79 2e 20 49 74 20 |table en|try. It |
|00003db0| 6d 61 79 20 62 65 20 64 | 65 72 65 66 65 72 65 6e |may be d|ereferen|
|00003dc0| 63 65 64 20 6f 72 20 75 | 6e 64 65 72 65 66 65 72 |ced or u|nderefer|
|00003dd0| 65 6e 63 65 64 0d 20 20 | 20 20 2a 20 20 62 75 74 |enced. | * but|
|00003de0| 20 6e 6f 74 20 62 6f 74 | 68 2e 0d 20 20 20 20 2a | not bot|h.. *|
|00003df0| 2f 0d 20 20 20 73 79 6d | 20 3d 20 70 61 72 61 6d |/. sym| = param|
|00003e00| 73 2d 3e 75 2e 70 61 72 | 61 6d 5f 69 6e 66 6f 2e |s->u.par|am_info.|
|00003e10| 6e 65 78 74 3b 0d 20 20 | 20 69 66 20 28 73 79 6d |next;. | if (sym|
|00003e20| 20 21 3d 20 4e 55 4c 4c | 20 26 26 20 73 79 6d 2d | != NULL| && sym-|
|00003e30| 3e 75 2e 70 61 72 61 6d | 5f 69 6e 66 6f 2e 70 61 |>u.param|_info.pa|
|00003e40| 72 61 6d 5f 6e 75 6d 20 | 3d 3d 20 0d 20 20 20 20 |ram_num |== . |
|00003e50| 20 20 70 61 72 61 6d 73 | 2d 3e 75 2e 70 61 72 61 | params|->u.para|
|00003e60| 6d 5f 69 6e 66 6f 2e 70 | 61 72 61 6d 5f 6e 75 6d |m_info.p|aram_num|
|00003e70| 29 0d 20 20 20 20 20 20 | 20 20 20 65 72 72 74 31 |). | errt1|
|00003e80| 28 69 64 65 6e 74 2c 20 | 22 6f 6e 6c 79 20 6f 6e |(ident, |"only on|
|00003e90| 65 20 76 65 72 73 69 6f | 6e 20 6f 66 20 76 61 72 |e versio|n of var|
|00003ea0| 69 61 62 6c 65 20 70 61 | 72 61 6d 65 74 65 72 20 |iable pa|rameter |
|00003eb0| 6c 69 73 74 20 61 6c 6c | 6f 77 65 64 22 29 3b 0d |list all|owed");.|
|00003ec0| 20 20 20 70 61 72 61 6d | 73 2d 3e 69 64 5f 74 79 | param|s->id_ty|
|00003ed0| 70 65 20 7c 3d 20 56 61 | 72 50 72 6d 3b 0d 0d 20 |pe |= Va|rPrm;.. |
|00003ee0| 20 20 2f 2a 0d 20 20 20 | 20 2a 20 41 64 64 20 74 | /*. | * Add t|
|00003ef0| 68 65 20 69 64 65 6e 74 | 69 66 69 65 72 20 66 6f |he ident|ifier fo|
|00003f00| 72 20 74 68 65 20 6c 65 | 6e 67 74 68 20 6f 66 20 |r the le|ngth of |
|00003f10| 74 68 65 20 76 61 72 69 | 61 62 6c 65 20 70 61 72 |the vari|able par|
|00003f20| 74 20 6f 66 20 74 68 65 | 20 6c 69 73 74 0d 20 20 |t of the| list. |
|00003f30| 20 20 2a 20 20 74 6f 20 | 74 68 65 20 73 79 6d 62 | * to |the symb|
|00003f40| 6f 6c 20 74 61 62 6c 65 | 2e 0d 20 20 20 20 2a 2f |ol table|.. */|
|00003f50| 0d 20 20 20 73 79 6d 20 | 3d 20 73 79 6d 5f 61 64 |. sym |= sym_ad|
|00003f60| 64 28 49 64 65 6e 74 69 | 66 69 65 72 2c 20 69 64 |d(Identi|fier, id|
|00003f70| 65 6e 74 2d 3e 69 6d 61 | 67 65 2c 20 56 41 72 67 |ent->ima|ge, VArg|
|00003f80| 4c 65 6e 2c 20 64 63 6c | 5f 73 74 6b 2d 3e 6e 65 |Len, dcl|_stk->ne|
|00003f90| 73 74 5f 6c 76 6c 29 3b | 0d 20 20 20 69 66 20 28 |st_lvl);|. if (|
|00003fa0| 73 79 6d 20 3d 3d 20 4e | 55 4c 4c 29 0d 20 20 20 |sym == N|ULL). |
|00003fb0| 20 20 20 65 72 72 74 32 | 28 69 64 65 6e 74 2c 20 | errt2|(ident, |
|00003fc0| 22 72 65 64 65 66 69 6e | 69 74 69 6f 6e 20 6f 66 |"redefin|ition of|
|00003fd0| 20 22 2c 20 69 64 65 6e | 74 2d 3e 69 6d 61 67 65 | ", iden|t->image|
|00003fe0| 29 3b 0d 20 20 20 73 79 | 6d 2d 3e 69 6c 5f 69 6e |);. sy|m->il_in|
|00003ff0| 64 78 20 3d 20 69 6c 5f | 69 6e 64 78 2b 2b 3b 0d |dx = il_|indx++;.|
|00004000| 20 20 20 76 5f 6c 65 6e | 20 3d 20 73 79 6d 3b 0d | v_len| = sym;.|
|00004010| 20 20 20 2b 2b 76 5f 6c | 65 6e 2d 3e 72 65 66 5f | ++v_l|en->ref_|
|00004020| 63 6e 74 3b 0d 20 20 20 | 7d 0d 0d 2f 2a 0d 20 2a |cnt;. |}../*. *|
|00004030| 20 64 5f 6c 73 74 5f 74 | 79 70 20 2d 20 74 68 65 | d_lst_t|yp - the|
|00004040| 20 65 6e 64 20 6f 66 20 | 61 20 22 64 65 63 6c 61 | end of |a "decla|
|00004050| 72 65 20 7b 2e 2e 2e 7d | 22 20 69 73 20 65 6e 63 |re {...}|" is enc|
|00004060| 6f 75 6e 74 65 72 65 64 | 2e 20 47 6f 20 74 68 72 |ountered|. Go thr|
|00004070| 6f 75 67 68 20 61 0d 20 | 2a 20 20 20 64 65 63 6c |ough a. |* decl|
|00004080| 61 72 61 74 69 6f 6e 20 | 6c 69 73 74 20 61 64 64 |aration |list add|
|00004090| 69 6e 67 20 73 74 6f 72 | 61 67 65 20 63 6c 61 73 |ing stor|age clas|
|000040a0| 73 2c 20 74 79 70 65 20 | 71 75 61 6c 69 66 69 65 |s, type |qualifie|
|000040b0| 72 2c 20 64 65 63 6c 61 | 72 61 74 6f 72 0d 20 2a |r, decla|rator. *|
|000040c0| 20 20 20 61 6e 64 20 69 | 6e 69 74 69 61 6c 69 7a | and i|nitializ|
|000040d0| 65 72 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 74 |er infor|mation t|
|000040e0| 6f 20 74 68 65 20 73 79 | 6d 62 6f 6c 20 74 61 62 |o the sy|mbol tab|
|000040f0| 6c 65 20 65 6e 74 72 79 | 20 66 6f 72 20 65 61 63 |le entry| for eac|
|00004100| 68 0d 20 2a 20 20 20 69 | 64 65 6e 74 69 66 69 65 |h. * i|dentifie|
|00004110| 72 2e 20 41 64 64 20 74 | 68 65 20 65 6e 74 72 79 |r. Add t|he entry|
|00004120| 20 6f 6e 74 6f 20 74 68 | 65 20 6c 69 73 74 20 61 | onto th|e list a|
|00004130| 73 73 6f 63 69 61 74 65 | 64 20 77 69 74 68 20 74 |ssociate|d with t|
|00004140| 68 65 20 22 64 65 63 6c | 61 72 65 22 0d 20 2a 2f |he "decl|are". */|
|00004150| 0d 6e 6f 76 61 6c 75 65 | 20 64 5f 6c 73 74 5f 74 |.novalue| d_lst_t|
|00004160| 79 70 28 64 63 6c 73 29 | 0d 73 74 72 75 63 74 20 |yp(dcls)|.struct |
|00004170| 6e 6f 64 65 20 2a 64 63 | 6c 73 3b 0d 20 20 20 7b |node *dc|ls;. {|
|00004180| 0d 20 20 20 69 66 20 28 | 64 63 6c 73 20 3d 3d 20 |. if (|dcls == |
|00004190| 4e 55 4c 4c 29 0d 20 20 | 20 20 20 20 72 65 74 75 |NULL). | retu|
|000041a0| 72 6e 3b 0d 20 20 20 66 | 6f 72 20 28 20 3b 20 64 |rn;. f|or ( ; d|
|000041b0| 63 6c 73 20 21 3d 20 4e | 55 4c 4c 20 26 26 20 64 |cls != N|ULL && d|
|000041c0| 63 6c 73 2d 3e 6e 64 5f | 69 64 20 3d 3d 20 4c 73 |cls->nd_|id == Ls|
|000041d0| 74 4e 64 3b 20 64 63 6c | 73 20 3d 20 64 63 6c 73 |tNd; dcl|s = dcls|
|000041e0| 2d 3e 75 5b 30 5d 2e 63 | 68 69 6c 64 29 0d 20 20 |->u[0].c|hild). |
|000041f0| 20 20 20 20 64 63 6c 5f | 74 79 70 28 64 63 6c 73 | dcl_|typ(dcls|
|00004200| 2d 3e 75 5b 31 5d 2e 63 | 68 69 6c 64 29 3b 0d 20 |->u[1].c|hild);. |
|00004210| 20 20 64 63 6c 5f 74 79 | 70 28 64 63 6c 73 29 3b | dcl_ty|p(dcls);|
|00004220| 0d 20 20 20 7d 0d 0d 2f | 2a 0d 20 2a 20 64 63 6c |. }../|*. * dcl|
|00004230| 5f 74 79 70 20 2d 20 67 | 6f 20 74 68 72 6f 75 67 |_typ - g|o throug|
|00004240| 68 20 74 68 65 20 64 65 | 63 6c 61 72 61 74 6f 72 |h the de|clarator|
|00004250| 73 20 6f 66 20 61 20 64 | 65 63 6c 61 72 61 74 69 |s of a d|eclarati|
|00004260| 6f 6e 20 61 64 64 69 6e | 67 20 74 68 65 20 73 74 |on addin|g the st|
|00004270| 6f 72 61 67 65 0d 20 2a | 20 20 20 63 6c 61 73 73 |orage. *| class|
|00004280| 2c 20 74 79 70 65 20 71 | 75 61 6c 69 66 69 65 72 |, type q|ualifier|
|00004290| 2c 20 64 65 63 6c 61 72 | 61 74 6f 72 2c 20 61 6e |, declar|ator, an|
|000042a0| 64 20 69 6e 69 74 69 61 | 6c 69 7a 65 72 20 69 6e |d initia|lizer in|
|000042b0| 66 6f 72 6d 61 74 69 6f | 6e 20 74 6f 20 74 68 65 |formatio|n to the|
|000042c0| 0d 20 2a 20 20 20 73 79 | 6d 62 6f 6c 20 74 61 62 |. * sy|mbol tab|
|000042d0| 6c 65 20 65 6e 74 72 79 | 20 6f 66 20 65 61 63 68 |le entry| of each|
|000042e0| 20 69 64 65 6e 74 69 66 | 69 65 72 2e 20 41 64 64 | identif|ier. Add|
|000042f0| 20 74 68 65 20 65 6e 74 | 72 79 20 6f 6e 74 6f 20 | the ent|ry onto |
|00004300| 74 68 65 20 6c 69 73 74 | 0d 20 2a 20 20 20 61 73 |the list|. * as|
|00004310| 73 6f 63 69 61 74 65 64 | 20 77 69 74 68 20 74 68 |sociated| with th|
|00004320| 65 20 63 75 72 72 65 6e | 74 20 22 64 65 63 6c 61 |e curren|t "decla|
|00004330| 72 65 20 7b 2e 2e 2e 7d | 22 2e 0d 20 2a 2f 0d 73 |re {...}|".. */.s|
|00004340| 74 61 74 69 63 20 6e 6f | 76 61 6c 75 65 20 64 63 |tatic no|value dc|
|00004350| 6c 5f 74 79 70 28 64 63 | 6c 29 0d 73 74 72 75 63 |l_typ(dc|l).struc|
|00004360| 74 20 6e 6f 64 65 20 2a | 64 63 6c 3b 0d 20 20 20 |t node *|dcl;. |
|00004370| 7b 0d 20 20 20 73 74 72 | 75 63 74 20 6e 6f 64 65 |{. str|uct node|
|00004380| 20 2a 74 71 75 61 6c 3b | 0d 20 20 20 73 74 72 75 | *tqual;|. stru|
|00004390| 63 74 20 6e 6f 64 65 20 | 2a 64 63 6c 74 6f 72 73 |ct node |*dcltors|
|000043a0| 3b 0d 0d 20 20 20 69 66 | 20 28 64 63 6c 20 3d 3d |;.. if| (dcl ==|
|000043b0| 20 4e 55 4c 4c 29 0d 20 | 20 20 20 20 20 72 65 74 | NULL). | ret|
|000043c0| 75 72 6e 3b 0d 20 20 20 | 74 71 75 61 6c 20 3d 20 |urn;. |tqual = |
|000043d0| 64 63 6c 2d 3e 75 5b 30 | 5d 2e 63 68 69 6c 64 3b |dcl->u[0|].child;|
|000043e0| 0d 20 20 20 66 6f 72 20 | 28 64 63 6c 74 6f 72 73 |. for |(dcltors|
|000043f0| 20 3d 20 64 63 6c 2d 3e | 75 5b 31 5d 2e 63 68 69 | = dcl->|u[1].chi|
|00004400| 6c 64 3b 20 64 63 6c 74 | 6f 72 73 2d 3e 6e 64 5f |ld; dclt|ors->nd_|
|00004410| 69 64 20 3d 3d 20 43 6f | 6d 6d 61 4e 64 3b 0d 20 |id == Co|mmaNd;. |
|00004420| 20 20 20 20 20 64 63 6c | 74 6f 72 73 20 3d 20 64 | dcl|tors = d|
|00004430| 63 6c 74 6f 72 73 2d 3e | 75 5b 30 5d 2e 63 68 69 |cltors->|u[0].chi|
|00004440| 6c 64 29 0d 20 20 20 20 | 20 20 20 20 20 64 63 6c |ld). | dcl|
|00004450| 74 6f 72 5f 74 79 70 28 | 64 63 6c 74 6f 72 73 2d |tor_typ(|dcltors-|
|00004460| 3e 75 5b 31 5d 2e 63 68 | 69 6c 64 2c 20 74 71 75 |>u[1].ch|ild, tqu|
|00004470| 61 6c 29 3b 0d 20 20 20 | 64 63 6c 74 6f 72 5f 74 |al);. |dcltor_t|
|00004480| 79 70 28 64 63 6c 74 6f | 72 73 2c 20 74 71 75 61 |yp(dclto|rs, tqua|
|00004490| 6c 29 3b 0d 20 20 20 7d | 0d 0d 2f 2a 0d 20 2a 20 |l);. }|../*. * |
|000044a0| 64 63 6c 74 6f 72 5f 74 | 79 70 2d 20 66 69 6e 64 |dcltor_t|yp- find|
|000044b0| 20 74 68 65 20 69 64 65 | 6e 74 69 66 69 65 72 20 | the ide|ntifier |
|000044c0| 69 6e 20 74 68 65 20 5b | 69 6e 69 74 69 61 6c 69 |in the [|initiali|
|000044d0| 7a 65 64 5d 20 64 65 63 | 6c 61 72 61 74 6f 72 20 |zed] dec|larator |
|000044e0| 61 6e 64 20 61 64 64 0d | 20 2a 20 20 20 74 68 65 |and add.| * the|
|000044f0| 20 73 74 6f 72 61 67 65 | 20 63 6c 61 73 73 2c 20 | storage| class, |
|00004500| 74 79 70 65 20 71 75 61 | 6c 69 66 65 72 2c 20 64 |type qua|lifer, d|
|00004510| 65 63 6c 61 72 61 74 6f | 72 2c 20 61 6e 64 20 69 |eclarato|r, and i|
|00004520| 6e 69 74 69 61 6c 69 7a | 61 74 69 6f 6e 0d 20 2a |nitializ|ation. *|
|00004530| 20 20 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 74 | infor|mation t|
|00004540| 6f 20 69 74 73 20 73 79 | 6d 62 6f 6c 20 74 61 62 |o its sy|mbol tab|
|00004550| 6c 65 20 65 6e 74 72 79 | 2e 20 41 64 64 20 74 68 |le entry|. Add th|
|00004560| 65 20 65 6e 74 72 79 20 | 6f 6e 74 6f 20 74 68 65 |e entry |onto the|
|00004570| 20 6c 69 73 74 0d 20 2a | 20 20 20 61 73 73 6f 63 | list. *| assoc|
|00004580| 69 61 74 65 64 20 77 69 | 74 68 20 74 68 65 20 63 |iated wi|th the c|
|00004590| 75 72 72 65 6e 74 20 22 | 64 65 63 6c 61 72 65 20 |urrent "|declare |
|000045a0| 7b 2e 2e 2e 7d 22 2e 0d | 20 2a 2f 0d 73 74 61 74 |{...}"..| */.stat|
|000045b0| 69 63 20 6e 6f 76 61 6c | 75 65 20 64 63 6c 74 6f |ic noval|ue dclto|
|000045c0| 72 5f 74 79 70 28 64 63 | 6c 74 6f 72 2c 20 74 71 |r_typ(dc|ltor, tq|
|000045d0| 75 61 6c 29 0d 73 74 72 | 75 63 74 20 6e 6f 64 65 |ual).str|uct node|
|000045e0| 20 2a 64 63 6c 74 6f 72 | 3b 0d 73 74 72 75 63 74 | *dcltor|;.struct|
|000045f0| 20 6e 6f 64 65 20 2a 74 | 71 75 61 6c 3b 0d 20 20 | node *t|qual;. |
|00004600| 20 7b 0d 20 20 20 73 74 | 72 75 63 74 20 73 79 6d | {. st|ruct sym|
|00004610| 5f 65 6e 74 72 79 20 2a | 73 79 6d 3b 0d 20 20 20 |_entry *|sym;. |
|00004620| 73 74 72 75 63 74 20 6e | 6f 64 65 20 2a 70 61 72 |struct n|ode *par|
|00004630| 74 5f 64 63 6c 74 6f 72 | 3b 0d 20 20 20 73 74 72 |t_dcltor|;. str|
|00004640| 75 63 74 20 6e 6f 64 65 | 20 2a 69 6e 69 74 20 3d |uct node| *init =|
|00004650| 20 4e 55 4c 4c 3b 0d 20 | 20 20 73 74 72 75 63 74 | NULL;. | struct|
|00004660| 20 74 6f 6b 65 6e 20 2a | 74 3b 0d 0d 20 20 20 69 | token *|t;.. i|
|00004670| 66 20 28 64 63 6c 74 6f | 72 2d 3e 6e 64 5f 69 64 |f (dclto|r->nd_id|
|00004680| 20 3d 3d 20 42 69 6e 72 | 79 4e 64 20 26 26 20 64 | == Binr|yNd && d|
|00004690| 63 6c 74 6f 72 2d 3e 74 | 6f 6b 2d 3e 74 6f 6b 5f |cltor->t|ok->tok_|
|000046a0| 69 64 20 3d 3d 20 27 3d | 27 29 20 7b 0d 20 20 20 |id == '=|') {. |
|000046b0| 20 20 20 69 6e 69 74 20 | 3d 20 64 63 6c 74 6f 72 | init |= dcltor|
|000046c0| 2d 3e 75 5b 31 5d 2e 63 | 68 69 6c 64 3b 0d 20 20 |->u[1].c|hild;. |
|000046d0| 20 20 20 20 64 63 6c 74 | 6f 72 20 3d 20 64 63 6c | dclt|or = dcl|
|000046e0| 74 6f 72 2d 3e 75 5b 30 | 5d 2e 63 68 69 6c 64 3b |tor->u[0|].child;|
|000046f0| 0d 20 20 20 20 20 20 7d | 0d 20 20 20 70 61 72 74 |. }|. part|
|00004700| 5f 64 63 6c 74 6f 72 20 | 3d 20 64 63 6c 74 6f 72 |_dcltor |= dcltor|
|00004710| 3b 0d 20 20 20 66 6f 72 | 20 28 3b 3b 29 20 7b 0d |;. for| (;;) {.|
|00004720| 20 20 20 20 20 20 73 77 | 69 74 63 68 20 28 70 61 | sw|itch (pa|
|00004730| 72 74 5f 64 63 6c 74 6f | 72 2d 3e 6e 64 5f 69 64 |rt_dclto|r->nd_id|
|00004740| 29 20 7b 20 0d 20 20 20 | 20 20 20 20 20 20 63 61 |) { . | ca|
|00004750| 73 65 20 42 69 6e 72 79 | 4e 64 3a 0d 20 20 20 20 |se Binry|Nd:. |
|00004760| 20 20 20 20 20 20 20 20 | 2f 2a 20 27 29 27 20 6f | |/* ')' o|
|00004770| 72 20 27 5b 27 20 2a 2f | 0d 20 20 20 20 20 20 20 |r '[' */|. |
|00004780| 20 20 20 20 20 70 61 72 | 74 5f 64 63 6c 74 6f 72 | par|t_dcltor|
|00004790| 20 3d 20 70 61 72 74 5f | 64 63 6c 74 6f 72 2d 3e | = part_|dcltor->|
|000047a0| 75 5b 30 5d 2e 63 68 69 | 6c 64 3b 0d 20 20 20 20 |u[0].chi|ld;. |
|000047b0| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0d 20 | |break;. |
|000047c0| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 43 6f 6e | |case Con|
|000047d0| 43 61 74 4e 64 3a 0d 20 | 20 20 20 20 20 20 20 20 |CatNd:. | |
|000047e0| 20 20 20 2f 2a 20 70 6f | 69 6e 74 65 72 20 64 69 | /* po|inter di|
|000047f0| 72 65 63 74 2d 64 65 63 | 6c 61 72 61 74 6f 72 20 |rect-dec|larator |
|00004800| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 70 |*/. | p|
|00004810| 61 72 74 5f 64 63 6c 74 | 6f 72 20 3d 20 70 61 72 |art_dclt|or = par|
|00004820| 74 5f 64 63 6c 74 6f 72 | 2d 3e 75 5b 31 5d 2e 63 |t_dcltor|->u[1].c|
|00004830| 68 69 6c 64 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |hild;. | |
|00004840| 20 20 62 72 65 61 6b 3b | 0d 20 20 20 20 20 20 20 | break;|. |
|00004850| 20 20 63 61 73 65 20 50 | 72 65 66 78 4e 64 3a 0d | case P|refxNd:.|
|00004860| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 28 | | /* (|
|00004870| 20 2e 2e 2e 20 29 20 2a | 2f 0d 20 20 20 20 20 20 | ... ) *|/. |
|00004880| 20 20 20 20 20 20 70 61 | 72 74 5f 64 63 6c 74 6f | pa|rt_dclto|
|00004890| 72 20 3d 20 20 70 61 72 | 74 5f 64 63 6c 74 6f 72 |r = par|t_dcltor|
|000048a0| 2d 3e 75 5b 30 5d 2e 63 | 68 69 6c 64 3b 0d 20 20 |->u[0].c|hild;. |
|000048b0| 20 20 20 20 20 20 20 20 | 20 20 62 72 65 61 6b 3b | | break;|
|000048c0| 0d 20 20 20 20 20 20 20 | 20 20 63 61 73 65 20 50 |. | case P|
|000048d0| 72 69 6d 72 79 4e 64 3a | 0d 20 20 20 20 20 20 20 |rimryNd:|. |
|000048e0| 20 20 20 20 20 74 20 3d | 20 70 61 72 74 5f 64 63 | t =| part_dc|
|000048f0| 6c 74 6f 72 2d 3e 74 6f | 6b 3b 0d 20 20 20 20 20 |ltor->to|k;. |
|00004900| 20 20 20 20 20 20 20 69 | 66 20 28 74 2d 3e 74 6f | i|f (t->to|
|00004910| 6b 5f 69 64 20 3d 3d 20 | 49 64 65 6e 74 69 66 69 |k_id == |Identifi|
|00004920| 65 72 20 7c 7c 20 74 2d | 3e 74 6f 6b 5f 69 64 20 |er || t-|>tok_id |
|00004930| 3d 3d 20 54 79 70 65 44 | 65 66 4e 61 6d 65 29 20 |== TypeD|efName) |
|00004940| 7b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |{. | |
|00004950| 20 2f 2a 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | /*. | |
|00004960| 20 20 20 20 2a 20 54 68 | 65 20 69 64 65 6e 74 69 | * Th|e identi|
|00004970| 66 69 65 72 20 68 61 73 | 20 62 65 65 6e 20 66 6f |fier has| been fo|
|00004980| 75 6e 64 2c 20 75 70 64 | 61 74 65 20 69 74 73 20 |und, upd|ate its |
|00004990| 73 79 6d 62 6f 6c 20 74 | 61 62 6c 65 0d 20 20 20 |symbol t|able. |
|000049a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 20 20 | | * |
|000049b0| 65 6e 74 72 79 2e 0d 20 | 20 20 20 20 20 20 20 20 |entry.. | |
|000049c0| 20 20 20 20 20 20 20 2a | 2f 0d 20 20 20 20 20 20 | *|/. |
|000049d0| 20 20 20 20 20 20 20 20 | 20 73 79 6d 20 3d 20 73 | | sym = s|
|000049e0| 79 6d 5f 6c 6b 75 70 28 | 74 2d 3e 69 6d 61 67 65 |ym_lkup(|t->image|
|000049f0| 29 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |);. | |
|00004a00| 20 20 73 79 6d 2d 3e 75 | 2e 64 65 63 6c 61 72 65 | sym->u|.declare|
|00004a10| 5f 76 61 72 2e 74 71 75 | 61 6c 20 3d 20 74 71 75 |_var.tqu|al = tqu|
|00004a20| 61 6c 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |al;. | |
|00004a30| 20 20 20 73 79 6d 2d 3e | 75 2e 64 65 63 6c 61 72 | sym->|u.declar|
|00004a40| 65 5f 76 61 72 2e 64 63 | 6c 74 6f 72 20 3d 20 64 |e_var.dc|ltor = d|
|00004a50| 63 6c 74 6f 72 3b 0d 20 | 20 20 20 20 20 20 20 20 |cltor;. | |
|00004a60| 20 20 20 20 20 20 73 79 | 6d 2d 3e 75 2e 64 65 63 | sy|m->u.dec|
|00004a70| 6c 61 72 65 5f 76 61 72 | 2e 69 6e 69 74 20 3d 20 |lare_var|.init = |
|00004a80| 69 6e 69 74 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |init;. | |
|00004a90| 20 20 20 20 20 2b 2b 73 | 79 6d 2d 3e 72 65 66 5f | ++s|ym->ref_|
|00004aa0| 63 6e 74 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |cnt;. | |
|00004ab0| 20 20 20 20 73 79 6d 2d | 3e 75 2e 64 65 63 6c 61 | sym-|>u.decla|
|00004ac0| 72 65 5f 76 61 72 2e 6e | 65 78 74 20 3d 20 64 65 |re_var.n|ext = de|
|00004ad0| 63 6c 5f 6c 73 74 3b 0d | 20 20 20 20 20 20 20 20 |cl_lst;.| |
|00004ae0| 20 20 20 20 20 20 20 64 | 65 63 6c 5f 6c 73 74 20 | d|ecl_lst |
|00004af0| 3d 20 73 79 6d 3b 0d 20 | 20 20 20 20 20 20 20 20 |= sym;. | |
|00004b00| 20 20 20 20 20 20 7d 0d | 20 20 20 20 20 20 20 20 | }.| |
|00004b10| 20 20 20 20 72 65 74 75 | 72 6e 3b 0d 20 20 20 20 | retu|rn;. |
|00004b20| 20 20 20 20 20 64 65 66 | 61 75 6c 74 3a 0d 20 20 | def|ault:. |
|00004b30| 20 20 20 20 20 20 20 20 | 20 20 72 65 74 75 72 6e | | return|
|00004b40| 3b 0d 20 20 20 20 20 20 | 20 20 20 7d 0d 20 20 20 |;. | }. |
|00004b50| 20 20 20 7d 0d 20 20 20 | 7d 0d 0d 2f 2a 0d 20 2a | }. |}../*. *|
|00004b60| 20 74 6e 64 5f 63 68 61 | 72 20 2d 20 69 6e 64 69 | tnd_cha|r - indi|
|00004b70| 63 61 74 65 20 69 6e 20 | 74 68 65 20 63 75 72 72 |cate in |the curr|
|00004b80| 65 6e 74 20 64 65 63 6c | 61 72 61 74 69 6f 6e 20 |ent decl|aration |
|00004b90| 63 6f 6e 74 65 78 74 20 | 74 68 61 74 20 61 20 74 |context |that a t|
|00004ba0| 65 6e 64 65 64 0d 20 2a | 20 20 63 68 61 72 61 63 |ended. *| charac|
|00004bb0| 74 65 72 20 28 70 6f 69 | 6e 74 65 72 3f 29 20 64 |ter (poi|nter?) d|
|00004bc0| 65 63 6c 61 72 61 74 69 | 6f 6e 20 68 61 73 20 62 |eclarati|on has b|
|00004bd0| 65 65 6e 20 66 6f 75 6e | 64 2e 0d 20 2a 2f 0d 6e |een foun|d.. */.n|
|00004be0| 6f 76 61 6c 75 65 20 74 | 6e 64 5f 63 68 61 72 28 |ovalue t|nd_char(|
|00004bf0| 29 0d 20 20 20 7b 0d 20 | 20 20 64 63 6c 5f 73 74 |). {. | dcl_st|
|00004c00| 6b 2d 3e 6b 69 6e 64 5f | 64 63 6c 20 3d 20 54 6e |k->kind_|dcl = Tn|
|00004c10| 64 53 74 72 3b 0d 20 20 | 20 64 63 6c 5f 73 74 6b |dStr;. | dcl_stk|
|00004c20| 2d 3e 62 6c 6b 5f 6e 61 | 6d 65 20 3d 20 4e 55 4c |->blk_na|me = NUL|
|00004c30| 4c 3b 0d 20 20 20 7d 0d | 0d 2f 2a 0d 20 2a 20 74 |L;. }.|./*. * t|
|00004c40| 6e 64 5f 73 74 72 63 74 | 20 2d 20 69 6e 64 69 63 |nd_strct| - indic|
|00004c50| 61 74 65 20 69 6e 20 74 | 68 65 20 63 75 72 72 65 |ate in t|he curre|
|00004c60| 6e 74 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 20 63 |nt decla|ration c|
|00004c70| 6f 6e 74 65 78 74 20 74 | 68 61 74 20 61 20 74 65 |ontext t|hat a te|
|00004c80| 6e 64 65 64 0d 20 2a 20 | 20 73 74 72 75 63 74 20 |nded. * | struct |
|00004c90| 64 65 63 6c 61 72 61 74 | 69 6f 6e 20 68 61 73 20 |declarat|ion has |
|00004ca0| 62 65 65 6e 20 66 6f 75 | 6e 64 20 61 6e 64 20 69 |been fou|nd and i|
|00004cb0| 6e 64 69 63 61 74 65 20 | 74 68 65 20 73 74 72 75 |ndicate |the stru|
|00004cc0| 63 74 20 74 79 70 65 2e | 0d 20 2a 2f 0d 6e 6f 76 |ct type.|. */.nov|
|00004cd0| 61 6c 75 65 20 74 6e 64 | 5f 73 74 72 63 74 28 74 |alue tnd|_strct(t|
|00004ce0| 29 0d 73 74 72 75 63 74 | 20 74 6f 6b 65 6e 20 2a |).struct| token *|
|00004cf0| 74 3b 0d 20 20 20 7b 0d | 20 20 20 63 68 61 72 20 |t;. {.| char |
|00004d00| 2a 73 74 72 63 74 5f 6e | 6d 3b 0d 0d 20 20 20 73 |*strct_n|m;.. s|
|00004d10| 74 72 63 74 5f 6e 6d 20 | 3d 20 74 2d 3e 69 6d 61 |trct_nm |= t->ima|
|00004d20| 67 65 3b 0d 20 20 20 66 | 72 65 65 5f 74 28 74 29 |ge;. f|ree_t(t)|
|00004d30| 3b 0d 0d 20 20 20 69 66 | 20 28 73 74 72 63 74 5f |;.. if| (strct_|
|00004d40| 6e 6d 20 3d 3d 20 64 65 | 73 63 72 69 70 29 20 7b |nm == de|scrip) {|
|00004d50| 0d 20 20 20 20 20 20 64 | 63 6c 5f 73 74 6b 2d 3e |. d|cl_stk->|
|00004d60| 6b 69 6e 64 5f 64 63 6c | 20 3d 20 54 6e 64 44 65 |kind_dcl| = TndDe|
|00004d70| 73 63 3b 0d 20 20 20 20 | 20 20 64 63 6c 5f 73 74 |sc;. | dcl_st|
|00004d80| 6b 2d 3e 62 6c 6b 5f 6e | 61 6d 65 20 3d 20 4e 55 |k->blk_n|ame = NU|
|00004d90| 4c 4c 3b 0d 20 20 20 20 | 20 20 72 65 74 75 72 6e |LL;. | return|
|00004da0| 3b 0d 20 20 20 20 20 20 | 7d 0d 20 20 20 64 63 6c |;. |}. dcl|
|00004db0| 5f 73 74 6b 2d 3e 6b 69 | 6e 64 5f 64 63 6c 20 3d |_stk->ki|nd_dcl =|
|00004dc0| 20 54 6e 64 42 6c 6b 3b | 0d 20 20 20 64 63 6c 5f | TndBlk;|. dcl_|
|00004dd0| 73 74 6b 2d 3e 62 6c 6b | 5f 6e 61 6d 65 20 3d 20 |stk->blk|_name = |
|00004de0| 73 74 72 63 74 5f 6e 6d | 3b 0d 20 20 20 7d 0d 0d |strct_nm|;. }..|
|00004df0| 2f 2a 0d 20 2a 20 74 6e | 64 5f 73 74 72 63 74 20 |/*. * tn|d_strct |
|00004e00| 2d 20 69 6e 64 69 63 61 | 74 65 20 69 6e 20 74 68 |- indica|te in th|
|00004e10| 65 20 63 75 72 72 65 6e | 74 20 64 65 63 6c 61 72 |e curren|t declar|
|00004e20| 61 74 69 6f 6e 20 63 6f | 6e 74 65 78 74 20 74 68 |ation co|ntext th|
|00004e30| 61 74 20 61 20 74 65 6e | 64 65 64 0d 20 2a 20 20 |at a ten|ded. * |
|00004e40| 75 6e 69 6f 6e 20 28 70 | 6f 69 6e 74 65 72 3f 29 |union (p|ointer?)|
|00004e50| 20 64 65 63 6c 61 72 61 | 74 69 6f 6e 20 68 61 73 | declara|tion has|
|00004e60| 20 62 65 65 6e 20 66 6f | 75 6e 64 2e 0d 20 2a 2f | been fo|und.. */|
|00004e70| 0d 6e 6f 76 61 6c 75 65 | 20 74 6e 64 5f 75 6e 69 |.novalue| tnd_uni|
|00004e80| 6f 6e 28 74 29 0d 73 74 | 72 75 63 74 20 74 6f 6b |on(t).st|ruct tok|
|00004e90| 65 6e 20 2a 74 3b 0d 20 | 20 20 7b 0d 20 20 20 2f |en *t;. | {. /|
|00004ea0| 2a 0d 20 20 20 20 2a 20 | 4f 6e 6c 79 20 75 6e 69 |*. * |Only uni|
|00004eb0| 6f 6e 20 62 6c 6f 63 6b | 20 70 6f 69 6e 74 65 72 |on block| pointer|
|00004ec0| 73 20 6d 61 79 20 62 65 | 20 74 65 6e 64 65 64 2e |s may be| tended.|
|00004ed0| 0d 20 20 20 20 2a 2f 0d | 20 20 20 69 66 20 28 74 |. */.| if (t|
|00004ee0| 2d 3e 69 6d 61 67 65 20 | 21 3d 20 62 6c 6f 63 6b |->image |!= block|
|00004ef0| 29 0d 20 20 20 20 20 20 | 79 79 65 72 72 6f 72 28 |). |yyerror(|
|00004f00| 22 75 6e 73 75 70 70 6f | 72 74 65 64 20 74 65 6e |"unsuppo|rted ten|
|00004f10| 64 65 64 20 74 79 70 65 | 22 29 3b 0d 20 20 20 66 |ded type|");. f|
|00004f20| 72 65 65 5f 74 28 74 29 | 3b 0d 20 20 20 64 63 6c |ree_t(t)|;. dcl|
|00004f30| 5f 73 74 6b 2d 3e 6b 69 | 6e 64 5f 64 63 6c 20 3d |_stk->ki|nd_dcl =|
|00004f40| 20 54 6e 64 42 6c 6b 3b | 0d 20 20 20 64 63 6c 5f | TndBlk;|. dcl_|
|00004f50| 73 74 6b 2d 3e 62 6c 6b | 5f 6e 61 6d 65 20 3d 20 |stk->blk|_name = |
|00004f60| 4e 55 4c 4c 3b 0d 20 20 | 20 7d 0d 00 00 00 00 00 |NULL;. | }......|
|00004f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004f80| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00004f90| 65 74 09 09 09 23 20 72 | 65 6d 6f 76 65 20 53 68 |et...# r|emove Sh|
|00004fa0| 65 6c 6c 20 76 61 72 69 | 61 62 6c 65 20 64 65 66 |ell vari|able def|
|00004fb0| 08 72 74 74 73 79 6d 2e | 63 00 02 00 00 00 54 45 |.rttsym.|c.....TE|
|00004fc0| 58 54 4d 50 53 20 00 00 | 00 00 00 00 00 00 00 00 |XTMPS ..|........|
|00004fd0| 00 00 54 45 58 54 4d 50 | 53 20 00 00 00 00 00 00 |..TEXTMP|S ......|
|00004fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004ff0| 00 00 a6 e0 04 d2 00 00 | 4e eb 00 00 01 ac 63 65 |........|N.....ce|
|00005000| 72 74 61 69 6e 20 73 79 | 73 74 65 6d 0d 09 66 75 |rtain sy|stem..fu|
|00005010| 6e 63 74 69 6f 6e 73 2e | 20 20 46 6f 72 20 68 65 |nctions.| For he|
|00005020| 6c 70 2c 20 65 6e 74 65 | 72 20 61 20 63 6f 6d 6d |lp, ente|r a comm|
|00005030| 61 6e 64 20 73 75 63 68 | 20 61 73 0d 09 0d 09 48 |and such| as....H|
|00005040| 65 6c 70 20 43 68 6f 6f | 73 65 09 09 09 23 20 63 |elp Choo|se...# c|
|00005050| 68 6f 6f 73 65 20 6f 72 | 20 6c 69 73 74 20 6e 65 |hoose or| list ne|
|00005060| 74 77 6f 72 6b 20 66 69 | 6c 65 20 73 65 72 76 65 |twork fi|le serve|
|00005070| 72 20 76 6f 6c 75 6d 65 | 73 20 61 6e 64 20 70 72 |r volume|s and pr|
|00005080| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00005090| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050a0| 00 00 00 00 00 00 00 06 | 00 08 00 2a 00 03 01 53 |........|...*...S|
|000050b0| 01 fd 00 f1 00 00 01 53 | 01 bd a6 e0 04 d3 00 00 |.......S|........|
|000050c0| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 00 1e |........|........|
|000050d0| 00 2a 00 03 01 53 01 fd | 00 f1 00 00 01 53 01 bd |.*...S..|.....S..|
|000050e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050f0| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 57 |.....n..|.n...>.W|
|00005100| 1a 60 05 e2 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |.`......|.>..MPSR|
|00005110| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00005120| 03 f0 ff ff 00 00 00 4c | 00 59 19 84 00 00 00 00 |.......L|.Y......|
|00005130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+