1: /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
   2: 
   3: /*
   4:  * $Header: tabl.c,v 2.4 85/08/22 16:08:42 timo Exp $
   5:  */
   6: 
   7: /*
   8:  * B editor -- Grammar table.
   9:  */
  10: 
  11: #include "b.h"
  12: #include "node.h"
  13: #include "gram.h"
  14: #include "tabl.h"
  15: 
  16: 
  17: /*
  18:  * ***** DISCLAIMER *****
  19:  *
  20:  * This file is a mess.  There should really be a separate program (like Yacc)
  21:  * to compile a grammar into tables.  But for the time being . . .
  22:  */
  23: 
  24: 
  25: /*
  26:  * Values returned by function symbol(n).
  27:  * They are used directly as index in the grammar table.
  28:  * The NAMES of the #defined constants are of no importance outside this file.
  29:  */
  30: 
  31: #define Put 1
  32: #define Insert  2
  33: #define Remove  3
  34: #define Choose  4
  35: #define Draw    5
  36: #define Set_random  6
  37: #define Delete  7
  38: #define Check   8
  39: #define Share   9
  40: 
  41: #define Write   10
  42: #define Read    11
  43: #define Read_raw    12
  44: 
  45: #define If  13
  46: #define While   14
  47: #define For 15
  48: 
  49: #define Select  16
  50: 
  51: #define Quit    18
  52: #define Return  19
  53: #define Report  20
  54: #define Succeed 21
  55: #define Fail    22
  56: 
  57: #define How_to  23
  58: #define Yield   24
  59: #define Test    25
  60: #define Suite   26
  61: #define Refinement  27
  62: 
  63: #define Compound    28
  64: #define Collateral  29
  65: #define Tag 30
  66: #define Number  31
  67: #define Selection   32
  68: #define Behead  33
  69: #define Curtail 34
  70: 
  71: #define And 35
  72: #define Or  36
  73: #define Not 37
  74: #define Some_in 38
  75: #define Each_in 39
  76: #define No_in   40
  77: #define Some_parsing    41
  78: #define Each_parsing    42
  79: #define No_parsing  43
  80: 
  81: #define Comment 44
  82: #define Keyword 45
  83: 
  84: #define L_t_dis 46
  85: #define List_body   47
  86: #define Tab_body    48
  87: #define Tab_entry   49
  88: 
  89: #define E_number    50
  90: #define Com_target  51
  91: #define Col_target  52
  92: #define Sel_expr    53
  93: #define Text1   54
  94: #define Text2   55
  95: #define Grouped 56
  96: #define Blocked 57
  97: #define Operators   58
  98: 
  99: #define Else_kw 59
 100: #define Kw_plus 60
 101: #define E_plus  61
 102: #define Conversion  62
 103: #define T1  63
 104: #define T1_plus 64
 105: #define T2  65
 106: #define T2_plus 66
 107: #define Cmt_cmd 67
 108: 
 109: #define F_kw_plus   69
 110: #define F_e_plus    70
 111: #define Plus_sign   71
 112: #define Minus_sign  72
 113: 
 114: #define Long_comp   73
 115: #define Short_comp  74
 116: #define Cmt_comp    75
 117: 
 118: #define Long_unit   76
 119: #define Short_unit  77
 120: #define Cmt_head    78
 121: 
 122: #define Ref_join    79
 123: 
 124: #define And_kw  80
 125: #define Or_kw   81
 126: 
 127: #define E_part 82
 128: 
 129: #define Unit_edit   83
 130: #define Target_edit 84
 131: #define Imm_cmd 85
 132: #define Raw 86
 133: #define Raw_input   87
 134: #define Edit_unit   88
 135: #define Edit_target 89
 136: #define Colon   90
 137: #define Equals  91
 138: #define Test_suite  92
 139: #define Expression  93
 140: 
 141: /*
 142:  * The last three, `Suggestion', `Optional' and `Hole',
 143:  * with values 97, 98 and 99, are defined in "gram.h".
 144:  */
 145: 
 146: 
 147: /*
 148:  * Symbol values used for lexical elements.
 149:  * Cross-reference: "lexi.c", table `chclass'.
 150:  */
 151: 
 152: #define LEXICAL 100
 153: 
 154: #define IDENT (LEXICAL+0)
 155: #define KEYWORD (LEXICAL+1)
 156: #define NUMBER (LEXICAL+2)
 157: #define COMMENT (LEXICAL+3)
 158: #define TEXT1 (LEXICAL+4)
 159: #define TEXT2 (LEXICAL+5)
 160: #define OPERATORS (LEXICAL+6)
 161: #define RAWINPUT (LEXICAL+7)
 162: #define SUGGESTION (LEXICAL+8)
 163: 
 164: 
 165: /*
 166:  * Classes used in table initialization.
 167:  */
 168: 
 169: Hidden classelem Asugg_body[] = {SUGGESTION, 0};
 170:     Hidden struct classinfo sugg_body[] = {Asugg_body};
 171: 
 172: #define TARGET Tag, Com_target, Selection, Behead, Curtail
 173: #define PRIMARY \
 174:     Sel_expr, Tag, E_number, Number, Compound, L_t_dis, Text1, Text2
 175: #define EXPR Blocked, Grouped, Operators, PRIMARY
 176: 
 177: Hidden classelem Atag_body[] = {IDENT, 0};
 178:     Hidden struct classinfo tag_body[] = {Atag_body};
 179: Hidden classelem Anum_body[] = {NUMBER, 0};
 180:     Hidden struct classinfo num_body[] = {Anum_body};
 181: Hidden classelem Acom_body[] = {COMMENT, 0};
 182:     Hidden struct classinfo com_body[] = {Acom_body};
 183: Hidden classelem Akw_body[] = {KEYWORD, 0};
 184:     Hidden struct classinfo kw_body[] = {Akw_body};
 185: Hidden classelem At1_body[] = {TEXT1, 0};
 186:     Hidden struct classinfo t1_body[] = {At1_body};
 187: Hidden classelem At2_body[] = {TEXT2, 0};
 188:     Hidden struct classinfo t2_body[] = {At2_body};
 189: Hidden classelem Aops_body[] = {OPERATORS, 0};
 190:     Hidden struct classinfo ops_body[] = {Aops_body};
 191: Hidden classelem Araw_body[] = {RAWINPUT, 0};
 192:     Hidden struct classinfo raw_body[] = {Araw_body};
 193: Hidden classelem Araw_input[] = {Optional, Raw, 0};
 194:     Hidden struct classinfo raw_input[] = {Araw_input};
 195: 
 196: Hidden classelem Aid_or_kw[] = {Tag, Keyword, 0};
 197:     Hidden struct classinfo id_or_kw[] = {Aid_or_kw};
 198: Hidden classelem Anumber[] = {Number, 0};
 199:     Hidden struct classinfo number[] = {Anumber};
 200: Hidden classelem Asign[] = {Optional, Plus_sign, Minus_sign, 0};
 201:     Hidden struct classinfo sign[] = {Asign};
 202: 
 203: Hidden classelem Ao_c_expr[] = {Optional, Collateral, EXPR, 0};
 204:     Hidden struct classinfo o_c_expr[] = {Ao_c_expr};
 205: 
 206: #define Ac_expr (Ao_c_expr+1)
 207:     Hidden struct classinfo c_expr[] = {Ac_expr};
 208: #define Aexpr (Ao_c_expr+2)
 209:     Hidden struct classinfo expr[] = {Aexpr};
 210: #define Aprimary (Ao_c_expr+5)
 211:     Hidden struct classinfo primary[] = {Aprimary};
 212: 
 213: Hidden classelem Ablock[] = {Operators, PRIMARY, 0};
 214:     Hidden struct classinfo block[] = {Ablock};
 215: Hidden classelem Agroup[] = {Blocked, Operators, PRIMARY, 0};
 216:     Hidden struct classinfo group[] = {Agroup};
 217: 
 218: #define Ar_expr Agroup
 219:     Hidden struct classinfo r_expr[] = {Ar_expr};
 220: 
 221: Hidden classelem Al_t_body[] =  {Optional, List_body, PRIMARY, Blocked,
 222:     Grouped, Operators, Tab_body, Tab_entry, 0};
 223:     Hidden struct classinfo l_t_body[] = {Al_t_body};
 224: Hidden classelem Alist_body[] = {List_body, EXPR, 0};
 225:     Hidden struct classinfo list_body[] = {Alist_body};
 226: Hidden classelem Atab_body[] = {Tab_body, Tab_entry, 0};
 227:     Hidden struct classinfo tab_body[] = {Atab_body};
 228: Hidden classelem Atab_entry[] = {Tab_entry, 0};
 229:     Hidden struct classinfo tab_entry[] = {Atab_entry};
 230: 
 231: Hidden classelem Ac_target[] = {Col_target, TARGET, 0};
 232:     Hidden struct classinfo c_target[] = {Ac_target};
 233: 
 234: #define Atarget (Ac_target+1)
 235:     Hidden struct classinfo target[] = {Atarget};
 236: 
 237: #define SOME_ETC \
 238:     Not, Some_in, Each_in, No_in, Some_parsing, Each_parsing, No_parsing
 239: 
 240: Hidden classelem Ae_test[] = {Else_kw, SOME_ETC, And, Or, EXPR, 0};
 241:     Hidden struct classinfo e_test[] = {Ae_test};
 242: 
 243: #define Atest (Ae_test+1)
 244:     Hidden struct classinfo test[] = {Atest};
 245: #define At_test Aexpr
 246:     Hidden struct classinfo t_test[] = {At_test};
 247: Hidden classelem Ar_test[] = {SOME_ETC, EXPR, 0};
 248:     Hidden struct classinfo r_test[] = {Ar_test};
 249: Hidden classelem Aand_test[] = {SOME_ETC, And, EXPR, 0};
 250:     Hidden struct classinfo and_test[] = {Aand_test};
 251: Hidden classelem Aor_test[] = {SOME_ETC, Or, EXPR, 0};
 252:     Hidden struct classinfo or_test[] = {Aor_test};
 253: Hidden classelem Ac_test[] = {Collateral, SOME_ETC, And, Or, EXPR, 0};
 254:     Hidden struct classinfo c_test[] = {Ac_test};
 255:     /*
 256: 	 * This means that a compound expression may in fact
 257: 	 * contain a `collateral test', e.g. (a AND b, c AND d).
 258: 	 * Of course, this is illegal in B, but I couldn't
 259: 	 * solve the ambiguity of `(' where a test is expected
 260: 	 * otherwise (this may start a parenthesized test, or
 261: 	 * a compound expression; the latter may be followed
 262: 	 * by more expression fragments, the first may not).
 263: 	 */
 264: 
 265: Hidden classelem Acomment[] = {Comment, 0};
 266:     Hidden struct classinfo comment[] = {Acomment};
 267: Hidden classelem Ao_comment[] = {Optional, Comment, 0};
 268:     Hidden struct classinfo o_comment[] = {Ao_comment};
 269: 
 270: #define HEAD How_to, Yield, Test
 271: #define BODY HEAD, Cmt_head, Long_unit, Short_unit
 272: 
 273: /* The order here determines which are suggested first and is subject
 274:    to constant change! */
 275: #define SIMPLE_CMD SC1, SC2, SC3
 276: #define SC1 Share, Quit, Return, Write, Read, Read_raw, Put, Delete
 277: #define SC2 Report, Fail, Succeed, Insert, Remove, Check
 278: #define SC3 Choose, Draw, Set_random, Suggestion, Keyword, Kw_plus
 279: 
 280: #define CONTROL_CMD If, While, For
 281: #define COMP_CMD Short_comp, Long_comp, Cmt_comp, Select
 282: #define CMD If, For, COMP_CMD, SIMPLE_CMD, While
 283: /* #define SHORTCMD SIMPLE_CMD, Cmt_cmd */
 284: #define SHORTCMD If, For, SIMPLE_CMD, While, Short_comp, Cmt_comp, Cmt_cmd
 285: 
 286: Hidden classelem Ac_head[] = {Cmt_head, HEAD, 0};
 287:     Hidden struct classinfo c_head[] = {Ac_head};
 288: #define Ahead (Ac_head+1)
 289:     Hidden struct classinfo head[] = {Ahead};
 290: 
 291: Hidden classelem Aunit[] = {Optional, EXPR, BODY, Ref_join, 0};
 292:     Hidden struct classinfo unit[] = {Aunit};
 293: Hidden classelem Ao_refinements[] = {Optional, Refinement, 0};
 294:     Hidden struct classinfo o_refinements[] = {Ao_refinements};
 295: #define Arefinements (Ao_refinements+1)
 296:     Hidden struct classinfo refinements[] = {Arefinements};
 297: Hidden classelem Arefpred[] = {BODY, 0};
 298:     Hidden struct classinfo refpred[] = {Arefpred};
 299: 
 300: Hidden classelem Af_cmd[] = {Keyword, F_kw_plus, 0};
 301:     Hidden struct classinfo f_cmd[] = {Af_cmd};
 302: #define Af_formula Aexpr /*****/
 303:     Hidden struct classinfo f_formula[] = {Af_formula};
 304: 
 305: Hidden classelem Ao_suite[] = {Optional, Suite, 0};
 306:     Hidden struct classinfo o_suite[] = {Ao_suite};
 307: Hidden classelem At_suite[] = {Test_suite, 0};
 308:     Hidden struct classinfo t_suite[] = {At_suite};
 309: Hidden classelem Ao_t_suite[] = {Optional, Test_suite, 0};
 310:     Hidden struct classinfo o_t_suite[] = {Ao_t_suite};
 311: 
 312: Hidden classelem Acmd[] = {Comment, CMD, Cmt_cmd, 0};
 313:     Hidden struct classinfo cmd[] = {Acmd};
 314: Hidden classelem Ashortcmd[] = {SHORTCMD, 0};
 315:     Hidden struct classinfo shortcmd[] = {Ashortcmd};
 316: Hidden classelem Ao_cmdsuite[] = {Optional, SHORTCMD, Suite, 0};
 317:     Hidden struct classinfo o_cmdsuite[] = {Ao_cmdsuite};
 318: Hidden classelem Asuite[] = {Suite, 0};
 319:     Hidden struct classinfo suite[] = {Asuite};
 320: Hidden classelem Asimple_cmd[] = {SIMPLE_CMD, 0};
 321:     Hidden struct classinfo simple_cmd[] = {Asimple_cmd};
 322: 
 323: Hidden classelem Ac_ifforwhile[] = {CONTROL_CMD, Cmt_comp, 0};
 324:     Hidden struct classinfo c_ifforwhile[] = {Ac_ifforwhile};
 325: Hidden classelem Aifforwhile[] = {CONTROL_CMD, 0};
 326:     Hidden struct classinfo ifforwhile[] = {Aifforwhile};
 327: 
 328: Hidden classelem Akeyword[] = {Keyword, 0};
 329:     Hidden struct classinfo keyword[] = {Akeyword};
 330: Hidden classelem Akw_next[] = {Collateral, EXPR, Keyword, E_plus, Kw_plus, 0};
 331:     Hidden struct classinfo kw_next[] = {Akw_next};
 332: Hidden classelem Ae_next[] = {Keyword, Kw_plus, 0};
 333:     Hidden struct classinfo e_next[] = {Ae_next};
 334: 
 335: Hidden classelem Af_kw_next[] = {Tag, Keyword, F_kw_plus, F_e_plus, 0};
 336:     Hidden struct classinfo f_kw_next[] = {Af_kw_next};
 337: Hidden classelem Af_e_next[] = {Keyword, F_kw_plus, 0};
 338:     Hidden struct classinfo f_e_next[] = {Af_e_next};
 339: Hidden classelem Atag[] = {Tag, 0};
 340:     Hidden struct classinfo tag[] = {Atag};
 341: 
 342: Hidden classelem Atext1[] = {Optional, T1, Conversion, T1_plus, 0};
 343:     Hidden struct classinfo text1[] = {Atext1};
 344: Hidden classelem At1_conv[] = {T1, Conversion, 0};
 345:     Hidden struct classinfo t1_conv[] = {At1_conv};
 346: Hidden classelem At1_next[] = {T1, Conversion, T1_plus, 0};
 347:     Hidden struct classinfo t1_next[] = {At1_next};
 348: 
 349: Hidden classelem Atext2[] = {Optional, T2, Conversion, T2_plus, 0};
 350:     Hidden struct classinfo text2[] = {Atext2};
 351: Hidden classelem At2_conv[] = {T2, Conversion, 0};
 352:     Hidden struct classinfo t2_conv[] = {At2_conv};
 353: Hidden classelem At2_next[] = {T2, Conversion, T2_plus, 0};
 354:     Hidden struct classinfo t2_next[] = {At2_next};
 355: 
 356: Hidden classelem Aand[] = {And_kw, 0};
 357:     Hidden struct classinfo and[] = {Aand};
 358: Hidden classelem Aor[] = {Or_kw, 0};
 359:     Hidden struct classinfo or[] = {Aor};
 360: 
 361: Hidden classelem Ae_part[] = {E_part, 0};
 362:     Hidden struct classinfo e_part[] = {Ae_part};
 363: 
 364: Hidden classelem Aunit_edit[] = {Optional, BODY, Ref_join, 0};
 365:     Hidden struct classinfo unit_edit[] = {Aunit_edit};
 366: Hidden classelem Atarget_edit[] = {Optional, EXPR, 0};
 367:     Hidden struct classinfo target_edit[] = {Atarget_edit};
 368: Hidden classelem Aimm_cmd[] = {Optional, Comment, HEAD, CMD, Cmt_cmd, Cmt_head,
 369:     Edit_unit, Edit_target, 0};
 370:     Hidden struct classinfo imm_cmd[] = {Aimm_cmd};
 371: 
 372: Hidden classelem Aed_unit[] = {Optional, Tag, Keyword, Colon, 0};
 373:     Hidden struct classinfo ed_unit[] = {Aed_unit};
 374: Hidden classelem Aed_target[] = {Optional, Tag, Equals, 0};
 375:     Hidden struct classinfo ed_target[] = {Aed_target};
 376: 
 377: 
 378: /*
 379:  * WARNING: The entries in this table must correspond one by one
 380:  * to the symbols defined earlier.  This is checked dynamically
 381:  * by the initialization procedure (syserr "table order").
 382:  */
 383: 
 384: #define XX(name) name, "name"
 385: 
 386: Hidden struct table b_grammar[] = {
 387:     {XX(Rootsymbol), {0}, {unit}}, /* Start symbol of the grammar,
 388: 			may be overridden by setroot("Blabla") call. */
 389:     {XX(Put), {"PUT ", " IN "}, {c_expr, c_target}},
 390:     {XX(Insert), {"INSERT ", " IN "}, {c_expr, target}},
 391:     {XX(Remove), {"REMOVE ", " FROM "}, {c_expr, target}},
 392:     {XX(Choose), {"CHOOSE ", " FROM "}, {c_expr, expr}},
 393:     {XX(Draw), {"DRAW "}, {target}},
 394:     {XX(Set_random), {"SET'RANDOM "}, {c_expr}},
 395:     {XX(Delete), {"DELETE "}, {c_target}},
 396:     {XX(Check), {"CHECK "}, {test}},
 397:     {XX(Share), {"SHARE "}, {c_target}},
 398: 
 399:     {XX(Write), {"WRITE "}, {c_expr}},
 400:     {XX(Read), {"READ ", " EG "}, {c_target, c_expr}},
 401:     {XX(Read_raw), {"READ ", " RAW"}, {target}},
 402: 
 403:     {XX(If), {"IF ", ": "}, {test}},
 404:     {XX(While), {"WHILE ", ": "}, {test}},
 405:     {XX(For), {"FOR ", " IN ", ": "}, {c_target, expr}},
 406: 
 407:     {XX(Select), {"SELECT: ", "\t", "\b"}, {o_comment, t_suite}},
 408:     {0}, /* Test_suite moved to 92 */
 409: 
 410:     {XX(Quit), {"QUIT"}, {0}},
 411:     {XX(Return), {"RETURN "}, {c_expr}},
 412:     {XX(Report), {"REPORT "}, {test}},
 413:     {XX(Succeed), {"SUCCEED"}, {0}},
 414:     {XX(Fail), {"FAIL"}, {0}},
 415: 
 416:     {XX(How_to), {"HOW'TO ", ": "}, {f_cmd}},
 417:     {XX(Yield), {"YIELD ", ": "}, {f_formula}},
 418:     {XX(Test), {"TEST ", ": "}, {f_formula}},
 419: 
 420:     {XX(Suite), {"\n"}, {cmd, o_suite}},
 421:     {XX(Refinement), {"\n", ": ", "\t", "\b"},
 422:         {id_or_kw, o_comment, o_cmdsuite, o_refinements}},
 423: 
 424:     {XX(Compound), {"(", ")"}, {c_test}},
 425:     {XX(Collateral), {0, ", "}, {expr, c_expr}},
 426:     {XX(Tag), {0}, {tag_body}},
 427:     {XX(Number), {0}, {num_body}},
 428:     {XX(Selection), {0, "[", "]"}, {target, c_expr}},
 429:     {XX(Behead), {0, "@"}, {target, r_expr}},
 430:     {XX(Curtail), {0, "|"}, {target, r_expr}},
 431: 
 432:     {XX(And), {0, " "}, {t_test, and}},
 433:     {XX(Or), {0, " "}, {t_test, or}},
 434:     {XX(Not), {"NOT "}, {r_test}},
 435:     {XX(Some_in), {"SOME ", " IN ", " HAS "}, {c_target, expr, r_test}},
 436:     {XX(Each_in), {"EACH ", " IN ", " HAS "}, {c_target, expr, r_test}},
 437:     {XX(No_in), {"NO ", " IN ", " HAS "}, {c_target, expr, r_test}},
 438:     {XX(Some_parsing), {"SOME ", " PARSING ", " HAS "},
 439:         {c_target, expr, r_test}},
 440:     {XX(Each_parsing), {"EACH ", " PARSING ", " HAS "},
 441:         {c_target, expr, r_test}},
 442:     {XX(No_parsing), {"NO ", " PARSING ", " HAS "}, {c_target, expr, r_test}},
 443: 
 444:     {XX(Comment), {0}, {com_body}},
 445:     {XX(Keyword), {0}, {kw_body}},
 446: 
 447:     {XX(L_t_dis), {"{", "}"}, {l_t_body}},
 448:     {XX(List_body), {0, "; "}, {expr, list_body}},
 449:     {XX(Tab_body), {0, "; "}, {tab_entry, tab_body}},
 450:     {XX(Tab_entry), {"[", "]: "}, {c_expr, expr}},
 451:     {XX(E_number), {0}, {number, e_part}},
 452: 
 453:     {XX(Com_target), {"(", ")"}, {c_target}},
 454:     {XX(Col_target), {0, ", "}, {target, c_target}},
 455:     {XX(Sel_expr), {0, "[", "]"}, {primary, c_expr}},
 456: 
 457:     {XX(Text1), {"'", "'"}, {text1}},
 458:     {XX(Text2), {"\"", "\""}, {text2}},
 459:     {XX(Grouped), {0, " "}, {group, expr}},
 460:     {XX(Blocked), {0}, {block, group}},
 461:     {XX(Operators), {0}, {ops_body}},
 462:     {XX(Else_kw), {"ELSE"}, {0}},
 463:     {XX(Kw_plus), {0, " "}, {keyword, kw_next}},
 464:     {XX(E_plus), {0, " "}, {c_expr, e_next}},
 465:     {XX(Conversion), {"`", "`"}, {o_c_expr}},
 466:     {XX(T1), {0}, {t1_body}},
 467:     {XX(T1_plus), {0}, {t1_conv, t1_next}},
 468:     {XX(T2), {0}, {t2_body}},
 469:     {XX(T2_plus), {0}, {t2_conv, t2_next}},
 470:     {XX(Cmt_cmd), {0, " "}, {simple_cmd, comment}},
 471:     {0},
 472:     {XX(F_kw_plus), {0, " "}, {keyword, f_kw_next}},
 473:     {XX(F_e_plus), {0, " "}, {tag, f_e_next}},
 474:     {XX(Plus_sign), {"+"}, {0}},
 475:     {XX(Minus_sign), {"-"}, {0}},
 476: 
 477:     {XX(Long_comp), {0, "\t", "\b"}, {c_ifforwhile, suite}},
 478:     {XX(Short_comp), {0, "\t", "\b"}, {ifforwhile, shortcmd}},
 479:     {XX(Cmt_comp), {0}, {ifforwhile, comment}},
 480: 
 481:     {XX(Long_unit), {0, "\t", "\b"}, {c_head, suite}},
 482:     {XX(Short_unit), {0, "\t", "\b"}, {head, shortcmd}},
 483:     {XX(Cmt_head), {0}, {head, comment}},
 484: 
 485:     {XX(Ref_join), {0}, {refpred, refinements}},
 486: 
 487:     {XX(And_kw), {"AND "}, {and_test}},
 488:     {XX(Or_kw), {"OR "}, {or_test}},
 489: 
 490:     {XX(E_part), {"E"}, {sign, number}},
 491: 
 492:     /* Alternate root symbols */
 493: 
 494:     {XX(Unit_edit), {0}, {unit_edit}},
 495:     {XX(Target_edit), {0}, {target_edit}},
 496:     {XX(Imm_cmd), {0}, {imm_cmd}},
 497:     {XX(Raw), {0}, {raw_body}},
 498:     {XX(Raw_input), {0}, {raw_input}},
 499:     {XX(Edit_unit), {":"}, {ed_unit}},
 500:     {XX(Edit_target), {"="}, {ed_target}},
 501:     {XX(Colon), {":"}, {0}},
 502:     {XX(Equals), {"="}, {0}},
 503:     {XX(Test_suite), {"\n", ": ", "\t", "\b"},
 504:         {e_test, o_comment, o_cmdsuite, o_t_suite}},
 505:     {XX(Expression), {0}, {c_expr}},
 506: 
 507:     /* Spare(s); change Optional and Hole in "gram.h" if you run out. */
 508: 
 509:     {0}, {0}, {0},
 510: 
 511:     /* Next three entries must be the last entries of the table. */
 512:     /* (See comments in "gram.c", initgram().) */
 513: 
 514:     {XX(Suggestion), {0}, {sugg_body}},
 515:     {XX(Optional), {0}, {0}},
 516:     {XX(Hole), {"?"}, {0}},
 517: };
 518: 
 519: Visible struct table *table= b_grammar;

Defined variables

Aand defined in line 356; used 1 times
Aand_test defined in line 249; used 1 times
Ablock defined in line 213; used 1 times
Ac_head defined in line 286; used 2 times
Ac_ifforwhile defined in line 323; used 1 times
Ac_target defined in line 231; used 2 times
Ac_test defined in line 253; used 1 times
Acmd defined in line 312; used 1 times
Acom_body defined in line 181; used 1 times
Acomment defined in line 265; used 1 times
Ae_next defined in line 332; used 1 times
Ae_part defined in line 361; used 1 times
Ae_test defined in line 240; used 2 times
Aed_target defined in line 374; used 1 times
Aed_unit defined in line 372; used 1 times
Af_cmd defined in line 300; used 1 times
Af_e_next defined in line 337; used 1 times
Af_kw_next defined in line 335; used 1 times
Agroup defined in line 215; used 2 times
Aid_or_kw defined in line 196; used 1 times
Aifforwhile defined in line 325; used 1 times
Aimm_cmd defined in line 368; used 1 times
Akeyword defined in line 328; used 1 times
Akw_body defined in line 183; used 1 times
Akw_next defined in line 330; used 1 times
Al_t_body defined in line 221; used 1 times
Alist_body defined in line 224; used 1 times
Anum_body defined in line 179; used 1 times
Anumber defined in line 198; used 1 times
Ao_c_expr defined in line 203; used 4 times
Ao_cmdsuite defined in line 316; used 1 times
Ao_comment defined in line 267; used 1 times
Ao_refinements defined in line 293; used 2 times
Ao_suite defined in line 305; used 1 times
Ao_t_suite defined in line 309; used 1 times
Aops_body defined in line 189; used 1 times
Aor defined in line 358; used 1 times
Aor_test defined in line 251; used 1 times
Ar_test defined in line 247; used 1 times
Araw_body defined in line 191; used 1 times
Araw_input defined in line 193; used 1 times
Arefpred defined in line 297; used 1 times
Ashortcmd defined in line 314; used 1 times
Asign defined in line 200; used 1 times
Asimple_cmd defined in line 320; used 1 times
Asugg_body defined in line 169; used 1 times
Asuite defined in line 318; used 1 times
At1_body defined in line 185; used 1 times
At1_conv defined in line 344; used 1 times
At1_next defined in line 346; used 1 times
At2_body defined in line 187; used 1 times
At2_conv defined in line 351; used 1 times
At2_next defined in line 353; used 1 times
At_suite defined in line 307; used 1 times
Atab_body defined in line 226; used 1 times
Atab_entry defined in line 228; used 1 times
Atag defined in line 339; used 1 times
Atag_body defined in line 177; used 1 times
Atarget_edit defined in line 366; used 1 times
Atext1 defined in line 342; used 1 times
Atext2 defined in line 349; used 1 times
Aunit defined in line 291; used 1 times
Aunit_edit defined in line 364; used 1 times
and defined in line 357; used 1 times
and_test defined in line 250; used 1 times
b_grammar defined in line 386; used 1 times
block defined in line 214; used 1 times
c_expr defined in line 207; used 14 times
c_head defined in line 287; used 1 times
c_ifforwhile defined in line 324; used 1 times
c_target defined in line 232; used 13 times
c_test defined in line 254; used 1 times
cmd defined in line 313; used 1 times
com_body defined in line 182; used 1 times
comment defined in line 266; used 3 times
e_next defined in line 333; used 1 times
e_part defined in line 362; used 1 times
e_test defined in line 241; used 1 times
ed_target defined in line 375; used 1 times
ed_unit defined in line 373; used 1 times
expr defined in line 209; used 12 times
f_cmd defined in line 301; used 1 times
f_e_next defined in line 338; used 1 times
f_formula defined in line 303; used 2 times
f_kw_next defined in line 336; used 1 times
group defined in line 216; used 2 times
head defined in line 289; used 2 times
id_or_kw defined in line 197; used 1 times
ifforwhile defined in line 326; used 2 times
imm_cmd defined in line 370; used 1 times
keyword defined in line 329; used 2 times
kw_body defined in line 184; used 1 times
kw_next defined in line 331; used 1 times
l_t_body defined in line 223; used 1 times
list_body defined in line 225; used 1 times
num_body defined in line 180; used 1 times
number defined in line 199; used 2 times
o_c_expr defined in line 204; used 1 times
o_cmdsuite defined in line 317; used 2 times
o_comment defined in line 268; used 3 times
o_refinements defined in line 294; used 1 times
o_suite defined in line 306; used 1 times
o_t_suite defined in line 310; used 1 times
ops_body defined in line 190; used 1 times
or defined in line 359; used 1 times
or_test defined in line 252; used 1 times
primary defined in line 211; used 1 times
r_expr defined in line 219; used 2 times
r_test defined in line 248; used 7 times
raw_body defined in line 192; used 1 times
raw_input defined in line 194; used 1 times
refinements defined in line 296; used 1 times
refpred defined in line 298; used 1 times
shortcmd defined in line 315; used 2 times
sign defined in line 201; used 1 times
simple_cmd defined in line 321; used 1 times
sugg_body defined in line 170; used 1 times
suite defined in line 319; used 2 times
t1_body defined in line 186; used 1 times
t1_conv defined in line 345; used 1 times
t1_next defined in line 347; used 1 times
t2_body defined in line 188; used 1 times
t2_conv defined in line 352; used 1 times
t2_next defined in line 354; used 1 times
t_suite defined in line 308; used 1 times
t_test defined in line 246; used 2 times
tab_body defined in line 227; used 1 times
tab_entry defined in line 229; used 1 times
table defined in line 519; never used
tag defined in line 340; used 1 times
tag_body defined in line 178; used 1 times
target defined in line 235; used 8 times
target_edit defined in line 367; used 1 times
test defined in line 244; used 4 times
text1 defined in line 343; used 1 times
text2 defined in line 350; used 1 times
unit defined in line 292; used 1 times
unit_edit defined in line 365; used 1 times

Defined macros

Ac_expr defined in line 206; used 1 times
Aexpr defined in line 208; used 3 times
Af_formula defined in line 302; used 1 times
Ahead defined in line 288; used 1 times
And defined in line 71; used 4 times
And_kw defined in line 124; used 2 times
Aprimary defined in line 210; used 1 times
Ar_expr defined in line 218; used 1 times
Arefinements defined in line 295; used 1 times
At_test defined in line 245; used 1 times
Atarget defined in line 234; used 1 times
Atest defined in line 243; used 1 times
BODY defined in line 271; used 3 times
Behead defined in line 68; used 2 times
Blocked defined in line 96; used 4 times
CMD defined in line 282; used 2 times
COMMENT defined in line 157; used 1 times
COMP_CMD defined in line 281; used 1 times
CONTROL_CMD defined in line 280; used 2 times
Check defined in line 38; used 2 times
Choose defined in line 34; used 2 times
Cmt_cmd defined in line 107; used 4 times
Cmt_comp defined in line 116; used 4 times
Cmt_head defined in line 120; used 4 times
Col_target defined in line 91; used 2 times
Collateral defined in line 64; used 4 times
Colon defined in line 136; used 2 times
Com_target defined in line 90; used 2 times
Comment defined in line 81; used 5 times
Compound defined in line 63; used 2 times
Conversion defined in line 102; used 7 times
Curtail defined in line 69; used 2 times
Delete defined in line 37; used 2 times
Draw defined in line 35; used 2 times
EXPR defined in line 175; used 10 times
E_number defined in line 89; used 2 times
E_part defined in line 127; used 2 times
E_plus defined in line 101; used 2 times
Each_in defined in line 75; used 2 times
Each_parsing defined in line 78; used 2 times
Edit_target defined in line 135; used 2 times
Edit_unit defined in line 134; used 2 times
Else_kw defined in line 99; used 2 times
Equals defined in line 137; used 2 times
Expression defined in line 139; used 1 times
F_e_plus defined in line 110; used 2 times
F_kw_plus defined in line 109; used 4 times
Fail defined in line 55; used 2 times
For defined in line 47; used 4 times
Grouped defined in line 95; used 3 times
HEAD defined in line 270; used 3 times
How_to defined in line 57; used 2 times
IDENT defined in line 154; used 1 times
If defined in line 45; used 4 times
Imm_cmd defined in line 131; used 1 times
Insert defined in line 32; used 2 times
KEYWORD defined in line 155; used 1 times
Keyword defined in line 82; used 10 times
Kw_plus defined in line 100; used 4 times
LEXICAL defined in line 152; used 9 times
L_t_dis defined in line 84; used 2 times
List_body defined in line 85; used 3 times
Long_comp defined in line 114; used 2 times
Long_unit defined in line 118; used 2 times
Minus_sign defined in line 112; used 2 times
NUMBER defined in line 156; used 1 times
No_in defined in line 76; used 2 times
No_parsing defined in line 79; used 2 times
Not defined in line 73; used 2 times
Number defined in line 66; used 3 times
OPERATORS defined in line 160; used 1 times
Operators defined in line 97; used 5 times
Or defined in line 72; used 4 times
Or_kw defined in line 125; used 2 times
PRIMARY defined in line 173; used 4 times
Plus_sign defined in line 111; used 2 times
Put defined in line 31; used 2 times
Quit defined in line 51; used 2 times
RAWINPUT defined in line 161; used 1 times
Raw defined in line 132; used 2 times
Raw_input defined in line 133; used 1 times
Read defined in line 42; used 2 times
Read_raw defined in line 43; used 2 times
Ref_join defined in line 122; used 3 times
Refinement defined in line 61; used 2 times
Remove defined in line 33; used 2 times
Report defined in line 53; used 2 times
Return defined in line 52; used 2 times
SC1 defined in line 276; used 1 times
SC2 defined in line 277; used 1 times
SC3 defined in line 278; used 1 times
SHORTCMD defined in line 284; used 2 times
SIMPLE_CMD defined in line 275; used 3 times
SOME_ETC defined in line 237; used 5 times
SUGGESTION defined in line 162; used 1 times
Sel_expr defined in line 92; used 2 times
Select defined in line 49; used 2 times
Selection defined in line 67; used 2 times
Set_random defined in line 36; used 2 times
Share defined in line 39; used 2 times
Short_comp defined in line 115; used 3 times
Short_unit defined in line 119; used 2 times
Some_in defined in line 74; used 2 times
Some_parsing defined in line 77; used 2 times
Succeed defined in line 54; used 2 times
Suite defined in line 60; used 4 times
T1 defined in line 103; used 4 times
T1_plus defined in line 104; used 3 times
T2 defined in line 105; used 4 times
T2_plus defined in line 106; used 3 times
TARGET defined in line 172; used 1 times
TEXT1 defined in line 158; used 1 times
TEXT2 defined in line 159; used 1 times
Tab_body defined in line 86; used 3 times
Tab_entry defined in line 87; used 4 times
Tag defined in line 65; used 8 times
Target_edit defined in line 130; used 1 times
Test defined in line 59; used 2 times
Test_suite defined in line 138; used 3 times
Text1 defined in line 93; used 2 times
Text2 defined in line 94; used 2 times
Unit_edit defined in line 129; used 1 times
While defined in line 46; used 4 times
Write defined in line 41; used 2 times
XX defined in line 384; used 95 times
Yield defined in line 58; used 2 times
Last modified: 1985-08-27
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 4671
Valid CSS Valid XHTML 1.0 Strict