Beispiel #1
0
        private TypeInfo Visit(CreateArrayNode node, MethodBuilder builder, CodegenContext context)
        {
            Visit(node.Length, builder, context);

            var arrType = typeBuilder.GenerateArrayType(node.TypeNode);

            builder.Construct(arrType, new List <TypeInfo>()
            {
                TypeInfo.Int
            });

            return(arrType);
        }
Beispiel #2
0
        private TypeInfo Visit(CreateInstanceNode node, MethodBuilder builder, CodegenContext context)
        {
            var typeList = new List <TypeInfo>();

            foreach (dynamic item in node.Arguments)
            {
                var type = Visit(item, builder, context);

                typeList.Add(type);
            }

            var classType = types.GetType(node.TypeName);

            builder.Construct(classType, typeList);

            return(classType);
        }