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

org.jruby.parser.ProductionState Maven / Gradle / Ivy

package org.jruby.parser;

public class ProductionState {
    int state;
    Object value;
    public long start;
    public long end;

    public String toString() {
        return "STATE: " + state + ", VALUE: " + value +
                ", COLS: (" + column(start) + ", " + column(end) +
                "), ROW: (" + line(start) + ", " + line(end) + ")";
    }

    public int start() {
        return line(start);
    }

    public static int line(long packed) {
        return (int) (packed >> 32);
    }

    public static long shift_line(long packed) {
        return packed << 32;
    }

    public static long pack(int line, int column) {
        return shift_line(line) | column;
    }

    public static int column(long packed) {
        return (int) (packed & 0xffff);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy