public class Block extends AbstractStructuredStatement
Modifier and Type | Field and Description |
---|---|
private BlockIdentifier |
blockIdentifier |
private java.util.LinkedList<Op04StructuredStatement> |
containedStatements |
private boolean |
indenting |
Constructor and Description |
---|
Block(java.util.LinkedList<Op04StructuredStatement> containedStatements,
boolean indenting) |
Block(java.util.LinkedList<Op04StructuredStatement> containedStatements,
boolean indenting,
BlockIdentifier blockIdentifier) |
Block(Op04StructuredStatement statement) |
addLoc, canDefine, canFall, claimBlock, fallsNopToNext, findCreatedHere, getContainer, getLoc, informBlockHeirachy, isProperlyStructured, setContainer, suggestName, supportsBreak, supportsContinueBreak, toString
private java.util.LinkedList<Op04StructuredStatement> containedStatements
private boolean indenting
private BlockIdentifier blockIdentifier
public Block(Op04StructuredStatement statement)
public Block(java.util.LinkedList<Op04StructuredStatement> containedStatements, boolean indenting)
public Block(java.util.LinkedList<Op04StructuredStatement> containedStatements, boolean indenting, BlockIdentifier blockIdentifier)
public BytecodeLoc getCombinedLoc()
public void flattenOthersIn()
public void addStatement(Op04StructuredStatement stm)
static Block getEmptyBlock(boolean indenting)
public static Block getBlockFor(boolean indenting, StructuredStatement... statements)
public void collectTypeUsages(TypeUsageCollector collector)
public boolean removeLastContinue(BlockIdentifier block)
public void removeLastNVReturn()
public void removeLastGoto()
public Op04StructuredStatement getLast()
public UnstructuredWhile removeLastEndWhile()
public Pair<java.lang.Boolean,Op04StructuredStatement> getOneStatementIfPresent()
public java.util.List<Op04StructuredStatement> getFilteredBlockStatements()
public Optional<Op04StructuredStatement> getMaybeJustOneStatement()
public boolean inlineable()
inlineable
in interface StructuredStatement
inlineable
in class AbstractStructuredStatement
public Op04StructuredStatement getInline()
getInline
in interface StructuredStatement
getInline
in class AbstractStructuredStatement
public void combineInlineable()
private void replaceInlineSource(Op04StructuredStatement oldS, Op04StructuredStatement newS)
public void extractLabelledBlocks()
public void combineTryCatch()
public boolean isScopeBlock()
isScopeBlock
in interface StructuredStatement
isScopeBlock
in class AbstractStructuredStatement
public void transformStructuredChildren(StructuredStatementTransformer transformer, StructuredScope scope)
public void transformStructuredChildrenInReverse(StructuredStatementTransformer transformer, StructuredScope scope)
transformStructuredChildrenInReverse
in interface StructuredStatement
transformStructuredChildrenInReverse
in class AbstractStructuredStatement
public java.util.Set<Op04StructuredStatement> getNextAfter(int x)
public boolean statementIsLast(Op04StructuredStatement needle)
public BlockIdentifier getBreakableBlockOrNull()
getBreakableBlockOrNull
in interface StructuredStatement
getBreakableBlockOrNull
in class AbstractStructuredStatement
public boolean isRecursivelyStructured()
isRecursivelyStructured
in interface StructuredStatement
isRecursivelyStructured
in class AbstractStructuredStatement
public java.util.List<Op04StructuredStatement> getBlockStatements()
public void replaceBlockStatements(java.util.Collection<Op04StructuredStatement> statements)
public void linearizeInto(java.util.List<StructuredStatement> out)
public void traceLocalVariableScope(LValueScopeDiscoverer scopeDiscoverer)
public void markCreator(LValue scopedEntity, StatementContainer<StructuredStatement> hint)
markCreator
in interface StructuredStatement
markCreator
in class AbstractStructuredStatement
public boolean alwaysDefines(LValue scopedEntity)
alwaysDefines
in interface StructuredStatement
alwaysDefines
in class AbstractStructuredStatement
private boolean canFoldUp()
public boolean isIndenting()
public void setIndenting(boolean indenting)
public boolean match(MatchIterator<StructuredStatement> matchIterator, MatchResultCollector matchResultCollector)
match
in interface Matcher<StructuredStatement>
match
in class AbstractStructuredStatement
public void rewriteExpressions(ExpressionRewriter expressionRewriter)
public boolean isEffectivelyNOP()
isEffectivelyNOP
in interface StructuredStatement
isEffectivelyNOP
in class AbstractStructuredStatement