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

SCM Repository

[smlnj] Annotation of /smlnj-lib/trunk/HTML4/html4-attr.g
ViewVC logotype

Annotation of /smlnj-lib/trunk/HTML4/html4-attr.g

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3985 - (view) (download)

1 : jhr 3962 (* html4-attr.g
2 :     *
3 :     * COPYRIGHT (c) 2014 The Fellowship of SML/NJ (http://www.smlnj.org)
4 :     * All rights reserved.
5 :     *
6 :     * Grammar for parsing HTML 4 attributes.
7 : jhr 3985 *
8 :     * FIXME: we could probably just do this in the scanner!!!
9 : jhr 3962 *)
10 : jriehl 3531
11 :     %name HTML4Attr;
12 :    
13 :     %tokens : NAME of Atom.atom
14 :     | EQUALS ("=")
15 :     | STRINGLIT of string
16 :     | DOT (".")
17 :     | NUMBER of string
18 :     ;
19 :    
20 :     %start attrs;
21 :    
22 :     attrs : attr*
23 :     ;
24 :    
25 :     attr : NAME (EQUALS attr_value => (attr_value))?
26 :     => ((NAME, SR))
27 :     ;
28 :    
29 :     attr_value : STRINGLIT
30 :     | NAME (DOT NAME => (NAME))*
31 :     => ((Atom.toString NAME) ^ (String.concatWith "."
32 :     (map Atom.toString SR)))
33 :     | NUMBER (DOT NUMBER => (NUMBER))*
34 :     => (NUMBER ^ (String.concatWith "." SR))
35 :     ;
36 :    
37 :     (* ______________________________________________________________________
38 :     End of html4-attr.g
39 :     ______________________________________________________________________ *)

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