public class SlistHandler extends BlockParentHandler
Handler for a list of statements.
  • Field Details

    • PARENT_TOKEN_TYPES

      private static final int[] PARENT_TOKEN_TYPES
      Parent token types.
  • Constructor Details

    • SlistHandler

      public SlistHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
      Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.
      Parameters:
      indentCheck - the indentation check
      ast - the abstract syntax tree
      parent - the parent handler
  • Method Details

    • getSuggestedChildIndent

      public IndentLevel getSuggestedChildIndent(AbstractExpressionHandler child)
      Description copied from class: AbstractExpressionHandler
      Indentation level suggested for a child element. Children don't have to respect this, but most do.
      Overrides:
      getSuggestedChildIndent in class BlockParentHandler
      Parameters:
      child - child AST (so suggestion level can differ based on child type)
      Returns:
      suggested indentation for child
    • getListChild

      protected DetailAST getListChild()
      Description copied from class: BlockParentHandler
      Get the child element representing the list of statements.
      Overrides:
      getListChild in class BlockParentHandler
      Returns:
      the statement list child
    • getLeftCurly

      protected DetailAST getLeftCurly()
      Description copied from class: BlockParentHandler
      Get the left curly brace portion of the expression we are handling.
      Overrides:
      getLeftCurly in class BlockParentHandler
      Returns:
      the left curly brace expression
    • getRightCurly

      protected DetailAST getRightCurly()
      Description copied from class: BlockParentHandler
      Get the right curly brace portion of the expression we are handling.
      Overrides:
      getRightCurly in class BlockParentHandler
      Returns:
      the right curly brace expression
    • getTopLevelAst

      protected DetailAST getTopLevelAst()
      Description copied from class: BlockParentHandler
      Get the top level expression being managed by this handler.
      Overrides:
      getTopLevelAst in class BlockParentHandler
      Returns:
      the top level expression
    • hasBlockParent

      private boolean hasBlockParent()
      Determine if the expression we are handling has a block parent.
      Returns:
      true if it does, false otherwise
    • checkIndentation

      public void checkIndentation()
      Description copied from class: AbstractExpressionHandler
      Check the indentation of the expression we are handling.
      Overrides:
      checkIndentation in class BlockParentHandler
    • isSameLineCaseGroup

      private boolean isSameLineCaseGroup()
      Checks if SLIST node is placed at the same line as CASE_GROUP node.
      Returns:
      true, if SLIST node is places at the same line as CASE_GROUP node.