Class BaseBlockBody

All Implemented Interfaces:
io.github.mmm.code.api.block.CodeBlock, io.github.mmm.code.api.block.CodeBlockBody, io.github.mmm.code.api.CodeWithContext, io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.node.CodeFunction, io.github.mmm.code.api.block.CodeBlockBody>, 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

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

    • BaseBlockBody

      public BaseBlockBody(io.github.mmm.code.api.node.CodeFunction parent)
      The constructor.
      Parameters:
      parent - the parent.
    • BaseBlockBody

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

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

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

    • getParent

      public io.github.mmm.code.api.node.CodeFunction getParent()
      Specified by:
      getParent in interface io.github.mmm.code.api.node.CodeNode
      Specified by:
      getParent in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.node.CodeFunction, io.github.mmm.code.api.block.CodeBlockBody>
    • setParent

      public void setParent(io.github.mmm.code.api.node.CodeFunction 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.
    • copy

      public BaseBlockBody copy()
      Specified by:
      copy in interface io.github.mmm.code.api.block.CodeBlock
      Specified by:
      copy in interface io.github.mmm.code.api.block.CodeBlockBody
      Specified by:
      copy in interface io.github.mmm.code.api.item.CodeMutableItem
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItem
      Specified by:
      copy in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.node.CodeFunction, io.github.mmm.code.api.block.CodeBlockBody>
    • copy

      public BaseBlockBody copy(io.github.mmm.code.api.copy.CodeCopyMapper mapper)
      Specified by:
      copy in interface io.github.mmm.code.api.item.CodeMutableItem
      Specified by:
      copy in interface io.github.mmm.code.api.node.CodeNodeItem
      Specified by:
      copy in interface io.github.mmm.code.api.copy.CodeNodeItemCopyable<io.github.mmm.code.api.node.CodeFunction, io.github.mmm.code.api.block.CodeBlockBody>