[furcas-discussion] Parser generation and URIs in _beforeSeqEl
Axel Uhl
axel.uhl at gmx.de
Thu Feb 3 14:41:31 CET 2011
Hi all,
Sebastian accidentally ran into an issue that seems to have to do with
how the parser generator adds URIs to the _beforeSeqEl calls in the
generated parser. You can, for example, see that in TCSParser, line 6188:
_beforeSeqEl("http://www.furcas.org/transientParsingResource_mu-KICssEeCJxeruKCZONA#//@templates.17/@templateSequence/@elements.0");
The call uses a URI that obviously refers to a transient element that in
this case is supposed to be part of the TCS concrete syntax. However,
the URI refers to a transient resource that for sure doesn't survive the
parser generation phase as we currently don't seem to be storing the
mapping model anywhere.
Interestingly, this doesn't seem to cause problems... except for this
one test case that Sebastian added.
TestNestedScopesWithTextBlocks.testRebindingToDefinitionInInnerScope
causes an exception when
ParserTextBlocksHandler.notifyEnterSequenceElement is trying to actually
load the EObject with the URI specified in the _beforeSeqEl call from
the current ResourceSet. But if the test case is run as the entire
ReferenceResolvingTests suite, for reasons yet to explore the
ResourceSet doesn't contain the mapping definition of the test language
anymore. In turn, the URI can't be resolved in the resource set.
Downstream, this ultimately leads to an exception because EMF can't
resolve the URI
http://www.furcas.org/transientParsingResource_C-8x4C-WEeCFZIxoq4PPuw#//@templates.4/@templateSequence/@elements.0
to an input stream because without proper proxy settings, www.furcas.org
can't be resolved in the SAP intranet.
What does this mean w.r.t how the URIs need to look that are generated
into the _beforeSeqEl calls? It seems to mean that these URIs in general
should be resolvable in the scope of the ResourceSet used during
(incremental) parsing. This would also mean that the TCSParser may
ultimately cause problems because its URIs can't be resolved anymore,
either.
I suppose we'd need to store at least the durable TCS mapping model
persistently and generate URIs into TCSParser that can be resolved to
this persistent resource. For test cases this may be different, and
Sebastian's particular problem may be resolved by ensuring that the
transiently-created mapping remains in the test's resource set.
Best,
-- Axel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2156 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.furcas.org/pipermail/furcas-discussion/attachments/20110203/e05ceebc/attachment.bin>
More information about the Furcas-discussion
mailing list