com.togethersoft.openapi.sci
Interface SciCodeBlock
- public interface SciCodeBlock
- extends SciScope
A block of a source code.
For example, the body of an operation is represented by the SciCodeBlock object. It can be
obtained using the SciFunction.getBody method.
Since this interface is an inheritor of SciObject, it is possible to get a containing
SciScope for
this code block, using getContainingScope method. This method returns either
SciFile, SciClass or other SciCodeBlock.
For example, for the inner code block:
MyClass extends BigClass{
void myMethod{
for (i=0;i<10;i++) {
//this is the inner code block
}
}
}
the getContainingScope method will return SciCodeBlock for the body
of myMethod. And the same getContainingScope method for that code block
will return SciClass for MyClass class.
Once again, since this interface is an inheritor of SciObject, you can use the
SciObject.getText method to get a string with the text of this code block.
- Author:
- TogetherSoft
- See Also: SciScope, SciClass, SciFile
| Methods inherited from interface com.togethersoft.openapi.sci.SciObject |
canCut, canDelete, canReplace, copy, cut, delete, getContainingFile, getContainingScope, getLanguage, getPositions, getText, getUserProperty, isReadOnly, replace, setUserProperty |
statements
public SciStatementEnumeration statements()
- Returns an enumeration of all statements taking place in this block of a source code.
- Returns: an enumeration of all statements taking place in this block of a source code