001/*
002 * Copyright (c) 2012-2018 Institut National des Sciences Appliquées de Lyon (INSA Lyon) and others
003 *
004 * This program and the accompanying materials are made available under the
005 * terms of the Eclipse Public License 2.0 which is available at
006 * http://www.eclipse.org/legal/epl-2.0.
007 *
008 * SPDX-License-Identifier: EPL-2.0
009 */
010
011package org.eclipse.golo.compiler.parser;
012
013import java.util.List;
014
015public class ASTFunction extends GoloASTNode {
016
017  private List<String> parameters;
018  private boolean varargs = false;
019  private boolean compactForm = false;
020
021  public ASTFunction(int i) {
022    super(i);
023  }
024
025  public ASTFunction(GoloParser p, int i) {
026    super(p, i);
027  }
028
029  public List<String> getParameters() {
030    return parameters;
031  }
032
033  public void setParameters(List<String> parameters) {
034    this.parameters = parameters;
035  }
036
037  public boolean isVarargs() {
038    return varargs;
039  }
040
041  public void setVarargs(boolean varargs) {
042    this.varargs = varargs;
043  }
044
045  public boolean isCompactForm() {
046    return compactForm;
047  }
048
049  public void setCompactForm(boolean compactForm) {
050    this.compactForm = compactForm;
051  }
052
053  @Override
054  public String toString() {
055    return String.format("ASTFunction{parameters=%s, varargs=%s, compactForm=%s}",
056        parameters,
057        varargs,
058        compactForm);
059  }
060
061  @Override
062  public Object jjtAccept(GoloParserVisitor visitor, Object data) {
063    return visitor.visit(this, data);
064  }
065}