public void setupThisAndSuper()
{
// Create an implicit VariableDefinition for "this".
VariableDefinition thisDef = new VariableDefinition(IASKeywordConstants.THIS);
ASScope containedScope = getContainedScope();
IWorkspace workspace = containedScope.getWorkspace();
// this is a lexical ref for codemodel backwards compat
thisDef.setTypeReference(ReferenceFactory.lexicalReference(workspace, getBaseName()));
thisDef.setImplicit();
thisDef.setNamespaceReference(NamespaceDefinition.getCodeModelImplicitDefinitionNamespace());
// Create an implicit VariableDefinition for "super".
VariableDefinition superDef = new VariableDefinition(IASKeywordConstants.SUPER);
IReference baseClassRef = getBaseClassReference();
if (baseClassRef == null)
{
baseClassRef = ReferenceFactory.builtinReference(BuiltinType.OBJECT);
}
superDef.setTypeReference(baseClassRef);
superDef.setImplicit();
superDef.setNamespaceReference(NamespaceDefinition.getCodeModelImplicitDefinitionNamespace());
// Add these definitions to the class scope.
containedScope.addDefinition(thisDef);
containedScope.addDefinition(superDef);
}