/* So, you might want to optimize these later, because, like, this might slow down type searching (and compilation), soooo: TODO: */ public GamaTypeRef FindTypeRefGlobal(GamaParser.FqtnContext fqtn) { var names = fqtn.Symbol().Select(s => s.GetText()).ToArray(); var found = This.FindTypeChain(names); if (found != null) { return(found); } if (This != Compiler.GlobalContext.Root) { found = Compiler.GlobalContext.Root.FindTypeChain(names); if (found != null) { return(found); } } foreach (var ns in Imports) { found = ns.FindTypeChain(names); if (found != null) { return(found); } } return(Compiler.GlobalContext.GetTypeChain(names)); }
/// <summary> /// Visit a parse tree produced by <see cref="GamaParser.fqtn"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitFqtn([NotNull] GamaParser.FqtnContext context) { return(VisitChildren(context)); }
/// <summary> /// Exit a parse tree produced by <see cref="GamaParser.fqtn"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitFqtn([NotNull] GamaParser.FqtnContext context) { }