Kuba Ober d6d83d54a2 Fix annotations and constants: Factor out type definitions, and add definitions of annotations and constants.
The TypeDefinition is no longer overloaded for Annotation and Constant nodes, and the generator is happy again.
2019-08-29 13:36:58 -04:00

24 lines
710 B
C#

using System.Collections.Generic;
namespace CapnpC.Model
{
class GenFile: IDefinition, IHasNestedDefinitions
{
public ulong Id { get; }
public TypeTag Tag { get => TypeTag.File; }
public IHasNestedDefinitions DeclaringElement { get; }
public string Name { get; set; }
public string[] Namespace { get; set; }
public IEnumerable<TypeDefinition> NestedTypes { get => this.GetNestedTypes(); }
public ICollection<IDefinition> NestedDefinitions { get; } = new List<IDefinition>();
public ICollection<Constant> Constants { get; } = new List<Constant>();
public GenFile(ulong id)
{
Id = id;
}
}
}