It sounds like it has a lot to bring to the table for the Knitting Expression Language. It has a way to express the KEL grammar in a formal way, which means that it is also capable of providing content assist / code completion, syntax highlighting, and pattern formatting for the KEL format.
XText would also enable the KEL format to take the form of an external DSL. As Martin points out, external DSLs traditionally take a lot of work. But XText looks like it could make this a lot simpler. At the basic level, all I need to do is write the grammar, and that gives me a base working set of tools as a starting point.
I could also get rid of many of the curly braces. This, for instance:
Directions {
InstructionGroup 'make-back' withLabel "Make the Back" {
...
}
InstructionGroup 'make-front' withLabel "Make the Front" {
...
}
} could look like this:Directions:Because the structure of the grammar at this level of the pattern is very formal, you don't really need open / closed curly braces. You can simply infer where one InstructionGroup starts by where the next one begins. This looks much more like a knitting pattern to me. But the current way the internal DSL is built (text polishing on top of Groovy), you really need the curly braces so that Groovy understands where these boundaries are. It sounds like XText could liberate us from unnecessary braces.
InstructionGroup "Make the Back":
...
InstructionGroup "Make the Front":
...
XText will also be able to provide validation and feedback to the user about their KEL pattern. That's going to be extremely important, because currently the feedback that the conversion tool provides to the user is a stack trace (with a fairly cryptic error message).
All of this hits home a point I have made before. If you are writing software to integrate with KnitML, please make sure you're coding to the XML specification and not the KEL syntax. The KEL syntax is really a tool to achieve an easy way to create a XML document. I would consider the KEL not stable for integration between versions. At least not at this point.
[ add comment ] ( 3 views ) | [ 0 trackbacks ] | permalink

Archives



