Annotation of researchv10no/cmd/2500/gram.y, revision 1.1

1.1     ! root        1: %start         input
        !             2: 
        !             3: %{
        !             4: 
        !             5: #define                LTIME(t, hr, mi, se, fr)        (t.h=hr, t.m=mi, t.s=se, t.f=fr)
        !             6: 
        !             7: #define                YYDEBUG         1
        !             8: 
        !             9: #include       "hdr.h"
        !            10: 
        !            11: %}
        !            12: 
        !            13: %token         AUTO CUE EDIT HELP INSERT MODE PLAY REC SET SNAP STATUS STEP STOP
        !            14: %token         LOOP VIEW WAIT FRAME STANDBY REMOTE SHOOT SLEEP
        !            15: %token         FWD REV OFF ON PREROLL STILL GO
        !            16: %token         VIDSYNC AUDIO1 AUDIO2 AUDIO3 VIDEO
        !            17: %token         TIME LTC VITC T1 T2 TCR UB
        !            18: %token         NUMBER STRING
        !            19: 
        !            20: %type <time>   time
        !            21: %type <ival>   NUMBER timertype channel channels
        !            22: %type <str>    STRING
        !            23: 
        !            24: %union{
        !            25:        int ival;
        !            26:        Time time;
        !            27:        char *str;
        !            28: }
        !            29: 
        !            30: %%
        !            31: 
        !            32: input  :       /* nothing */
        !            33:        |       input line '\n'
        !            34:        |       input line ';'
        !            35:        |       input line error '\n'
        !            36:        |       input line error ';'
        !            37:        ;
        !            38:        /*
        !            39:                help can be done explicitly by :help info::
        !            40:        */
        !            41: 
        !            42: line   :               /* nothing */
        !            43:        |       AUTO ON  { two("auto on", 0x40, 0x41); } /*:::*/
        !            44:        |       AUTO OFF  { two("auto off", 0x40, 0x40); } /*:AUTO [ON|OFF]::*/
        !            45:        |       CUE time { cue($2); }
        !            46:        |       EDIT OFF  { two("edit off", 0x20, 0x64); }
        !            47:        |       FRAME OFF { frame(0); } /*:::*/
        !            48:        |       FRAME ON { frame(1); } /*:FRAME [ON|OFF]::*/
        !            49:        |       HELP  { help(); }
        !            50:        |       EDIT SET time time channels { editset($3, $4, $5); }/*:EDIT SET in_time out_time channels::*/
        !            51:        |       EDIT GO { editgo(); }
        !            52:        |       INSERT time  { insert($2, 1); }/*:INSERT time [nframes=1]::*/
        !            53:        |       INSERT time NUMBER  { insert($2, $3); } /*:::*/
        !            54:        |       LOOP time time NUMBER   { loop($2, $3, $4); } /*:LOOP tbegin tend frames/s:: */
        !            55:        |       PLAY  { two("play", 0x20, 0x01); }
        !            56:        |       PREROLL TIME time  { prerollt($3); }
        !            57:        |       REC  { two("rec", 0x20, 0x02); }
        !            58:        |       REC STEP  { three("rec step", 0x41, 0x3F, 2); }
        !            59:        |       REMOTE NUMBER { remiframe($2); } /*:REMOTE [frame|str]::*/
        !            60:        |       REMOTE STRING { remsframe($2); } /*:::*/
        !            61:        |       REMOTE { remiframe(-1); } /*:::*/
        !            62:        |       REMOTE STRING STRING { remsetup($2, $3, (char *)0); } /*:REMOTE system prog [relay]::*/
        !            63:        |       REMOTE STRING STRING STRING { remsetup($2, $3, $4); } /*:REMOTE system prog [relay]::*/
        !            64:        |       SET TIME T1 time { settimer($4, 0); } /*:SET TIME [T1|TCR] time::*/
        !            65:        |       SET TIME TCR time { settimer($4, 4); } /*:::*/
        !            66:        |       SHOOT NUMBER NUMBER { shoot($2, $3, 1); } /*:SHOOT start nframes::*/
        !            67:        |       SLEEP NUMBER { sleep($2); }
        !            68:        |       snap { snap(1); } /*:SNAP [nframes=1]::*/
        !            69:        |       snap NUMBER { snap($2); } /*:::*/
        !            70:        |       STANDBY OFF  { two("stop", 0x20, 0x00); two("standby off", 0x20, 0x04); }
        !            71:        |       STATUS  { status(0); }
        !            72:        |       STATUS STATUS  { status(1); }
        !            73:        |       STEP FWD  { two("step fwd", 0x20, 0x14); } /*:STEP [FWD|REV]::*/
        !            74:        |       STEP REV  { two("step rev", 0x20, 0x24); } /*:::*/
        !            75:        |       STILL time  { still($2); }
        !            76:        |       STILL MODE ON { three("", 0x41, 0x3F, 0x01); } /*:STILL MODE [ON|OFF]::*/
        !            77:        |       STILL MODE OFF { three("", 0x41, 0x3F, 0x00); } /*:::*/
        !            78:        |       STOP  { two("stop", 0x20, 0x00); printclock(); }
        !            79:        |       TIME timertype  { timer($2); }
        !            80:        |       TIME MODE TCR  { three("time mode tcr", 0x41, 0x36, 0); } /*:TIME MODE [T1|T2|TCR]::*/
        !            81:        |       TIME MODE T1  { three("time mode t1", 0x41, 0x36, 1); } /*:::*/
        !            82:        |       TIME MODE T2  { three("time mode t2", 0x41, 0x36, 2); } /*:::*/
        !            83:        |       VIEW time time { view($2,$3); } /*:VIEW tbegin tend:: */
        !            84:        |       WAIT  {  swait(); }
        !            85:        ;
        !            86: 
        !            87: /*DO NOT MOVE, used to generate helptab.c*/
        !            88: 
        !            89: snap   :       SNAP
        !            90:        |       EDIT ON
        !            91:        ;
        !            92: 
        !            93: time   :       NUMBER  { LTIME($$, 0, 0, $1, 0); }
        !            94:        |       NUMBER '.' NUMBER  { LTIME($$, 0, 0, $1, $3); }
        !            95:        |       NUMBER '.' NUMBER '.' NUMBER  { LTIME($$, 0, $1, $3, $5); }
        !            96:        |       NUMBER '.' NUMBER '.' NUMBER '.' NUMBER  { LTIME($$, $1, $3, $5, $7); }
        !            97:        ;
        !            98: 
        !            99: timertype      :       LTC  { $$ = 0x01; }
        !           100:        |        { $$ = 0x01; }
        !           101:        |       VITC  { $$ = 0x02; }
        !           102:        |       T1  { $$ = 0x04; }
        !           103:        |       T2  { $$ = 0x08; }
        !           104:        ;
        !           105: 
        !           106: channels       :       channel { $$ = $1; }
        !           107:        |       channels channel { $$ = $1|$2; }
        !           108:        ;
        !           109: 
        !           110: channel        :       AUDIO1  { $$ = 0x01; }
        !           111:        |       AUDIO2  { $$ = 0x02; }
        !           112:        |       AUDIO3  { $$ = 0x04; }
        !           113:        |       VIDEO   { $$ = 0x18; }
        !           114:        ;
        !           115: 
        !           116: %%
        !           117: 
        !           118: yywrap()
        !           119: {
        !           120:        return(1);
        !           121: }
        !           122: 
        !           123: yyerror(s1, s2)
        !           124:        char *s1;
        !           125: {
        !           126:        fprint(2, s1, s2);
        !           127: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.