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 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 020 public ASTFunctionDeclaration(int i) { 021 super(i); 022 } 023 024 public ASTFunctionDeclaration(GoloParser p, int i) { 025 super(p, i); 026 } 027 028 @Override 029 public String getName() { 030 return name; 031 } 032 033 @Override 034 public void setName(String name) { 035 this.name = name; 036 } 037 038 public boolean isLocal() { 039 return local; 040 } 041 042 public void setLocal(boolean local) { 043 this.local = local; 044 } 045 046 public boolean isAugmentation() { 047 return augmentation; 048 } 049 050 public void setAugmentation(boolean augmentation) { 051 this.augmentation = augmentation; 052 } 053 054 public boolean isDecorator() { 055 return decorator; 056 } 057 058 public void setDecorator(boolean decorator) { 059 this.decorator = decorator; 060 } 061 062 @Override 063 public String toString() { 064 return String.format( 065 "ASTFunctionDeclaration{name='%s', local=%s, decorator=%s, augmentation=%s}", 066 name, 067 local, 068 decorator, 069 augmentation); 070 } 071 072 @Override 073 public Object jjtAccept(GoloParserVisitor visitor, Object data) { 074 return visitor.visit(this, data); 075 } 076}