public void CodeGen(CodeBuilder builder)
        {
            if (Summary != null)
            {
                builder.AppendSummary(Summary);
            }

            Visibility.CodeGen(builder);

            if (ReturnType != null)
            {
                ReturnType.CodeGen(builder);
            }
            else
            {
                builder.AppendToken("void");
            }

            builder.AppendToken(Name);
            builder.ForceNoWhitespace();

            builder.AppendToken("()");
            builder.BeginBlock();

            Body.CodeGen(builder);

            builder.EndBlock();
        }
Пример #2
0
        public void CodeGen(CodeBuilder builder)
        {
            if (Summary != null)
            {
                builder.AppendSummary(Summary);
            }

            Visibility.CodeGen(builder);

            if (CompileTimeConstant)
            {
                builder.AppendToken("const");
            }
            else
            {
                builder.AppendToken("static readonly");
            }

            Type.CodeGen(builder);

            builder.AppendToken(Name);

            builder.AppendToken("=");

            Expression.CodeGen(builder);

            builder.EndOfStatement();
        }