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 ASTLetOrVar extends GoloASTNode implements NamedNode { 014 015 public enum Type { 016 LET, VAR 017 } 018 019 private Type type; 020 private String name; 021 private boolean moduleState = false; 022 023 public ASTLetOrVar(int id) { 024 super(id); 025 } 026 027 public ASTLetOrVar(GoloParser p, int id) { 028 super(p, id); 029 } 030 031 public Type getType() { 032 return type; 033 } 034 035 public void setType(Type type) { 036 this.type = type; 037 } 038 039 @Override 040 public String getName() { 041 return name; 042 } 043 044 @Override 045 public void setName(String name) { 046 this.name = name; 047 } 048 049 public boolean isModuleState() { 050 return moduleState; 051 } 052 053 public void setModuleState(boolean moduleState) { 054 this.moduleState = moduleState; 055 } 056 057 @Override 058 public String toString() { 059 return String.format("ASTLetOrVar{type=%s, name='%s', moduleState=%s}", 060 type, 061 name, 062 moduleState); 063 } 064 065 @Override 066 public Object jjtAccept(GoloParserVisitor visitor, Object data) { 067 return visitor.visit(this, data); 068 } 069}