GRM: SETL grammar.
GRM: SETL grammar. stlgrm.opl
1 .=member intro 2$ ssssssss eeeeeeeeee tttttttttt ll 3$ ssssssssss eeeeeeeeee tttttttttt ll 4$ ss ss ee tt ll 5$ ss ee tt ll 6$ sssssssss eeeeee tt ll 7$ sssssssss eeeeee tt ll 8$ ss ee tt ll 9$ ss ss ee tt ll 10$ ssssssssss eeeeeeeee tt llllllllll 11$ ssssssss eeeeeeeee tt llllllllll 12$ 13$ 14$ gggggggg rrrrrrrrr mm mm 15$ gggggggggg rrrrrrrrrr mmm mmm 16$ gg gg rr rr mmmm mmmm 17$ gg rr rr mm mmmm mm 18$ gg ggggg rrrrrrrrrr mm mm mm 19$ gg gggggg rrrrrrrrr mm mm mm 20$ gg gg rr rr mm mm 21$ gg gg rr rr mm mm 22$ gggggggggg rr rr mm mm 23$ gggggggg rr rr mm mm 24$ 25$ 26$ t h e s e t l g r a m m a r 27$ 28$ 29$ this software is part of the setl programming system 30$ address queries and comments to 31$ 32$ setl project 33$ department of computer science 34$ new york university 35$ courant institute of mathematical sciences 36$ 251 mercer street 37$ new york, ny 10012 38$ 1 .=member mods 2 3 4$ program revision history 5$ ------------------------ 6 7$ this section contains a description of each revision to the program. 8$ these descriptions have the following format: 9$ 10$ mm-dd-yy jdate author(s) 11$ 12$ 1.............15........25........................................ 13$ 14$ where mm-dd-yy are the month, day, and year, and jdate is the julian 15$ date. 16$ 17$ each time a revision is installed, the author should insert a 18$ description after line 'mods.21', and change the macro 'prog_level' 19$ to the current julian date. 20$ 21$ ...................................................................... smfe 1 smfe 2 smfe 3$ 09/01/83 83244 s. freudenberger smfe 4$ smfe 5$ 1. change the production for universal quantifiers to allow sem to smfe 6$ correctly fold the 'st' clause. smfe 7$ module affected: exp. smfb 1 smfb 2 smfb 3$ 08/08/83 83220 s. freudenberger smfb 4$ smfb 5$ 1. extend the syntax for the assert statement. note that the new smfb 6$ syntax is experimental. smfb 7$ module affected: stats. smfb 8$ 2. special case two iterator constructs in the production. smfb 9$ module affected: exp. 22 23 24$ 08/12/82 82224 s. freudenberger 25$ 26$ 1. we postpone the check for constant expressions to the semantic 27$ pass, and are thus able to constant fold additional operators. 28$ the parse sequence for case tags must be reversed because of this 29$ change: the 'arb ' must precede the ''. 30$ modules affected: decls and stats. 31$ 2. the error text number in the production has been 32$ corrected. 33$ module affected: exp. 34 35 36$ 06/15/82 82166 s. freudenberger 37$ 38$ 1. we count the 'case of' of a case statement as a separate 39$ statement. 40$ module affected: stats. 41 42 43$ 06/01/82 82152 s. freudenberger 44$ 45$ 1. we permit the syntax 'map', 'map ( )', and 46$ 'map ( ) ' to declare an ambiguous map (i.e. a 47$ map which can have both single- and multi-valued image points. 48$ module affected: decls. 49 50 51$ 03/16/82 82075 s. freudenberger 52$ 53$ 1. we permit the syntax 'procedure () ' to declare the return 54$ value of a parameterless procedure. 55$ 2. we disallow the token sequence ';;', i.e. the undocumented null 56$ statement. 57 58 59$ 02/01/82 82032 s. freudenberger 60$ 61$ 1. 'notexists' has been included for recognition by the parser. 62$ modules affected: macros and exp. 63$ 2. the places in the parse when source lines are listed has been 64$ changed. most visibly, the 'end' statement for procedures and 65$ operators should now have the last statement number for their 66$ scope, and not one. 'lstcrd' has been eliminated, its function 67$ has been assumed by 'put_card'. 68$ modules affected: prog, routs, stats, and misc. 69$ 3. the precedence for the binary compound operator has been corrected 70$ so that <*binop> <*binop> '/' will use the 71$ binary precedence of the second <*binop> to pop the op-stack. 72$ module affected: exp. 73$ 4. we allow '(' ')' as a valid in an . 74$ module affected: exp. 75 76 77$ 11/05/80 80310 s. freudenberger 78$ 79$ the trace option has been changed to include <*name>'s. 80 81 82$ 06/20/80 80172 e. deak 83$ 84$ modification to improve error recovery for nested statements. 85 86 87$ 04/11/80 80102 d. shields 88$ 89$ 1. correct 'na' to be 'nargs'. documentation and implementation 90$ differed - nargs is now the standard. 91$ 2. accept 'for' for iterators. continue to recognize 'forall' 92$ to maintain compatibility. 93$ 3. s66 (cdc 6000) users note that this file contains successive colons 94$ each such line is prefixed by line $ double colon follows. 95$ equals signs (=) have been placed above first colon of double 96$ colons in following line. 97$ adjust as needed if unexpected new lines occur when listing this 98$ file. this is a cdc (c-olons d-uplicated c-rash) problem. 99 100 101$ 01/15/80 80015 s. freudenberger 102$ 103$ we only allow a factor after a compound operator in an . 104 105 106$ 12/17/79 79351 s. freudenberger 107$ 108$ 1. prs.puttabs has been shortened to six characters, 'puttbs'. 109 110 111$ 11/10/79 79314 s. freudenberger 112$ 113$ 1. the mode keyword 'map' has been deleted. when declaring a map, 114$ it is now necessary to declare it either a 'smap' or a 'mmap'. 115$ 2. the colon after 'assert' has been dropped. 116$ 3. 'name(...)' and 'name(...exp)' have been taken out of the 117$ language. 1 .=member macros 2 3$ this section contains macros used to define literal codes, etc. 4$ first we need a few meta macros: 5 6 +* q3(a, b, c) = a b c ** 7 +* macdef(text) = q3(+, * text *, *) ** 8 +* macdrop(nam) = macdef(nam = ) ** 9 +* defc(nam) = macdef(nam = zzyz) ** 10 11 12$ next we define the lexical codes and the lexmap. 13 14 .=zzyorg z 15 16 defc(l_name) $ names 17 defc(l_bold) $ stropped names 18 defc(l_int) $ integer denotation 19 defc(l_real) $ real denotation 20 defc(l_string) $ string denotation 21 defc(l_delim) $ delimiters 22 defc(l_dkey) $ keyword in declaratory statement 23 defc(l_modekey) $ mode set, tuple, etc. 24 defc(l_btkey) $ basetype keyword local, remote... 25 defc(l_stkey) $ statement keyword 26 defc(l_rwkey) $ rd, rw, ot r wr 27 defc(l_rkey1) $ libs, reads, writes 28 defc(l_rkey2) $ imports, exports 29 defc(l_bin) $ binary operator 30 defc(l_from) $ from, etc. 31 defc(l_un) $ unary operator 32 defc(l_unbin) $ unary/binary operators 33 defc(l_dots) $ .. 34 defc(l_debug) $ compiler debugging options 35 defc(l_trace) $ user run-time trace options 36 37 +* l_min = l_name ** $ minimum type 38 +* l_max = l_dots ** $ maximum type 39 40 41 lexmap $ lexical type map 42 43 'name' = l_name $ names 44 'bold' = l_bold $ stropped names 45 'int' = l_int $ integer denotation 46 'real' = l_real $ real denotation 47 'string' = l_string $ string denotation 48 'delim' = l_delim $ delimiters 49 'dkey' = l_dkey $ keyword in declaratory stateme 50 'modekey' = l_modekey $ system defined modes 51 'btkey' = l_btkey $ basetype keyword local, remote... 52 'stkey' = l_stkey $ statement keyword 53 'rwkey' = l_rwkey $ rd, wr, or rw 54 'rkey1' = l_rkey1 $ libs, reads, writes 55 'rkey2' = l_rkey2 $ imports, exports 56 'bin' = l_bin $ binary operator 57 'from' = l_from $ from, etc. 58 'un' = l_un $ unary operator 59 'unbin' = l_unbin $ unary/binary operator 60 'dots' = l_dots $ .. 61 'debug' = l_debug $ compiler debugging options 62 'trace' = l_trace $ user run-time trace options 63 64 65 66$ next, we define assign codes to each of the literals and define 67$ a map from the literals to their codes. 68 69 .=zzyorg z $ reset counter for codes 70 71 defc(lit_direct) $ directory 72 defc(lit_prog) $ program 73 defc(lit_lib) $ library 74 defc(lit_mod) $ module 75 defc(lit_semi) $ ; 76 defc(lit_lp) $ ( 77 defc(lit_rp) $ ) 78 defc(lit_dash) $ - 79 defc(lit_star) $ * 80 defc(lit_back) $ back 81 defc(lit_all) $ all 82 defc(lit_repr) $ repr 83 defc(lit_colon) $ : 84$ double colon follows = 85 defc(lit_dcolon) $ :: 86 defc(lit_eq) $ = 87 defc(lit_base) $ base 88 defc(lit_plex) $ plex 89 defc(lit_mode) $ mode 90 defc(lit_in) $ in 91 defc(lit_arb) $ arb 92 defc(lit_lbrace) $ << 93 defc(lit_rbrace) $ >> 94 defc(lit_comma) $ , 95 defc(lit_proc) $ procedure 96 defc(lit_op) $ operator 97 defc(lit_asn) $ := 98 defc(lit_pass) $ pass 99 defc(lit_expr) $ expr 100 defc(lit_if) $ if 101 defc(lit_then) $ then 102 defc(lit_else) $ else 103 defc(lit_elseif) $ elseif 104 defc(lit_case) $ case 105 defc(lit_for) $ for 106 defc(lit_forall) $ forall 107 defc(lit_do) $ do 108 defc(lit_of) $ of 109 defc(lit_end) $ end 110 defc(lit_slash) $ / 111 defc(lit_newat) $ newat 112 defc(lit_ok) $ ok 113 defc(lit_lev) $ lev 114 defc(lit_eof) $ eof 115 defc(lit_time) $ time 116 defc(lit_date) $ date 117 defc(lit_na) $ na 118 defc(lit_exist) $ exists 119 defc(lit_notexist) $ notexists 120 defc(lit_lbrack) $ (/ 121 defc(lit_rbrack) $ /) 122 defc(lit_dot) $ . 123 defc(lit_init) $ init 124 defc(lit_doing) $ doing 125 defc(lit_while) $ while 126 defc(lit_where) $ where 127 defc(lit_step) $ step 128 defc(lit_until) $ until 129 defc(lit_term) $ term 130 131 litmap $ map literals to their codes 132 133 'directory' = lit_direct 134 'program' = lit_prog 135 'prog' = lit_prog 136 'library' = lit_lib 137 'lib' = lit_lib 138 'module' = lit_mod 139 ';' = lit_semi 140 '(' = lit_lp 141 ')' = lit_rp 142 '-' = lit_dash 143 '*' = lit_star 144 'back' = lit_back 145 'all' = lit_all 146 ':' = lit_colon 147$ = double colon follows 148 '::' = lit_dcolon 149 '=' = lit_eq 150 'repr' = lit_repr 151 'base' = lit_base 152 'plex' = lit_plex 153 'mode' = lit_mode 154 'in' = lit_in 155 'arb' = lit_arb 156 '<<' = lit_lbrace 157 '>>' = lit_rbrace 158 ',' = lit_comma 159 'procedure' = lit_proc 160 'proc' = lit_proc 161 'operator' = lit_op 162 'op' = lit_op 163 ':=' = lit_asn 164 'pass' = lit_pass 165 'expr' = lit_expr 166 'if' = lit_if 167 'then' = lit_then 168 'else' = lit_else 169 'elseif' = lit_elseif 170 'case' = lit_case 171 'for' = lit_for 172 'forall' = lit_forall 173 'do' = lit_do 174 'of' = lit_of 175 'end' = lit_end 176 '/' = lit_slash 177 'newat' = lit_newat 178 'ok' = lit_ok 179 'lev' = lit_lev 180 'eof' = lit_eof 181 'time' = lit_time 182 'date' = lit_date 183 'nargs' = lit_na 184 'exists' = lit_exist 185 'notexists' = lit_notexist 186 '(/' = lit_lbrack 187 '/)' = lit_rbrack 188 '.' = lit_dot 189 'init' = lit_init 190 'doing' = lit_doing 191 'while' = lit_while 192 'where' = lit_where 193 'st' = lit_where 194 'step' = lit_step 195 'until' = lit_until 196 'term' = lit_term 197 198$ define the extra parser opcodes 199 200 +* skip = op1(0) ** $ jump on keyword 201 +* save = op2(0) ** $ save current parser status 202 +* accept = op3(0) ** $ pop saved parser status 203 +* restore = op4(0) ** $ back-up parser 204 +* m(i) = op5(i) ** $ write marker 205 +* ok = set(1, 1) ** $ set parseok to true 206 +* fail = set(1, 0) ** $ set parseok to false 207 208 1 .=member prog 2 .=eject 3$ start of grammar 4$ ---------------- 5 6 = (back(0,1)) 7 / 8 9 = (put_card) (stat1) m(p_stat1) 10 11 / - 12 = 13 / - 14 = 15 / - 16 = 17 / -b 18 19 = m(p_gsym1) m(p_gsym2) 20 (back(0,1)) 21 m(p_save) (svtab) m(p_puttb) m(p_endm) 22 m(p_reset) (puttbs) (retab) 23 / -b -0 -17 -0 -0 24 25 = 26 / -b -0 -0 -0 27 28 = 29 / -b -0 -18 30 31 = 32 / -b -0 -18 33 34 = m(p_head6) m(p_save) (svtab) 35 m(p_sw2) m(p_puttb) 36 / -0 -0 -0 37 38 = (back(0,1)) 'end' (mx(p_sw1)) 39 (back(1,0)) 40 m(p_endm) m(p_reset) (puttbs) (retab) 41 / - -0 42 = $ no end statement found. too many ends. 43 (errend) m(p_save) (svtab) m(p_error) 44 (back(0,1)) 45 'else' +restbod 46 / - -0 -0 47 = (back(0,1)) +elsept 48 / - 49 = (back(0,1)) +elsept 50 / -restbod 51 52 = 'else' +restbod 53 / - -0 -0 54 = +restbod 55 / -0 56 57 = (back(0,1)) m(p_endb) 58 (back(0,1)) m(p_endr1) 59 m(p_puttb) m(p_endr2) m(p_reset) 60 (puttbs) (retab) +body 61 / -0 62 63 = 'end' (scanend) 64 / -63 -1 65 66 = 'directory' (atitle) (opentoks(0,0)) <*name> 67 m(p_dirct) 68 / -b -11 -1 69 70 = 'program' (atitle) (opentoks(0,0)) <*name> 71 '-' m(p_prog1) <*name> m(p_prog2) 72 / -b -12 - -13 -1 73 = m(p_prog3) 74 / -1 75 76 = 'library' (atitle) (opentoks(0,0)) <*name> 77 m(p_lib) 78 / -b -14 -1 79 80 = 'module' (atitle) (opentoks(0,0)) <*name> 81 m(p_mod1) '-' <*name> m(p_mod2) 82 / -b -15 -10 -16 -1 83 84 = m(p_head1) (back(0,1)) m(p_head5) 85 / 86 87 = <*rkey1> m(p_head2) 88 / - -19 -1 89 = <*rkey2> m(p_head2) 90 / -b -19 -1 91 92 = (back(0,1)) 93 / - 94 = 'all' m(p_head4) 95 / -b 96 97 = <*name> m(p_head3) 98 / -b 99 100 = ',' 101 / -b -19 102 103 = (back(0,1)) 104 / -b 105 106 = '(' ')' 107 m(p_pdcl1) m(p_head3) 108 / -b -pdecl3 -0 -pdecl2 -3 109 110 = ')' m(p_pdcl2) m(p_head3) 111 / -3 112 113 = ok m(p_pdcl3) m(p_head3) 114 / 115 116 = '(' '*' ')' 117 / -b -20 -3 118 119 = ',' 120 / -b -21 121 122 = <*name> (back(0,1)) 123 / -0 - 124 = ok 125 / 126 127 = ',' 128 / -b -0 129 130 = <*rwkey> 131 / - 132 = ok m(p_pdcl4) 133 / 134 135 = <*name> 136 / - 137 = <*bold> 138 / -b 139 140 = 'program' <*name> '-' <*name> ':' 141 m(p_head7) 142 / -b -22 -10 -23 -8 -0 143 144 = 'module' <*name> '-' <*name> ':' 145 m(p_head7) 146 / -b -24 -10 -25 -8 -0 147 148 = m(p_save) (svtab) m(p_mprog) m(p_endb) 149 (back(0,1)) m(p_endr1) m(p_puttb) 150 m(p_endr2) m(p_reset) (puttbs) (retab) 151 / -26 152 1 .=member decls 2 = (back(0,1)) 3 / 4 5 = <*dkey> (back(0,1)) skip 6 +constst +varst +initst 7 / -b 8 9 = (back(0,1)) 10 / -27 -1 11 12 = <*name> +citem1 13 / -b 14 15 = '=' m(p_cnst1) 16 / - -28 17 = ok m(p_cnst2) 18 / 19 20 = ',' 21 / -b -27 22 23 = m(p_var) 24 / -27 -0 -1 25 26 = ':' 'back' m(p_bk) 27 / - -29 28 = ok m(p_nobk) 29 / 30 31 = (back(0,1)) 32 / -27 -1 33 34 = <*name> m(p_name) ':=' m(p_init) 35 / -b -9 -28 36 37 = ',' 38 / -b -27 39 40 = m(p_cname) 41 / -b 42 43 = 'repr' (opentoks(0,0)) (back(0,1)) 44 (chkrepr) 45 / - -0 46 = ok 47 / 48 49 = ':' m(p_repr) 50 / - -8 -30 -1 51 = ':' 'operator' m(p_repr) 52 / - -8 -30 -0 -1 53 = 'mode' <*name> ':' m(p_mode) 54 / - -31 -8 -30 -1 55 = 'plex' 'base' m(p_plex) 56 / - -32 -33 -1 57 = 'base' ':' m(p_base1) 58 / -b -33 -8 -30 -1 59 60 = <*modekey> skip 61 +tprim1 +tint +tprim1 +tprim1 62 +tprim1 +tprim1 +tprim1 +telmt 63 +ttup1 +tset +tsmap +tsmap 64 +tmmap 65 / - 66 = '*' m(p_tgen) 67 / - 68 = <*btkey> m(p_tpref) $ sparse, etc 69 / - -34 70 = <*name> m(p_tmode) 71 / - 72 = 'procedure' +tprc1 73 / -b 74 75 = m(p_tprim) 76 / 77 78 = ok m(p_tprim) 79 / 80 81 = <*dots> (back(0,1)) m(p_tint) 82 / -tprim2 -35 -28 83 84 = (back(0,1)) <*name> m(p_telmt) 85 / -36 86 87 = '(' (back(0,1)) ')' 88 m(p_ttup1) 89 / -tprim2 -37 -ttup2 -3 90 91 = ')' '(' ')' m(p_ttup2) 92 / -3 -ttup3 -38 -3 93 94 = ok m(p_ttup3) 95 / 96 97 = '(' ')' m(p_tset) 98 / -tprim2 -39 -3 99 100 = '(' ')' m(p_tmap1) 101 / - -0 -3 -tsmap1 102 = ok m(p_tsmap) 103 / 104 105 = ok m(p_tgen) m(p_tmap1) 106 / 107 108 = '(' ')' m(p_tmmp1) 109 / - -0 -3 -tmmap1 110 = '<<' '>>' m(p_tmmp2) 111 / - -0 -5 -40 112 = ok m(p_tmmap) 113 / 114 115 = ok m(p_tgen) m(p_tmmp1) 116 / 117 118 = '(' ')' m(p_tprc4) 119 / -tprc2 - -tprc3 120 = ')' m(p_tprc1) 121 / -0 -3 -tprc3 122 123 = ok m(p_tprc2) 124 / 125 126 = ok m(p_tprc3) 127 / 128 129 = 130 / -41 131 132 = ',' 133 / -b -41 134 1 .=member routs 2 = +rbody 3 / - 4 = +rbody 5 / -b 6 7 = 'procedure' (atitle) (stat1) m(p_stat1) (put_card) 8 m(p_save) (svtab) (opentoks(0,0)) m(p_def4) 9 <*name> +plist 10 / -b -42 11 12 = 'operator' (atitle) (stat1) m(p_stat1) (put_card) 13 m(p_save) (svtab) (opentoks(0,0)) m(p_def5) 14 <*bold> +plist 15 / -b -43 16 17 = (copyx) m(p_def1) 18 m(p_def3) (mx(p_pdcl3)) (mx(p_pdcl7)) 19 / - 20 = '(' ')' 21 / -2 - -1 22 = (back(1,1)) (backx) (backx) 23 '(' (copyx) ')' 24 m(p_def2) (mx(p_pdcl1)) (mx(p_pdcl7)) 25 / -2 -0 -pnovary -3 -1 26 27 = ')' 28 m(p_def6) (mx(p_pdcl2)) (mx(p_pdcl7)) 29 / -3 -1 30 31 = <*rwkey> (copyx) <*name> 32 / - -44 33 = m(p_pdcl4) (mx(p_pdcl4)) <*name> 34 / -44 35 36 = ',' 37 / -b -0 38 39 = m(p_endb) 40 (back(0,1)) m(p_endr1) 41 m(p_puttb) m(p_endr2) m(p_reset) (puttbs) 42 (retab) 43 / -0 -0 -45 -0 44 45$ double colon follows = 46 = <*name> '::' m(p_perf1) m(p_perf2) 47 / -b -8 -0 48 1 .=member stats 2 = (back(0,1)) 3 / -b 4 5 = 6 / - 7 = fail 8 / - 9 = (chkst) 10 / 11 12$ double colon follows = 13 = <*name> '::' (back(1,1)) (back(1,0)) 14 / -b -back11 15 16 = (back(1,1)) 17 / 18 19 = (back(0,1)) 20 / 21 22 = 23 / - 24 = (chkst) 25 / 26 27 = (back(0,1)) 28 / -b 29 30 = <*name> ':' m(p_label) 31 / -b -back11 32 33 = <*stkey> (back(0,1)) skip 34 +asrtst +casest +contst +debugst 35 +exitst +failst +gotost +ifst 36 +loop1 +notrcst +quitst +retst 37 +stopst +scdst +tracest +yieldst 38 / - 39 = 'pass' 40 / - -1 41 = fail 42 / - 43 = 44 / - 45 = 46 / - 47 = 48 / -b 49 smfb 10 = m(p_asrt1) smfb 11 save ':=' accept m(p_asrt2) smfb 12 / - - -47 -1 smfb 13 = restore m(p_asrt3) smfb 14 / -46 -1 52 53 = +asntail 54 / -b 55 56 = <*bin> ':=' m(p_asn2) 57 / - -9 -47 -1 58 = <*unbin> ':=' m(p_asn2) 59 / - -9 -47 -1 60 = <*bold> ':=' m(p_asn2) 61 / - -9 -47 -1 62 = ':=' m(p_asn1) 63 / - -47 -1 64 = <*from> m(p_from1) 65 / -9 -48 -1 66 67 = save accept 68 / - 69 = restore 70 / 71 72 = <*name> m(p_call1) 73 / -b -callst2 74 75 = (back(0,1)) 76 '(' ')' m(p_call2) 77 / -b -callst3 -b -b 78 79 = ')' m(p_call3) 80 / -b -b 81 82 = (opentoks(0,0)) m(p_case1) m(p_case2) 'of' 83 (put_card) (new_stat) m(p_stat) 84 (back(0,1)) m(p_case3) 85 'else' m(p_case4) 86 / -49 -50 - -0 -0 87 = m(p_case4) 88 / -0 89 90 = (back(0,1)) m(p_case5) 91 / -b 92 93 = '(' m(p_tag1) 94 (back(0,1)) ')' ':' 95 / -b -51 -3 -8 96 97 = 'arb' m(p_tag3) 98 / - -52 99 = m(p_tag2) 100 / -b 101 102 = ',' 103 / -b -51 104 105 = (checktoks(0)) m(p_cont) 106 / -1 107 108 = m(p_debug) 109 / -53 -1 110 111 = <*debug> (bugact) 112 / -b 113 114 = ',' 115 / -b -53 116 117 = m(p_exit) 118 / -1 119 120 = m(p_fail) 121 / -1 122 123 = <*name> m(p_goto) 124 / -54 -1 125 126 = (opentoks(0,0)) m(p_if1) m(p_if2) 127 'then' (put_card) (new_stat) m(p_stat) 128 (back(0,1)) m(p_if3) 129 'else' m(p_if4) 130 / -55 -56 -0 - -0 -0 131 = $ if then elseif no else 132 m(p_if4) 133 / -0 134 135 = 'elseif' m(p_if5) m(p_if2) 136 'then' (put_card) (new_stat) m(p_stat) 137 / -b -57 -56 -0 138 139 = (opentoks(1,0)) 'do' +loop 140 / -58 -59 141 142 = '(' (opentoks(1,1)) ')' +loop 143 / -b - -59 144 $ full tag statement syntax not handled correctly 145 $ if there is no loop iterator, check for tag. 146 = (poptoks) (back(1, 1)) 147 / 148 149 150 = m(p_loop1) (put_card) (new_stat) m(p_stat) 151 m(p_loop2) 152 / -0 -0 153 154 = (checktoks(1)) m(p_quit) 155 / -1 156 157 = m(p_ret1) 158 / - -1 159 = m(p_ret2) 160 / -60 161 162 = m(p_stop) 163 / -1 164 165 = m(p_scdst) 166 / -1 167 168 = m(p_trace) 169 / -61 -1 170 171 = m(p_notrc) 172 / -61 -1 173 174 = <*trace> 175 / - 176 = <*name> 177 / -b 178 179 = ',' 180 / -b -61 181 182 = m(p_yield) 183 / -62 -1 184 185 = 'end' (endtoks) 186 / -98 -1 187 1 .=member exp 2 = (stackexp) (back(0,1)) (popexp) 3 / - 4 = (popexp) 5 / 6 7 = <*bin> +exptail1 8 / - 9 = <*unbin> +exptail1 10 / - 11 = <*bold> +exptail2 12 / - 13 = ':=' m(p_asn3) 14 / - -64 15 = <*from> m(p_from2) 16 / -b -65 17 18 = ':=' m(p_asn4) 19 / - -67 20 = (opprec(p_bin)) '/' +comp5 21 / - 22 = 23 / -68 24 25 = ':=' m(p_asn4) 26 / - -67 27 = (opprec(p_ubin)) '/' +comp5 28 / - 29 = 30 / -68 31 32 = (popop) m(p_comp4) '(/' '/)' m(p_comp5) 33 / -comp6 - -3 34 = (back(1,0)) +comp6 35 / 36 37 = m(p_comp6) 38 / -66 39 40 = 'exists' m(p_quant) m(p_exist) 41 / - -69 -70 42 = 'notexists' m(p_quant) m(p_nexst) 43 / - -69 -70 smfe 8 = 'forall' m(p_quant) 'st' m(p_univq) smfe 9 / - -69 -70 -87 46 = 'expr' m(p_eblk1) 'end' m(p_eblk2) 47 / - -0 -63 48 = 'newat' m(p_newat) 49 / - 50 = 'ok' m(p_ok) 51 / - 52 = 'lev' m(p_lev) 53 / - 54 = 'time' m(p_time) 55 / - 56 = 'date' m(p_date) 57 / - 58 = 'nargs' m(p_na) 59 / - 60 = 'eof' m(p_eof) 61 / - 62 = 63 / - 64 = 65 / - 66 = 67 / - 68 = <*un> (opprec(p_un)) 69 / - -71 70 = <*unbin> (opprec(p_un)) 71 / - -71 72 = <*bold> (opprec(p_uun)) 73 / - -71 74 = 75 / - 76 = 77 / -b 78 79 80 = 'case' m(p_case1) m(p_ifx1) m(p_case2) 'of' 81 (back(0,1)) m(p_case3) 82 'else' m(p_ifx2) 83 'end' m(p_case4) 84 / -b -72 -73 -74 -75 -76 -63 85 86 = m(p_ifx2) m(p_case5) 87 / -b -77 88 89 = ',' 90 / -b -74 91 92 93 = <*bin> '/' +comp2 94 / - -95 95 = <*bold> '/' +comp2 96 / - -notcomp 97 = <*unbin> '/' +comp2 98 / -b -notcomp 99 100 = m(p_comp1) '(/' '/)' m(p_comp2) 101 / -comp3 - -3 102 = (back(1,0)) +comp3 103 / 104 105 = m(p_comp3) 106 / -66 107 108 = (back(1,1)) 109 / 110 111 112 = <*int> m(p_int) 113 / - 114 = <*real> m(p_real) 115 / - 116 = <*string> m(p_str) 117 / -b 118 119 120 = 'if' m(p_if1) m(p_ifx1) m(p_if2) 121 'then' m(p_ifx2) 122 (back(0,1)) m(p_if3) 123 'else' m(p_ifx2) 124 'end' m(p_if4) 125 / -b -78 -79 -80 -75 -76 -63 126 127 = 'elseif' m(p_if5) m(p_if2) 128 'then' m(p_ifx2) 129 / -b -81 -79 -80 130 131 132 = '(' ')' (back(0,1)) 133 / - -82 -3 134 = <*name> (back(0,1)) 135 / - -toknam 136 = (back(0,1)) 137 / -b 138 139 = '<<' +set 140 / - 141 = '(/' +tuple 142 / -b 143 144 = m(p_set1) '>>' m(p_set2) 145 / - -5 146 = (back(0,1)) '>>' m(p_set3) 147 / - -5 148 = '>>' m(p_set4) 149 / -5 150 151 = m(p_tup1) '/)' m(p_tup2) 152 / - -7 153 = (back(0,1)) '/)' m(p_tup3) 154 / - -7 155 = '/)' m(p_tup4) 156 / -7 157 158 = save 159 ':' accept 160 / - - - smfb 15 = restore save smfb 16 m(p_iter1) m(p_bvar1) <*name> m(p_name) 'in' smfb 17 '(/' <*dots> (back(0,1)) '/)' smfb 18 m(p_arith) m(p_bvar2) accept smfb 19 / - - - - - - - - - smfb 20 = restore save smfb 21 m(p_iter1) m(p_bvar1) <*name> m(p_name) 'in' smfb 22 '<<' <*dots> (back(0,1)) '>>' smfb 23 m(p_arith) m(p_bvar2) accept smfb 24 / - - - - - - - - - 161 = restore save 162 m(p_iter1) m(p_bvar1) 'in' 163 m(p_seti) m(p_bvar2) accept 164 / - - - - 165 = restore save 166 m(p_iter1) m(p_bvar1) m(p_nonam) 167 <*dots> (back(0,1)) 168 m(p_arith) m(p_bvar2) accept 169 / - - - - 170 = restore fail 171 / 172 173 = <*name> (back(0,1)) 174 / - -toknam 175 = '(/' '/)' m(p_tup3) 176 / -b -b -b 177 178 = ok m(p_name) 179 / 180 181 = 182 / - 183 = '-' m(p_dash) 184 / -b 185 186 = ',' 187 / -b -b 188 189 = ',' 190 / -b -b 191 192 = <*name> (back(0,1)) 193 / - -toknam 194 = '(/' '/)' m(p_tup3) 195 / -b -83 -7 196 197 = 198 / - 199 = '-' m(p_dash) 200 / -b 201 202 = ',' 203 / -b -83 204 205 = '<<' '>>' m(p_ofa) 206 / - -84 -5 207 = '(' <*dots> (back(0,1)) ')' m(p_sub1) 208 / -b -fnp -of -sub2 -3 209 210 = ')' m(p_fnp) 211 / -3 212 213 = ')' m(p_of) 214 / -3 215 216 = ')' m(p_sub2) 217 / -3 218 219 = ',' 220 / -b -82 221 1 .=member iter 2 = 'for' 3 / - -69 4 = 'forall' 5 / - -69 6 = m(p_iter1) 7 +loopr1 8 / - 9 = +loopr2 10 / - 11 = +loopr3 12 / - 13 = +loopr4 14 / - 15 = +loopr5 16 / - 17 = 18 / - 19 = ')' (back(1,0)) 20 / - 21 = 'do' (back(1,0)) 22 / -b 23 24 = $ init seen 25 +loopr2 26 / -loopr2 27 28 = +loopr3 29 / -loopr3 30 31 = +loopr4 32 / -loopr4 33 34 = +loopr5 35 / -loopr5 36 37 = 38 / - 39 = ok 40 / 41 42 43 = 44 / -b - 45 = ok 46 / 47 48 = (back(0,1)) 49 / -b 50 51 = save 52 m(p_iter1) <*name> m(p_name) 'in' '(/' 53 <*dots> (back(0,1)) '/)' 54 m(p_arith) accept 55 / - - - - - - - - 56 = restore save 57 m(p_iter1) <*name> m(p_name) 'in' '<<' 58 <*dots> (back(0,1)) '>>' 59 m(p_arith) accept 60 / - - - - - - - - 61 = restore save 62 m(p_iter1) 'in' m(p_seti) accept 63 / - - - 64 = restore save 65 m(p_iter1) '=' <*name> accept 66 / - - - - 67 = restore fail 68 / 69 70 = ',' 71 / - -b 72 = ok m(p_nostp) 73 / 74 75 = '(' ')' m(p_domi1) 76 / - -b -b 77 = '<<' '>>' m(p_domi2) 78 / -b -b -b 79 80 = 81 / -b 82 83 = ',' m(p_iter2) m(p_iter3) 84 / -b -85 85 86 = 'init' m(p_init1) m(p_init2) 87 / -b -0 88 89 = 'doing' m(p_dng1) m(p_dng2) 90 / -b -0 91 92 = 'while' m(p_while) 93 / -b -86 94 95 = 'where' m(p_where) 96 / -b -87 97 98 = 'step' m(p_step1) m(p_step2) 99 / -b -0 100 101 = 'until' m(p_until) 102 / -b -88 103 104 = 'term' m(p_term1) m(p_term2) 105 / -b -0 106 1 .=member misc 2 = <*name> 3 / -b 4 5 = ',' <*name> 6 / -b -89 7 8 = <*bold> 9 / -b 10 11 = ',' <*bold> 12 / -b -96 13 14 = ';' (put_card) m(p_stat) (new_stat) 15 / -b 16 17 = ok m(p_error) 18 / 19 20 = $ recover by re-starting parser 21 m(p_save) (svtab) m(p_error) 22 (back(0,1)) m(p_endb) 23 (back(0,1)) m(p_endr1) 24 m(p_puttb) m(p_endr2) m(p_reset) 25 (puttbs) (retab) 26 27 / -0 28 29 end