public override void VisitCastCPPModel(CastCPPModel model)
        {
            var type       = TypeLookup.LookupCPPTypeName(model.Type);
            var expression = Invoke <ExpressionBuilder>(model.Expression).Expression;

            Expression = $"({type}){expression}";
        }
        public override void VisitMethodCPPModel(MethodCPPModel model)
        {
            Context.Method = model;

            var pars = string.Join(", ", model.Parameters.Select(arg =>
            {
                var pass = "";
                switch (arg.Pass)
                {
                case ArgumentPassCPPModel.Ref:
                    pass = "******";
                    break;

                case ArgumentPassCPPModel.Pointer:
                    pass = "******";
                    break;

                case ArgumentPassCPPModel.Raw:
                    pass = "******";
                    break;
                }
                return($"{TypeLookup.LookupCPPTypeName(arg.ParameterType)}{pass}{arg.Name}");
            }));

            AppendLine($"{TypeLookup.LookupCPPTypeName(model.ReturnType)} {Context.Class.Name}::{model.Name}({pars})");
            OpenBlock();
            VisitChildren(model.Members);
            CloseBlock();
        }
        public override void VisitFieldCPPModel(FieldCPPModel model)
        {
            if (model.FieldType.IsArray)
            {
                var size = "";

                switch (model.Initializer)
                {
                case ArrayCreationExpressionCPPModel ac:
                    size = Invoke <ExpressionBuilder>(ac.Rank).Expression;
                    break;

                default:
                    Unsupported(model, "Array initializer not suported");
                    break;
                }

                AppendLine($"{TypeLookup.LookupCPPTypeName(model.FieldType.GetElementType())} {Context.Class.Name}::{model.Name}[{size}] = {{0}};");
            }
            else
            {
                var initializer = Invoke <ExpressionBuilder>(model.Initializer).Expression;
                AppendLine($"{TypeLookup.LookupCPPTypeName(model.FieldType)} {Context.Class.Name}::{model.Name} = {initializer};");
            }
        }
 public override void VisitFieldCPPModel(FieldCPPModel model)
 {
     if (model.FieldType.IsArray)
     {
         AppendLine($"{CPPModelTools.Modifiers(model.Modifiers)} {TypeLookup.LookupCPPTypeName(model.FieldType.GetElementType())} {model.Name}[];");
     }
     else
     {
         AppendLine($"{CPPModelTools.Modifiers(model.Modifiers)} {TypeLookup.LookupCPPTypeName(model.FieldType)} {model.Name};");
     }
 }
        public override void VisitMethodCPPModel(MethodCPPModel model)
        {
            var pars = string.Join(", ", model.Parameters.Select(arg =>
            {
                var pass = "";
                switch (arg.Pass)
                {
                case ArgumentPassCPPModel.Ref:
                    pass = "******";
                    break;

                case ArgumentPassCPPModel.Pointer:
                    pass = "******";
                    break;

                case ArgumentPassCPPModel.Raw:
                    pass = "******";
                    break;
                }
                return($"{TypeLookup.LookupCPPTypeName(arg.ParameterType)}{pass}{arg.Name}");
            }));

            AppendLine($"{CPPModelTools.Modifiers(model.Modifiers)} {TypeLookup.LookupCPPTypeName(model.ReturnType)} {model.Name}({pars});");
        }
        public override void VisitDataCPPModel(DataCPPModel model)
        {
            var initializers = model.Initializers.Select(i => Invoke <ExpressionBuilder>(i).Expression);

            Expression = $"{TypeLookup.LookupCPPTypeName(model.DataType)} {string.Join(", ", initializers)}";
        }