On 13 Feb 2007, at 14:32, Frans Englich wrote:
I have a design problem that I don't know how to solve, so any
pointer would
be highly appreciated!
The problem is that is that in a parser for pseudo-XML, ...
If it is a known problem, perhaps you might check the USenet
newsgroup comp.compilers, or some XML list.
I need to delay the
lookup of certain names, to after all namespace declarations has
been parsed.
Here's an example:
<e attribute="{p:herePrefixPisUsed}"
xmlns:p="http://example.com/HerePrefixPisDeclared"/>
As can be seen, "xmlns:p" appears after "p:herePrefixPisUsed".
The problem is that the parser operates sequentially, and attempts
to resolve
"p" inside "p:herePrefixPisUsed", but since "xmlns:p" hasn't been
encountered
yet, it doesn't know about it, and hence fails.
Unless you can save "{p:herePrefixPisUsed}", and resolve in the
actions, when he 'xmlns:p=', I think you will have a hard parsing
problem. You might cause delays in the parsing by the use of %glr,
and letting the grammar be ambiguous until being resolved.
Hans Aberg
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison