Ejemplo n.º 1
0
        public override void ExitDotNetGenericName(DotNetIlTypeNameParser.DotNetGenericNameContext context)
        {
            var netName = MyDotNetNames.RemoveFrom(context) ?? new NfTypeNameParseItem();

            netName.FullName            = ConcatDotNetName(context.dotNetName());
            netName.AssemblyFullName    = ConcatDotNetAsmName(context.dotNetAsmName());
            netName.PublicKeyTokenValue = GetPublicKeyTokenValue(context.dotNetAsmName());
            var fk = context.GENERIC_COUNTER().GetText() ?? "0";

            fk = fk.Replace("`", String.Empty);
            byte genCount;

            if (Byte.TryParse(fk, out genCount) && genCount > 0)
            {
                netName.GenericCounter = genCount;
            }

            var genericArgs = new List <NfTypeNameParseItem>();

            foreach (var genArg in context.dotNetGenericArg())
            {
                var genNetName = MyGenericArgs.Get(genArg);
                if (genNetName == null)
                {
                    continue;
                }
                genericArgs.Add(genNetName);
            }
            netName.GenericItems = genericArgs;
            MyDotNetNames.Put(context, netName);
        }
 /// <summary>
 /// Exit a parse tree produced by <see cref="DotNetIlTypeNameParser.dotNetGenericName"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitDotNetGenericName([NotNull] DotNetIlTypeNameParser.DotNetGenericNameContext context)
 {
 }