1 lalr_grammar_semantics_: proc (prod_no);
2
3
4
5
6
7
8
9
10 dcl prod_no fixed bin parameter;
11
12 go to prod (prod_no);
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 dcl i fixed bin;
30 dcl unspec builtin;
31
32
33
34
35
36
37
38 prod (4):
39 if ^prod_sw
40 then do;
41 if separate_semantics_sw & (stk.token_position (stk_top) ^= 0 | stk.tag (stk_top) ^= 0)
42 then do;
43 actions_list.procedure (actions_list_size) = stk.token_position (stk_top);
44 actions_list.entry (actions_list_size) = stk.token_length (stk_top);
45 actions_list.tag (actions_list_size) = stk.tag (stk_top);
46 actions_list.file (actions_list_size) = stk.file (stk_top);
47 actions_list.line (actions_list_size) = stk.line (stk_top);
48 end;
49 if stk.token_position (stk_top) ^= 0
50 then do i = first_production_index to productions_list_size;
51 productions_list.rule (i) = rule_num;
52 end;
53 end;
54 return;
55
56
57
58
59
60
61
62
63 prod (8):
64 prod (10):
65 actions_list.procedure (actions_list_size) = stk.token_position (stk_top);
66 actions_list.entry (actions_list_size) = stk.token_length (stk_top);
67 actions_list.tag (actions_list_size) = stk.tag (stk_top);
68 actions_list.file (actions_list_size) = stk.file (stk_top);
69 actions_list.line (actions_list_size) = stk.line (stk_top);
70 if stk.token_position (stk_top) ^= 0 then
71 productions_list.rule (productions_list_size) = rule_num;
72 return;
73
74
75
76
77
78
79 prod (13):
80 prod (14):
81 call store;
82 return;
83
84
85 prod (15):
86 call store;
87 fsl = symbols_list_size;
88 production_name_last_applied = "1"b;
89 return;
90
91
92 prod (16):
93 Alt = 1;
94 if separate_semantics_sw
95 then do;
96 actions_list_size = actions_list_size+1;
97 unspec (actions_list (actions_list_size)) = ""b;
98 end;
99 first_production_index, productions_list_size = productions_list_size+1;
100 productions_list.first_symbol (productions_list_size) = symbols_list_size;
101 productions_list.rule (productions_list_size) = -rule_num;
102 productions_list.alternative (productions_list_size) = Alt;
103 production_name_last_applied = "0"b;
104 return;
105
106
107 prod (17):
108 if separate_semantics_sw & prod_sw
109 then do;
110 actions_list_size = actions_list_size+1;
111 unspec (actions_list (actions_list_size)) = ""b;
112 end;
113 symbols_list_size = symbols_list_size+1;
114
115 unclassified_symbols_list.position (symbols_list_size) = unclassified_symbols_list.position (fsl);
116 unclassified_symbols_list.length (symbols_list_size) = unclassified_symbols_list.length (fsl);
117 unclassified_symbols_list.file (symbols_list_size) = stk.file (stk_top);
118 unclassified_symbols_list.line (symbols_list_size) = stk.line (stk_top);
119 productions_list_size = productions_list_size+1;
120 productions_list.first_symbol (productions_list_size) = symbols_list_size;
121 productions_list.rule (productions_list_size) = -rule_num;
122 productions_list.alternative (productions_list_size), Alt = Alt+1;
123 return;
124
125 store: proc;
126 symbols_list_size = symbols_list_size+1;
127 unclassified_symbols_list.position (symbols_list_size) = stk.token_position (stk_top);
128 unclassified_symbols_list.length (symbols_list_size) = stk.token_length (stk_top);
129 unclassified_symbols_list.file (symbols_list_size) = stk.file (stk_top);
130 unclassified_symbols_list.line (symbols_list_size) = stk.line (stk_top);
131 return;
132 end store;
133
134 end lalr_grammar_semantics_;