public static class Navigate.LocalReferenceNormalizer extends SinglePhase
def b = ___ def b = ___ def a = ___ b ___ def a = ___ a.b ___ with local tags b = _ c _ d ==> with local tags b = ___ a.b.c _ a.d with local tags c = __ d __ with local tags c = ___ d __ end local end local tags d = _ d _ tags d = _ a.d _ end local end localNo nesting is supported: only simple identifiers are compared with the names of the local definitions on the same level. So NO replacement happens in:
def a = ___ b.c ___ with local tags b = ___ ____ with local tags c = ___ b ___Nor is there any replacement in the last argument of an explicit substitution expression, because this means an identifier as a textual component, not a reference to a definition:
def a = ___ (@c)^(x/b) ___ with local tags b = ___ b ___This normalization must be done before any substitution is applied, because these operate on normalized, but unresolved identifiers, simply replacing text. Therefore the TEXTUAL representation of all references must be normalized, independently from the (later) resolution process.
def a = ___ b ___ with local tags b = ___ DOES REPLACE: DOES NOT REPLACE: def x = @a ^(z/a.b) def x = @a ^(z/b)
Modifier and Type | Field and Description |
---|---|
protected String |
prefixLocals |
protected String |
prefixParent |
protected @Opt TagsRegExp |
regexpLocals
The local defs of the regexp we are currently visiting.
|
protected @Opt TagsRegExp |
regexpParent
The local defs of the parent of the regexp we are currently visiting.
|
_visitor_debug_stream, partial
Constructor and Description |
---|
LocalReferenceNormalizer() |
Modifier and Type | Method and Description |
---|---|
void |
action(CharsRegExp x)
Chars Reg Exp do not have local defs.
|
void |
action(Module mod) |
void |
action(Reference ref)
ATTENTION currently NOT supporting nested local defs properly.
|
void |
action(Subst x)
Do not normalize the x in "a^(b/x)".
|
void |
action(TagsRegExp x) |
action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action, action
_visitor_trace, action, action, action, action, foreignObject, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, match, nomatch
@Opt protected @Opt TagsRegExp regexpLocals
@Opt protected @Opt TagsRegExp regexpParent
protected String prefixLocals
protected String prefixParent
public void action(Module mod)
action
in class SinglePhase
public void action(Subst x)
action
in class SinglePhase
public void action(CharsRegExp x)
action
in class SinglePhase
public void action(TagsRegExp x)
action
in class SinglePhase
public void action(Reference ref)
Does currently not recognize mixcure of implict/partly qualified, like ...:
tags a = b.c with local tags b = // ... with local tags c = // ... end local end local
action
in class SinglePhase
see also the complete user documentation .