cmdparse.cpp
Go to the documentation of this file.
1 #ifndef lint
2 static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
3 #endif
4 
5 #include <stdlib.h>
6 #include <string.h>
7 
8 #define YYBYACC 1
9 #define YYMAJOR 1
10 #define YYMINOR 9
11 #define YYPATCH 20070509
12 
13 #define YYEMPTY (-1)
14 #define yyclearin (yychar = YYEMPTY)
15 #define yyerrok (yyerrflag = 0)
16 #define YYRECOVERING (yyerrflag != 0)
17 
18 extern int yyparse(void);
19 
20 static int yygrowstack(void);
21 #define YYPREFIX "yy"
22 #line 2 "cmdparse.ypp"
23 /*----------------------------------------------------------------------------*/
24 /* */
25 /* Copyright (c) 2009-2010 Rexx Language Association. All rights reserved. */
26 /* */
27 /* This program and the accompanying materials are made available under */
28 /* the terms of the Common Public License v1.0 which accompanies this */
29 /* distribution. A copy is also available at the following address: */
30 /* http://www.oorexx.org/license.html */
31 /* */
32 /* Redistribution and use in source and binary forms, with or */
33 /* without modification, are permitted provided that the following */
34 /* conditions are met: */
35 /* */
36 /* Redistributions of source code must retain the above copyright */
37 /* notice, this list of conditions and the following disclaimer. */
38 /* Redistributions in binary form must reproduce the above copyright */
39 /* notice, this list of conditions and the following disclaimer in */
40 /* the documentation and/or other materials provided with the distribution. */
41 /* */
42 /* Neither the name of Rexx Language Association nor the names */
43 /* of its contributors may be used to endorse or promote products */
44 /* derived from this software without specific prior written permission. */
45 /* */
46 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
47 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
48 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
49 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
50 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
51 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
52 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
53 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
54 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
55 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
56 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
57 /* */
58 /* Authors; */
59 /* W. David Ashley <dashley@us.ibm.com> */
60 /* */
61 /*----------------------------------------------------------------------------*/
62 
63 
64 /*----------------------------------------------------------------------------*/
65 /* !!!CAUTION!!! */
66 /* Do not edit the cmdparse.cpp file! This file is produced by yacc! You */
67 /* should edit the cmdparse.y file and regen the changes via make! */
68 /*----------------------------------------------------------------------------*/
69 
70 
71 #include <stdlib.h>
72 #include <string.h>
73 #include <stdio.h>
74 #include <ctype.h>
75 #include <rexx.h>
76 
77 #include "hostemu.h"
78 
79 /*--------------------------------------------------------------------*/
80 /* Local function prototypes */
81 /*--------------------------------------------------------------------*/
82 
83 int yylex (
84  void); /* no arguments */
85 void yyerror (
86  char * token); /* token string */
87 int kwsearch (
88  char * token); /* token string */
89 bool isnumeric (
90  char * token); /* token string */
91 
92 
93 #line 73 "cmdparse.ypp"
94 typedef union
95  {
96  int numval;
97  char * strval;
98  } YYSTYPE;
99 #line 100 "cmdparse.cpp"
100 #define EXECIO 257
101 #define HI 258
102 #define TE 259
103 #define TS 260
104 #define CONSTANT 261
105 #define DISKW 262
106 #define DISKR 263
107 #define STEM 264
108 #define FINIS 265
109 #define LIFO 266
110 #define FIFO 267
111 #define SKIP 268
112 #define YYERRCODE 256
113 short yylhs[] = { -1,
114  0, 0, 0, 0, 0, 1, 1, 1, 3, 3,
115  4, 4, 4, 4, 4, 4, 4, 4, 2, 2,
116  5, 5, 5, 5, 5,
117 };
118 short yylen[] = { 2,
119  3, 3, 1, 1, 1, 3, 3, 4, 2, 0,
120  1, 2, 2, 2, 2, 3, 3, 0, 2, 0,
121  1, 2, 3, 3, 0,
122 };
123 short yydefred[] = { 0,
124  0, 3, 4, 5, 0, 0, 0, 0, 0, 1,
125  2, 0, 0, 0, 6, 0, 0, 7, 0, 0,
126  19, 8, 0, 0, 9, 0, 0, 0, 0, 13,
127  12, 14, 23, 24, 16, 17,
128 };
129 short yydgoto[] = { 5,
130  10, 15, 18, 25, 21,
131 };
132 short yysindex[] = { -250,
133  -41, 0, 0, 0, 0, -251, -251, -258, -248, 0,
134  0, -26, -40, -249, 0, -21, -247, 0, -241, -243,
135  0, 0, -239, -262, 0, -242, -237, -240, -235, 0,
136  0, 0, 0, 0, 0, 0,
137 };
138 short yyrindex[] = { 0,
139  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
140  0, 27, 28, 29, 0, 28, 30, 0, 0, 31,
141  0, 0, 0, 32, 0, 33, 0, 34, 0, 0,
142  0, 0, 0, 0, 0, 0,
143 };
144 short yygindex[] = { 0,
145  35, 0, 19, 0, 0,
146 };
147 #define YYTABLESIZE 221
148 short yytable[] = { 17,
149  7, 29, 12, 30, 31, 32, 1, 2, 3, 4,
150  8, 9, 13, 14, 19, 20, 23, 24, 17, 26,
151  27, 28, 33, 34, 35, 36, 20, 10, 25, 18,
152  21, 11, 22, 15, 22, 0, 0, 0, 0, 0,
153  0, 11, 0, 0, 0, 0, 0, 0, 0, 0,
154  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
155  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
156  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
157  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
158  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
159  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
160  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
161  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
162  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
163  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
164  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
165  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
166  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
167  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
168  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
169  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
170  0, 0, 0, 0, 0, 0, 0, 0, 0, 6,
171  16,
172 };
173 short yycheck[] = { 40,
174  42, 264, 261, 266, 267, 268, 257, 258, 259, 260,
175  262, 263, 261, 40, 264, 265, 264, 265, 40, 261,
176  264, 261, 265, 261, 265, 261, 0, 0, 0, 0,
177  0, 0, 0, 0, 16, -1, -1, -1, -1, -1,
178  -1, 7, -1, -1, -1, -1, -1, -1, -1, -1,
179  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
180  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
181  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
182  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
183  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
184  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
185  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
186  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
187  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
188  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
189  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
190  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
191  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
192  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
193  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
194  -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
195  -1, -1, -1, -1, -1, -1, -1, -1, -1, 261,
196  261,
197 };
198 #define YYFINAL 5
199 #ifndef YYDEBUG
200 #define YYDEBUG 0
201 #endif
202 #define YYMAXTOKEN 268
203 #if YYDEBUG
204 char *yyname[] = {
205 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
206 0,0,0,0,0,0,"'('",0,"'*'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
207 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
208 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
209 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
210 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
211 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"EXECIO","HI","TE","TS",
212 "CONSTANT","DISKW","DISKR","STEM","FINIS","LIFO","FIFO","SKIP",
213 };
214 char *yyrule[] = {
215 "$accept : stmt",
216 "stmt : EXECIO CONSTANT disk_clause",
217 "stmt : EXECIO '*' disk_clause",
218 "stmt : HI",
219 "stmt : TE",
220 "stmt : TS",
221 "disk_clause : DISKW CONSTANT diskw_option",
222 "disk_clause : DISKR CONSTANT diskr_option",
223 "disk_clause : DISKR CONSTANT CONSTANT diskr_option",
224 "diskr_option : '(' diskr_options",
225 "diskr_option :",
226 "diskr_options : FINIS",
227 "diskr_options : FINIS FIFO",
228 "diskr_options : FINIS LIFO",
229 "diskr_options : FINIS SKIP",
230 "diskr_options : STEM CONSTANT",
231 "diskr_options : STEM CONSTANT FINIS",
232 "diskr_options : FINIS STEM CONSTANT",
233 "diskr_options :",
234 "diskw_option : '(' diskw_options",
235 "diskw_option :",
236 "diskw_options : FINIS",
237 "diskw_options : STEM CONSTANT",
238 "diskw_options : STEM CONSTANT FINIS",
239 "diskw_options : FINIS STEM CONSTANT",
240 "diskw_options :",
241 };
242 #endif
243 #if YYDEBUG
244 #include <stdio.h>
245 #endif
246 
247 /* define the initial stack-sizes */
248 #ifdef YYSTACKSIZE
249 #undef YYMAXDEPTH
250 #define YYMAXDEPTH YYSTACKSIZE
251 #else
252 #ifdef YYMAXDEPTH
253 #define YYSTACKSIZE YYMAXDEPTH
254 #else
255 #define YYSTACKSIZE 500
256 #define YYMAXDEPTH 500
257 #endif
258 #endif
259 
260 #define YYINITSTACKSIZE 500
261 
265 int yychar;
266 short *yyssp;
270 
271 /* variables for the parser stack */
272 static short *yyss;
273 static short *yysslim;
274 static YYSTYPE *yyvs;
275 static int yystacksize;
276 #line 211 "cmdparse.ypp"
277 
278 
279 /*--------------------------------------------------------------------*/
280 /* */
281 /* yylex () - lexical analyzer. */
282 /* */
283 /*--------------------------------------------------------------------*/
284 
285 int yylex (
286  void) /* no arguments */
287  {
288 
289  /* local function variables */
290  int tktype, idx = 0;
291  static char token [1024];
292 
293  while (*(prxCmd -> strptr + lCmdPtr) == ' ' ||
294  *(prxCmd -> strptr + lCmdPtr) == '\t')
295  lCmdPtr++;
296  if (*(prxCmd -> strptr + lCmdPtr) == '\0')
297  return 0;
298  if (*(prxCmd -> strptr + lCmdPtr) == '*')
299  {
300  lCmdPtr++;
301  return '*';
302  }
303  else if (*(prxCmd -> strptr + lCmdPtr) == '(')
304  {
305  lCmdPtr++;
306  return '(';
307  }
308  else if (*(prxCmd -> strptr + lCmdPtr) == '\"')
309  {
310  lCmdPtr++;
311  while (*(prxCmd -> strptr + lCmdPtr) != '\"')
312  {
313  if (*(prxCmd -> strptr + lCmdPtr) == '\0')
314  return 0;
315  if (idx == 1024)
316  return 0;
317  token[idx] = *(prxCmd -> strptr + lCmdPtr);
318  lCmdPtr++;
319  idx++;
320  }
321  token[idx] = '\0';
322  lCmdPtr++;
323  /* insert it into our symbol table */
324  if (ulNumSym == SYMTABLESIZE)
325  return 0;
326  pszSymbol[ulNumSym] = (char *)malloc(strlen (token) + 1);
327  strcpy (pszSymbol[ulNumSym], token);
329  ulNumSym++;
330  return CONSTANT;
331  }
332  else if (isalpha (*(prxCmd -> strptr + lCmdPtr)) ||
333  isdigit (*(prxCmd -> strptr + lCmdPtr)) ||
334  *(prxCmd -> strptr + lCmdPtr) == '\\')
335  {
336  while (*(prxCmd -> strptr + lCmdPtr) != ' ' &&
337  *(prxCmd -> strptr + lCmdPtr) != '\0')
338  {
339  if (idx == 1024)
340  return 0;
341  token[idx] = *(prxCmd -> strptr + lCmdPtr);
342  lCmdPtr++;
343  idx++;
344  }
345  token[idx] = '\0';
346  /* insert it into our symbol table */
347  if (ulNumSym == SYMTABLESIZE)
348  return 0;
349  pszSymbol[ulNumSym] = (char *)malloc(strlen (token) + 1);
350  strcpy (pszSymbol[ulNumSym], token);
352  ulNumSym++;
353  return kwsearch (token);
354  }
355  return 0;
356  }
357 
358 
359 /*--------------------------------------------------------------------*/
360 /* */
361 /* yyerror () - error handler. */
362 /* */
363 /*--------------------------------------------------------------------*/
364 
365 void yyerror (
366  char * token) /* token string */
367  {
368 
369  fprintf (stderr, "Token \"%s\"\n", token);
370  return;
371  }
372 
373 
374 /*--------------------------------------------------------------------*/
375 /* */
376 /* Keyword table */
377 /* */
378 /*--------------------------------------------------------------------*/
379 
380 static struct
381  {
382  const char * kw;
383  int type;
384  } kwtable [] = {
385  "HI", HI,
386  "TE", TE,
387  "TS", TS,
388  "EXECIO", EXECIO,
389  "DISKW", DISKW,
390  "DISKR", DISKR,
391  "STEM", STEM,
392  "FINIS", FINIS,
393  "FIFO", FIFO,
394  "LIFO", LIFO,
395  "SKIP", SKIP,
396  "eot", EOF
397  };
398 
399 
400 /*--------------------------------------------------------------------*/
401 /* */
402 /* kwsearch () - search for keywords. */
403 /* */
404 /*--------------------------------------------------------------------*/
405 
406 int kwsearch (
407  char * token) /* token string */
408  {
409 
410  /* local function variables */
411  int i;
412  char *utoken, *uutoken;
413 
414  utoken = strdup(token);
415  uutoken = utoken;
416  while (*uutoken != '\0')
417  {
418  *uutoken = toupper(*uutoken);
419  uutoken++;
420  }
421  for (i = 0; kwtable[i].type != EOF; i++)
422  if (strcmp(utoken, kwtable[i].kw) == 0)
423  {
424  free(utoken);
425  return kwtable[i].type;
426  }
427  free(utoken);
428  return CONSTANT;
429  }
430 
431 
432 /*--------------------------------------------------------------------*/
433 /* */
434 /* isnumeric () - is a string numeric? */
435 /* */
436 /*--------------------------------------------------------------------*/
437 
438 bool isnumeric (
439  char * token) /* token string */
440  {
441 
442  /* local function variables */
443  int i;
444 
445  for (i = 0; i < strlen (token); i++)
446  if (!isdigit(*(token + i)))
447  return false;
448  return true;
449  }
450 
451 #line 451 "cmdparse.cpp"
452 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
453 static int yygrowstack(void)
454 {
455  int newsize, i;
456  short *newss;
457  YYSTYPE *newvs;
458 
459  if ((newsize = yystacksize) == 0)
460  newsize = YYINITSTACKSIZE;
461  else if (newsize >= YYMAXDEPTH)
462  return -1;
463  else if ((newsize *= 2) > YYMAXDEPTH)
464  newsize = YYMAXDEPTH;
465 
466  i = yyssp - yyss;
467  newss = (yyss != 0)
468  ? (short *)realloc(yyss, newsize * sizeof(*newss))
469  : (short *)malloc(newsize * sizeof(*newss));
470  if (newss == 0)
471  return -1;
472 
473  yyss = newss;
474  yyssp = newss + i;
475  newvs = (yyvs != 0)
476  ? (YYSTYPE *)realloc(yyvs, newsize * sizeof(*newvs))
477  : (YYSTYPE *)malloc(newsize * sizeof(*newvs));
478  if (newvs == 0)
479  return -1;
480 
481  yyvs = newvs;
482  yyvsp = newvs + i;
483  yystacksize = newsize;
484  yysslim = yyss + newsize - 1;
485  return 0;
486 }
487 
488 #define YYABORT goto yyabort
489 #define YYREJECT goto yyabort
490 #define YYACCEPT goto yyaccept
491 #define YYERROR goto yyerrlab
492 int
493 yyparse(void)
494 {
495  register int yym, yyn, yystate;
496 #if YYDEBUG
497  register const char *yys;
498 
499  if ((yys = getenv("YYDEBUG")) != 0)
500  {
501  yyn = *yys;
502  if (yyn >= '0' && yyn <= '9')
503  yydebug = yyn - '0';
504  }
505 #endif
506 
507  yynerrs = 0;
508  yyerrflag = 0;
509  yychar = YYEMPTY;
510 
511  if (yyss == NULL && yygrowstack()) goto yyoverflow;
512  yyssp = yyss;
513  yyvsp = yyvs;
514  *yyssp = yystate = 0;
515 
516 yyloop:
517  if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
518  if (yychar < 0)
519  {
520  if ((yychar = yylex()) < 0) yychar = 0;
521 #if YYDEBUG
522  if (yydebug)
523  {
524  yys = 0;
525  if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
526  if (!yys) yys = "illegal-symbol";
527  printf("%sdebug: state %d, reading %d (%s)\n",
528  YYPREFIX, yystate, yychar, yys);
529  }
530 #endif
531  }
532  if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
533  yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
534  {
535 #if YYDEBUG
536  if (yydebug)
537  printf("%sdebug: state %d, shifting to state %d\n",
538  YYPREFIX, yystate, yytable[yyn]);
539 #endif
540  if (yyssp >= yysslim && yygrowstack())
541  {
542  goto yyoverflow;
543  }
544  *++yyssp = yystate = yytable[yyn];
545  *++yyvsp = yylval;
546  yychar = YYEMPTY;
547  if (yyerrflag > 0) --yyerrflag;
548  goto yyloop;
549  }
550  if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
551  yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
552  {
553  yyn = yytable[yyn];
554  goto yyreduce;
555  }
556  if (yyerrflag) goto yyinrecovery;
557 
558  yyerror("syntax error");
559 
560 #ifdef lint
561  goto yyerrlab;
562 #endif
563 
564 yyerrlab:
565  ++yynerrs;
566 
567 yyinrecovery:
568  if (yyerrflag < 3)
569  {
570  yyerrflag = 3;
571  for (;;)
572  {
573  if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
574  yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
575  {
576 #if YYDEBUG
577  if (yydebug)
578  printf("%sdebug: state %d, error recovery shifting\
579  to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
580 #endif
581  if (yyssp >= yysslim && yygrowstack())
582  {
583  goto yyoverflow;
584  }
585  *++yyssp = yystate = yytable[yyn];
586  *++yyvsp = yylval;
587  goto yyloop;
588  }
589  else
590  {
591 #if YYDEBUG
592  if (yydebug)
593  printf("%sdebug: error recovery discarding state %d\n",
594  YYPREFIX, *yyssp);
595 #endif
596  if (yyssp <= yyss) goto yyabort;
597  --yyssp;
598  --yyvsp;
599  }
600  }
601  }
602  else
603  {
604  if (yychar == 0) goto yyabort;
605 #if YYDEBUG
606  if (yydebug)
607  {
608  yys = 0;
609  if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
610  if (!yys) yys = "illegal-symbol";
611  printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
612  YYPREFIX, yystate, yychar, yys);
613  }
614 #endif
615  yychar = YYEMPTY;
616  goto yyloop;
617  }
618 
619 yyreduce:
620 #if YYDEBUG
621  if (yydebug)
622  printf("%sdebug: state %d, reducing by rule %d (%s)\n",
623  YYPREFIX, yystate, yyn, yyrule[yyn]);
624 #endif
625  yym = yylen[yyn];
626  if (yym)
627  yyval = yyvsp[1-yym];
628  else
629  memset(&yyval, 0, sizeof yyval);
630  switch (yyn)
631  {
632 case 1:
633 #line 96 "cmdparse.ypp"
634 {
637  /* if constant is not a numeric string we have an error */
638  if (isnumeric (yyvsp[-1].strval))
639  ExecIO_Options.lRcdCnt = atoi (yyvsp[-1].strval);
640  else
641  return 1;
642  }
643 break;
644 case 2:
645 #line 106 "cmdparse.ypp"
646 {
649  ExecIO_Options.lRcdCnt = -1;
650  }
651 break;
652 case 3:
653 #line 112 "cmdparse.ypp"
654 {
655  lStmtType = HI_STMT;
656  }
657 break;
658 case 4:
659 #line 116 "cmdparse.ypp"
660 {
661  lStmtType = TE_STMT;
662  }
663 break;
664 case 5:
665 #line 120 "cmdparse.ypp"
666 {
667  lStmtType = TS_STMT;
668  }
669 break;
670 case 6:
671 #line 126 "cmdparse.ypp"
672 {
673  ExecIO_Options.fRW = true;
674  strcpy (ExecIO_Options.aFilename, yyvsp[-1].strval);
675  }
676 break;
677 case 7:
678 #line 131 "cmdparse.ypp"
679 {
680  ExecIO_Options.fRW = false;
681  strcpy (ExecIO_Options.aFilename, yyvsp[-1].strval);
682  }
683 break;
684 case 8:
685 #line 136 "cmdparse.ypp"
686 {
687  ExecIO_Options.fRW = false;
688  strcpy (ExecIO_Options.aFilename, yyvsp[-2].strval);
689  /* if constant is not a numeric string we have an error */
690  if (isnumeric (yyvsp[-1].strval))
691  ExecIO_Options.lStartRcd = atoi (yyvsp[-1].strval);
692  else
693  return 1;
694  }
695 break;
696 case 11:
697 #line 152 "cmdparse.ypp"
698 {
699  ExecIO_Options.fFinis = true;
700  }
701 break;
702 case 12:
703 #line 156 "cmdparse.ypp"
704 {
705  ExecIO_Options.fFinis = false;
706  }
707 break;
708 case 13:
709 #line 160 "cmdparse.ypp"
710 {
711  ExecIO_Options.fFinis = true;
713  }
714 break;
715 case 14:
716 #line 165 "cmdparse.ypp"
717 {
718  ExecIO_Options.fFinis = true;
720  }
721 break;
722 case 15:
723 #line 170 "cmdparse.ypp"
724 {
725  strcpy (ExecIO_Options.aStem, yyvsp[0].strval);
726  }
727 break;
728 case 16:
729 #line 174 "cmdparse.ypp"
730 {
731  strcpy (ExecIO_Options.aStem, yyvsp[-1].strval);
732  ExecIO_Options.fFinis = true;
733  }
734 break;
735 case 17:
736 #line 179 "cmdparse.ypp"
737 {
738  strcpy (ExecIO_Options.aStem, yyvsp[0].strval);
739  ExecIO_Options.fFinis = true;
740  }
741 break;
742 case 21:
743 #line 191 "cmdparse.ypp"
744 {
745  ExecIO_Options.fFinis = true;
746  }
747 break;
748 case 22:
749 #line 195 "cmdparse.ypp"
750 {
751  strcpy (ExecIO_Options.aStem, yyvsp[0].strval);
752  }
753 break;
754 case 23:
755 #line 199 "cmdparse.ypp"
756 {
757  strcpy (ExecIO_Options.aStem, yyvsp[-1].strval);
758  ExecIO_Options.fFinis = true;
759  }
760 break;
761 case 24:
762 #line 204 "cmdparse.ypp"
763 {
764  strcpy (ExecIO_Options.aStem, yyvsp[0].strval);
765  ExecIO_Options.fFinis = true;
766  }
767 break;
768 #line 768 "cmdparse.cpp"
769  }
770  yyssp -= yym;
771  yystate = *yyssp;
772  yyvsp -= yym;
773  yym = yylhs[yyn];
774  if (yystate == 0 && yym == 0)
775  {
776 #if YYDEBUG
777  if (yydebug)
778  printf("%sdebug: after reduction, shifting from state 0 to\
779  state %d\n", YYPREFIX, YYFINAL);
780 #endif
781  yystate = YYFINAL;
782  *++yyssp = YYFINAL;
783  *++yyvsp = yyval;
784  if (yychar < 0)
785  {
786  if ((yychar = yylex()) < 0) yychar = 0;
787 #if YYDEBUG
788  if (yydebug)
789  {
790  yys = 0;
791  if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
792  if (!yys) yys = "illegal-symbol";
793  printf("%sdebug: state %d, reading %d (%s)\n",
794  YYPREFIX, YYFINAL, yychar, yys);
795  }
796 #endif
797  }
798  if (yychar == 0) goto yyaccept;
799  goto yyloop;
800  }
801  if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
802  yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
803  yystate = yytable[yyn];
804  else
805  yystate = yydgoto[yym];
806 #if YYDEBUG
807  if (yydebug)
808  printf("%sdebug: after reduction, shifting from state %d \
809 to state %d\n", YYPREFIX, *yyssp, yystate);
810 #endif
811  if (yyssp >= yysslim && yygrowstack())
812  {
813  goto yyoverflow;
814  }
815  *++yyssp = yystate;
816  *++yyvsp = yyval;
817  goto yyloop;
818 
819 yyoverflow:
820  yyerror("yacc stack overflow");
821 
822 yyabort:
823  return (1);
824 
825 yyaccept:
826  return (0);
827 }
#define YYINITSTACKSIZE
Definition: cmdparse.cpp:260
#define FINIS
Definition: cmdparse.cpp:108
int yynerrs
Definition: cmdparse.cpp:263
#define YYMAXDEPTH
Definition: cmdparse.cpp:256
int yyerrflag
Definition: cmdparse.cpp:264
#define HI
Definition: cmdparse.cpp:101
short * yyssp
Definition: cmdparse.cpp:266
int kwsearch(char *token)
Definition: cmdparse.cpp:406
YYSTYPE yylval
Definition: cmdparse.cpp:269
#define YYERRCODE
Definition: cmdparse.cpp:112
static short * yyss
Definition: cmdparse.cpp:272
#define YYPREFIX
Definition: cmdparse.cpp:21
static YYSTYPE * yyvs
Definition: cmdparse.cpp:274
const char * kw
Definition: cmdparse.cpp:382
#define YYFINAL
Definition: cmdparse.cpp:198
static int yygrowstack(void)
Definition: cmdparse.cpp:453
short yydefred[]
Definition: cmdparse.cpp:123
static int yystacksize
Definition: cmdparse.cpp:275
#define SKIP
Definition: cmdparse.cpp:111
#define YYTABLESIZE
Definition: cmdparse.cpp:147
short yycheck[]
Definition: cmdparse.cpp:173
short yytable[]
Definition: cmdparse.cpp:148
int yyparse(void)
Definition: cmdparse.cpp:493
short yylen[]
Definition: cmdparse.cpp:118
short yyrindex[]
Definition: cmdparse.cpp:138
#define TE
Definition: cmdparse.cpp:102
int yylex(void)
Definition: cmdparse.cpp:285
int yychar
Definition: cmdparse.cpp:265
#define CONSTANT
Definition: cmdparse.cpp:104
#define DISKR
Definition: cmdparse.cpp:106
void yyerror(char *token)
Definition: cmdparse.cpp:365
#define TS
Definition: cmdparse.cpp:103
short yygindex[]
Definition: cmdparse.cpp:144
int yydebug
Definition: cmdparse.cpp:262
#define LIFO
Definition: cmdparse.cpp:109
short yydgoto[]
Definition: cmdparse.cpp:129
#define DISKW
Definition: cmdparse.cpp:105
short yysindex[]
Definition: cmdparse.cpp:132
YYSTYPE * yyvsp
Definition: cmdparse.cpp:267
int type
Definition: cmdparse.cpp:383
#define YYMAXTOKEN
Definition: cmdparse.cpp:202
static const char yysccsid[]
Definition: cmdparse.cpp:2
YYSTYPE yyval
Definition: cmdparse.cpp:268
bool isnumeric(char *token)
Definition: cmdparse.cpp:438
#define STEM
Definition: cmdparse.cpp:107
#define YYEMPTY
Definition: cmdparse.cpp:13
static struct @21 kwtable[]
#define FIFO
Definition: cmdparse.cpp:110
static short * yysslim
Definition: cmdparse.cpp:273
short yylhs[]
Definition: cmdparse.cpp:113
#define EXECIO
Definition: cmdparse.cpp:100
#define HI_STMT
Definition: hostemu.h:70
#define TS_STMT
Definition: hostemu.h:72
#define EXECIO_STMT
Definition: hostemu.h:69
#define SYMTABLESIZE
Definition: hostemu.h:68
#define TE_STMT
Definition: hostemu.h:71
long lStartRcd
Definition: hostemu.h:80
char aFilename[1024]
Definition: hostemu.h:77
long lRcdCnt
Definition: hostemu.h:75
char aStem[251]
Definition: hostemu.h:78
long lDirection
Definition: hostemu.h:81
int numval
Definition: cmdparse.cpp:96
char * strval
Definition: cmdparse.cpp:97
long lStmtType
char * pszSymbol[SYMTABLESIZE]
long lCmdPtr
unsigned long ulNumSym
EXECIO_OPTIONS ExecIO_Options
PCONSTRXSTRING prxCmd