[climacs-cvs] CVS update: climacs/html-syntax.lisp

Robert Strandh rstrandh at common-lisp.net
Thu Apr 7 05:02:36 UTC 2005


Update of /project/climacs/cvsroot/climacs
In directory common-lisp.net:/tmp/cvs-serv11719

Modified Files:
	html-syntax.lisp 
Log Message:
Introduced the concept of inline element and block-level element.

Reorganized the attributes into core attributes, i18n attributes and
scripting events according to the HTML standard. 


Date: Thu Apr  7 07:02:33 2005
Author: rstrandh

Index: climacs/html-syntax.lisp
diff -u climacs/html-syntax.lisp:1.22 climacs/html-syntax.lisp:1.23
--- climacs/html-syntax.lisp:1.22	Mon Apr  4 13:49:05 2005
+++ climacs/html-syntax.lisp	Thu Apr  7 07:02:33 2005
@@ -185,9 +185,13 @@
      (display-parse-tree name syntax pane)
      (display-parse-tree equals syntax pane)))
 
+(defclass core-attribute (html-attribute) ())
+(defclass i18n-attribute (html-attribute) ())
+(defclass scripting-event (html-attribute) ())
+
 ;;;;;;;;;;;;;;; lang attribute
 
-(defclass lang-attr (html-attribute)
+(defclass lang-attr (i18n-attribute)
   ((lang :initarg :lang)))
 
 (add-html-rule (lang-attr -> ((name word (word-is name "lang"))
@@ -204,7 +208,7 @@
 
 ;;;;;;;;;;;;;;; dir attribute
 
-(defclass dir-attr (html-attribute)
+(defclass dir-attr (i18n-attribute)
   ((dir :initarg :dir)))
 
 (add-html-rule (dir-attr -> ((name word (word-is name "dir"))
@@ -334,6 +338,24 @@
      (display-parse-tree items syntax pane)     
      (display-parse-tree </body> syntax pane)))
 
+;;;;;;;;;;;;;;; inline-element, block-level-element
+
+(defclass inline-element (html-nonterminal) ())
+(defclass block-level-element (html-nonterminal) ())
+
+;;;;;;;;;;;;;;; inline-element-or-text
+
+(defclass inline-element-or-text (html-nonterminal)
+  ((contents :initarg contents)))
+     
+(add-html-rule (inline-element-or-text -> (inline-element) :contents inline-element))
+(add-html-rule (inline-element-or-text -> (word) :contents word))
+(add-html-rule (inline-element-or-text -> (delimiter) :contents delimiter))
+
+(defmethod display-parse-tree ((entity inline-element-or-text) (syntax html-syntax) pane)
+  (with-slots (contents) entity
+     (display-parse-tree contents syntax pane)))
+
 ;;;;;;;;;;;;;;; <a>-tag
 
 (defclass <a>-attribute (html-nonterminal)
@@ -369,7 +391,7 @@
 
 (define-end-tag </a> "a")
 
-(defclass a (html-nonterminal)
+(defclass a (inline-element)
   ((<a> :initarg :<a>)
    (items :initarg :items)
    (</a> :initarg :</a>)))




More information about the Climacs-cvs mailing list