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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.