|
|
1.1 ! root 1: %{ ! 2: /******************************************************************* ! 3: * * ! 4: * File: CIFPLOT/pat.l * ! 5: * Written by Dan Fitzpatrick * ! 6: * copyright 1980 -- Regents of the University of California * ! 7: * * ! 8: ********************************************************************/ ! 9: ! 10: #define STRING 2 ! 11: #define INTEGER 1 ! 12: ! 13: #undef input() ! 14: #undef unput(x) ! 15: #define input() (((pat_ch = getc(patfile)) == EOF) ? 0:pat_ch) ! 16: #define unput(x) ungetc(x,patfile) ! 17: ! 18: extern int patval; ! 19: extern char *patstr; ! 20: extern FILE *patfile; ! 21: ! 22: char pat_ch; ! 23: int lncnt = 1; ! 24: %} ! 25: ! 26: %% ! 27: \"[^\"\n]*\" { patstr = (char *) unquote(&(yytext[0])); return(STRING); } ! 28: 0[0-7]* { sscanf(&(yytext[0]),"%o",&patval); return(INTEGER); } ! 29: 0x[0-9a-fA-F]+ { sscanf(&(yytext[2]),"%x",&patval); return(INTEGER); } ! 30: 0X[0-9a-fA-F]+ { sscanf(&(yytext[2]),"%x",&patval); return(INTEGER); } ! 31: [1-9][0-9]* { sscanf(&(yytext[0]),"%d",&patval); return(INTEGER); } ! 32: [\ \t","";""{""}"]+ {} ! 33: \n { lncnt++; } ! 34: . { fprintf(stderr,"Unknown character(%o) on line %d in pattern file\n",yytext[0],lncnt); ! 35: abort(); } ! 36: %%
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.