Skip to content

mikhaildubov/Component-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 

Repository files navigation

Component model with declarative type definition

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.

VRML Parser

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:



XML Parser

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.



Front-end

The front-end allows one to visualize component models using the scene graph produced by one of the parsers.



Documentation

The project comes along with the appropriate GOST Documentation.



Reference books:

  • "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

Collaborators

Mikhail Dubov (parsers)
Timur Akhmetgareev (front-end)

About

Simple component model with VRML-based description

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages