|
|
1.1 root 1:
2: # line 4 "gram.y"
3:
4: #define LTIME(t, hr, mi, se, fr) (t.h=hr, t.m=mi, t.s=se, t.f=fr)
5:
6: #define YYDEBUG 1
7:
8: #include "hdr.h"
9:
10:
11: # line 24 "gram.y"
12: typedef union {
13: int ival;
14: Time time;
15: char *str;
16: } YYSTYPE;
17: # define AUTO 257
18: # define CUE 258
19: # define EDIT 259
20: # define HELP 260
21: # define INSERT 261
22: # define MODE 262
23: # define PLAY 263
24: # define REC 264
25: # define SET 265
26: # define SNAP 266
27: # define STATUS 267
28: # define STEP 268
29: # define STOP 269
30: # define LOOP 270
31: # define VIEW 271
32: # define WAIT 272
33: # define FRAME 273
34: # define STANDBY 274
35: # define REMOTE 275
36: # define SHOOT 276
37: # define SLEEP 277
38: # define FWD 278
39: # define REV 279
40: # define OFF 280
41: # define ON 281
42: # define PREROLL 282
43: # define STILL 283
44: # define GO 284
45: # define VIDSYNC 285
46: # define AUDIO1 286
47: # define AUDIO2 287
48: # define AUDIO3 288
49: # define VIDEO 289
50: # define TIME 290
51: # define LTC 291
52: # define VITC 292
53: # define T1 293
54: # define T2 294
55: # define TCR 295
56: # define UB 296
57: # define NUMBER 297
58: # define STRING 298
59: #define yyclearin yychar = -1
60: #define yyerrok yyerrflag = 0
61: extern int yychar;
62: extern short yyerrflag;
63: #ifndef YYMAXDEPTH
64: #define YYMAXDEPTH 150
65: #endif
66: YYSTYPE yylval, yyval;
67: # define YYERRCODE 256
68:
69: # line 116 "gram.y"
70:
71:
72: yywrap()
73: {
74: return(1);
75: }
76:
77: yyerror(s1, s2)
78: char *s1;
79: {
80: fprint(2, s1, s2);
81: }
82: short yyexca[] ={
83: -1, 1,
84: 0, -1,
85: -2, 6,
86: };
87: # define YYNPROD 66
88: # define YYLAST 317
89: short yyact[]={
90:
91: 3, 4, 5, 7, 8, 83, 10, 12, 14, 26,
92: 19, 20, 22, 9, 24, 25, 6, 18, 13, 15,
93: 16, 44, 45, 70, 57, 11, 21, 55, 96, 93,
94: 33, 82, 80, 23, 77, 78, 76, 73, 46, 67,
95: 42, 49, 48, 47, 71, 35, 72, 89, 90, 91,
96: 92, 75, 74, 58, 59, 60, 61, 38, 39, 50,
97: 34, 37, 33, 43, 36, 31, 30, 52, 53, 51,
98: 27, 88, 32, 63, 95, 86, 65, 17, 2, 87,
99: 56, 40, 41, 1, 0, 0, 0, 0, 0, 0,
100: 0, 0, 0, 0, 54, 0, 0, 62, 0, 0,
101: 0, 0, 0, 0, 0, 0, 0, 0, 66, 0,
102: 0, 0, 0, 0, 68, 69, 0, 0, 0, 28,
103: 0, 0, 64, 0, 0, 0, 0, 0, 0, 0,
104: 0, 0, 0, 0, 0, 79, 0, 0, 0, 81,
105: 0, 0, 0, 0, 84, 85, 0, 0, 0, 0,
106: 0, 0, 0, 0, 0, 0, 0, 0, 0, 94,
107: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
108: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
109: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
110: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
111: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
112: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
113: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
114: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
115: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
116: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
117: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
118: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
119: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
120: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
121: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
122: 0, 0, 0, 0, 0, 0, 29 };
123: short yypact[]={
124:
125: -1000,-257, 60,-215,-267,-220,-223,-1000,-267,-267,
126: -1000,-250,-205,-276,-252,-254,-255,-256,-221,-198,
127: -211,-235,-1000,-238,-267,-1000,-1000,-1000,-1000, 63,
128: -1000,-1000,-1000, 30,-1000,-267,-1000,-1000,-1000,-1000,
129: -258,-267,-267,-1000,-1000,-275,-249,-260,-1000,-1000,
130: -1000,-1000,-1000,-1000,-1000,-229,-1000,-259,-1000,-1000,
131: -1000,-1000,-267,-1000,-1000,-265,-267,-1000,-266,-1000,
132: -293,-267,-267,-1000,-1000,-1000,-1000,-1000,-1000,-1000,
133: 29,-239,-1000,-1000,-1000,-1000,-268,-239,-1000,-1000,
134: -1000,-1000,-1000, 28,-1000,-269,-1000 };
135: short yypgo[]={
136:
137: 0, 83, 72, 80, 71, 79, 78, 77 };
138: short yyr1[]={
139:
140: 0, 1, 1, 1, 1, 1, 6, 6, 6, 6,
141: 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
142: 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
143: 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
144: 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
145: 7, 2, 2, 2, 2, 3, 3, 3, 3, 3,
146: 5, 5, 4, 4, 4, 4 };
147: short yyr2[]={
148:
149: 0, 0, 3, 3, 4, 4, 0, 2, 2, 2,
150: 2, 2, 2, 1, 5, 2, 2, 3, 4, 1,
151: 3, 1, 2, 2, 2, 1, 3, 4, 4, 4,
152: 3, 2, 1, 2, 2, 1, 2, 2, 2, 2,
153: 3, 3, 1, 2, 3, 3, 3, 3, 1, 1,
154: 2, 1, 3, 5, 7, 1, 0, 1, 1, 1,
155: 1, 2, 1, 1, 1, 1 };
156: short yychk[]={
157:
158: -1000, -1, -6, 257, 258, 259, 273, 260, 261, 270,
159: 263, 282, 264, 275, 265, 276, 277, -7, 274, 267,
160: 268, 283, 269, 290, 271, 272, 266, 10, 59, 256,
161: 281, 280, -2, 297, 280, 265, 284, 281, 280, 281,
162: -2, -2, 290, 268, 297, 298, 290, 297, 297, 297,
163: 280, 267, 278, 279, -2, 262, -3, 262, 291, 292,
164: 293, 294, -2, 10, 59, 46, -2, 297, -2, -2,
165: 298, 293, 295, 297, 281, 280, 295, 293, 294, -2,
166: 297, -2, 297, 298, -2, -2, 46, -5, -4, 286,
167: 287, 288, 289, 297, -4, 46, 297 };
168: short yydef[]={
169:
170: 1, -2, 0, 0, 0, 0, 0, 13, 0, 0,
171: 19, 0, 21, 25, 0, 0, 0, 32, 0, 35,
172: 0, 0, 42, 56, 0, 48, 49, 2, 3, 0,
173: 7, 8, 9, 51, 10, 0, 15, 50, 11, 12,
174: 16, 0, 0, 22, 23, 24, 0, 0, 31, 33,
175: 34, 36, 37, 38, 39, 0, 43, 0, 55, 57,
176: 58, 59, 0, 4, 5, 0, 0, 17, 0, 20,
177: 26, 0, 0, 30, 40, 41, 44, 45, 46, 47,
178: 52, 0, 18, 27, 28, 29, 0, 14, 60, 62,
179: 63, 64, 65, 53, 61, 0, 54 };
180: # ifdef YYDEBUG
181: # include "y.debug"
182: # endif
183:
184: # define YYFLAG -1000
185: # define YYERROR goto yyerrlab
186: # define YYACCEPT return(0)
187: # define YYABORT return(1)
188:
189: /* parser for yacc output */
190:
191: #ifdef YYDEBUG
192: int yydebug = 0; /* 1 for debugging */
193: #endif
194: YYSTYPE yyv[YYMAXDEPTH]; /* where the values are stored */
195: int yychar = -1; /* current input token number */
196: int yynerrs = 0; /* number of errors */
197: short yyerrflag = 0; /* error recovery flag */
198:
199: yyparse()
200: { short yys[YYMAXDEPTH];
201: int yyj, yym;
202: register YYSTYPE *yypvt;
203: register int yystate, yyn;
204: register short *yyps;
205: register YYSTYPE *yypv;
206: register short *yyxi;
207:
208: yystate = 0;
209: yychar = -1;
210: yynerrs = 0;
211: yyerrflag = 0;
212: yyps= &yys[-1];
213: yypv= &yyv[-1];
214:
215: yystack: /* put a state and value onto the stack */
216: #ifdef YYDEBUG
217: if(yydebug >= 3)
218: if(yychar < 0 || yytoknames[yychar] == 0)
219: print("char %d in %s", yychar, yystates[yystate]);
220: else
221: print("%s in %s", yytoknames[yychar], yystates[yystate]);
222: #endif
223: if( ++yyps >= &yys[YYMAXDEPTH] ) {
224: yyerror( "yacc stack overflow" );
225: return(1);
226: }
227: *yyps = yystate;
228: ++yypv;
229: *yypv = yyval;
230: yynewstate:
231: yyn = yypact[yystate];
232: if(yyn <= YYFLAG) goto yydefault; /* simple state */
233: if(yychar<0) {
234: yychar = yylex();
235: #ifdef YYDEBUG
236: if(yydebug >= 2) {
237: if(yychar <= 0)
238: print("lex EOF\n");
239: else if(yytoknames[yychar])
240: print("lex %s\n", yytoknames[yychar]);
241: else
242: print("lex (%c)\n", yychar);
243: }
244: #endif
245: if(yychar < 0)
246: yychar = 0;
247: }
248: if((yyn += yychar) < 0 || yyn >= YYLAST)
249: goto yydefault;
250: if( yychk[ yyn=yyact[ yyn ] ] == yychar ){ /* valid shift */
251: yychar = -1;
252: yyval = yylval;
253: yystate = yyn;
254: if( yyerrflag > 0 ) --yyerrflag;
255: goto yystack;
256: }
257: yydefault:
258: /* default state action */
259: if( (yyn=yydef[yystate]) == -2 ) {
260: if(yychar < 0) {
261: yychar = yylex();
262: #ifdef YYDEBUG
263: if(yydebug >= 2)
264: if(yychar < 0)
265: print("lex EOF\n");
266: else
267: print("lex %s\n", yytoknames[yychar]);
268: #endif
269: if(yychar < 0)
270: yychar = 0;
271: }
272: /* look through exception table */
273: for(yyxi=yyexca; (*yyxi!= (-1)) || (yyxi[1]!=yystate);
274: yyxi += 2 ) ; /* VOID */
275: while( *(yyxi+=2) >= 0 ){
276: if( *yyxi == yychar ) break;
277: }
278: if( (yyn = yyxi[1]) < 0 ) return(0); /* accept */
279: }
280: if( yyn == 0 ){ /* error */
281: /* error ... attempt to resume parsing */
282: switch( yyerrflag ){
283: case 0: /* brand new error */
284: #ifdef YYDEBUG
285: yyerror("syntax error\n%s", yystates[yystate]);
286: if(yytoknames[yychar])
287: yyerror("saw %s\n", yytoknames[yychar]);
288: else if(yychar >= ' ' && yychar < '\177')
289: yyerror("saw `%c'\n", yychar);
290: else if(yychar == 0)
291: yyerror("saw EOF\n");
292: else
293: yyerror("saw char 0%o\n", yychar);
294: #else
295: yyerror( "syntax error" );
296: #endif
297: yyerrlab:
298: ++yynerrs;
299: case 1:
300: case 2: /* incompletely recovered error ... try again */
301: yyerrflag = 3;
302: /* find a state where "error" is a legal shift action */
303: while ( yyps >= yys ) {
304: yyn = yypact[*yyps] + YYERRCODE;
305: if( yyn>= 0 && yyn < YYLAST && yychk[yyact[yyn]] == YYERRCODE ){
306: yystate = yyact[yyn]; /* simulate a shift of "error" */
307: goto yystack;
308: }
309: yyn = yypact[*yyps];
310: /* the current yyps has no shift onn "error", pop stack */
311: #ifdef YYDEBUG
312: if( yydebug ) print( "error recovery pops state %d, uncovers %d\n", *yyps, yyps[-1] );
313: #endif
314: --yyps;
315: --yypv;
316: }
317: /* there is no state on the stack with an error shift ... abort */
318: yyabort:
319: return(1);
320: case 3: /* no shift yet; clobber input char */
321: #ifdef YYDEBUG
322: if( yydebug ) {
323: print("error recovery discards ");
324: if(yytoknames[yychar])
325: print("%s\n", yytoknames[yychar]);
326: else if(yychar >= ' ' && yychar < '\177')
327: print("`%c'\n", yychar);
328: else if(yychar == 0)
329: print("EOF\n");
330: else
331: print("char 0%o\n", yychar);
332: }
333: #endif
334: if( yychar == 0 ) goto yyabort; /* don't discard EOF, quit */
335: yychar = -1;
336: goto yynewstate; /* try again in the same state */
337: }
338: }
339: /* reduction by production yyn */
340: #ifdef YYDEBUG
341: if(yydebug) { char *s;
342: print("reduce %d in:\n\t", yyn);
343: for(s = yystates[yystate]; *s; s++) {
344: putchar(*s);
345: if(*s == '\n' && *(s+1))
346: putchar('\t');
347: }
348: }
349: #endif
350: yyps -= yyr2[yyn];
351: yypvt = yypv;
352: yypv -= yyr2[yyn];
353: yyval = yypv[1];
354: yym=yyn;
355: /* consult goto table to find next state */
356: yyn = yyr1[yyn];
357: yyj = yypgo[yyn] + *yyps + 1;
358: if( yyj>=YYLAST || yychk[ yystate = yyact[yyj] ] != -yyn ) yystate = yyact[yypgo[yyn]];
359: switch(yym){
360:
361: case 7:
362: # line 43 "gram.y"
363: { two("auto on", 0x40, 0x41); } break;
364: case 8:
365: # line 44 "gram.y"
366: { two("auto off", 0x40, 0x40); } break;
367: case 9:
368: # line 45 "gram.y"
369: { cue(yypvt[-0].time); } break;
370: case 10:
371: # line 46 "gram.y"
372: { two("edit off", 0x20, 0x64); } break;
373: case 11:
374: # line 47 "gram.y"
375: { frame(0); } break;
376: case 12:
377: # line 48 "gram.y"
378: { frame(1); } break;
379: case 13:
380: # line 49 "gram.y"
381: { help(); } break;
382: case 14:
383: # line 50 "gram.y"
384: { editset(yypvt[-2].time, yypvt[-1].time, yypvt[-0].ival); } break;
385: case 15:
386: # line 51 "gram.y"
387: { editgo(); } break;
388: case 16:
389: # line 52 "gram.y"
390: { insert(yypvt[-0].time, 1); } break;
391: case 17:
392: # line 53 "gram.y"
393: { insert(yypvt[-1].time, yypvt[-0].ival); } break;
394: case 18:
395: # line 54 "gram.y"
396: { loop(yypvt[-2].time, yypvt[-1].time, yypvt[-0].ival); } break;
397: case 19:
398: # line 55 "gram.y"
399: { two("play", 0x20, 0x01); } break;
400: case 20:
401: # line 56 "gram.y"
402: { prerollt(yypvt[-0].time); } break;
403: case 21:
404: # line 57 "gram.y"
405: { two("rec", 0x20, 0x02); } break;
406: case 22:
407: # line 58 "gram.y"
408: { three("rec step", 0x41, 0x3F, 2); } break;
409: case 23:
410: # line 59 "gram.y"
411: { remiframe(yypvt[-0].ival); } break;
412: case 24:
413: # line 60 "gram.y"
414: { remsframe(yypvt[-0].str); } break;
415: case 25:
416: # line 61 "gram.y"
417: { remiframe(-1); } break;
418: case 26:
419: # line 62 "gram.y"
420: { remsetup(yypvt[-1].str, yypvt[-0].str, (char *)0); } break;
421: case 27:
422: # line 63 "gram.y"
423: { remsetup(yypvt[-2].str, yypvt[-1].str, yypvt[-0].str); } break;
424: case 28:
425: # line 64 "gram.y"
426: { settimer(yypvt[-0].time, 0); } break;
427: case 29:
428: # line 65 "gram.y"
429: { settimer(yypvt[-0].time, 4); } break;
430: case 30:
431: # line 66 "gram.y"
432: { shoot(yypvt[-1].ival, yypvt[-0].ival, 1); } break;
433: case 31:
434: # line 67 "gram.y"
435: { sleep(yypvt[-0].ival); } break;
436: case 32:
437: # line 68 "gram.y"
438: { snap(1); } break;
439: case 33:
440: # line 69 "gram.y"
441: { snap(yypvt[-0].ival); } break;
442: case 34:
443: # line 70 "gram.y"
444: { two("stop", 0x20, 0x00); two("standby off", 0x20, 0x04); } break;
445: case 35:
446: # line 71 "gram.y"
447: { status(0); } break;
448: case 36:
449: # line 72 "gram.y"
450: { status(1); } break;
451: case 37:
452: # line 73 "gram.y"
453: { two("step fwd", 0x20, 0x14); } break;
454: case 38:
455: # line 74 "gram.y"
456: { two("step rev", 0x20, 0x24); } break;
457: case 39:
458: # line 75 "gram.y"
459: { still(yypvt[-0].time); } break;
460: case 40:
461: # line 76 "gram.y"
462: { three("", 0x41, 0x3F, 0x01); } break;
463: case 41:
464: # line 77 "gram.y"
465: { three("", 0x41, 0x3F, 0x00); } break;
466: case 42:
467: # line 78 "gram.y"
468: { two("stop", 0x20, 0x00); printclock(); } break;
469: case 43:
470: # line 79 "gram.y"
471: { timer(yypvt[-0].ival); } break;
472: case 44:
473: # line 80 "gram.y"
474: { three("time mode tcr", 0x41, 0x36, 0); } break;
475: case 45:
476: # line 81 "gram.y"
477: { three("time mode t1", 0x41, 0x36, 1); } break;
478: case 46:
479: # line 82 "gram.y"
480: { three("time mode t2", 0x41, 0x36, 2); } break;
481: case 47:
482: # line 83 "gram.y"
483: { view(yypvt[-1].time,yypvt[-0].time); } break;
484: case 48:
485: # line 84 "gram.y"
486: { swait(); } break;
487: case 51:
488: # line 93 "gram.y"
489: { LTIME(yyval.time, 0, 0, yypvt[-0].ival, 0); } break;
490: case 52:
491: # line 94 "gram.y"
492: { LTIME(yyval.time, 0, 0, yypvt[-2].ival, yypvt[-0].ival); } break;
493: case 53:
494: # line 95 "gram.y"
495: { LTIME(yyval.time, 0, yypvt[-4].ival, yypvt[-2].ival, yypvt[-0].ival); } break;
496: case 54:
497: # line 96 "gram.y"
498: { LTIME(yyval.time, yypvt[-6].ival, yypvt[-4].ival, yypvt[-2].ival, yypvt[-0].ival); } break;
499: case 55:
500: # line 99 "gram.y"
501: { yyval.ival = 0x01; } break;
502: case 56:
503: # line 100 "gram.y"
504: { yyval.ival = 0x01; } break;
505: case 57:
506: # line 101 "gram.y"
507: { yyval.ival = 0x02; } break;
508: case 58:
509: # line 102 "gram.y"
510: { yyval.ival = 0x04; } break;
511: case 59:
512: # line 103 "gram.y"
513: { yyval.ival = 0x08; } break;
514: case 60:
515: # line 106 "gram.y"
516: { yyval.ival = yypvt[-0].ival; } break;
517: case 61:
518: # line 107 "gram.y"
519: { yyval.ival = yypvt[-1].ival|yypvt[-0].ival; } break;
520: case 62:
521: # line 110 "gram.y"
522: { yyval.ival = 0x01; } break;
523: case 63:
524: # line 111 "gram.y"
525: { yyval.ival = 0x02; } break;
526: case 64:
527: # line 112 "gram.y"
528: { yyval.ival = 0x04; } break;
529: case 65:
530: # line 113 "gram.y"
531: { yyval.ival = 0x18; } break;
532: }
533: goto yystack; /* stack new state and value */
534: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.