|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectentities.Function
The Function class represents the information regarding a function.
Field Summary | |
protected ScopeManager |
fParentScope
|
protected java.util.Hashtable |
fTypeTable
|
protected java.util.Hashtable |
fUserTypeTable
|
Constructor Summary | |
Function(ScopeManager parentScope,
java.lang.String name,
java.lang.String file,
int position,
boolean staticFlag,
boolean inlineFlag,
boolean externFlag,
boolean returnedValueConst,
java.lang.String returnedType,
java.util.Vector parameters)
Construct a new Function object |
Method Summary | |
void |
addClass(ClassEntity cl)
Empty |
void |
addClassHeaderFile(java.lang.String className,
java.lang.String headerFileName)
Empty |
void |
addEnumerator(Enumerator en)
Add an Enumerator object to the function |
void |
addExpression(Expression expr,
ScopeManager wrapper)
Add an Expression object associated with a statement of the function to the current Function |
void |
addExternalField(Variable variable)
Empty |
void |
addExternalMethod(Method method)
Empty |
void |
addField(Variable variable)
Empty |
void |
addFriendClass(Variable variable)
Empty |
void |
addFriendFunction(Function function)
Empty |
void |
addFriendMethod(Method method)
Empty |
void |
addFunction(Function function)
Empty |
void |
addGeneralization(SuperClass superClass)
Empty |
void |
addMethod(Method method)
Empty |
void |
addNameSpace(NameSpace namespace)
Empty |
void |
addType(java.lang.String name,
java.lang.String type)
Empty |
void |
addUserType(java.lang.String name,
java.lang.String type)
Add a new type defined with typedef to the user types. |
void |
addVariable(Variable var)
Add a Variable object (corresponding to a local variable) to the Function |
boolean |
areExceptionUsed()
Deprecated. |
static void |
createTable(java.sql.Connection dbConnection)
|
static void |
delete(java.sql.Connection dbConnection,
int id)
|
ScopeManager |
findVariableType(java.lang.String nameToBeFound,
java.lang.StringBuffer typeToBeFound,
Expression expr)
Look for the variable declaration whose name is "nameToBeFound" and return the ScopeManager in which it is defined (if found), filling "typeToBeFound" with the variable type. |
java.util.Vector |
getBody()
|
Method |
getCurrentMethod(java.lang.String methodName,
java.util.Vector parameters)
|
int |
getEndLine()
|
java.util.Vector |
getEnumerators()
|
java.lang.String |
getFile()
|
int |
getInitLine()
|
java.util.Vector |
getLocalVariables()
|
java.lang.String |
getName()
|
Parameter |
getParameter(java.lang.String parameterName)
|
java.util.Vector |
getParameters()
|
java.lang.String |
getParameterTypesAsString()
|
ScopeManager |
getParent()
|
int |
getPosition()
|
java.lang.String |
getReturnedType()
|
java.lang.String |
getSignature()
|
java.util.Vector |
getThrownExceptions()
|
java.util.Hashtable |
getTypeTable()
|
java.util.Hashtable |
getUserTypeTable()
|
void |
insert(java.sql.Connection dbConnection,
int sourceId,
int sourceType)
|
boolean |
isATemplate()
|
boolean |
isExtern()
|
boolean |
isStatic()
|
void |
print(java.lang.String indentation)
Print all information contained in a Function object |
void |
setEndLine(int end)
The parameter "end" represents the line corresponding to the last "}" |
void |
setExceptionFlag(boolean exceptionFlag)
"exceptionFlag" is true if exceptions are used inside the function |
void |
setInitLine(int init)
The parameter "init" represents the line corresponding to the first "{" |
void |
setTemplateFlag(boolean templateFlag)
"templateFlag" is true if the function is a template function |
void |
setThrownExceptions(java.util.Vector thrownExceptions)
The parameter "thrownExceptions" contains the strings (of type String) corresponding to the names of exceptions thrown by the function. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ScopeManager fParentScope
protected java.util.Hashtable fTypeTable
protected java.util.Hashtable fUserTypeTable
Constructor Detail |
public Function(ScopeManager parentScope, java.lang.String name, java.lang.String file, int position, boolean staticFlag, boolean inlineFlag, boolean externFlag, boolean returnedValueConst, java.lang.String returnedType, java.util.Vector parameters)
parentScope
- The entity containing the functionname
- Name of the functionfile
- Name of the file in which the function is definedstaticFlag
- Flag that states if the function is staticinlineFlag
- Flag that states if the function has the keyword inlineexternFlag
- Flag that states if the function is externreturnedValueConst
- Flag that states if the returned value is constantreturnedType
- Type returned by the functionparameters
- Vector of Parameter objects corresponding to the function parametersMethod Detail |
public java.lang.String getName()
getName
in interface ScopeManager
public java.lang.String getFile()
public int getPosition()
public java.lang.String getReturnedType()
public java.util.Vector getParameters()
public Parameter getParameter(java.lang.String parameterName)
public java.lang.String getParameterTypesAsString()
public java.lang.String getSignature()
public java.util.Vector getEnumerators()
Enumerator
public java.util.Vector getLocalVariables()
Variable
public int getInitLine()
public int getEndLine()
public java.util.Vector getBody()
Expression
public java.util.Hashtable getTypeTable()
public java.util.Hashtable getUserTypeTable()
public ScopeManager getParent()
getParent
in interface ScopeManager
public java.util.Vector getThrownExceptions()
Ex: void h () throw (Range_Error) {..}In this case it returns a Vector containing an object (of type String) corresponding to the string "Range_Error".
public Method getCurrentMethod(java.lang.String methodName, java.util.Vector parameters)
getCurrentMethod
in interface ScopeManager
public boolean isExtern()
public boolean isStatic()
public boolean isATemplate()
public boolean areExceptionUsed()
public void setInitLine(int init)
public void setEndLine(int end)
public void setTemplateFlag(boolean templateFlag)
public void setExceptionFlag(boolean exceptionFlag)
public void addEnumerator(Enumerator en)
addEnumerator
in interface ScopeManager
Enumerator
public void setThrownExceptions(java.util.Vector thrownExceptions)
Ex: void h () throw (Range_Error) {..}In this case "thrownExceptions" will contain the string (of type String) corresponding to "Range_Error".
public void addNameSpace(NameSpace namespace)
addNameSpace
in interface ScopeManager
public void addExpression(Expression expr, ScopeManager wrapper)
addExpression
in interface ScopeManager
public void addClass(ClassEntity cl)
addClass
in interface ScopeManager
public void addFunction(Function function)
addFunction
in interface ScopeManager
public void addMethod(Method method)
addMethod
in interface ScopeManager
public void addVariable(Variable var)
addVariable
in interface ScopeManager
public void addField(Variable variable)
addField
in interface ScopeManager
public void addType(java.lang.String name, java.lang.String type)
addType
in interface ScopeManager
public void addUserType(java.lang.String name, java.lang.String type)
addUserType
in interface ScopeManager
public void addGeneralization(SuperClass superClass)
addGeneralization
in interface ScopeManager
public void addExternalMethod(Method method)
addExternalMethod
in interface ScopeManager
public void addExternalField(Variable variable)
addExternalField
in interface ScopeManager
public void addFriendFunction(Function function)
addFriendFunction
in interface ScopeManager
public void addFriendMethod(Method method)
addFriendMethod
in interface ScopeManager
public void addFriendClass(Variable variable)
addFriendClass
in interface ScopeManager
public void addClassHeaderFile(java.lang.String className, java.lang.String headerFileName)
addClassHeaderFile
in interface ScopeManager
public void print(java.lang.String indentation)
print
in interface ScopeManager
public ScopeManager findVariableType(java.lang.String nameToBeFound, java.lang.StringBuffer typeToBeFound, Expression expr)
findVariableType
in interface ScopeManager
public static void delete(java.sql.Connection dbConnection, int id) throws java.sql.SQLException
java.sql.SQLException
public static void createTable(java.sql.Connection dbConnection) throws java.sql.SQLException
java.sql.SQLException
public void insert(java.sql.Connection dbConnection, int sourceId, int sourceType) throws java.sql.SQLException
java.sql.SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |