scanner.l

changeset 9
de78038d990f
parent 8
7288d2753c18
child 11
30d18cf8bb67
     1.1 --- a/scanner.l	Fri Dec 28 16:04:15 2001 +0000
     1.2 +++ b/scanner.l	Sat Dec 29 10:19:49 2001 +0000
     1.3 @@ -14,19 +14,48 @@
     1.4  \.\.		{ return (ELIPSIS); }
     1.5  
     1.6  {digit}+	{ yylval.integer = atoi (yytext); return (INTEGER); }
     1.7 +{digit}+.{digit}* { yylval.float = atof (yytext); return (FLOAT); }
     1.8 +
     1.9 +a		{ yylval.size.width = 8.5 * 25.4;
    1.10 +		  yylval.size.height = 11.0 * 25.4;
    1.11 +                  return (PAGE_SIZE); }
    1.12 +b		{ yylval.size.width = 11.0 * 25.4;
    1.13 +                  yylval.size.height = 17.0 * 25.4;
    1.14 +                  return (PAGE_SIZE); }
    1.15 +c		{ yylval.size.width = 17.0 * 25.4;
    1.16 +                  yylval.size.height = 22.0 * 25.4;
    1.17 +                  return (PAGE_SIZE); }
    1.18 +d		{ yylval.size.width = 22.0 * 25.4;
    1.19 +                  yylval.size.height = 34.0 * 25.4;
    1.20 +                  return (PAGE_SIZE); }
    1.21 +e		{ yylval.size.width = 34.0 * 25.4;
    1.22 +                   yylval.size.height = 44.0 * 25.4;
    1.23 +                  return (PAGE_SIZE); }
    1.24  
    1.25  all		{ return (ALL); }
    1.26  bookmark	{ return (BOOKMARK); }
    1.27 +cm		{ return (CM); }
    1.28  crop		{ return (CROP); }
    1.29  even		{ return (EVEN); }
    1.30  file		{ return (FILE); }
    1.31  image		{ return (IMAGE); }
    1.32 +images		{ return (IMAGES); }
    1.33 +inch		{ return (INCH); }
    1.34  input		{ return (INPUT); }
    1.35 +landscape	{ return (LANDSCAPE); }
    1.36  odd		{ return (ODD); }
    1.37  output		{ return (OUTPUT); }
    1.38  page		{ return (PAGE); }
    1.39  pages		{ return (PAGES); }
    1.40 +portrait	{ return (PORTRAIT) ; }
    1.41  rotate		{ return (ROTATE); }
    1.42  size		{ return (SIZE); }
    1.43  
    1.44  \".*\"		{ yylval.string = newstr (yytext); return (STRING); }
    1.45 +
    1.46 +[ \t\n]+	/* whitespace */
    1.47 +
    1.48 +--.*		/* Ada/VHDL style one-line comment */
    1.49 +
    1.50 +.		{ printf( "Unrecognized character: %s\n", yytext ); }
    1.51 +