Describing Grammars – Defining a Syntax
I like the general structure of EBNF but want to distinguish between attributes that are concepts in their own right and those that just have a primitive data type. It is a slightly less generalized approach than EBNF, but I find it useful to distinguish the tree leafs (which would be implemented as columns in an Active Data Model) from the other nodes (which would be implemented as tables). Apart from anything else I find the concepts to be more “important” and like the ability to get a sense of the grammar without worrying about primitive data types and then to see the data type information below. Here is a sample:
Concepts:
Object: Name [ShortDescription] [Description] [“extends” Object.Name] {Attribute}
Attribute: Name [ShortDescription]
Attributes:
Object.Name: text(100)
Object.ShortDescription: text(250)
Object.Description: ntext
Attribute.Name: text(100)
Attribute.ShortDescription: text(250)
I’ve kept the “::=” for “is comprised of”, square brackets still define optionality and curly brackets still define elements that there can be 0..n of. Note that the dot notation (Object.Name) for allows different concepts to have attributes with the same name without necessarily being the same data type.
I just find this a little easier to understand, but I am extremely new to playing with grammars and haven’t looked into the notations used by the tooling out there, so I may well find I’ve been reinventing the wheel. However, the good news is that as long as the underlying abstract grammar I support matches EBNF, I could always write a transformation to map one to the other automatically.
Any thoughts/suggestions/ideas?!



Yeah, sorry for all of the CompSci, but it's for a good cause - less code to provide more functionality. Now that it is solving a real problem (how can I write a generic tool that will automatically create a schema for storing and scripting for accessing the metadata in any generalized DSL), it actually becomes important/interesting to me :->