1 lalr_grammar_semantics_: proc (prod_no);
  2 
  3 /*        SEMANTICS SEGMENT lalr_grammar_semantics_.incl.pl1
  4           Generated by: Swenson.SysAdmin.a using LALR 7.3a of Thursday, January 24, 1985
  5           Generated at: Gold Hill Multics
  6           Generated on: 08/07/22  0955.7 pdt Sun
  7           Generated from: >udd>sa>ejs>work>temp>mit>foo>lalr_parse_grammar_.lalr
  8 */
  9 
 10 dcl  prod_no fixed bin parameter;
 11 
 12           go to prod (prod_no);
 13 
 14 /* -order '::=
 15           '|
 16           <non-terminal symbol>
 17           <rule semantics>
 18           <production semantics>
 19           <terminal symbol>
 20 -sem lalr_grammar_semantics_.incl.pl1
 21 -optimize
 22 -table lalr_parse_grammar_t_
 23 -terminals_list
 24 -production_names
 25 -production
 26 -no_terminals_hash_list (* Added:  01 May 85 - B. Wong *)
 27 -no_synonyms            (* Added:  01 May 85 - B. Wong *)
 28 -parse */
 29 dcl i fixed bin;
 30 dcl  unspec builtin;
 31 /* <lalr> ::=
 32           <rules>! */
 33 /* <rules> ::=
 34           <rule> |
 35           <rules> <rule>! */
 36 /* <rule> ::=
 37           <production name> <::=> <alternatives> <rule semantics>! */
 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 /* <alternatives> ::=
 56           <production> |
 57           <alternatives> <|> <production>! */
 58 /* <production> ::=
 59           |
 60           <production semantics> |
 61           <symbols> |
 62           <symbols> <production semantics>! */
 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 /* <symbols> ::=
 74           <symbol> |
 75           <symbols> <symbol>! */
 76 /* <symbol> ::=
 77           <non-terminal symbol> |
 78           <terminal symbol>! */
 79 prod (13):
 80 prod (14):
 81           call store;
 82           return;
 83 /* <production name> ::=
 84           <non-terminal symbol>! */
 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                                                             /* This symbol number aliases the original. */
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;     /* Store the current symbol in "symbols_list". */
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_;