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