|
|
@@ -7,22 +7,27 @@ import (
|
|
|
// Listener is ...
|
|
|
type Listener struct {
|
|
|
*grammar.BaseUrnListener
|
|
|
- target *Urn
|
|
|
+ target *URN
|
|
|
}
|
|
|
|
|
|
// NewListener is ...
|
|
|
-func NewListener(target *Urn) *Listener {
|
|
|
+func NewListener(u *URN) *Listener {
|
|
|
return &Listener{
|
|
|
- target: target,
|
|
|
+ target: u,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// ExitID is called when production id is exited
|
|
|
+// ExitID is called when rule iD is exited
|
|
|
func (l *Listener) ExitID(ctx *grammar.IDContext) {
|
|
|
l.target.ID = ctx.GetText()
|
|
|
}
|
|
|
|
|
|
-// ExitSS is called when production ss is exited
|
|
|
+// ExitSS is called when rule sS is exited
|
|
|
func (l *Listener) ExitSS(ctx *grammar.SSContext) {
|
|
|
l.target.SS = ctx.GetText()
|
|
|
}
|
|
|
+
|
|
|
+// ExitUrn is called when rule urn is exited
|
|
|
+func (l *Listener) ExitUrn(ctx *grammar.UrnContext) {
|
|
|
+ l.target.tree = ctx.ToStringTree(nil, ctx.GetParser())
|
|
|
+}
|