All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.qbicc.graph.literal.GlobalVariableLiteral Maven / Gradle / Ivy

There is a newer version: 0.77.0
Show newest version
package org.qbicc.graph.literal;

import org.qbicc.type.definition.element.GlobalVariableElement;
import org.qbicc.type.definition.element.VariableElement;

/**
 * A literal for a global variable.
 */
public class GlobalVariableLiteral extends VariableLiteral {
    GlobalVariableLiteral(GlobalVariableElement variable) {
        super(variable);
    }

    GlobalVariableLiteral(VariableElement variable) {
        this((GlobalVariableElement) variable);
    }

    @Override
    public GlobalVariableElement getVariableElement() {
        return (GlobalVariableElement) super.getVariableElement();
    }

    @Override
    public StringBuilder toReferenceString(StringBuilder b) {
        GlobalVariableElement gve = getVariableElement();
        return b.append('@').append(gve.getName());
    }

    @Override
    public  R accept(LiteralVisitor visitor, T param) {
        return visitor.visit(param, this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy