public override void ExitId(DOTParser.IdContext context) { string name = ""; if (context.Parent.GetType().Name == "Node_idContext") { name = "(Node) "; } if (context.Parent.GetType().Name == "SubgraphContext") { name = "(Subgraph) "; } if (context.Parent.GetType().Name == "GraphContext") { name = "(Graph) "; } if (!String.IsNullOrEmpty(name)) { Names.Add(new Name() { Text = name + context.GetText(), Line = context.Stop.Line - 1, Start = context.Start.Column, End = context.Start.Column + context.GetText().Length }); } }
public override void EnterId(DOTParser.IdContext context) { OnRuleEnter(Rule.Id, context.GetText()); base.EnterId(context); }