scanner.l

Sat, 29 Dec 2001 18:59:47 +0000

author
eric
date
Sat, 29 Dec 2001 18:59:47 +0000
changeset 12
c3e2c2344560
parent 11
30d18cf8bb67
child 13
3ab5717225d3
permissions
-rw-r--r--

*** empty log message ***

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