- gettok (token);
-
- if (token->type == TT_BLANK)
- goto nexttok;
- if (token->type == TT_SPECLCHAR) {
- if (strchr(pol.skipchars, token->tokstr[0]) != NULL)
- goto nexttok;
- if (token->tokstr[0] == NEWLINE)
- goto nexttok;
- if (token->tokstr[0] == meta.cmd) {
- getcmd();
- goto nexttok;
- }
- if (token->tokstr[0] == meta.com) { /* skip comment */
- eatline ();
- goto nexttok;
- }
- if (token->tokstr[0] == meta.out) {
- getescape(token->tokstr, meta.out, MAXTOK);
- fputs (token->tokstr, stderr);
- goto nexttok;
- }
- if (token->tokstr[0] == meta.con) { /* continuation across NEWLINE */
- while (pol_lookchar() == BLANK || pol_lookchar() == TAB)
- pol_inchar();
- if (pol_lookchar() == NEWLINE)
- pol_inchar();
- }
- if (token->tokstr[0] == meta.ter) { /* get input from terminal */
- pol_usefile (P_USE_FILE, "");
- pol_tok (token);
- pol_closefile();
- return (token->type);
- }
- }
-
- /* look for filler words */
-
- if (lookup (skiptable, token->tokstr) != NULL) /* ignore words in skip table */
- goto nexttok;
-
- /* look for user defined symbols */
-
- if ((sym = lookup (usertable, token->tokstr)) != NULL) {
- token->type = TT_USERTOK;
- token->code = sym->code;
- } else
- token->code = 0;
-
- if (pol.trace == TRUE)
- printf ("Read token '%s', type = %d\n", token->tokstr, token->type);
-
- return (token->type);
-}
-
-
-static int getcmd(void)
-{
- int tt, found;
- char str[MAXTOK+1];
- SYMBOL *cmd;
- TOKEN tok;
-
- tt = getalpha (str, MAXTOK);
- if (tt == TT_ERROR) {
- synerr ("error in pol parameter command");
- pol_reader();
- return(FALSE);
- }
- if ((cmd = lookup (cmdtable,str)) == NULL) {
- synerr ("unrecognized command");
- pol_reader();
- return (FALSE);
- } else {
- found = FALSE;
- switch (cmd->code) {
- case PC_TRON:
- pol.trace = TRUE;
- found = TRUE;
- break;
- case PC_TROFF:
- pol.trace = FALSE;
- found = TRUE;
- break;
- case PC_FILE:
- found = TRUE;
- tt = gettok (&tok);
- pol_usefile (P_USE_FILE, tok.tokstr);
- break;
- case PC_NL_EOC:
- found = TRUE;
- pol.nl_eoc = TRUE;
- break;
- case PC_NL_NEOC:
- found = TRUE;
- pol.nl_eoc = FALSE;
- break;
- case PC_DUMP:
- found = TRUE;
- printf("eoc = %c str = %c com = %c cmd = %c prg = %c\n",
- meta.eoc, meta.str, meta.com, meta.cmd, meta.prg);
- printf("con = %c out = %c ter = %c inb = %c\n",
- meta.con, meta.out, meta.ter, meta.inb);
- break;
- }
- if (found == FALSE) {
- tt = gettok (&tok);
- if (tt != TT_SPECLCHAR) {
- synerr("illegal command character");
- return (FALSE);
- }
- switch(cmd->code) {
- case PC_EOC:
- meta.eoc = tok.tokstr[0];
- break;
- case PC_STR:
- meta.str = tok.tokstr[0];
- break;
- case PC_COM:
- meta.com = tok.tokstr[0];
- break;
- case PC_CMD:
- meta.cmd = tok.tokstr[0];
- break;
- case PC_PRG:
- meta.prg = tok.tokstr[0];
- break;
- case PC_CON:
- meta.con = tok.tokstr[0];
- break;
- case PC_OUT:
- meta.out = tok.tokstr[0];
- break;
- case PC_TER:
- meta.ter = tok.tokstr[0];
- break;
- case PC_INB:
- meta.inb = tok.tokstr[0];
- break;
- default:
- printf("command not implemented\n");
- break;
- } /* switch (tok->type) */
- } /* if (found == FALSE) */
- pol_reader(); /* clean up command */
- } /* if legal command */
-
- return (TRUE);
-}
+ gettok (token);
+
+ if (token->type == TT_BLANK)
+ goto nexttok;
+ if (token->type == TT_SPECLCHAR) {
+ if (strchr(m_szSkipChars, token->tokstr[0]) != NULL)
+ goto nexttok;
+ if (token->tokstr[0] == NEWLINE)
+ goto nexttok;
+ if (token->tokstr[0] == meta.cmd) {
+ getcmd();
+ goto nexttok;
+ }
+ if (token->tokstr[0] == meta.com) { /* skip comment */
+ eatline ();
+ goto nexttok;
+ }
+ if (token->tokstr[0] == meta.out) {
+ getescape(token->tokstr, meta.out, MAXTOK);
+ fputs (token->tokstr, stderr);
+ goto nexttok;
+ }
+ if (token->tokstr[0] == meta.con) { /* continuation across NEWLINE */
+ while (lookchar() == BLANK || lookchar() == TAB)
+ inchar();
+ if (lookchar() == NEWLINE)
+ inchar();
+ }
+ if (token->tokstr[0] == meta.ter) { /* get input from terminal */
+ usefile (P_USE_FILE, "");
+ tok (token);
+ closefile();
+ return (token->type);
+ }
+ }