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