scanner.l

Sat, 29 Dec 2001 17:45:43 +0000

author
eric
date
Sat, 29 Dec 2001 17:45:43 +0000
changeset 11
30d18cf8bb67
parent 9
de78038d990f
child 12
c3e2c2344560
permissions
-rw-r--r--

*** empty log message ***

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