SCCS-vsn: usr.bin/pascal/pdx/command/token.l 5.3
-static char sccsid[] = "@(#)token.l 5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)token.l 5.3 (Berkeley) %G%";
char *initfile = ".pdxinit";
char *initfile = ".pdxinit";
-/*
- * This is a silly "lex" thing.
- */
-
-#define yywrap() (1)
-
-/*
- * Override Lex default input macros.
- */
-
-#undef input
-#undef unput
-
-#define unput(c) ungetc(c, yyin)
+/* override Lex default input macro. */
+LOCAL int pdxinput();
+
+#undef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ { \
+ int c = pdxinput(); \
+ if ( c == EOF ) \
+ result = YY_NULL; \
+ else \
+ { \
+ buf[0] = c; \
+ result = 1; \
+ } \
+ }
alphanum [a-zA-Z0-9]
ident {alpha}{alphanum}*
filenm [^ \t\n"<>!*"]+
alphanum [a-zA-Z0-9]
ident {alpha}{alphanum}*
filenm [^ \t\n"<>!*"]+
string '[^']+'('[^']*')*
newline "\n"
char .
string '[^']+'('[^']*')*
newline "\n"
char .
^sh{white}.*$ { BEGIN 0; yylval.y_string = &yytext[3]; return(SH); }
^sh { BEGIN 0; yylval.y_string = NIL; return(SH); }
^{ident} { return(findcmd(yytext)); }
^sh{white}.*$ { BEGIN 0; yylval.y_string = &yytext[3]; return(SH); }
^sh { BEGIN 0; yylval.y_string = NIL; return(SH); }
^{ident} { return(findcmd(yytext)); }
-<file>{filenm} { yylval.y_string = strdup(yytext); return(FILENAME); }
-{qfilenm} { yylval.y_string = strdup(yytext); return(FILENAME); }
+<File>{filenm} { yylval.y_string = strdup(yytext); return(FILENAME); }
+{filenm}/":" { yylval.y_string = strdup(yytext); return(FILENAME); }
{n}?\.{n}{e}? { yylval.y_real = atof(yytext); return(REAL); }
0{n} { yylval.y_long = octal(yytext); return(INT); }
0x{h} { yylval.y_long = hex(yytext); return(INT); }
{n}?\.{n}{e}? { yylval.y_real = atof(yytext); return(REAL); }
0{n} { yylval.y_long = octal(yytext); return(INT); }
0x{h} { yylval.y_long = hex(yytext); return(INT); }
case RUN:
case SOURCE:
case STATUS:
case RUN:
case SOURCE:
case STATUS:
return((BOOLEAN) (yyin == stdin));
}
return((BOOLEAN) (yyin == stdin));
}