Class BaseBlockStatement

All Implemented Interfaces:
io.github.mmm.code.api.block.CodeBlock, io.github.mmm.code.api.block.CodeBlockStatement, io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.item.CodeItem, io.github.mmm.code.api.item.CodeItemWithVariables, io.github.mmm.code.api.item.CodeMutableItem, io.github.mmm.code.api.node.CodeNode, io.github.mmm.code.api.node.CodeNodeItem, io.github.mmm.code.api.object.CodeMutable, io.github.mmm.code.api.statement.CodeStatement
Direct Known Subclasses:
BaseBlockFor, BaseBlockStatementPlain, BaseBlockStatementWithCondition

public abstract class BaseBlockStatement extends BaseBlock implements io.github.mmm.code.api.block.CodeBlockStatement
Base implementation of CodeBlockStatement.
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Constructor Details

    • BaseBlockStatement

      public BaseBlockStatement(BaseBlock parent, io.github.mmm.code.api.statement.CodeStatement... statements)
      The constructor.
      Parameters:
      parent - the parent.
      statements - the statements.
    • BaseBlockStatement

      public BaseBlockStatement(BaseBlock parent, List<io.github.mmm.code.api.statement.CodeStatement> statements)
      The constructor.
      Parameters:
      parent - the parent.
      statements - the statements.
    • BaseBlockStatement

      public BaseBlockStatement(BaseBlockStatement template, io.github.mmm.code.api.copy.CodeCopyMapper mapper)
      The copy-constructor.
      Parameters:
      template - the BaseBlockStatement to copy.
      mapper - the CodeCopyMapper.
  • Method Details

    • getParent

      public BaseBlock getParent()
      Specified by:
      getParent in interface io.github.mmm.code.api.block.CodeBlockStatement
      Specified by:
      getParent in interface io.github.mmm.code.api.node.CodeNode
    • setParent

      public void setParent(BaseBlock parent)
      Parameters:
      parent - the new value of getParent().
    • getVariableFromParent

      protected io.github.mmm.code.api.expression.CodeVariable getVariableFromParent(String name)
      Specified by:
      getVariableFromParent in class BaseBlock
      Parameters:
      name - the name of the requested CodeVariable.
      Returns:
      the CodeVariable declared by the parent node with the given name or null if not found.