[furcas-discussion] Reference Re-Evaluation Algorithm
Stephan Erb
stephan at dev.static-void.de
Sun Feb 6 23:09:39 CET 2011
Hey everybody,
here the result of our last whiteboard session:
> Create a collect expression only consisting of lookupScope and referenceBy. (It does not contain ?, prefix or postfix).
> Register the IA on this expression
> Register the IA on the lookupScope expression
>
> If the IA triggers for one of these two registrations, then:
>
> Filter the affected elements. Only those may remain for which a TB is
> documenting that the above triggered expression may be executed.
> (See IAExpressionInvalidationChangeListener in the MOIN code base)
>
> For all remaining effected elements and their associated document nodes:
>
> Determine if the given reference is bound. Probably this works by inspecting
> the 'referrencedModelElements'. The context element at hand may be visible
> in several textual views. If at least one of these documents that the reference is bound
> then we consider this to be true. Views indicating otherwise are considered to be stale.
>
> evaluate the lookupScope
>
> If bound and the bound element is still in the current lookup scope then:
>
> Update all corresponding token values. The tokens are set to
> the evaluation result of referenceBy on the bound element.
> Prefix and postfix are substracted. If prefix and postfix do not match
> the given name then the bound reference will be unset.
>
> else if bound but the bound element is no longer in the lookup scope then:
>
> Retrieve the name of the previously bound element (overruling the
< respective token value). Use this name to perform a fresh lookup
> using lookupScope, referenceBy, prefix and postfix. Set the reference
> based on the result or break it, if nothing was found.
>
> else if not bound:
>
> Perform a fresh lookup. The lookup is performed with the current token value
> at hand, using lookupScope, referenceBy, prefix and postfix. Set the reference
> based on the result or break it, if nothing was found.
>
Tasks:
* Axel will implement a ModelUpdater using to the given algorithm.
* Sebastian will write several test cases:
* Tests covering all branches of the algorithm.
* A testcase where the model is constructed in memory. We
will use it to test the algorithm if no TB model is
available.
* A set of testcases operating on the text level:
search/replace in the TB model with a subsequent call of
the incremental parser.
Happy Hacking!
Stephan
PS: Thomas, we might need your help with all this textblocks magic (e.g.
find out if a reference is still bound). Expect some questions on the
mailing list rather soon :-)
More information about the Furcas-discussion
mailing list