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

org.incava.analysis.TokenUtil Maven / Gradle / Ivy

package org.incava.analysis;

import net.sourceforge.pmd.lang.java.ast.Token;
import org.incava.ijdk.text.Location;
import org.incava.ijdk.text.LocationRange;

public class TokenUtil {
    public static Location toBeginLocation(Token t) {
        return t == null ? null : new Location(t.beginLine, t.beginColumn);
    }

    public static LocationRange toLocationRange(Token from, Token to) {
        return new LocationRange(toBeginLocation(from), toEndLocation(to));
    }
    
    public static Location toEndLocation(Token t) {
        return t == null ? null : new Location(t.endLine, t.endColumn);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy