public static final class SourceMapping.Origin extends Object
length
and same contents, and the origin is characterized
by its offset
in the source file.
It is also possible that the generated code be the result of
Expansion
and instantiation
of placeholders in parameterized semantic actions. In that case,
the source region may contain placeholders and be of a different
length than the mapped region. In that case the textual replacements
to perform to obtain the contents of the region in generated code
is given by replacements
. The rule in the ground grammar
which produced these instantiated actions is given in ruleName
.
Modifier and Type | Field and Description |
---|---|
int |
length
The length of the source region
|
int |
offset
The starting offset of the source region
|
Map<String,String> |
replacements
The textual replacements for potential holes in the source region
|
@Nullable String |
ruleName
The name of the (possibly instantiated) rule which
encloses this origin, if any, or
null otherwise |
public final int offset
public final int length
public final @Nullable String ruleName
null
otherwisepublic Origin(int offset, int length, @Nullable String ruleName, Map<String,String> replacements)
offset
- offset of the origin in source file (0-based)length
- length of the origin in source fileruleName
- name of the (ground) rule which encloses this originreplacements
- textual replacements for holes