java.lang.Object
bossa.syntax.Node
bossa.syntax.Definition
bossa.syntax.MethodDeclaration
- All Implemented Interfaces:
- bossa.util.Located
- Direct Known Subclasses:
- Constructor, FieldAccess, InlinedMethod, JavaMethod, UserOperator
- public abstract class MethodDeclaration
- extends Definition
Declaration of a method.
Can be
- a Nice method,
with several method bodies @see bossa.syntax.MethodBodyDefinition
- a Java method
- an inlined method
- Version:
- $Date: 2003/12/08 18:39:21 $
|
Constructor Summary |
(package private) |
MethodDeclaration(LocatedString name,
mlsub.typing.Constraint cst,
mlsub.typing.Monotype[] parameters,
mlsub.typing.Monotype returnType)
Does not specify the type of the method. |
|
MethodDeclaration(LocatedString name,
Constraint constraint,
Monotype returnType,
FormalParameters parameters)
|
(package private) |
MethodDeclaration(LocatedString name,
FormalParameters formals,
mlsub.typing.Constraint cst,
mlsub.typing.Monotype[] parameters,
mlsub.typing.Monotype returnType)
|
(package private) |
MethodDeclaration(LocatedString name,
FormalParameters formals,
mlsub.typing.Polytype type)
|
| Methods inherited from class bossa.syntax.Node |
addChild, addChildren, addFirstChild, addSymbol, addTypeMap, addTypeSymbol, addTypeSymbols, buildScope, buildScope, child, doResolve, doTypecheck, getCurrentFunction, getGlobalScope, getGlobalTypeScope, getScope, getTypeScope, removeChild, resolve, setCurrentFunction, setModule |
type
private mlsub.typing.Polytype type
syntacticConstraint
private java.lang.String syntacticConstraint
- Module interface
arity
protected int arity
parameters
protected FormalParameters parameters
symbol
private MethodDeclaration.Symbol symbol
code
private gnu.expr.Expression code
MethodDeclaration
public MethodDeclaration(LocatedString name,
Constraint constraint,
Monotype returnType,
FormalParameters parameters)
MethodDeclaration
MethodDeclaration(LocatedString name,
mlsub.typing.Constraint cst,
mlsub.typing.Monotype[] parameters,
mlsub.typing.Monotype returnType)
- Does not specify the type of the method.
Used in JavaMethod to lazyfy the lookup of java types.
MethodDeclaration
MethodDeclaration(LocatedString name,
FormalParameters formals,
mlsub.typing.Constraint cst,
mlsub.typing.Monotype[] parameters,
mlsub.typing.Monotype returnType)
MethodDeclaration
MethodDeclaration(LocatedString name,
FormalParameters formals,
mlsub.typing.Polytype type)
getType
public final mlsub.typing.Polytype getType()
getArgTypes
public final mlsub.typing.Monotype[] getArgTypes()
getReturnType
public final mlsub.typing.Monotype getReturnType()
isIgnored
boolean isIgnored()
typedResolve
void typedResolve()
- This is called in a pass before typechecking itself.
This is important, to typecheck and disambiguate the default values
of optional parameters, that will be used to typecheck code.
innerTypecheck
void innerTypecheck()
throws mlsub.typing.TypingEx
- Do further typechecking, once the context of the method is entered.
typecheck
void typecheck()
- Description copied from class:
Node
- override this when typechecking is needed.
- Overrides:
typecheck in class Node
typecheckCompiled
void typecheckCompiled()
- Typechecking when the package has already been compiled.
printInterface
public abstract void printInterface(java.io.PrintWriter s)
- Description copied from class:
Definition
- Write the exported interface of the definition
to the stream.
- Specified by:
printInterface in class Definition
toString
public java.lang.String toString()
- Printing
getArity
public int getArity()
formalParameters
public FormalParameters formalParameters()
isFieldAccess
public boolean isFieldAccess()
- true if this method represent the access to the field of an object.
checkSpecialRequirements
void checkSpecialRequirements(Expression[] arguments)
explainWhyMatchFails
java.lang.String explainWhyMatchFails(Arguments arguments)
getSymbol
MethodDeclaration.Symbol getSymbol()
getFullName
public java.lang.String getFullName()
computeCode
protected abstract gnu.expr.Expression computeCode()
getCode
gnu.expr.Expression getCode()
getCodeInCallPosition
final gnu.expr.Expression getCodeInCallPosition()
javaReturnType
public gnu.bytecode.Type javaReturnType()
javaArgTypes
public gnu.bytecode.Type[] javaArgTypes()
compile
public void compile()
- Description copied from class:
Definition
- Generates bytecode for this definition.
- Specified by:
compile in class Definition