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