The project is targeted at constructing a component model using its declarative description. The goal is to build a set of connected JavaBeans components, called the scene graph. The interactions between components are described in a declarative language, either VRML or XML. Then, a special front-end visualizes the scene graph and allows the user to change the properties of the components as well as the connections between them.
The main project features are:
- 2 parsers for VRML and X3D built using 2 different algorithms;
- Probably the best error diagnostic tools incorporated into the parsers;
- Codegenerators, which enable conversion between VRML and X3D formats;
- A front-end that visualizes the declarative description of component models.
The VRML parser is built using the recursive-descent parsing technique, a top-down method which allows one to develop the parser in a strict way according to the VRML grammar.
The parser performs the syntax analysis of some input VRML file:
DEF shape1 Shape
{
appearance Appearance
{
material Material
{
diffuseColor 0 0.5 0
}
}
geometry Sphere {}
}
USE shape1
– and, using its knowledge about the VRML node types and data types, immediately builds a bunch of JavaBeans components, which make up the scene graph:
The XML parser is built according to SAX, "Simple API for XML", which is an event-based model of parser construction. Here, the parser operates on each piece of the XML document sequentially, reporting special events as soon as he meets an opening tag, an attribute etc.:
openingTag(name)
closingTag(name)
attribute(name, value)
textNode(text)
One of the benefits of this approach is a relatively effective use of memory, as there is no need of tree representation of the entire document.
The front-end allows one to visualize component models using the scene graph produced by one of the parsers.
The project comes along with the appropriate GOST Documentation.
- "Compilers: Principles, Techniques, and Tools" by Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman
- "Core Java, Volume I: Fundamentals" by Cay S. Horstmann and Gary Cornell
- "Core Java, Volume II: Advanced features" by Cay S. Horstmann and Gary Cornell
Timur Akhmetgareev (front-end)