3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
7 static char rcsid2[]= "$Id: scan.l,v 0.6 1994/06/24 10:38:11 ceriel Exp $";
14 extern char *filename;
20 c = input(); if (c=='\n') lineno++;
24 if (c=='\n') lineno++;
27 if (c=='\n') lineno++;
30 ^\#(line)?[ \t]*[0-9]+[ \t]+\".*\".*$ {
32 for (ind=0; yytext[ind] < '0' || yytext[ind]>'9'; ind++)
34 lineno=atoi(&yytext[ind])-1;
35 for(;yytext[ind]!='"';ind++)
37 for(ind2=ind+1;yytext[ind2]!='"';ind2++)
40 if (strcmp(yytext+ind+1,filename)!=0)
41 filename=mystrcpy(yytext+ind+1);
55 ":ro" { yylval.yy_int = AD_RO; return(ADORNACCESS); }
56 ":wo" { yylval.yy_int = AD_WO; return(ADORNACCESS); }
57 ":rw" { yylval.yy_int = AD_RW; return(ADORNACCESS); }
58 ":cc" { yylval.yy_int = AD_CC; return(ADORNCC); }
59 \$[0-9]+ { yylval.yy_int = atoi(yytext+1); return(DOLLAR); }
60 \%[0-9]+ { yylval.yy_int = atoi(yytext+1); return(PERCENT); }
61 \%[a-z] { yylval.yy_int = yytext[1]-'a'; return(ALLREG); }
62 [0-9]+|0x[0-9A-Fa-f]+ { yylval.yy_int = myatoi(yytext); return(NUMBER); }
63 [_A-Za-z][_A-Za-z0-9]* { register symbol *sy_p;
66 (yylval.yy_int=mlookup(yytext))!=0) {
69 if ((sy_p=lookup(yytext,symkeyw,justlooking))!=0)
70 return(sy_p->sy_value.syv_keywno);
71 yylval.yy_str = mystrcpy(yytext); return(IDENT);
73 \%[_A-Za-z][_A-Za-z0-9]* { yylval.yy_str = mystrcpy(yytext+1);
76 \"[^"\n]*\" { yytext[yyleng-1]=0;
77 yylval.yy_str = mystrcpy(yytext+1);
80 [0-9][bf] { yytext[2]=0;
81 yylval.yy_str = mystrcpy(yytext);
93 fatal("EOF reached during error recovery");
97 skipupto(tok,str) char *str; {
103 for(i=strlen(str); i>0; i--)