Пример #1
0
        public override void EnterSupertypeDecl(ExpressParser.SupertypeDeclContext context)
        {
            ((Entity)currTypeData).IsAbstract = context.ABSTRACT() != null;
            var factor = context.supertypeExpr().supertypeFactor();

            // IFC: Use choice only.
            if (factor[0].choice() != null)
            {
                foreach (var superRef in factor[0].choice().supertypeExpr())
                {
                    var    name    = superRef.supertypeFactor()[0].entityRef().SimpleId().GetText();
                    Entity tdSuper = null;
                    if (typeGraph.ContainsKey(name))
                    {
                        tdSuper = (Entity)typeGraph[name];
                    }
                    else
                    {
                        tdSuper = new Entity(name, generator, testGenerator);
                        typeGraph.Add(name, tdSuper);
                    }
                    ((Entity)currTypeData).Supers.Add(tdSuper);
                }
            }
        }
Пример #2
0
        public override void EnterSupertypeDecl(ExpressParser.SupertypeDeclContext context)
        {
            if (context.ABSTRACT() != null)
            {
                currentEntityInfo.IsAbstract = true;
            }

            currentEntityInfo.SupertypeOf.Add(context.Identifier().GetText());
        }
 /// <summary>
 /// Exit a parse tree produced by the <c>SupertypeDecl</c>
 /// labeled alternative in <see cref="ExpressParser.supertypeDeclaration"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitSupertypeDecl([NotNull] ExpressParser.SupertypeDeclContext context)
 {
 }