Example #1
0
        public override void VisitClassCPPModel(ClassCPPModel model)
        {
            var delcarationParts = new[]
            {
                CPPModelTools.Modifiers(model.Modifiers, ModifersFlag.AccessTypeCPPModel),
                "class",
                model.Name
            };

            var declarationLine = string.Join(" ", delcarationParts.Where(p => !string.IsNullOrWhiteSpace(p)));

            AppendLine($"{declarationLine}");
            OpenBlock();
            Invoke <ClassMembersCPPModelVisitor>(model.Members);
            CloseBlockWithSemicolon();
        }
Example #2
0
        public override void VisitClassDeclaration(ClassDeclarationSyntax node)
        {
            if (node.Identifier.ToString() == "SOC")
            {
                Invoke <SOCClassVisitor>(node);
                return;
            }

            var _class = new ClassCPPModel(Modifiers: new ModifiersCPPModel());

            _class.Name = node.Identifier.ToString();
            _class.Modifiers.InstanceType = node.Modifiers.ExtractInstanceType();

            using (Context.WithCodeContainer(_class))
            {
                Invoke <ClassMembersVisitor>(node.Members);
            }

            // unsupported
            EnsureNullOrEmpty(node.TypeParameterList, "Generics to be implemented");
        }
Example #3
0
 public override void VisitClassCPPModel(ClassCPPModel model)
 => Invoke <ClassCPPModelVisitor>(model);
Example #4
0
 public override void VisitClassCPPModel(ClassCPPModel model)
 {
     Context.Class = model;
     Invoke <ClassMembersCPPModelVisitor>(model.Members);
 }