package de.dhbwstuttgart.syntaxtree;

import java.util.ArrayList;
import java.util.List;

import de.dhbwstuttgart.syntaxtree.type.RefType;
import org.antlr.v4.runtime.Token;

import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;

public class RecordPattern extends FormalParameter {

  private final List<Pattern> subPattern;
  private final RefType ctor;

  public RecordPattern(List<Pattern> subPattern, String name, RefTypeOrTPHOrWildcardOrGeneric type, RefType ctor, Token offset) {
    super(name, type, offset);
    this.subPattern = subPattern;
    this.ctor = ctor;
  }

  public List<Pattern> getSubPattern() {
    return this.subPattern;
  }

  public RefType getCtor() {
    return ctor;
  }

  @Override
  public void accept(ASTVisitor visitor) {
    visitor.visit(this);
  }

}