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

Quick Search    Search Deep

bossa.syntax
Class NiceClass  view NiceClass download NiceClass.java

java.lang.Object
  extended bybossa.syntax.ClassDefinition.ClassImplementation
      extended bybossa.syntax.NiceClass

public class NiceClass
extends ClassDefinition.ClassImplementation

Abstract syntax for a class definition.

Version:
$Date: 2003/12/04 13:34:28 $

Nested Class Summary
(package private)  class NiceClass.Field
           
(package private)  class NiceClass.NewField
           
(package private)  class NiceClass.OverridenField
           
 
Field Summary
(package private)  gnu.expr.ClassExp classe
           
(package private) static gnu.bytecode.Method cloneMethod
           
private  Constructor[] constructorMethod
           
(package private)  ClassDefinition definition
           
private  boolean entered
           
private  NiceClass.NewField[] fields
           
private  Statement[] initializers
          Initializers
private  TypeScope localScope
           
private static NiceClass.NewField[] noFields
           
private static NiceClass.OverridenField[] noOverrides
           
private static gnu.expr.Expression objectConstructor
           
private  NiceClass.OverridenField[] overrides
           
private  java.lang.Long serialVersionUIDValue
           
private  gnu.expr.Expression thisExp
           
private  MonoSymbol thisSymbol
           
 
Constructor Summary
NiceClass(ClassDefinition definition)
           
 
Method Summary
 gnu.expr.Expression addJavaMethod(gnu.expr.LambdaExp method)
          This native method is redefined for this Nice class.
private  void addPublicCloneMethod()
           
(package private)  gnu.expr.Expression callSuperMethod(gnu.bytecode.Method superMethod)
          Returns an expression to call a super method from outside a class method.
private  void checkFields(FormalParameters.Parameter[] allFields)
          This must be done only once per class.
 void compile()
           
(package private)  gnu.expr.Expression compileInitializer(int index)
           
private  gnu.expr.Expression[] computeSupers()
           
 gnu.expr.ClassExp createClassExp()
           
private  void createConstructor()
           
private  void createFields()
           
 gnu.expr.LambdaExp createJavaMethod(java.lang.String name, gnu.bytecode.Method likeMethod, gnu.expr.Expression[] params)
           
(package private)  void createSerialUIDField()
           
private  void enterTypingContext()
           
 gnu.expr.ClassExp getClassExp()
           
private  FormalParameters.Parameter[][] getFieldsAsParameters(int nbFields, java.util.List constraints, mlsub.typing.TypeSymbol[] binders)
           
private static FormalParameters.Parameter[][] getFieldsAsParameters(mlsub.typing.TypeConstructor tc, int nbFields, java.util.List constraints, mlsub.typing.TypeSymbol[] binders)
          Collect in 'constraints' the constraints set by each class on the type parameters.
 java.lang.String getName()
           
private  gnu.expr.Declaration getOverridenField(NiceClass.OverridenField field, boolean checkValue)
           
(package private)  NiceClass getParent()
           
(package private)  gnu.expr.Expression getSuper(int index, boolean omitDefaults)
           
 NiceClass.Field makeField(MonoSymbol sym, Expression value, boolean isFinal, boolean isTransient, boolean isVolatile, java.lang.String docString)
          Fields
 NiceClass.Field makeOverride(MonoSymbol sym, Expression value)
           
 int nbInitializers()
           
 void precompile()
           
private  void prepareCodeGeneration()
          Code generation
 void printInterface(java.io.PrintWriter s)
          Module Interface
 void recompile()
          Called instead of compile if the package is up-to-date.
(package private)  void resolveBody()
           
(package private)  void resolveClass()
           
private  void resolveFields()
           
private  void resolveIntitializers()
           
(package private)  java.lang.String serialUIDFieldString()
           
 void setFields(java.util.List fields)
           
 void setInitializers(java.util.List inits)
           
 void setOverrides(java.util.List overrides)
           
(package private)  void setThisExp(gnu.expr.Expression thisExp)
           
 java.lang.String toString()
          Misc.
private  TypeScope translationScope(NiceClass other)
           
(package private)  void typecheck()
          Type checking
private  gnu.expr.Expression typeExpression(mlsub.typing.TypeConstructor tc)
           
private  void updateConstructorParameters(FormalParameters.Parameter[] inherited, int nb, TypeScope scope)
          This must be done in a given class for every subclass, since they have different type parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

definition

ClassDefinition definition

noFields

private static NiceClass.NewField[] noFields

noOverrides

private static NiceClass.OverridenField[] noOverrides

localScope

private TypeScope localScope

initializers

private Statement[] initializers
Initializers


thisSymbol

private MonoSymbol thisSymbol

thisExp

private gnu.expr.Expression thisExp

entered

private boolean entered

cloneMethod

static gnu.bytecode.Method cloneMethod

classe

gnu.expr.ClassExp classe

constructorMethod

private Constructor[] constructorMethod

objectConstructor

private static gnu.expr.Expression objectConstructor

fields

private NiceClass.NewField[] fields

overrides

private NiceClass.OverridenField[] overrides

serialVersionUIDValue

private java.lang.Long serialVersionUIDValue
Constructor Detail

NiceClass

public NiceClass(ClassDefinition definition)
Method Detail

getName

public java.lang.String getName()

setFields

public void setFields(java.util.List fields)

setOverrides

public void setOverrides(java.util.List overrides)

getParent

NiceClass getParent()

makeField

public NiceClass.Field makeField(MonoSymbol sym,
                                 Expression value,
                                 boolean isFinal,
                                 boolean isTransient,
                                 boolean isVolatile,
                                 java.lang.String docString)
Fields


makeOverride

public NiceClass.Field makeOverride(MonoSymbol sym,
                                    Expression value)

resolveClass

void resolveClass()
Specified by:
resolveClass in class ClassDefinition.ClassImplementation

resolveFields

private void resolveFields()

createFields

private void createFields()

getOverridenField

private gnu.expr.Declaration getOverridenField(NiceClass.OverridenField field,
                                               boolean checkValue)

setInitializers

public void setInitializers(java.util.List inits)

nbInitializers

public int nbInitializers()

resolveIntitializers

private void resolveIntitializers()

setThisExp

void setThisExp(gnu.expr.Expression thisExp)

compileInitializer

gnu.expr.Expression compileInitializer(int index)

typecheck

void typecheck()
Type checking

Overrides:
typecheck in class ClassDefinition.ClassImplementation

enterTypingContext

private void enterTypingContext()

printInterface

public void printInterface(java.io.PrintWriter s)
Module Interface

Specified by:
printInterface in class ClassDefinition.ClassImplementation

serialUIDFieldString

java.lang.String serialUIDFieldString()

prepareCodeGeneration

private void prepareCodeGeneration()
Code generation


addPublicCloneMethod

private void addPublicCloneMethod()

createClassExp

public gnu.expr.ClassExp createClassExp()

getClassExp

public gnu.expr.ClassExp getClassExp()

getFieldsAsParameters

private static FormalParameters.Parameter[][] getFieldsAsParameters(mlsub.typing.TypeConstructor tc,
                                                                    int nbFields,
                                                                    java.util.List constraints,
                                                                    mlsub.typing.TypeSymbol[] binders)
Collect in 'constraints' the constraints set by each class on the type parameters.


translationScope

private TypeScope translationScope(NiceClass other)

getFieldsAsParameters

private FormalParameters.Parameter[][] getFieldsAsParameters(int nbFields,
                                                             java.util.List constraints,
                                                             mlsub.typing.TypeSymbol[] binders)

updateConstructorParameters

private void updateConstructorParameters(FormalParameters.Parameter[] inherited,
                                         int nb,
                                         TypeScope scope)
This must be done in a given class for every subclass, since they have different type parameters.


checkFields

private void checkFields(FormalParameters.Parameter[] allFields)
This must be done only once per class.


createConstructor

private void createConstructor()

getSuper

gnu.expr.Expression getSuper(int index,
                             boolean omitDefaults)

precompile

public void precompile()

compile

public void compile()
Overrides:
compile in class ClassDefinition.ClassImplementation

recompile

public void recompile()
Called instead of compile if the package is up-to-date.

Overrides:
recompile in class ClassDefinition.ClassImplementation

typeExpression

private gnu.expr.Expression typeExpression(mlsub.typing.TypeConstructor tc)

computeSupers

private gnu.expr.Expression[] computeSupers()

addJavaMethod

public gnu.expr.Expression addJavaMethod(gnu.expr.LambdaExp method)
This native method is redefined for this Nice class.


createJavaMethod

public gnu.expr.LambdaExp createJavaMethod(java.lang.String name,
                                           gnu.bytecode.Method likeMethod,
                                           gnu.expr.Expression[] params)

callSuperMethod

gnu.expr.Expression callSuperMethod(gnu.bytecode.Method superMethod)
Returns an expression to call a super method from outside a class method. This is needed because the JVM restricts call to a specific implementation to occur inside a method of the same class. So this generates a stub class method that calls the desired super method, and return a reference to this stub.


createSerialUIDField

void createSerialUIDField()

toString

public java.lang.String toString()
Misc.


resolveBody

void resolveBody()