# 2.11BSD#431 - /usr/src/new/PORT/B/src/bed/tabl.c

##### Variables

    Aand              X
    Aand_test         X
    Ablock            X
    Ac_head           X
    Ac_ifforwhile     X
    Ac_target         X
    Ac_test           X
    Acmd              X
    Acom_body         X
    Acomment          X
    Ae_next           X
    Ae_part           X
    Ae_test           X
    Aed_target        X
    Aed_unit          X
    Af_cmd            X
    Af_e_next         X
    Af_kw_next        X
    Agroup            X
    Aid_or_kw         X
    Aifforwhile       X
    Aimm_cmd          X
    Akeyword          X
    Akw_body          X
    Akw_next          X
    Al_t_body         X
    Alist_body        X
    Anum_body         X
    Anumber           X
    Ao_c_expr         X
    Ao_cmdsuite       X
    Ao_comment        X
    Ao_refinements    X
    Ao_suite          X
    Ao_t_suite        X
    Aops_body         X
    Aor               X
    Aor_test          X
    Ar_test           X
    Araw_body         X
    Araw_input        X
    Arefpred          X
    Ashortcmd         X
    Asign             X
    Asimple_cmd       X
    Asugg_body        X
    Asuite            X
    At1_body          X
    At1_conv          X
    At1_next          X
    At2_body          X
    At2_conv          X
    At2_next          X
    At_suite          X
    Atab_body         X
    Atab_entry        X
    Atag              X
    Atag_body         X
    Atarget_edit      X
    Atext1            X
    Atext2            X
    Aunit             X
    Aunit_edit        X
    and               X
    and_test          X
    b_grammar         X
    block             X
    c_expr            X
    c_head            X
    c_ifforwhile      X
    c_target          X
    c_test            X
    cmd               X
    com_body          X
    comment           X
    e_next            X
    e_part            X
    e_test            X
    ed_target         X
    ed_unit           X
    expr              X
    f_cmd             X
    f_e_next          X
    f_formula         X
    f_kw_next         X
    group             X
    head              X
    id_or_kw          X
    ifforwhile        X
    imm_cmd           X
    keyword           X
    kw_body           X
    kw_next           X
    l_t_body          X
    list_body         X
    num_body          X
    number            X
    o_c_expr          X
    o_cmdsuite        X
    o_comment         X
    o_refinements     X
    o_suite           X
    o_t_suite         X
    ops_body          X
    or                X
    or_test           X
    primary           X
    r_expr            X
    r_test            X
    raw_body          X
    raw_input         X
    refinements       X
    refpred           X
    shortcmd          X
    sign              X
    simple_cmd        X
    sugg_body         X
    suite             X
    t1_body           X
    t1_conv           X
    t1_next           X
    t2_body           X
    t2_conv           X
    t2_next           X
    t_suite           X
    t_test            X
    tab_body          X
    tab_entry         X
    table             X
    tag               X
    tag_body          X
    target            X
    target_edit       X
    test              X
    text1             X
    text2             X
    unit              X
    unit_edit         X

##### Macros

    Ac_expr           X
    Aexpr             X
    Af_formula        X
    Ahead             X
    And               X
    And_kw            X
    Aprimary          X
    Ar_expr           X
    Arefinements      X
    At_test           X
    Atarget           X
    Atest             X
    BODY              X
    Behead            X
    Blocked           X
    CMD               X
    COMMENT           X
    COMP_CMD          X
    CONTROL_CMD       X
    Check             X
    Choose            X
    Cmt_cmd           X
    Cmt_comp          X
    Cmt_head          X
    Col_target        X
    Collateral        X
    Colon             X
    Com_target        X
    Comment           X
    Compound          X
    Conversion        X
    Curtail           X
    Delete            X
    Draw              X
    EXPR              X
    E_number          X
    E_part            X
    E_plus            X
    Each_in           X
    Each_parsing      X
    Edit_target       X
    Edit_unit         X
    Else_kw           X
    Equals            X
    Expression        X
    F_e_plus          X
    F_kw_plus         X
    Fail              X
    For               X
    Grouped           X
    HEAD              X
    How_to            X
    IDENT             X
    If                X
    Imm_cmd           X
    Insert            X
    KEYWORD           X
    Keyword           X
    Kw_plus           X
    LEXICAL           X
    L_t_dis           X
    List_body         X
    Long_comp         X
    Long_unit         X
    Minus_sign        X
    NUMBER            X
    No_in             X
    No_parsing        X
    Not               X
    Number            X
    OPERATORS         X
    Operators         X
    Or                X
    Or_kw             X
    PRIMARY           X
    Plus_sign         X
    Put               X
    Quit              X
    RAWINPUT          X
    Raw               X
    Raw_input         X
    Read              X
    Read_raw          X
    Ref_join          X
    Refinement        X
    Remove            X
    Report            X
    Return            X
    SC1               X
    SC2               X
    SC3               X
    SHORTCMD          X
    SIMPLE_CMD        X
    SOME_ETC          X
    SUGGESTION        X
    Sel_expr          X
    Select            X
    Selection         X
    Set_random        X
    Share             X
    Short_comp        X
    Short_unit        X
    Some_in           X
    Some_parsing      X
    Succeed           X
    Suite             X
    T1                X
    T1_plus           X
    T2                X
    T2_plus           X
    TARGET            X
    TEXT1             X
    TEXT2             X
    Tab_body          X
    Tab_entry         X
    Tag               X
    Target_edit       X
    Test              X
    Test_suite        X
    Text1             X
    Text2             X
    Unit_edit         X
    While             X
    Write             X
    XX                X
    Yield             X

       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

- in line 357

Aand_test defined in line 249; used 1 times

- in line 250

Ablock defined in line 213; used 1 times

- in line 214

Ac_head defined in line 286; used 2 times

- in line 287-288(2)

Ac_ifforwhile defined in line 323; used 1 times

- in line 324

Ac_target defined in line 231; used 2 times

- in line 232-234(2)

Ac_test defined in line 253; used 1 times

- in line 254

Acmd defined in line 312; used 1 times

- in line 313

Acom_body defined in line 181; used 1 times

- in line 182

Acomment defined in line 265; used 1 times

- in line 266

Ae_next defined in line 332; used 1 times

- in line 333

Ae_part defined in line 361; used 1 times

- in line 362

Ae_test defined in line 240; used 2 times

- in line 241-243(2)

Aed_target defined in line 374; used 1 times

- in line 375

Aed_unit defined in line 372; used 1 times

- in line 373

Af_cmd defined in line 300; used 1 times

- in line 301

Af_e_next defined in line 337; used 1 times

- in line 338

Af_kw_next defined in line 335; used 1 times

- in line 336

Agroup defined in line 215; used 2 times

- in line 216-218(2)

Aid_or_kw defined in line 196; used 1 times

- in line 197

Aifforwhile defined in line 325; used 1 times

- in line 326

Aimm_cmd defined in line 368; used 1 times

- in line 370

Akeyword defined in line 328; used 1 times

- in line 329

Akw_body defined in line 183; used 1 times

- in line 184

Akw_next defined in line 330; used 1 times

- in line 331

Al_t_body defined in line 221; used 1 times

- in line 223

Alist_body defined in line 224; used 1 times

- in line 225

Anum_body defined in line 179; used 1 times

- in line 180

Anumber defined in line 198; used 1 times

- in line 199

Ao_c_expr defined in line 203; used 4 times

- in line 204-210(4)

Ao_cmdsuite defined in line 316; used 1 times

- in line 317

Ao_comment defined in line 267; used 1 times

- in line 268

Ao_refinements defined in line 293; used 2 times

- in line 294-295(2)

Ao_suite defined in line 305; used 1 times

- in line 306

Ao_t_suite defined in line 309; used 1 times

- in line 310

Aops_body defined in line 189; used 1 times

- in line 190

Aor defined in line 358; used 1 times

- in line 359

Aor_test defined in line 251; used 1 times

- in line 252

Ar_test defined in line 247; used 1 times

- in line 248

Araw_body defined in line 191; used 1 times

- in line 192

Araw_input defined in line 193; used 1 times

- in line 194

Arefpred defined in line 297; used 1 times

- in line 298

Ashortcmd defined in line 314; used 1 times

- in line 315

Asign defined in line 200; used 1 times

- in line 201

Asimple_cmd defined in line 320; used 1 times

- in line 321

Asugg_body defined in line 169; used 1 times

- in line 170

Asuite defined in line 318; used 1 times

- in line 319

At1_body defined in line 185; used 1 times

- in line 186

At1_conv defined in line 344; used 1 times

- in line 345

At1_next defined in line 346; used 1 times

- in line 347

At2_body defined in line 187; used 1 times

- in line 188

At2_conv defined in line 351; used 1 times

- in line 352

At2_next defined in line 353; used 1 times

- in line 354

At_suite defined in line 307; used 1 times

- in line 308

Atab_body defined in line 226; used 1 times

- in line 227

Atab_entry defined in line 228; used 1 times

- in line 229

Atag defined in line 339; used 1 times

- in line 340

Atag_body defined in line 177; used 1 times

- in line 178

Atarget_edit defined in line 366; used 1 times

- in line 367

Atext1 defined in line 342; used 1 times

- in line 343

Atext2 defined in line 349; used 1 times

- in line 350

Aunit defined in line 291; used 1 times

- in line 292

Aunit_edit defined in line 364; used 1 times

- in line 365

and defined in line 357; used 1 times

- in line 432

and_test defined in line 250; used 1 times

- in line 487

b_grammar defined in line 386; used 1 times

- in line 519

block defined in line 214; used 1 times

- in line 460

c_expr defined in line 207; used 14 times

- in line 389-400(7), 411, 425-428(2), 450-455(2), 464, 505

c_head defined in line 287; used 1 times

- in line 481

c_ifforwhile defined in line 324; used 1 times

- in line 477

c_target defined in line 232; used 13 times

- in line 389, 395-405(4), 435-442(6), 453-454(2)

c_test defined in line 254; used 1 times

- in line 424

cmd defined in line 313; used 1 times

- in line 420

com_body defined in line 182; used 1 times

- in line 444

comment defined in line 266; used 3 times

- in line 470, 479-483(2)

e_next defined in line 333; used 1 times

- in line 464

e_part defined in line 362; used 1 times

- in line 451

e_test defined in line 241; used 1 times

- in line 504

ed_target defined in line 375; used 1 times

- in line 500

ed_unit defined in line 373; used 1 times

- in line 499

expr defined in line 209; used 12 times

- in line 392, 405, 425, 435-442(6), 448-450(2), 459

f_cmd defined in line 301; used 1 times

- in line 416

f_e_next defined in line 338; used 1 times

- in line 473

f_formula defined in line 303; used 2 times

- in line 417-418(2)

f_kw_next defined in line 336; used 1 times

- in line 472

group defined in line 216; used 2 times

- in line 459-460(2)

head defined in line 289; used 2 times

- in line 482-483(2)

id_or_kw defined in line 197; used 1 times

- in line 422

ifforwhile defined in line 326; used 2 times

- in line 478-479(2)

imm_cmd defined in line 370; used 1 times

- in line 496

keyword defined in line 329; used 2 times

- in line 463, 472

kw_body defined in line 184; used 1 times

- in line 445

kw_next defined in line 331; used 1 times

- in line 463

l_t_body defined in line 223; used 1 times

- in line 447

list_body defined in line 225; used 1 times

- in line 448

num_body defined in line 180; used 1 times

- in line 427

number defined in line 199; used 2 times

- in line 451, 490

o_c_expr defined in line 204; used 1 times

- in line 465

o_cmdsuite defined in line 317; used 2 times

- in line 422, 504

o_comment defined in line 268; used 3 times

- in line 407, 422, 504

o_refinements defined in line 294; used 1 times

- in line 422

o_suite defined in line 306; used 1 times

- in line 420

o_t_suite defined in line 310; used 1 times

- in line 504

ops_body defined in line 190; used 1 times

- in line 461

or defined in line 359; used 1 times

- in line 433

or_test defined in line 252; used 1 times

- in line 488

primary defined in line 211; used 1 times

- in line 455

r_expr defined in line 219; used 2 times

- in line 429-430(2)

r_test defined in line 248; used 7 times

- in line 434-442(7)

raw_body defined in line 192; used 1 times

- in line 497

raw_input defined in line 194; used 1 times

- in line 498

refinements defined in line 296; used 1 times

- in line 485

refpred defined in line 298; used 1 times

- in line 485

shortcmd defined in line 315; used 2 times

- in line 478-482(2)

sign defined in line 201; used 1 times

- in line 490

simple_cmd defined in line 321; used 1 times

- in line 470

sugg_body defined in line 170; used 1 times

- in line 514

suite defined in line 319; used 2 times

- in line 477-481(2)

t1_body defined in line 186; used 1 times

- in line 466

t1_conv defined in line 345; used 1 times

- in line 467

t1_next defined in line 347; used 1 times

- in line 467

t2_body defined in line 188; used 1 times

- in line 468

t2_conv defined in line 352; used 1 times

- in line 469

t2_next defined in line 354; used 1 times

- in line 469

t_suite defined in line 308; used 1 times

- in line 407

t_test defined in line 246; used 2 times

- in line 432-433(2)

tab_body defined in line 227; used 1 times

- in line 449

tab_entry defined in line 229; used 1 times

- in line 449

table defined in line 519; never used
tag defined in line 340; used 1 times

- in line 473

tag_body defined in line 178; used 1 times

- in line 426

target defined in line 235; used 8 times

- in line 390-393(3), 401, 428-430(3), 454

target_edit defined in line 367; used 1 times

- in line 495

test defined in line 244; used 4 times

- in line 396, 403-404(2), 412

text1 defined in line 343; used 1 times

- in line 457

text2 defined in line 350; used 1 times

- in line 458

unit defined in line 292; used 1 times

- in line 387

unit_edit defined in line 365; used 1 times

- in line 494

#### Defined macros

Ac_expr defined in line 206; used 1 times

- in line 207

Aexpr defined in line 208; used 3 times

- in line 209, 245, 302

Af_formula defined in line 302; used 1 times

- in line 303

Ahead defined in line 288; used 1 times

- in line 289

And defined in line 71; used 4 times

- in line 240, 249-253(2), 432

And_kw defined in line 124; used 2 times

- in line 356, 487

Aprimary defined in line 210; used 1 times

- in line 211

Ar_expr defined in line 218; used 1 times

- in line 219

Arefinements defined in line 295; used 1 times

- in line 296

At_test defined in line 245; used 1 times

- in line 246

Atarget defined in line 234; used 1 times

- in line 235

Atest defined in line 243; used 1 times

- in line 244

BODY defined in line 271; used 3 times

- in line 291, 297, 364

Behead defined in line 68; used 2 times

- in line 172, 429

Blocked defined in line 96; used 4 times

- in line 175, 215, 221, 460

CMD defined in line 282; used 2 times

- in line 312, 368

COMMENT defined in line 157; used 1 times

- in line 181

COMP_CMD defined in line 281; used 1 times

- in line 282

CONTROL_CMD defined in line 280; used 2 times

- in line 323-325(2)

Check defined in line 38; used 2 times

- in line 277, 396

Choose defined in line 34; used 2 times

- in line 278, 392

Cmt_cmd defined in line 107; used 4 times

- in line 284, 312, 368, 470

Cmt_comp defined in line 116; used 4 times

- in line 281-284(2), 323, 479

Cmt_head defined in line 120; used 4 times

- in line 271, 286, 368, 483

Col_target defined in line 91; used 2 times

- in line 231, 454

Collateral defined in line 64; used 4 times

- in line 203, 253, 330, 425

Colon defined in line 136; used 2 times

- in line 372, 501

Com_target defined in line 90; used 2 times

- in line 172, 453

Comment defined in line 81; used 5 times

- in line 265-267(2), 312, 368, 444

Compound defined in line 63; used 2 times

- in line 174, 424

Conversion defined in line 102; used 7 times

- in line 342-353(6), 465

Curtail defined in line 69; used 2 times

- in line 172, 430

Delete defined in line 37; used 2 times

- in line 276, 395

Draw defined in line 35; used 2 times

- in line 278, 393

EXPR defined in line 175; used 10 times

- in line 203, 224, 240, 247-253(4), 291, 330, 366

E_number defined in line 89; used 2 times

- in line 174, 451

E_part defined in line 127; used 2 times

- in line 361, 490

E_plus defined in line 101; used 2 times

- in line 330, 464

Each_in defined in line 75; used 2 times

- in line 238, 436

Each_parsing defined in line 78; used 2 times

- in line 238, 440

Edit_target defined in line 135; used 2 times

- in line 369, 500

Edit_unit defined in line 134; used 2 times

- in line 369, 499

Else_kw defined in line 99; used 2 times

- in line 240, 462

Equals defined in line 137; used 2 times

- in line 374, 502

Expression defined in line 139; used 1 times

- in line 505

F_e_plus defined in line 110; used 2 times

- in line 335, 473

F_kw_plus defined in line 109; used 4 times

- in line 300, 335-337(2), 472

Fail defined in line 55; used 2 times

- in line 277, 414

For defined in line 47; used 4 times

- in line 280-284(3), 405

Grouped defined in line 95; used 3 times

- in line 175, 222, 459

HEAD defined in line 270; used 3 times

- in line 271, 286, 368

How_to defined in line 57; used 2 times

- in line 270, 416

IDENT defined in line 154; used 1 times

- in line 177

If defined in line 45; used 4 times

- in line 280-284(3), 403

Imm_cmd defined in line 131; used 1 times

- in line 496

Insert defined in line 32; used 2 times

- in line 277, 390

KEYWORD defined in line 155; used 1 times

- in line 183

Keyword defined in line 82; used 10 times

- in line 196, 278, 300, 328-337(5), 372, 445

Kw_plus defined in line 100; used 4 times

- in line 278, 330-332(2), 463

LEXICAL defined in line 152; used 9 times

- in line 154-162(9)

L_t_dis defined in line 84; used 2 times

- in line 174, 447

List_body defined in line 85; used 3 times

- in line 221-224(2), 448

Long_comp defined in line 114; used 2 times

- in line 281, 477

Long_unit defined in line 118; used 2 times

- in line 271, 481

Minus_sign defined in line 112; used 2 times

- in line 200, 475

NUMBER defined in line 156; used 1 times

- in line 179

No_in defined in line 76; used 2 times

- in line 238, 437

No_parsing defined in line 79; used 2 times

- in line 238, 442

Not defined in line 73; used 2 times

- in line 238, 434

Number defined in line 66; used 3 times

- in line 174, 198, 427

OPERATORS defined in line 160; used 1 times

- in line 189

Operators defined in line 97; used 5 times

- in line 175, 213-215(2), 222, 461

Or defined in line 72; used 4 times

- in line 240, 251-253(2), 433

Or_kw defined in line 125; used 2 times

- in line 358, 488

PRIMARY defined in line 173; used 4 times

- in line 175, 213-215(2), 221

Plus_sign defined in line 111; used 2 times

- in line 200, 474

Put defined in line 31; used 2 times

- in line 276, 389

Quit defined in line 51; used 2 times

- in line 276, 410

RAWINPUT defined in line 161; used 1 times

- in line 191

Raw defined in line 132; used 2 times

- in line 193, 497

Raw_input defined in line 133; used 1 times

- in line 498

Read defined in line 42; used 2 times

- in line 276, 400

Read_raw defined in line 43; used 2 times

- in line 276, 401

Ref_join defined in line 122; used 3 times

- in line 291, 364, 485

Refinement defined in line 61; used 2 times

- in line 293, 421

Remove defined in line 33; used 2 times

- in line 277, 391

Report defined in line 53; used 2 times

- in line 277, 412

Return defined in line 52; used 2 times

- in line 276, 411

SC1 defined in line 276; used 1 times

- in line 275

SC2 defined in line 277; used 1 times

- in line 275

SC3 defined in line 278; used 1 times

- in line 275

SHORTCMD defined in line 284; used 2 times

- in line 314-316(2)

SIMPLE_CMD defined in line 275; used 3 times

- in line 282-284(2), 320

SOME_ETC defined in line 237; used 5 times

- in line 240, 247-253(4)

SUGGESTION defined in line 162; used 1 times

- in line 169

Sel_expr defined in line 92; used 2 times

- in line 174, 455

Select defined in line 49; used 2 times

- in line 281, 407

Selection defined in line 67; used 2 times

- in line 172, 428

Set_random defined in line 36; used 2 times

- in line 278, 394

Share defined in line 39; used 2 times

- in line 276, 397

Short_comp defined in line 115; used 3 times

- in line 281-284(2), 478

Short_unit defined in line 119; used 2 times

- in line 271, 482

Some_in defined in line 74; used 2 times

- in line 238, 435

Some_parsing defined in line 77; used 2 times

- in line 238, 438

Succeed defined in line 54; used 2 times

- in line 277, 413

Suite defined in line 60; used 4 times

- in line 305, 316-318(2), 420

T1 defined in line 103; used 4 times

- in line 342-346(3), 466

T1_plus defined in line 104; used 3 times

- in line 342-346(2), 467

T2 defined in line 105; used 4 times

- in line 349-353(3), 468

T2_plus defined in line 106; used 3 times

- in line 349-353(2), 469

TARGET defined in line 172; used 1 times

- in line 231

TEXT1 defined in line 158; used 1 times

- in line 185

TEXT2 defined in line 159; used 1 times

- in line 187

Tab_body defined in line 86; used 3 times

- in line 222-226(2), 449

Tab_entry defined in line 87; used 4 times

- in line 222-228(3), 450

Tag defined in line 65; used 8 times

- in line 172-174(2), 196, 335-339(2), 372-374(2), 426

Target_edit defined in line 130; used 1 times

- in line 495

Test defined in line 59; used 2 times

- in line 270, 418

Test_suite defined in line 138; used 3 times

- in line 307-309(2), 503

Text1 defined in line 93; used 2 times

- in line 174, 457

Text2 defined in line 94; used 2 times

- in line 174, 458

Unit_edit defined in line 129; used 1 times

- in line 494

While defined in line 46; used 4 times

- in line 280-284(3), 404

Write defined in line 41; used 2 times

- in line 276, 399

XX defined in line 384; used 95 times

- in line 387-505(92), 514-516(3)

Yield defined in line 58; used 2 times

- in line 270, 417

Last modified: 1985-08-27 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 3929 |