Building an Enhanced Syntax-Directed Processing Environment for XML Documents by Combining StAX and CUP

Building on our previous work on the combination of JavaCC and SAX, we developed a new syntax-directed processing environment for XML documents. In this new environment, we use CUP as the parser-generation tool and StAX as the interface with the underlying XML parsing framework. The new environment supports a richer set of processing-specific context-free grammars (i.e., the grammars used for representing the processing-oriented structure of the processed documents) and enables the construction of more efficient and complex processors. In particular, the environment makes possible an event-driven computation style that enables processes that require multiple passes on the document tree, although such a tree is never explicitly built. This paper describes the environment and illustrates its use in the development of , an XML-driven courseware system.