net.jangaroo.jooc.ast
Class ClassDeclaration

java.lang.Object
  extended by net.jangaroo.jooc.ast.NodeImplBase
      extended by net.jangaroo.jooc.ast.Directive
          extended by net.jangaroo.jooc.ast.Statement
              extended by net.jangaroo.jooc.ast.Declaration
                  extended by net.jangaroo.jooc.ast.IdeDeclaration
                      extended by net.jangaroo.jooc.ast.ClassDeclaration
All Implemented Interfaces:
AstNode

public class ClassDeclaration
extends IdeDeclaration

Author:
Andreas Gawecki, Frank Wienberg

Nested Class Summary
 
Nested classes/interfaces inherited from class net.jangaroo.jooc.ast.NodeImplBase
NodeImplBase.Scoped
 
Field Summary
 
Fields inherited from class net.jangaroo.jooc.ast.Declaration
MODIFIER_ABSTRACT, MODIFIER_DYNAMIC, MODIFIER_FINAL, MODIFIER_INTERNAL, MODIFIER_NAMESPACE, MODIFIER_NATIVE, MODIFIER_OVERRIDE, MODIFIER_PRIVATE, MODIFIER_PROTECTED, MODIFIER_PUBLIC, MODIFIER_STATIC, MODIFIER_VIRTUAL, MODIFIERS_SCOPE
 
Constructor Summary
ClassDeclaration(JooSymbol[] modifiers, JooSymbol cls, Ide ide, Extends ext, Implements impl, ClassBody body)
           
 
Method Summary
 void addFieldWithInitializer(VariableDeclaration fieldDeclaration)
           
 void addInitIfClassOrGlobalVar(Ide ide)
           
 void analyze(AstNode parentNode)
           
protected  int getAllowedModifiers()
           
 ClassBody getBody()
           
 List<? extends AstNode> getChildren()
           
 Set<String> getClassInit()
           
 FunctionDeclaration getConstructor()
           
 List<VariableDeclaration> getFieldsWithInitializer()
           
 int getInheritanceLevel()
           
 TypedIdeDeclaration getMemberDeclaration(String memberName)
           
 String getName()
           
 Extends getOptExtends()
           
 Implements getOptImplements()
           
 List<IdeDeclaration> getSecondaryDeclarations()
           
 TypedIdeDeclaration getStaticMemberDeclaration(String memberName)
           
 Map<String,TypedIdeDeclaration> getStaticMembers()
           
 Type getSuperType()
           
 ClassDeclaration getSuperTypeDeclaration()
           
 JooSymbol getSymClass()
           
 Type getThisType()
           
 void handleDuplicateDeclaration(Scope scope, AstNode oldNode)
           
 boolean isAbstract()
           
 boolean isClassMember()
           
 boolean isInterface()
           
 boolean isStatic()
           
 boolean isSubclassOf(ClassDeclaration classDeclaration)
           
 void registerMember(TypedIdeDeclaration memberDeclaration)
           
 IdeDeclaration resolveDeclaration()
          Resolve this declaration to the underlying Class or PredefinedType declaration
 IdeDeclaration resolvePropertyDeclaration(String ide)
          Lookup a non-static member of the given name
 void scope(Scope scope)
           
 void setConstructor(FunctionDeclaration methodDeclaration)
           
 void setSecondaryDeclarations(List<IdeDeclaration> secondaryDeclarations)
           
 void visit(AstVisitor visitor)
           
 
Methods inherited from class net.jangaroo.jooc.ast.IdeDeclaration
getIde, getPackageDeclaration, getQualifiedName, getQualifiedNameStr, getSymbol, isConstructor, isDeclaringCompileTimeConstant, isMethod, isPrimaryDeclaration, setIde, toString
 
Methods inherited from class net.jangaroo.jooc.ast.Declaration
computeModifiers, getClassDeclaration, getModifierFlag, getModifiers, getParentDeclaration, getSymInheritedModifiers, getSymModifiers, isDynamic, isFinal, isNative, isOverride, isPrivate, isPrivateStatic, isProtected, isPublic, isPublicApi, setClassDeclaration, setInheritedModifiers, setParentDeclaration, setSymInheritedModifiers
 
Methods inherited from class net.jangaroo.jooc.ast.Directive
setClassMember
 
Methods inherited from class net.jangaroo.jooc.ast.NodeImplBase
analyze, getParentNode, makeChildren, scope, withNewDeclarationScope, withNewLabelScope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassDeclaration

public ClassDeclaration(JooSymbol[] modifiers,
                        JooSymbol cls,
                        Ide ide,
                        Extends ext,
                        Implements impl,
                        ClassBody body)
Method Detail

getChildren

public List<? extends AstNode> getChildren()
Specified by:
getChildren in interface AstNode
Overrides:
getChildren in class IdeDeclaration

getConstructor

public FunctionDeclaration getConstructor()

visit

public void visit(AstVisitor visitor)
           throws IOException
Throws:
IOException

getAllowedModifiers

protected int getAllowedModifiers()
Overrides:
getAllowedModifiers in class Declaration

isInterface

public boolean isInterface()

isAbstract

public boolean isAbstract()
Overrides:
isAbstract in class Declaration

isStatic

public boolean isStatic()
Overrides:
isStatic in class Declaration

isClassMember

public boolean isClassMember()
Overrides:
isClassMember in class Directive

getName

public String getName()
Overrides:
getName in class IdeDeclaration

setConstructor

public void setConstructor(FunctionDeclaration methodDeclaration)

getSymClass

public JooSymbol getSymClass()

getOptExtends

public Extends getOptExtends()

getOptImplements

public Implements getOptImplements()

getFieldsWithInitializer

public List<VariableDeclaration> getFieldsWithInitializer()

getBody

public ClassBody getBody()

getSecondaryDeclarations

public List<IdeDeclaration> getSecondaryDeclarations()

getStaticMembers

public Map<String,TypedIdeDeclaration> getStaticMembers()

getClassInit

public Set<String> getClassInit()

scope

public void scope(Scope scope)
Specified by:
scope in interface AstNode
Overrides:
scope in class IdeDeclaration

handleDuplicateDeclaration

public void handleDuplicateDeclaration(Scope scope,
                                       AstNode oldNode)
Overrides:
handleDuplicateDeclaration in class IdeDeclaration

analyze

public void analyze(AstNode parentNode)
Specified by:
analyze in interface AstNode
Overrides:
analyze in class Declaration

registerMember

public void registerMember(TypedIdeDeclaration memberDeclaration)

getMemberDeclaration

public TypedIdeDeclaration getMemberDeclaration(String memberName)

getStaticMemberDeclaration

public TypedIdeDeclaration getStaticMemberDeclaration(String memberName)

addInitIfClassOrGlobalVar

public void addInitIfClassOrGlobalVar(Ide ide)

isSubclassOf

public boolean isSubclassOf(ClassDeclaration classDeclaration)

getThisType

public Type getThisType()

getSuperType

public Type getSuperType()

setSecondaryDeclarations

public void setSecondaryDeclarations(List<IdeDeclaration> secondaryDeclarations)

resolveDeclaration

public IdeDeclaration resolveDeclaration()
Description copied from class: IdeDeclaration
Resolve this declaration to the underlying Class or PredefinedType declaration

Overrides:
resolveDeclaration in class IdeDeclaration
Returns:
the declaration

resolvePropertyDeclaration

public IdeDeclaration resolvePropertyDeclaration(String ide)
Lookup a non-static member of the given name

Overrides:
resolvePropertyDeclaration in class IdeDeclaration
Parameters:
ide - the member name
Returns:
a non-static member if found, null otherwise

getInheritanceLevel

public int getInheritanceLevel()

getSuperTypeDeclaration

public ClassDeclaration getSuperTypeDeclaration()

addFieldWithInitializer

public void addFieldWithInitializer(VariableDeclaration fieldDeclaration)


Copyright © 2002–2014 CoreMedia AG. All rights reserved.