Class ASTSwitchStatement

    • Field Detail

      • isStatement

        protected boolean isStatement
        Whether this switch is a statement (true) or an expression (false).
      • cases

        protected java.util.Map<java.lang.Object,​java.lang.Integer> cases
        The map of cases, where the key is the case value and the value is the switch index.
    • Constructor Detail

      • ASTSwitchStatement

        public ASTSwitchStatement​(int id)
    • Method Detail

      • jjtAccept

        public java.lang.Object jjtAccept​(ParserVisitor visitor,
                                          java.lang.Object data)
        Description copied from class: SimpleNode
        Accepts the visitor.
        Specified by:
        jjtAccept in interface Node
        Overrides:
        jjtAccept in class SimpleNode
        Parameters:
        visitor - the visitor
        data - contextual data
        Returns:
        result of visit
      • getCasesList

        public java.util.List<java.lang.Object>[] getCasesList()
        Returns the array of cases values.

        Meant only for verification during tests.

        The list at each index contains the case values for that index. If the values-list is empty for an index, it is the default case.
        Returns:
        an array of case values
      • isStatement

        public boolean isStatement()
      • switchIndex

        public int switchIndex​(java.lang.Object value)