// Copyright 2022 The Tint Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef SRC_TINT_LANG_WGSL_AST_CASE_SELECTOR_H_
#define SRC_TINT_LANG_WGSL_AST_CASE_SELECTOR_H_

#include <vector>

#include "src/tint/lang/wgsl/ast/block_statement.h"
#include "src/tint/lang/wgsl/ast/expression.h"

namespace tint::ast {

/// A case selector
class CaseSelector final : public Castable<CaseSelector, Node> {
  public:
    /// Constructor
    /// @param pid the identifier of the program that owns this node
    /// @param nid the unique node identifier
    /// @param src the source of this node
    /// @param expr the selector expression, |nullptr| for a `default` selector
    CaseSelector(GenerationID pid, NodeID nid, const Source& src, const Expression* expr = nullptr);

    /// Destructor
    ~CaseSelector() override;

    /// @returns true if this is a default statement
    bool IsDefault() const { return expr == nullptr; }

    /// Clones this node and all transitive child nodes using the `CloneContext` `ctx`.
    /// @param ctx the clone context
    /// @return the newly cloned node
    const CaseSelector* Clone(CloneContext& ctx) const override;

    /// The selector, nullptr for a default selector
    const Expression* const expr = nullptr;
};

}  // namespace tint::ast

#endif  // SRC_TINT_LANG_WGSL_AST_CASE_SELECTOR_H_
