use of org.eclipse.n4js.n4JS.FunctionDefinition in project n4js by eclipse.
the class NullUndefinedValidator method getParentScope.
private EObject getParentScope(EObject eobj) {
Iterable<EObject> containers = EcoreUtil2.getAllContainers(eobj);
for (EObject container : containers) {
boolean isScopeParent = false;
isScopeParent |= container instanceof FunctionDefinition;
isScopeParent |= container instanceof FunctionExpression;
if (isScopeParent) {
return container;
}
}
return null;
}
use of org.eclipse.n4js.n4JS.FunctionDefinition in project n4js by eclipse.
the class N4MethodDeclarationImpl method getDefinedFunctionOrAccessor.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IdentifiableElement getDefinedFunctionOrAccessor() {
final FunctionOrFieldAccessor _this = this;
EObject _switchResult = null;
boolean _matched = false;
if (_this instanceof FunctionDefinition) {
_matched = true;
_switchResult = ((FunctionDefinition) _this).getDefinedType();
}
if (!_matched) {
if (_this instanceof FieldAccessor) {
_matched = true;
_switchResult = ((FieldAccessor) _this).getDefinedAccessor();
}
}
return ((IdentifiableElement) _switchResult);
}
use of org.eclipse.n4js.n4JS.FunctionDefinition in project n4js by eclipse.
the class N4FieldAccessorImpl method getDefinedFunctionOrAccessor.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IdentifiableElement getDefinedFunctionOrAccessor() {
final FunctionOrFieldAccessor _this = this;
EObject _switchResult = null;
boolean _matched = false;
if (_this instanceof FunctionDefinition) {
_matched = true;
_switchResult = ((FunctionDefinition) _this).getDefinedType();
}
if (!_matched) {
if (_this instanceof org.eclipse.n4js.n4JS.FieldAccessor) {
_matched = true;
_switchResult = ((org.eclipse.n4js.n4JS.FieldAccessor) _this).getDefinedAccessor();
}
}
return ((IdentifiableElement) _switchResult);
}
use of org.eclipse.n4js.n4JS.FunctionDefinition in project n4js by eclipse.
the class FunctionDeclarationImpl method getDefinedFunctionOrAccessor.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IdentifiableElement getDefinedFunctionOrAccessor() {
final FunctionOrFieldAccessor _this = this;
EObject _switchResult = null;
boolean _matched = false;
if (_this instanceof FunctionDefinition) {
_matched = true;
_switchResult = ((FunctionDefinition) _this).getDefinedType();
}
if (!_matched) {
if (_this instanceof FieldAccessor) {
_matched = true;
_switchResult = ((FieldAccessor) _this).getDefinedAccessor();
}
}
return ((IdentifiableElement) _switchResult);
}
use of org.eclipse.n4js.n4JS.FunctionDefinition in project n4js by eclipse.
the class FunctionOrFieldAccessorImpl method getDefinedFunctionOrAccessor.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IdentifiableElement getDefinedFunctionOrAccessor() {
final FunctionOrFieldAccessor _this = this;
EObject _switchResult = null;
boolean _matched = false;
if (_this instanceof FunctionDefinition) {
_matched = true;
_switchResult = ((FunctionDefinition) _this).getDefinedType();
}
if (!_matched) {
if (_this instanceof FieldAccessor) {
_matched = true;
_switchResult = ((FieldAccessor) _this).getDefinedAccessor();
}
}
return ((IdentifiableElement) _switchResult);
}
Aggregations