Example usage for org.antlr.v4.runtime.misc Interval length

List of usage examples for org.antlr.v4.runtime.misc Interval length

Introduction

In this page you can find the example usage for org.antlr.v4.runtime.misc Interval length.

Prototype

public int length() 

Source Link

Document

return number of elements between a and b inclusively.

Usage

From source file:org.tvl.goworks.editor.go.codemodel.impl.AbstractCodeElementModel.java

License:Open Source License

@CheckForNull
protected static OffsetRegion getOffsetRegion(@NullAllowed ParseTree node) {
    if (node == null) {
        return null;
    }/*from   w w w. j a  v a 2 s .c o m*/

    Interval sourceInterval = ParseTrees.getSourceInterval(node);
    return new OffsetRegion(sourceInterval.a, sourceInterval.length());
}