scanner.l

changeset 12
c3e2c2344560
parent 11
30d18cf8bb67
child 13
3ab5717225d3
     1.1 diff -r 30d18cf8bb67 -r c3e2c2344560 scanner.l
     1.2 --- a/scanner.l	Sat Dec 29 17:45:43 2001 +0000
     1.3 +++ b/scanner.l	Sat Dec 29 18:59:47 2001 +0000
     1.4 @@ -1,8 +1,13 @@
     1.5 +/*
     1.6 +$Id: scanner.l,v 1.6 2001/12/29 10:59:33 eric Exp $
     1.7 +*/
     1.8 +
     1.9  %option case-insensitive
    1.10  
    1.11  %{
    1.12  #include "parser.tab.h"
    1.13 -}%
    1.14 +%}
    1.15 +
    1.16  
    1.17  digit [0-9]
    1.18  alpha [a-zA-Z]
    1.19 @@ -12,7 +17,7 @@
    1.20  \.\.		{ return (ELIPSIS); }
    1.21  
    1.22  {digit}+	{ yylval.integer = atoi (yytext); return (INTEGER); }
    1.23 -{digit}+.{digit}* { yylval.float = atof (yytext); return (FLOAT); }
    1.24 +{digit}+.{digit}* { yylval.fp = atof (yytext); return (FLOAT); }
    1.25  
    1.26  a		{ yylval.size.width = 8.5 * 25.4;
    1.27  		  yylval.size.height = 11.0 * 25.4;
    1.28 @@ -50,7 +55,7 @@
    1.29  rotate		{ return (ROTATE); }
    1.30  size		{ return (SIZE); }
    1.31  
    1.32 -\".*\"		{ yylval.string = newstr (yytext); return (STRING); }
    1.33 +\".*\"		{ yylval.string = strdup (yytext); return (STRING); }
    1.34  
    1.35  [ \t\n]+	/* whitespace */
    1.36  
    1.37 @@ -58,3 +63,4 @@
    1.38  
    1.39  .		{ printf( "Unrecognized character: %s\n", yytext ); }
    1.40  
    1.41 +%%