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 ***

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