public final class StatementRange extends Object
StatementBoundaryDetector.
A range covers a half-open token index interval
[startTokenIndex, endTokenIndex) on the Pp2TokenStream
that produced it. A ; terminator is included in the range; a
GO batch separator (and the count of GO n) is not: it
lies in the gap before the next range, where the assembler emits it
verbatim. The matching source-offset interval
[startOffset, endOffset) on the original input lets the
region assembler (S15) reconstruct verbatim bytes from the
SourceSpanLedger.
Plan reference: §6 layout, §7.3/S11, §7.4/S11.
| Modifier and Type | Class and Description |
|---|---|
static class |
StatementRange.Terminator
What ends a statement range.
|
| Constructor and Description |
|---|
StatementRange(int startTokenIndex,
int endTokenIndex,
int startOffset,
int endOffset,
StatementRange.Terminator terminator) |
| Modifier and Type | Method and Description |
|---|---|
int |
getEndOffset() |
int |
getEndTokenIndex() |
int |
getStartOffset() |
int |
getStartTokenIndex() |
StatementRange.Terminator |
getTerminator() |
boolean |
isEmpty()
True if the range carries no token slots.
|
int |
tokenCount()
Number of token slots in this range (a
; included, a following GO not). |
String |
toString() |
public StatementRange(int startTokenIndex, int endTokenIndex, int startOffset, int endOffset, StatementRange.Terminator terminator)
public int getStartTokenIndex()
public int getEndTokenIndex()
public int getStartOffset()
public int getEndOffset()
public StatementRange.Terminator getTerminator()
public int tokenCount()
; included, a following GO not).public boolean isEmpty()