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 ASTMacroInvocation extends GoloASTNode implements NamedNode { 014 015 private String name; 016 private boolean topLevel = false; 017 018 public ASTMacroInvocation(int id) { 019 super(id); 020 } 021 022 public ASTMacroInvocation(GoloParser p, int id) { 023 super(p, id); 024 } 025 026 @Override 027 public String getName() { 028 return name; 029 } 030 031 @Override 032 public void setName(String name) { 033 this.name = name; 034 } 035 036 public void setTopLevel(boolean v) { 037 topLevel = v; 038 } 039 040 public boolean isTopLevel() { 041 return topLevel; 042 } 043 044 @Override 045 public String toString() { 046 return "ASTMacroInvocation{" 047 + "name='" + name + "'" 048 + (topLevel ? ", top-level" : "") 049 + '}'; 050 } 051 052 @Override 053 public Object jjtAccept(GoloParserVisitor visitor, Object data) { 054 return visitor.visit(this, data); 055 } 056 057}