simpleparse.examples.formatvrml
index
/home/mcfletch/pylive/simpleparse/examples/formatvrml.py

Example using a parser to format VRML97 code as HTML w/CSS

 
Modules
       
os
string
sys

 
Classes
       
VRMLFormatter
HTMLVRMLFormatter

 
class HTMLVRMLFormatter(VRMLFormatter)
    Format VRML files for display in HTML
 
  Data and other attributes defined here:
NODEMAP = {'DEF': '<%(head)sstrong>', 'DEFName': '<span class="%(nodetype)s">', 'DEFName_tail': '</span>', 'EXTERNPROTO': '<span class="%(nodetype)s">', 'EXTERNPROTO_tail': '</span>', 'PROTO': '<span class="%(nodetype)s">', 'PROTO_tail': '</span>', 'ROUTEData': '<strong class="%(nodetype)s">', 'ROUTEData_tail': '</span>', 'SFString': '<span class="%(nodetype)s">', ...}

Methods inherited from VRMLFormatter:
__init__(self, infile, vrmlparser=<simpleparse.parser.Parser instance>)
format(self, outfile)

 
class VRMLFormatter
    Base formatting class
 
  Methods defined here:
__init__(self, infile, vrmlparser=<simpleparse.parser.Parser instance>)
format(self, outfile)

 
Data
        VRMLPARSERDEF = '\n# Specialised VRML parser for colourising VRML ... := ( [ \\011-\\015,]+ / comment+ )*\n'
usage = "formatvrml.py infile outfile\n\tinfile -- properly... your\n\tVRML by changing this file's definitions.\n"
vrmlparser = <simpleparse.parser.Parser instance>