How to check whether an XFeatureCall actually refers to something

112 views Asked by At

When I'm scanning the ast I want to check whether an element of the type XFeatureCall can be resolved.

Concrete example:

val x = 2
val y = x + z

I know that

val y = <XFeatureCall> + <XFeatureCall>

But only the XFeatureCall "z" should give true (when applying the yet to be found predicate I'm searching).

So far I haven't been able to find a pattern. Except that every unresolvable variable satisfies the following condition:

fc means XFeatureCall

fc.feature instanceof JvmVoid && !fc.explicitOperationCall

This however is not good enough. Because it also sees "System.out.println"

Note: I use a TreeIterator that I get from the root AST element

If necessary I will examine how the XbaseCompiler does it but I prefer not to :)

1

There are 1 answers

0
Sebastian Zarnekow On BEST ANSWER

The proper check would be fc.feature.eIsProxy to check whether the feature was not resolved. What do you mean by 'It also sees System.out.println'?