dizz / occi-grammar

ANTLR Grammar for the OCCI HTTP Text Rendering
http://www.occi-wg.org
Other
13 stars 3 forks source link

Introduction:

Interoperability is key to OCCI. The OCCI specifications set out in text how to implement the API and formats, however it is still up to our community and adopters to implement this. It is often the case when implementing a specification certain implementation decisions made can have an impact on an implementations interoperability. It is for this reason why this ANTLR grammar has been created to aid developers in creating their parser. The ANTLR grammar specifies the text rendering format in an abstract language known as a grammar.

What:

The grammar defined, when used with the ANTLR tools, will generate a lexer and parser that will validate any valid OCCI text format. The grammar itself does not currently check whether a value associated with an attribute is valid. Rather it primarily ensures that the structure of the request is valid. It is still up to the implementer that service behaviours (e.g. correctly responding to HTTP GETs) are implemented correctly.

Why:

One of the key strengths of ANTLR, outside of its lexer/parser technology, is it has a wide range of target languages (18), so your favourite language has a good chance! This is an important advantage as this enables multiple implementations of OCCI (client or server) to all share a the same rules that parse the OCCI text format, regardless of language.

The Goodies:

There are two grammars currently defined:

There are a number of rules that are present within the OCCI grammar that can be reused in order to validate certain supplied values. This would describe a second pass parsing phase. In the case that an implementer would like to validate a URI value then they can do so by using this URI grammar.

Generating the Lexer and Parser:

The ANTLR site has all the documentation you'll need for this. If you are an eclipse user, you will find that the ANTLR IDE eclipse plugin is very useful. Otherwise, ANTLRworks is another good standalone tool.

License:

This is released under a 3-clause BSD license and the work was sponsored by the SLA@SOI EU FP7 project.

Support:

For issues directly related to the grammars here, simply raise an issue on the issue tracker here. For issues related to the OCCI specification please contact the OCCI group.

Andy (mail, twitter).