Exemplo n.º 1
0
 public override void ExitSchemaDecl(ExpressParser.SchemaDeclContext context)
 {
     // Set the IsRelationshipReference on all attribute data.
     foreach (var td in typeGraph.Values.Where(td => td is Entity).Cast <Entity>())
     {
         if (!td.Subs.Any())
         {
             continue;
         }
     }
 }
Exemplo n.º 2
0
        public override void ExitSchemaDecl(ExpressParser.SchemaDeclContext context)
        {
            // Set the IsRelationshipReference on all attribute data.
            foreach (var td in typeGraph.Values.Where(td => td is Entity).Cast <Entity>())
            {
                if (!td.Subs.Any())
                {
                    continue;
                }
            }

            // Write all the entities
            foreach (var kvp in typeGraph)
            {
                var td = kvp.Value;
                stringBuilder.AppendLine(td.ToString());
            }

            // Close the main namespace.
            stringBuilder.AppendLine("}");
        }
Exemplo n.º 3
0
 public override void EnterSchemaDecl(ExpressParser.SchemaDeclContext context)
 {
 }
Exemplo n.º 4
0
        public override void EnterSchemaDecl(ExpressParser.SchemaDeclContext context)
        {
            var outer =
                @"/*
This code was generated by a tool. DO NOT MODIFY this code manually, unless you really know what you are doing.
 */
using System;
using System.ComponentModel;
using System.Collections.Generic;
using Newtonsoft.Json;
	
namespace IFC4
{
	public abstract class BaseIfc
	{
		[JsonProperty(""id"")]
		public Guid Id{get;}

		public BaseIfc()
		{
			Id = Guid.NewGuid();
		}

		public virtual string ToJSON()
		{
			var settings = new JsonSerializerSettings()
			{
				Formatting = Formatting.Indented,
				TypeNameHandling = TypeNameHandling.Objects
			};
			return JsonConvert.SerializeObject(this);
		}

		public virtual string ToSTEP()
		{
			throw new NotImplementedException();
		}
	}

	public abstract class Select : BaseIfc
	{
		[JsonProperty(""value"")]
		public dynamic Value {get;protected set;}
	}

	/// <summary>
	/// A type wrapper for IFC.
	/// </summary>
	public class IfcType<T> : BaseIfc
	{
		[JsonProperty(""value"")]
		public T Value{get;set;}
		public IfcType(T value)
		{
			Value = value;
		}

		public static implicit operator IfcType<T>(T value)
		{
			return new IfcType<T>(value);
		}
	}
	"    ;

            stringBuilder.AppendLine(outer);
        }