|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.svincent.util.BaseObject
|
+--com.svincent.smalljava.SmallMember
|
+--com.svincent.smalljava.SmallMethod
Represents a method declaration. To create new method declaration, use one of the method() methods in SmallClass.
SmallClass| Inner Class Summary | |
static class |
SmallMethod.Local
Represents a local variable. |
| Constructor Summary | |
|
SmallMethod(int _modifiers,
java.lang.String _name,
SmallType.MethodType _type,
java.lang.String[] _argNames)
|
|
SmallMethod(int _modifiers,
java.lang.String _signature,
java.lang.String[] _argNames)
|
protected |
SmallMethod(int _modifiers,
java.lang.String _name,
java.lang.String _descriptor,
SmallType.MethodType _type,
java.lang.String[] _argNames)
|
protected |
SmallMethod(int _modifiers,
java.lang.String _name,
java.lang.String _descriptor,
java.lang.String[] _argNames)
|
|
SmallMethod(java.lang.String _name,
SmallType.MethodType _type,
java.lang.String[] _argNames)
|
|
SmallMethod(java.lang.String _signature,
java.lang.String[] _argNames)
|
| Method Summary | |
SmallMethod |
add(Expr expr)
Add a new expression to this method, and returns, for your convenience, the SmallMethod again, so a convenient and wonderful method.add ().add ()... |
void |
addLocal(SmallMethod.Local l,
Expr initializer)
Adds a new local variable to this method. |
protected void |
addParameter(SmallType type,
java.lang.String name)
Add a new parameter to this method: called from the constructor. |
void |
addThrows(java.lang.String exClassName)
Add a throws clause to this method for the given exception class name. |
protected int |
allocVarIndex()
When a new local variable is added, its index is assigned using this method. |
protected void |
finalize()
|
int |
getArgCount()
Return the number of parameters this function has. |
java.lang.String |
getArgName(int i)
Return the name of argument 'i' |
java.lang.String[] |
getArgNames()
Return the names of all arguments |
SmallType |
getArgType(int i)
Get the type of argument 'i'. |
SmallType[] |
getArgTypes()
Get the types of all arguments. |
java.lang.String |
getDescriptor()
Return this method's type descriptor. |
SmallMethod.Local |
getLocal(java.lang.String name)
Get the local variable with the given name. |
java.lang.String |
getName()
Return the name of this method (not including its descriptor) |
SmallType |
getReturnType()
Return the type of the return value of this method. |
SmallType.MethodType |
getType()
Return the type of this method. |
void |
local(SmallType type,
java.lang.String name,
Expr initializer)
Add a new local variable to this method, with the given type and initializer. |
void |
local(java.lang.String descriptor,
java.lang.String name,
Expr initializer)
Add a new local variable to this method, with the given type descriptor and initializer. |
java.util.Iterator |
locals()
Return an iterator over all local variables of this method. |
protected void |
writeAsBytecodes(ClassFileWriter out)
|
void |
writeAsJava(IndentPrintWriter out)
Write this method out as Java source code. |
protected void |
writeBodyAsJava(IndentPrintWriter out)
Write the body of this method as Java source. |
protected void |
writeLocalVarDeclsAsJava(IndentPrintWriter out)
Write local variable declarations as Java source. |
| Methods inherited from class com.svincent.smalljava.SmallMember |
getDeclaringClass,
isStatic,
setDeclaringClass |
| Methods inherited from class com.svincent.util.BaseObject |
dump,
dump,
dumpToString,
tag |
| Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public SmallMethod(java.lang.String _signature,
java.lang.String[] _argNames)
throws SmallJavaBuildingException
public SmallMethod(int _modifiers,
java.lang.String _signature,
java.lang.String[] _argNames)
throws SmallJavaBuildingException
protected SmallMethod(int _modifiers,
java.lang.String _name,
java.lang.String _descriptor,
java.lang.String[] _argNames)
throws SmallJavaBuildingException
public SmallMethod(java.lang.String _name,
SmallType.MethodType _type,
java.lang.String[] _argNames)
throws SmallJavaBuildingException
public SmallMethod(int _modifiers,
java.lang.String _name,
SmallType.MethodType _type,
java.lang.String[] _argNames)
throws SmallJavaBuildingException
protected SmallMethod(int _modifiers,
java.lang.String _name,
java.lang.String _descriptor,
SmallType.MethodType _type,
java.lang.String[] _argNames)
throws SmallJavaBuildingException
| Method Detail |
public java.lang.String getName()
public java.lang.String getDescriptor()
public int getArgCount()
public SmallType getArgType(int i)
public SmallType[] getArgTypes()
public java.lang.String getArgName(int i)
public java.lang.String[] getArgNames()
public SmallType getReturnType()
public SmallType.MethodType getType()
public void addThrows(java.lang.String exClassName)
public SmallMethod.Local getLocal(java.lang.String name)
public java.util.Iterator locals()
protected void addParameter(SmallType type,
java.lang.String name)
throws SmallJavaBuildingException
protected int allocVarIndex()
public SmallMethod add(Expr expr)
public void local(java.lang.String descriptor,
java.lang.String name,
Expr initializer)
throws SmallJavaBuildingException
public void local(SmallType type,
java.lang.String name,
Expr initializer)
throws SmallJavaBuildingException
public void addLocal(SmallMethod.Local l,
Expr initializer)
throws SmallJavaBuildingException
local
instead.local(String,String,Expr),
local(SmallType,String,Expr)
protected void finalize()
throws SmallJavaValidationException
protected void writeAsBytecodes(ClassFileWriter out)
public void writeAsJava(IndentPrintWriter out)
protected void writeBodyAsJava(IndentPrintWriter out)
protected void writeLocalVarDeclsAsJava(IndentPrintWriter out)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This is documentation for Moksa Prolog, which can be found at http://www.svincent.com/moksa/
Copyright © 1999 Shawn P. Vincent.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.