Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

bossa.syntax
Class MethodDeclaration  view MethodDeclaration download MethodDeclaration.java

java.lang.Object
  extended bybossa.syntax.Node
      extended bybossa.syntax.Definition
          extended bybossa.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 $

Nested Class Summary
 class MethodDeclaration.Symbol
           
 
Field Summary
protected  int arity
           
private  gnu.expr.Expression code
           
protected  FormalParameters parameters
           
private  MethodDeclaration.Symbol symbol
           
private  java.lang.String syntacticConstraint
          Module interface
private  mlsub.typing.Polytype type
           
 
Fields inherited from class bossa.syntax.Definition
currentModule, docString, module, name
 
Fields inherited from class bossa.syntax.Node
children, currentFunction, down, global, none, propagate, scope, thisExp, typeScope, upper
 
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)
           
 
Method Summary
(package private)  void checkSpecialRequirements(Expression[] arguments)
           
 void compile()
          Generates bytecode for this definition.
protected abstract  gnu.expr.Expression computeCode()
           
(package private)  java.lang.String explainWhyMatchFails(Arguments arguments)
           
 FormalParameters formalParameters()
           
 mlsub.typing.Monotype[] getArgTypes()
           
 int getArity()
           
(package private)  gnu.expr.Expression getCode()
           
(package private)  gnu.expr.Expression getCodeInCallPosition()
           
 java.lang.String getFullName()
           
 mlsub.typing.Monotype getReturnType()
           
(package private)  MethodDeclaration.Symbol getSymbol()
           
 mlsub.typing.Polytype getType()
           
(package private)  void innerTypecheck()
          Do further typechecking, once the context of the method is entered.
 boolean isFieldAccess()
          true if this method represent the access to the field of an object.
(package private)  boolean isIgnored()
           
 gnu.bytecode.Type[] javaArgTypes()
           
 gnu.bytecode.Type javaReturnType()
           
abstract  void printInterface(java.io.PrintWriter s)
          Write the exported interface of the definition to the stream.
 java.lang.String toString()
          Printing
(package private)  void typecheck()
          override this when typechecking is needed.
(package private)  void typecheckCompiled()
          Typechecking when the package has already been compiled.
(package private)  void typedResolve()
          This is called in a pass before typechecking itself.
 
Methods inherited from class bossa.syntax.Definition
associatedDefinitions, compilation, getName, inInterfaceFile, location, printInterface, resolveBody
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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)
Method Detail

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