|
|
1.1 root 1: /* Input/Output Statements */
2:
3: io: io1
4: { endio(); }
5: ;
6:
7: io1: iofmove ioctl
8: | iofmove unpar_fexpr
9: { ioclause(IOSUNIT, $2); endioctl(); }
10: | iofmove SSTAR
11: { ioclause(IOSUNIT, ENULL); endioctl(); }
12: | iofmove SPOWER
13: { ioclause(IOSUNIT, IOSTDERR); endioctl(); }
14: | iofctl ioctl
15: | read ioctl
16: { doio(CHNULL); }
17: | read infmt
18: { doio(CHNULL); }
19: | read ioctl inlist
20: { doio(revchain($3)); }
21: | read infmt SCOMMA inlist
22: { doio(revchain($4)); }
23: | read ioctl SCOMMA inlist
24: { doio(revchain($4)); }
25: | write ioctl
26: { doio(CHNULL); }
27: | write ioctl outlist
28: { doio(revchain($3)); }
29: | print
30: { doio(CHNULL); }
31: | print SCOMMA outlist
32: { doio(revchain($3)); }
33: ;
34:
35: iofmove: fmkwd end_spec in_ioctl
36: ;
37:
38: fmkwd: SBACKSPACE
39: { iostmt = IOBACKSPACE; }
40: | SREWIND
41: { iostmt = IOREWIND; }
42: | SENDFILE
43: { iostmt = IOENDFILE; }
44: ;
45:
46: iofctl: ctlkwd end_spec in_ioctl
47: ;
48:
49: ctlkwd: SINQUIRE
50: { iostmt = IOINQUIRE; }
51: | SOPEN
52: { iostmt = IOOPEN; }
53: | SCLOSE
54: { iostmt = IOCLOSE; }
55: ;
56:
57: infmt: unpar_fexpr
58: {
59: ioclause(IOSUNIT, ENULL);
60: ioclause(IOSFMT, $1);
61: endioctl();
62: }
63: | SSTAR
64: {
65: ioclause(IOSUNIT, ENULL);
66: ioclause(IOSFMT, ENULL);
67: endioctl();
68: }
69: ;
70:
71: ioctl: SLPAR fexpr SRPAR
72: {
73: ioclause(IOSUNIT, $2);
74: endioctl();
75: }
76: | SLPAR ctllist SRPAR
77: { endioctl(); }
78: ;
79:
80: ctllist: ioclause
81: | ctllist SCOMMA ioclause
82: ;
83:
84: ioclause: fexpr
85: { ioclause(IOSPOSITIONAL, $1); }
86: | SSTAR
87: { ioclause(IOSPOSITIONAL, ENULL); }
88: | SPOWER
89: { ioclause(IOSPOSITIONAL, IOSTDERR); }
90: | nameeq expr
91: { ioclause($1, $2); }
92: | nameeq SSTAR
93: { ioclause($1, ENULL); }
94: | nameeq SPOWER
95: { ioclause($1, IOSTDERR); }
96: ;
97:
98: nameeq: SNAMEEQ
99: { $$ = iocname(); }
100: ;
101:
102: read: SREAD end_spec in_ioctl
103: { iostmt = IOREAD; }
104: ;
105:
106: write: SWRITE end_spec in_ioctl
107: { iostmt = IOWRITE; }
108: ;
109:
110: print: SPRINT end_spec fexpr in_ioctl
111: {
112: iostmt = IOWRITE;
113: ioclause(IOSUNIT, ENULL);
114: ioclause(IOSFMT, $3);
115: endioctl();
116: }
117: | SPRINT end_spec SSTAR in_ioctl
118: {
119: iostmt = IOWRITE;
120: ioclause(IOSUNIT, ENULL);
121: ioclause(IOSFMT, ENULL);
122: endioctl();
123: }
124: ;
125:
126: inlist: inelt
127: { $$ = mkchain((char *)$1, CHNULL); }
128: | inlist SCOMMA inelt
129: { $$ = mkchain((char *)$3, $1); }
130: ;
131:
132: inelt: lhs
133: { $$ = (tagptr) $1; }
134: | SLPAR inlist SCOMMA dospec SRPAR
135: { $$ = (tagptr) mkiodo($4,revchain($2)); }
136: ;
137:
138: outlist: uexpr
139: { $$ = mkchain((char *)$1, CHNULL); }
140: | other
141: { $$ = mkchain((char *)$1, CHNULL); }
142: | out2
143: ;
144:
145: out2: uexpr SCOMMA uexpr
146: { $$ = mkchain((char *)$3, mkchain((char *)$1, CHNULL) ); }
147: | uexpr SCOMMA other
148: { $$ = mkchain((char *)$3, mkchain((char *)$1, CHNULL) ); }
149: | other SCOMMA uexpr
150: { $$ = mkchain((char *)$3, mkchain((char *)$1, CHNULL) ); }
151: | other SCOMMA other
152: { $$ = mkchain((char *)$3, mkchain((char *)$1, CHNULL) ); }
153: | out2 SCOMMA uexpr
154: { $$ = mkchain((char *)$3, $1); }
155: | out2 SCOMMA other
156: { $$ = mkchain((char *)$3, $1); }
157: ;
158:
159: other: complex_const
160: { $$ = (tagptr) $1; }
161: | SLPAR expr SRPAR
162: { $$ = (tagptr) $2; }
163: | SLPAR uexpr SCOMMA dospec SRPAR
164: { $$ = (tagptr) mkiodo($4, mkchain((char *)$2, CHNULL) ); }
165: | SLPAR other SCOMMA dospec SRPAR
166: { $$ = (tagptr) mkiodo($4, mkchain((char *)$2, CHNULL) ); }
167: | SLPAR out2 SCOMMA dospec SRPAR
168: { $$ = (tagptr) mkiodo($4, revchain($2)); }
169: ;
170:
171: in_ioctl:
172: { startioctl(); }
173: ;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.