Class LoopRegion

All Implemented Interfaces:
IAttributeNode, IConditionRegion, IContainer, IRegion

public final class LoopRegion extends ConditionRegion
  • Field Details

    • info

      private final LoopInfo info
    • conditionAtEnd

      private final boolean conditionAtEnd
    • preCondition

      @Nullable private @Nullable BlockNode preCondition
    • body

      private IRegion body
    • type

      private LoopType type
  • Constructor Details

    • LoopRegion

      public LoopRegion(IRegion parent, LoopInfo info, @Nullable @Nullable BlockNode header, boolean reversed)
  • Method Details

    • getInfo

      public LoopInfo getInfo()
    • getHeader

      @Nullable public @Nullable BlockNode getHeader()
    • isEndless

      public boolean isEndless()
    • getBody

      public IRegion getBody()
    • setBody

      public void setBody(IRegion body)
    • isConditionAtEnd

      public boolean isConditionAtEnd()
    • setPreCondition

      public void setPreCondition(BlockNode preCondition)
      Set instructions which must be executed before condition in every loop
    • checkPreCondition

      public boolean checkPreCondition()
      Check if pre-conditions can be inlined into loop condition
    • mergePreCondition

      public void mergePreCondition()
      Move all preCondition block instructions before conditionBlock instructions
    • getSourceLine

      public int getSourceLine()
    • getType

      public LoopType getType()
    • setType

      public void setType(LoopType type)
    • getSubBlocks

      public List<IContainer> getSubBlocks()
    • replaceSubBlock

      public boolean replaceSubBlock(IContainer oldBlock, IContainer newBlock)
      Specified by:
      replaceSubBlock in interface IRegion
      Overrides:
      replaceSubBlock in class AbstractRegion
    • generate

      public void generate(RegionGen regionGen, ICodeWriter code) throws CodegenException
      Description copied from interface: IContainer
      Dispatch to needed generate method in RegionGen
      Throws:
      CodegenException
    • baseString

      public String baseString()
      Description copied from interface: IContainer
      Unique id for use in 'toString()' method
    • toString

      public String toString()
      Overrides:
      toString in class Object