Parent Directory
|
Revision Log
|
Patch
| revision 1.1 by wakaba, Sun Apr 20 06:07:24 2008 UTC | revision 1.3 by wakaba, Sun Apr 20 10:02:43 2008 UTC | |
|---|---|---|
| # | Line 19 | Line 19 |
| 19 | <script> | <script> |
| 20 | function update () { | function update () { |
| 21 | document.logElement.textContent = ''; | document.logElement.textContent = ''; |
| 22 | var p = new Parser (); | var p = new Parser (new InputStream (document.sourceElement.value)); |
| 23 | p.parse (new InputStream (document.sourceElement.value)); | p.parse (); |
| 24 | log (dumpTree (p.doc, '')); | log (dumpTree (p.doc, '')); |
| 25 | } // update | } // update |
| 26 | ||
| # | Line 32 | Line 32 |
| 32 | this.s = s; | this.s = s; |
| 33 | } // InputStream | } // InputStream |
| 34 | ||
| 35 | function Parser () { | function Parser (i) { |
| 36 | this.parseMode = 'pcdata'; | this.parseMode = 'pcdata'; |
| 37 | this.doc = new JSDocument (); | this.doc = new JSDocument (this); |
| 38 | this.openElements = [this.doc]; | this.openElements = [this.doc]; |
| 39 | this.in = i; | |