Esempio n. 1
0
        /* Added to a namespace, child of root */
        public override GamaNamespace VisitNamespaceRootStart([NotNull] GamaParser.NamespaceRootStartContext context)
        {
            var fqtn  = context.fqtnRoot();
            var names = fqtn.Symbol().Select(s => s.GetText()).ToArray();
            var ns    = GlobalContext.Root.GetOrCreateNamespaceChain(names);

            if (!new GamaTopLevelCompiler(GlobalContext, ns).Visit(context.topLevelBlock()))
            {
                return(null);
            }
            return(ns);
        }
Esempio n. 2
0
 /// <summary>
 /// Visit a parse tree produced by the <c>NamespaceRootStart</c>
 /// labeled alternative in <see cref="GamaParser.namespace"/>.
 /// <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 VisitNamespaceRootStart([NotNull] GamaParser.NamespaceRootStartContext context)
 {
     return(VisitChildren(context));
 }
Esempio n. 3
0
 /// <summary>
 /// Exit a parse tree produced by the <c>NamespaceRootStart</c>
 /// labeled alternative in <see cref="GamaParser.namespace"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitNamespaceRootStart([NotNull] GamaParser.NamespaceRootStartContext context)
 {
 }