Class ChainElement<N,​E,​T,​B,​TB extends B,​S,​I,​QI,​AT,​R extends RelatedExpression<N,​T,​B,​TB,​S,​QI,​R>,​A extends ASTBasedAnaphora<N,​E,​T,​B,​TB,​S,​I,​QI,​R,​A>,​C extends ChainElement<N,​E,​T,​B,​TB,​S,​I,​QI,​AT,​R,​A,​C>>

java.lang.Object
de.monochromata.anaphors.ast.chain.ChainElement<N,​E,​T,​B,​TB,​S,​I,​QI,​AT,​R,​A,​C>
Type Parameters:
N - The node type in the AST
E - The expression type
T - The type type
B - The binding type
TB - The type binding type
S - The scope type (optional)
I - The type used to represent identifiers
QI - The type used to represent qualified identifiers
AT - The type used for attachments to chain elements that have an anaphor part. The attachment may be used to stored e.g. an old anaphora relation.
R - The sub-type of related expression to use
A - The sub-type of AST-based anaphora to use
C - The sub-type of chain element to use

public class ChainElement<N,​E,​T,​B,​TB extends B,​S,​I,​QI,​AT,​R extends RelatedExpression<N,​T,​B,​TB,​S,​QI,​R>,​A extends ASTBasedAnaphora<N,​E,​T,​B,​TB,​S,​I,​QI,​R,​A>,​C extends ChainElement<N,​E,​T,​B,​TB,​S,​I,​QI,​AT,​R,​A,​C>>
extends Object
Used to form chains of anaphors. A chain element can have a single predecessor and multiple successors. I.e. an anaphor can have a single related expression and a related expression can have multiple related expressions.

E.g.

 new String("hello"); println(helloString); println(helloString);
 
would be realized as three ChainElements:
 ChainElement(RelatedExpressionPart)
 ├ ChainElement(AnaphorPart #1)
 └ ChainElement(AnaphorPart #2)
 

This 1:N relationship between related expressions and anaphors reflects their realization via local variables. From a theoretical, linguistic point it might also suitable to consider the second anaphor to be related to the first anaphor instead of being related to the (initial) related expression. From a cognitive point in three-level semantics, the related expression and the two anaphors would refer to a single node in memory and order would occur temporally only in the order of reading.

While an ASTBasedAnaphora combines both a RelatedExpressionPart and a AnaphorPart, an anaphoric chain represents them as two ChainElements. That way, a two AnaphorParts that are related to the same RelatedExpressionPart can be represented as three ChainElements.