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

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

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

import org.qbicc.type.ValueType;
import org.qbicc.type.WordType;

/**
 * The undefined value.  Usage of an undefined value results in a compilation error.
 */
public final class UndefinedLiteral extends Literal {
    private final ValueType type;

    UndefinedLiteral(final ValueType type) {
        this.type = type;
    }

    public boolean isZero() {
        return false;
    }

    public boolean equals(final Literal other) {
        return other instanceof UndefinedLiteral;
    }

    public ValueType getType() {
        return type;
    }

    @Override
    Literal bitCast(LiteralFactory lf, WordType toType) {
        return lf.undefinedLiteralOfType(toType);
    }

    public int hashCode() {
        return type.hashCode();
    }

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

    @Override
    public StringBuilder toString(StringBuilder b) {
        return b.append("undef");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy