This page last changed on Apr 21, 2006 by scytacki.

It seems like building off of libconf and conf2xml seems like a good place to start. But I need to figure out how to work on the schemas for conf2xml. It currently uses something called templates, which seems similar to schemas.

Another issues is that conf2xml uses a single dtd for its output. If we want to use a standard schema language then the output of conf2xml needs to not be generic but actually use the xml element names as the config file elements. This might be doable with a xslt.

Another way to work on this might be with syntax trees. Because one thing that should exist are rich editors for the basic text files, perhaps using syntax trees will make that easy.

More brainstorming....

Supporting the use of xml as an intermediate is very good. That combined with the schemas make this a very portable and broadly useful solution.

Supporting multiple languages for writing the "parsers" is also very good.

If the api for the parser is defined correctly then the same parser can be used both for generating and then merging xml. As well as working with real time object synchronizing in eclipse.

So the break down is this:

The parser component:

  • parses text file and generates an internal object model
  • can save the object model back to the text
  • provides a mapping between that object model and a more semantic object model
    • this mapping can be used to generate xml, the xml uses ids so it can be merged back
    • this mapping is used to merge the xml back in.
    • this mapping is used for real time object syncing. This can be done in two ways:
      • the mapping provides "adapters" for its internal object model, the adapters make its object model "look" like the more semantic object model.
      • the mapping converts its internal object model into the semantic object model. And then synchronizes changes between the two.

Using mono this parser component could be written in lots of languages, and still be usuable by a rich text/xml editor. Example ways to implement parser component:

  • JavaCC w/ JJTree parses the file and java code transforms the parse tree to the xml model
  • Perl parses the file and transforms it directly to xml model.

What I was calling the semantic model is implemented as a dynamic or compiled emf model from the schema.
There are 2 levels of implementation for the parser component:

Level 1

  • Parses text config file and generates instance of emf model.
  • Takes instance of emf model and generates config file.
  • Merges config file and emf model.

Level 2

  • Updates an additional model that contains character range information for each element in
    emf model. This information can be used by text editors to mark up and provide context sensitive help.
  • This info is stored outside of the main emf model, because it is not needed for higher level programs.

There are two kinds of parsers:

Schema Specific Parser

This type of parser is specific to a particular schema. These are the type of parsers that GST has already created.

Config File Format Parser

This is a more general parser that can work for multiple types of config files. Generally it shouldn't need to know about the schema it simply converts the file into the emf model that should exist. It might requie some parameters, so it knows keywords that are specific to a particular config file. These parameters would be stored as annotations to the schema.
One issue with this type of parser is error handling. If it doesn't know the schema and the emf model being populated is schema specific then errors will occur when the parser attempts to put invalid elements in the emf model.

More Research

  • Figure out how eclipse does the text editor to object model mapping, perhaps a simple example is shelled
  • Look more closely at GNOME System Tools and YaST


  • emf model can be generated using the xsd plugin in eclipse
  • schema specific parsers can be taken from GST, and modified to work with emf
  • file format parser can be written with combination of JavaCC, JJTree, and Java code.
  • Eclipse integration???

Eclipse Integration Issues

  • if we use a GST parser can we simply run save the text file, run the parser, import the xml?
Document generated by Confluence on Jan 27, 2014 16:56