001/*
002 * Copyright (c) 2012-2021 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
013public class ASTFunctionDeclaration extends GoloASTNode implements NamedNode {
014
015  private String name;
016  private boolean local = false;
017  private boolean augmentation = false;
018  private boolean decorator = false;
019  private boolean macro = false;
020
021  public ASTFunctionDeclaration(int i) {
022    super(i);
023  }
024
025  public ASTFunctionDeclaration(GoloParser p, int i) {
026    super(p, i);
027  }
028
029  @Override
030  public String getName() {
031    return name;
032  }
033
034  @Override
035  public void setName(String name) {
036    this.name = name;
037  }
038
039  public boolean isLocal() {
040    return local;
041  }
042
043  public void setLocal(boolean local) {
044    this.local = local;
045  }
046
047  public boolean isAugmentation() {
048    return augmentation;
049  }
050
051  public void setAugmentation(boolean augmentation) {
052    this.augmentation = augmentation;
053  }
054
055  public boolean isDecorator() {
056    return decorator;
057  }
058
059  public void setDecorator(boolean decorator) {
060    this.decorator = decorator;
061  }
062
063  public boolean isMacro() {
064    return macro;
065  }
066
067  public void setMacro(boolean  macro) {
068    this.macro = macro;
069  }
070
071  @Override
072  public String toString() {
073    return String.format(
074        "ASTFunctionDeclaration{name='%s', local=%s, decorator=%s, augmentation=%s, macro=%s}",
075        name,
076        local,
077        decorator,
078        augmentation,
079        macro);
080  }
081
082  @Override
083  public Object jjtAccept(GoloParserVisitor visitor, Object data) {
084    return visitor.visit(this, data);
085  }
086}