Example #1
0
        public void merge(DeclSpecNode that)
        {
            if (baseType == null)
            {
                baseType = that.baseType;
            }

            isTypedef  |= that.isTypedef;
            isExtern   |= that.isExtern;
            isStatic   |= that.isStatic;
            isAuto     |= that.isAuto;
            isRegister |= that.isRegister;

            isShort    |= that.isShort;
            isSigned   |= that.isSigned;
            isUnsigned |= that.isUnsigned;
            if (that.isLong)
            {
                longCount++;
            }

            isConst    |= that.isConst;
            isRestrict |= that.isRestrict;
            isVolatile |= that.isVolatile;

            isInline |= that.isInline;
        }
Example #2
0
 public virtual void VisitTypeDeclNode(TypeDeclNode node)
 {
     Visit(node.NameNode);
     Visit(node.EqualSignNode);
     Visit(node.TypeKeywordNode);
     Visit(node.TypeNode);
     Visit(node.PortabilityDirectiveListNode);
     Visit(node.SemicolonNode);
 }
Example #3
0
        public override Node VisitTypeDecls([NotNull] TigerParser.TypeDeclsContext context)
        {
            var node = new TypeDeclListNode(context);

            for (int i = 0; i < context.type().Length; i++)
            {
                ITerminalNode           id   = context.ID(i);
                TigerParser.TypeContext type = context.type(i);

                var decl = new TypeDeclNode(id.Symbol.Line, id.Symbol.Column);
                decl.Children.Add(
                    new IdNode(id.Symbol.Line, id.Symbol.Column, id.GetText()));
                decl.Children.Add(
                    Visit(type));

                node.Children.Add(decl);
            }
            return(node);
        }
Example #4
0
        public DeclSpecNode()
        {
            baseType = null;

            isTypedef  = false;
            isExtern   = false;
            isStatic   = false;
            isAuto     = false;
            isRegister = false;

            isShort    = false;
            isLong     = false;
            isSigned   = false;
            isUnsigned = false;
            longCount  = 0;

            isConst    = false;
            isRestrict = false;
            isVolatile = false;

            isInline = false;
        }
Example #5
0
 public virtual void VisitTypeDeclNode(TypeDeclNode node)
 {
     Visit(node.NameNode);
     Visit(node.EqualSignNode);
     Visit(node.TypeKeywordNode);
     Visit(node.TypeNode);
     Visit(node.PortabilityDirectiveListNode);
     Visit(node.SemicolonNode);
 }