Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /smlnj-lib/trunk/HTML4/html4-attr.l
ViewVC logotype

View of /smlnj-lib/trunk/HTML4/html4-attr.l

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3531 - (download) (annotate)
Fri May 21 00:12:21 2010 UTC (9 years, 3 months ago) by jriehl
File size: 757 byte(s)
    Added rudimentary parser for tag attributes.  Hooked the attribute 
    parser into the HTML 4 lexical utilities.  The resulting test drivers 
    can handle a good deal of the existing test inputs.
(* ______________________________________________________________________
   html4-attr.l

   Lexer for parsing HTML 4 attributes.
   ______________________________________________________________________ *)

%name HTML4AttrLexer;

%defs (
open HTML4AttrTokens

fun eof() = EOF
type lex_result = token
);

%let alpha=[A-Za-z];
%let digit=[0-9];
%let ws=[\ \t\r\n];

{alpha}({alpha}|{digit}|"-")* => (NAME (Atom.atom yytext));
{digit}+ => (NUMBER yytext);
"=" => (DOT);
"." => (DOT);
[\"][^\"]*[\"] => (STRINGLIT yytext);
[\'][^\']*[\'] => (STRINGLIT yytext);

{ws}+ => (continue());

(* ______________________________________________________________________
   End of html4-attr.l
   ______________________________________________________________________ *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0