17.5. Path Predicates

Path Predicates
[77]PathPredicate::='-' PathSpecification '-' | '-' PathSpecification '->' | '<-' PathSpecification '-'  
[78]PathSpecification::=NamePathPredicate | ParametrizedPathPredicate | MethodPathPredicate | ExpressionEdgePredicate  

Path predicates are used to connect their neighbouring predicates by a binary relation. In order to do this, they have both an open in-parameter and an open out-parameter, these are merged with the in- and out-parameters of their neighbouring predicates (Section 17.3.3, “Connecting Primary Predicates”).

A path predicate is specified by its direction and a path specification. The direction is indicated by the tokens around the path specification: For - -, it is undirected, for - ->, it is forward, for <- -, it is backward. If the direction is backward, the in- and out-parameters of the contained path specification are swapped.

17.5.1. Name Path Predicates

Name Path Predicates

17.5.2. Parametrized Path Predicates

Parametrized Path Predicates
[80]ParametrizedPathPredicate::=Name Arguments  

17.5.3. Method Path Predicates

Method Path Predicates
[81]MethodPathPredicate::=SelectorExpression '.' Identifier Arguments  

17.5.4. Expression Edge Predicates

Expression Edge Predicates

An expression edge predicate contains a single expression. It allows to specify an edge pattern which consists of a single value. At first, the expression is converted by method invocation conversion to the type E returned by m.getEdgeClassFor(T), where m is the current compile-time model (Section 3.1, “Compile-Time Model”) and T the original type of the expression. If such a conversion does not exist, a compile-time error occurs.

If the resulting expression is a compile-time constant, and if its type E is primitive or has java.io.Serializable as superinterface, then the expression edge predicate is reclassified as a constant edge predicate (Section 17.5.6, “Constant Edge Predicates”) having the constant value of the expression as its value.

17.5.5. Standard Edge Predicates

Standard Edge Predicates
[83]StandardEdgePredicate::='>' | '<' | '+>' | '<+' | '-->' | '<--' | '--'  

Standard edge predicates provide simple means to specify a connectivity relation between their neighbouring predicates. They are shorthands for constant edge predicates (Section 17.5.6, “Constant Edge Predicates”). The translation is defined by the following table:

Table 17.1. Reclassification as constant edge predicate

Predicate tokenConstant XDirection

The constant of the reclassified constant edge predicate is obtained by m.getStandardEdgeFor(de.grogra.xl.qnp.EdgePredicate.X), where m is the current compile-time model (Section 3.1, “Compile-Time Model”). The returned value has to be an instance of the type returned by m.getStandardEdgeClass() or an instance of the boxing type if the returned type is primitive. In the latter case, unboxing conversion is applied to the constant before reclassification.

17.5.6. Constant Edge Predicates

A constant edge predicate results from the reclassification of an expression edge predicate (Section 17.5.4, “Expression Edge Predicates”) or a standard edge predicate (Section 17.5.5, “Standard Edge Predicates”).