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/branches/rt-transition/HTML4/html4-attr.g
ViewVC logotype

View of /smlnj-lib/branches/rt-transition/HTML4/html4-attr.g

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4071 - (download) (annotate)
Thu Jun 11 13:04:26 2015 UTC (4 years, 3 months ago) by jhr
File size: 972 byte(s)
update to 110.78 version of SML/NJ Library
(* html4-attr.g
 *
 * COPYRIGHT (c) 2014 The Fellowship of SML/NJ (http://www.smlnj.org)
 * All rights reserved.
 *
 * Grammar for parsing HTML 4 attributes.
 *
 * FIXME: we could probably just do this in the scanner!!!
 *)

%name HTML4Attr;

%tokens : NAME of Atom.atom
        | EQUALS ("=")
        | STRINGLIT of string
        | DOT (".")
        | NUMBER of string
;

%start attrs;

attrs : attr*
      ;

attr : NAME (EQUALS attr_value => (attr_value))?
       => ((NAME, SR))
     ;

attr_value : STRINGLIT
           | NAME (DOT NAME => (NAME))*
             => ((Atom.toString NAME) ^ (String.concatWith "."
                                         (map Atom.toString SR)))
           | NUMBER (DOT NUMBER => (NUMBER))*
             => (NUMBER ^ (String.concatWith "." SR))
           ;

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

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