You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ChocoPy/src/main/java/chocopy/common/astnodes/GlobalDecl.java

35 lines
769 B

package chocopy.common.astnodes;
import chocopy.common.analysis.NodeAnalyzer;
import java_cup.runtime.ComplexSymbolFactory.Location;
/**
* Declaration of global variable.
*/
public class GlobalDecl extends Declaration {
/**
* The declared variable.
*/
public final Identifier variable;
/**
* The AST for the declaration
* global VARIABLE
* spanning source locations [LEFT..RIGHT].
*/
public GlobalDecl(Location left, Location right, Identifier variable) {
super(left, right);
this.variable = variable;
}
public <T> T dispatch(NodeAnalyzer<T> analyzer) {
return analyzer.analyze(this);
}
@Override
public Identifier getIdentifier() {
return this.variable;
}
}