Exemplo n.º 1
0
        public override void OutputPre(OutputStream os, OutputFlags flags)
        {
            if (Pointee.Kind == NodeKind.FunctionSignature)
            {
                FunctionSignatureNode sig = (FunctionSignatureNode)Pointee;
                sig.OutputPre(os, OutputFlags.NoCallingConvention);
            }
            else
            {
                Pointee.OutputPre(os, flags);
            }

            OutputSpaceIfNecessary(os);

            if (Quals.HasFlag(Qualifiers.Unaligned))
            {
                os.Append("__unaligned ");
            }

            if (Pointee.Kind == NodeKind.ArrayType)
            {
                os.Append('(');
            }
            else if (Pointee.Kind == NodeKind.FunctionSignature)
            {
                os.Append('(');
                FunctionSignatureNode sig = (FunctionSignatureNode)Pointee;
                OutputCallingConvention(os, sig.CallConvention);
                os.Append(' ');
            }

            if (ClassParent != null)
            {
                ClassParent.Output(os, flags);
                os.Append("::");
            }

            switch (Affinity)
            {
            case PointerAffinity.Pointer:
                os.Append('*');
                break;

            case PointerAffinity.Reference:
                os.Append('&');
                break;

            case PointerAffinity.RValueReference:
                os.Append("&&");
                break;

            default:
                Assert.True(false);
                break;
            }

            OutputQualifiers(os, Quals, false, false);
        }