scanner.l

Sat, 29 Dec 2001 10:19:49 +0000

author
eric
date
Sat, 29 Dec 2001 10:19:49 +0000
changeset 9
de78038d990f
parent 8
7288d2753c18
child 11
30d18cf8bb67
permissions
-rw-r--r--

*** empty log message ***

eric@5 1 %option case-insensitive
eric@5 2
eric@5 3 /*
eric@5 4 %{
eric@5 5 #include "parser.tab.h"
eric@5 6 }%
eric@5 7 */
eric@5 8
eric@5 9 digit [0-9]
eric@5 10 alpha [a-zA-Z]
eric@5 11
eric@5 12 %%
eric@5 13
eric@7 14 \.\. { return (ELIPSIS); }
eric@7 15
eric@5 16 {digit}+ { yylval.integer = atoi (yytext); return (INTEGER); }
eric@9 17 {digit}+.{digit}* { yylval.float = atof (yytext); return (FLOAT); }
eric@9 18
eric@9 19 a { yylval.size.width = 8.5 * 25.4;
eric@9 20 yylval.size.height = 11.0 * 25.4;
eric@9 21 return (PAGE_SIZE); }
eric@9 22 b { yylval.size.width = 11.0 * 25.4;
eric@9 23 yylval.size.height = 17.0 * 25.4;
eric@9 24 return (PAGE_SIZE); }
eric@9 25 c { yylval.size.width = 17.0 * 25.4;
eric@9 26 yylval.size.height = 22.0 * 25.4;
eric@9 27 return (PAGE_SIZE); }
eric@9 28 d { yylval.size.width = 22.0 * 25.4;
eric@9 29 yylval.size.height = 34.0 * 25.4;
eric@9 30 return (PAGE_SIZE); }
eric@9 31 e { yylval.size.width = 34.0 * 25.4;
eric@9 32 yylval.size.height = 44.0 * 25.4;
eric@9 33 return (PAGE_SIZE); }
eric@5 34
eric@5 35 all { return (ALL); }
eric@5 36 bookmark { return (BOOKMARK); }
eric@9 37 cm { return (CM); }
eric@5 38 crop { return (CROP); }
eric@5 39 even { return (EVEN); }
eric@5 40 file { return (FILE); }
eric@5 41 image { return (IMAGE); }
eric@9 42 images { return (IMAGES); }
eric@9 43 inch { return (INCH); }
eric@5 44 input { return (INPUT); }
eric@9 45 landscape { return (LANDSCAPE); }
eric@5 46 odd { return (ODD); }
eric@5 47 output { return (OUTPUT); }
eric@5 48 page { return (PAGE); }
eric@8 49 pages { return (PAGES); }
eric@9 50 portrait { return (PORTRAIT) ; }
eric@5 51 rotate { return (ROTATE); }
eric@5 52 size { return (SIZE); }
eric@5 53
eric@5 54 \".*\" { yylval.string = newstr (yytext); return (STRING); }
eric@9 55
eric@9 56 [ \t\n]+ /* whitespace */
eric@9 57
eric@9 58 --.* /* Ada/VHDL style one-line comment */
eric@9 59
eric@9 60 . { printf( "Unrecognized character: %s\n", yytext ); }
eric@9 61