public interface

IJavaCompound

implements IJavaStatement
com.pnfsoftware.jeb.core.units.code.java.IJavaCompound
Known Indirect Subclasses

Class Overview

Java AST interface to represent compound statements.

Compound statements contain more statements, laid out in blocks. A block is the simplest type of compound. Compounds include if-conditionals, loops, switches, etc.

Summary

[Expand]
Inherited Constants
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
Public Methods
abstract IJavaCompound duplicate()
Duplicate this element.
abstract List<IJavaStatement> generateFlatList()
Generate a flat list of AST and pseudo-AST elements that make up this block.
abstract List<IJavaBlock> getBlocks()
Get the list of blocks contained in this compound.
abstract List<IJavaElement> getSubElements(boolean excludeSubBlocks)
This specialized version of getSubElements() allows the caller to exclude collecting sub-blocks of this compound.
abstract boolean insertAt(int target_offset, IJavaStatement insert_stm)
Insert a statement at a particular offset within the AST.
abstract void reset()
Reset the compound.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaExpression
From interface com.pnfsoftware.jeb.core.units.code.java.IJavaStatement

Public Methods

public abstract IJavaCompound duplicate ()

Duplicate this element.

Returns
  • a (possibly) duplicated object of the same type

public abstract List<IJavaStatement> generateFlatList ()

Generate a flat list of AST and pseudo-AST elements that make up this block. This function allows the caller to get a flat representation of the AST, much like a programmer would view a source code. Note that the statements returned can be pseudo statements, ie, they're not real statements. For example, a flat view of a conditional block would return pseudo-statements to represent the "if" line, the "else if" lines, and the "else" line.

Returns
  • a list of statements and pseudo-statements

public abstract List<IJavaBlock> getBlocks ()

Get the list of blocks contained in this compound.

Caveat: if this compound is a block itself, the returned list is not empty, it contains self.

Returns
  • the list of blocks

public abstract List<IJavaElement> getSubElements (boolean excludeSubBlocks)

This specialized version of getSubElements() allows the caller to exclude collecting sub-blocks of this compound.

public abstract boolean insertAt (int target_offset, IJavaStatement insert_stm)

Insert a statement at a particular offset within the AST. This function recurses down the AST tree, inside the blocks, to find the exact location where the statement should be inserted.

public abstract void reset ()

Reset the compound. Internal use.