net.jangaroo.jooc
Class FunctionDeclaration

java.lang.Object
  extended by net.jangaroo.jooc.NodeImplBase
      extended by net.jangaroo.jooc.IdeDeclaration
          extended by net.jangaroo.jooc.TypedIdeDeclaration
              extended by net.jangaroo.jooc.FunctionDeclaration

public class FunctionDeclaration
extends TypedIdeDeclaration

Author:
Andreas Gawecki, Frank Wienberg

Nested Class Summary
 
Nested classes/interfaces inherited from class net.jangaroo.jooc.NodeImplBase
NodeImplBase.Scoped
 
Field Summary
protected  int allowedModifiers
           
protected  ClassDeclaration classDeclaration
           
protected static int MODIFIER_ABSTRACT
           
protected static int MODIFIER_DYNAMIC
           
protected static int MODIFIER_FINAL
           
protected static int MODIFIER_INTERNAL
           
protected static int MODIFIER_NAMESPACE
           
protected static int MODIFIER_NATIVE
           
protected static int MODIFIER_OVERRIDE
           
protected static int MODIFIER_PRIVATE
           
protected static int MODIFIER_PROTECTED
           
protected static int MODIFIER_PUBLIC
           
protected static int MODIFIER_STATIC
           
protected static int MODIFIER_VIRTUAL
           
protected static int MODIFIERS_SCOPE
           
protected  net.jangaroo.jooc.AstNode parentDeclaration
           
protected  JooSymbol[] symInheritedModifiers
           
protected  JooSymbol[] symModifiers
           
 
Constructor Summary
FunctionDeclaration(JooSymbol[] modifiers, JooSymbol symFunction, Ide ide, JooSymbol lParen, Parameters params, JooSymbol rParen, TypeRelation optTypeRelation, net.jangaroo.jooc.Statement optBody)
           
FunctionDeclaration(JooSymbol[] modifiers, JooSymbol symFunction, JooSymbol symGetOrSet, Ide ide, JooSymbol lParen, Parameters params, JooSymbol rParen, TypeRelation optTypeRelation, net.jangaroo.jooc.Statement optBody)
           
 
Method Summary
 net.jangaroo.jooc.AstNode analyze(net.jangaroo.jooc.AstNode parentNode, AnalyzeContext context)
           
protected  void computeModifiers()
           
 boolean containsSuperConstructorCall()
           
protected  void generateAsApiCode(JsWriter out)
          Default implementation generates same code as JS.
protected  void generateJsCode(JsWriter out)
           
 net.jangaroo.jooc.Statement getBody()
           
 ClassDeclaration getClassDeclaration()
           
protected  int getModifierFlag(JooSymbol modifier)
           
protected  int getModifiers()
           
 Parameters getParams()
           
 net.jangaroo.jooc.AstNode getParentDeclaration()
           
 JooSymbol[] getSymModifiers()
           
 boolean isAbstract()
           
 boolean isClassMember()
           
 boolean isConstructor()
           
 boolean isFinal()
           
 boolean isGetter()
           
 boolean isGetterOrSetter()
           
 boolean isMethod()
           
 boolean isNative()
           
 boolean isOverride()
           
 boolean isPrivate()
           
 boolean isPrivateStatic()
           
 boolean isProtected()
           
 boolean isPublic()
           
 boolean isSetter()
           
 boolean isStatic()
           
 boolean overrides()
           
 IdeDeclaration resolveDeclaration()
          Resolve this declaration to the underlying Class or PredefinedType declaration
 void scope(Scope scope)
           
 void setContainsSuperConstructorCall(boolean containsSuperConstructorCallStatement)
           
protected  void setInheritedModifiers(JooSymbol[] modifiers)
           
 void setIsClassMember(boolean classMember)
           
protected  void writeModifiers(JsWriter out)
           
 
Methods inherited from class net.jangaroo.jooc.TypedIdeDeclaration
getName
 
Methods inherited from class net.jangaroo.jooc.IdeDeclaration
getIde, getQualifiedName, getQualifiedNameStr, getSymbol, isField, isPrimaryDeclaration, isPrivateStaticMethod, resolvePropertyDeclaration, toString
 
Methods inherited from class net.jangaroo.jooc.NodeImplBase
analyze, generateCode, scope, withNewDeclarationScope, withNewLabelScope
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

symModifiers

protected JooSymbol[] symModifiers

symInheritedModifiers

protected JooSymbol[] symInheritedModifiers

parentDeclaration

protected net.jangaroo.jooc.AstNode parentDeclaration

classDeclaration

protected ClassDeclaration classDeclaration

allowedModifiers

protected int allowedModifiers

MODIFIER_PUBLIC

protected static final int MODIFIER_PUBLIC
See Also:
Constant Field Values

MODIFIER_PROTECTED

protected static final int MODIFIER_PROTECTED
See Also:
Constant Field Values

MODIFIER_PRIVATE

protected static final int MODIFIER_PRIVATE
See Also:
Constant Field Values

MODIFIER_INTERNAL

protected static final int MODIFIER_INTERNAL
See Also:
Constant Field Values

MODIFIER_STATIC

protected static final int MODIFIER_STATIC
See Also:
Constant Field Values

MODIFIER_ABSTRACT

protected static final int MODIFIER_ABSTRACT
See Also:
Constant Field Values

MODIFIER_FINAL

protected static final int MODIFIER_FINAL
See Also:
Constant Field Values

MODIFIER_OVERRIDE

protected static final int MODIFIER_OVERRIDE
See Also:
Constant Field Values

MODIFIER_DYNAMIC

protected static final int MODIFIER_DYNAMIC
See Also:
Constant Field Values

MODIFIER_NAMESPACE

protected static final int MODIFIER_NAMESPACE
See Also:
Constant Field Values

MODIFIER_NATIVE

protected static final int MODIFIER_NATIVE
See Also:
Constant Field Values

MODIFIER_VIRTUAL

protected static final int MODIFIER_VIRTUAL
See Also:
Constant Field Values

MODIFIERS_SCOPE

protected static final int MODIFIERS_SCOPE
See Also:
Constant Field Values
Constructor Detail

FunctionDeclaration

public FunctionDeclaration(JooSymbol[] modifiers,
                           JooSymbol symFunction,
                           Ide ide,
                           JooSymbol lParen,
                           Parameters params,
                           JooSymbol rParen,
                           TypeRelation optTypeRelation,
                           net.jangaroo.jooc.Statement optBody)

FunctionDeclaration

public FunctionDeclaration(JooSymbol[] modifiers,
                           JooSymbol symFunction,
                           JooSymbol symGetOrSet,
                           Ide ide,
                           JooSymbol lParen,
                           Parameters params,
                           JooSymbol rParen,
                           TypeRelation optTypeRelation,
                           net.jangaroo.jooc.Statement optBody)
Method Detail

getParams

public Parameters getParams()

isClassMember

public boolean isClassMember()
Overrides:
isClassMember in class IdeDeclaration

setIsClassMember

public void setIsClassMember(boolean classMember)

overrides

public boolean overrides()

isMethod

public boolean isMethod()
Overrides:
isMethod in class IdeDeclaration

isGetterOrSetter

public boolean isGetterOrSetter()

isGetter

public boolean isGetter()

isSetter

public boolean isSetter()

isConstructor

public final boolean isConstructor()
Overrides:
isConstructor in class IdeDeclaration

containsSuperConstructorCall

public boolean containsSuperConstructorCall()

setContainsSuperConstructorCall

public void setContainsSuperConstructorCall(boolean containsSuperConstructorCallStatement)

isAbstract

public boolean isAbstract()

getBody

public net.jangaroo.jooc.Statement getBody()

scope

public void scope(Scope scope)
Overrides:
scope in class TypedIdeDeclaration

analyze

public net.jangaroo.jooc.AstNode analyze(net.jangaroo.jooc.AstNode parentNode,
                                         AnalyzeContext context)
Overrides:
analyze in class NodeImplBase

generateAsApiCode

protected void generateAsApiCode(JsWriter out)
                          throws java.io.IOException
Description copied from class: NodeImplBase
Default implementation generates same code as JS. Overwritten where this must differ.

Overrides:
generateAsApiCode in class NodeImplBase
Throws:
java.io.IOException

generateJsCode

protected void generateJsCode(JsWriter out)
                       throws java.io.IOException
Specified by:
generateJsCode in class NodeImplBase
Throws:
java.io.IOException

resolveDeclaration

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

Overrides:
resolveDeclaration in class TypedIdeDeclaration

getSymModifiers

public JooSymbol[] getSymModifiers()

getParentDeclaration

public net.jangaroo.jooc.AstNode getParentDeclaration()

getClassDeclaration

public ClassDeclaration getClassDeclaration()

setInheritedModifiers

protected void setInheritedModifiers(JooSymbol[] modifiers)

computeModifiers

protected void computeModifiers()

getModifierFlag

protected int getModifierFlag(JooSymbol modifier)

getModifiers

protected int getModifiers()

isPublic

public boolean isPublic()

isProtected

public boolean isProtected()

isPrivate

public boolean isPrivate()

isOverride

public boolean isOverride()

isPrivateStatic

public boolean isPrivateStatic()

isStatic

public boolean isStatic()

isFinal

public boolean isFinal()

isNative

public boolean isNative()

writeModifiers

protected void writeModifiers(JsWriter out)
                       throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2002-2010 CoreMedia AG. All Rights Reserved.