in reply to Transforming axml into hyperlinks

simonodell:

Sorry this is totally unrelated to your question, but I've seen a few of your aXML posts over the last few days, and thought I'd make a comment. (Note: I haven't read your aXML stuff in detail, so this suggestion might prove unsuitable for your purposes.)

Languages and parsing can have a few tricky corners for the unwary, and I suspect you may be digging an ugly hole for yourself. The XML grammar, as simple as it is, may interact with yours in odd ways unless you thoroughly determine what you want. So far, it feels like you're flying by the seat of your pants, so it's quite possible you may find yourself coding around in circles, fixing a language bug, then a new special case arising that you'll have to fix. An ugly merry-go-round.

Looking at what you want, I'd suggest you go a slightly different way: Create a namespace for your keywords, and then build your processor (similar to an XSLT processor) that contains your plugin architecture. You could use an attribute to control processing order, rather than new syntax elements. This could give you some standard XML similar to:

<link action="..."><aX:qd procorder="after">ref</aX:qd></link>
This will give you a couple of advantages:

  • You'll still be able to fly by the seat of your pants, but you'll won't have the potential spectre of grammar interactions.
  • You'll be able to use standard XML parsers to do some of the heavy lifting, and you'll be able to concentrate on the unique bits of your idea.
  • Since it's a standard XML file, you can use a standard XSLT processor for pre/post processing your files. (Nice for your users when your tool is one of many in a chain of operations. For example, a user might use an XSLT stylesheet to insert some aXML syntax into documents for use with your tool.)

    ...roboticus

  • Replies are listed 'Best First'.