public StructDecl(OutputModelFactory factory, Rule r) : base(factory, factory.GetTarget().GetRuleFunctionContextStructName(r)) { AddDispatchMethods(r); derivedFromName = r.name; provideCopyFrom = r.HasAltSpecificContexts(); }
public virtual void AddDispatchMethods(Rule r) { dispatchMethods = new List<DispatchMethod>(); if (!r.HasAltSpecificContexts()) { // no enter/exit for this ruleContext if rule has labels if (factory.GetGrammar().tool.gen_listener) { dispatchMethods.Add(new ListenerDispatchMethod(factory, true)); dispatchMethods.Add(new ListenerDispatchMethod(factory, false)); } if (factory.GetGrammar().tool.gen_visitor) { dispatchMethods.Add(new VisitorDispatchMethod(factory)); } } }