library IdlNodes; enum Types { NatFloat32, NatFloat64, NatInt8, NatInt16, NatInt32, NatInt64, NatUint8, NatUint16, NatUint32, NatUint64, NatString, NatBool, NatNone, } enum IdlNode { LibraryName: string, Imports: string[], Comment: string[], InterfaceComment: string[], StructComment: string[], EnumComment: string[], ConstComment: string[], TypeListComment: string[], TypeStruct: TypeStruct, TypeEnum: TypeEnum, TypeList: TypeList, TypeConst: TypeConst, TypeInterface: TypeInterface, TypeAbstract: TypeAbstract, } struct TypeAbstract { ident: string, fields: AbstractNode[], hash: uint8[], } enum AbstractNode { AbstractField: AbstractField, Comment: string[], } struct AbstractField { ident: string, ty: TypeName, hash: uint8[], } struct TypeInterface { ident: string, fields: InterfaceNode[], hash: uint8[], extendNames: TypeName[], } enum InterfaceNode { InterfaceField: InterfaceField, Comment: string[], } enum InterfaceFieldModifier { Private, Readonly, Property, Ref, } struct InterfaceField { ident: string, ty: TypeName, hash: uint8[], modifiers: InterfaceFieldModifier[], } struct TypeStruct { ident: string, fields: StructNode[], hash: uint8[], isRecord: bool, } enum StructNode { StructField: StructField, Comment: string[], } struct StructField { ident: string, ty: TypeName, hash: uint8[], } struct TypeList { ident: string, fields: TypeListNode[], hash: uint8[], } enum TypeListNode { TypeListField: TypeListField, Comment: string[], } struct TypeListField { ident: string, ty: TypeName, hash: uint8[], } struct TypeEnum { ident: string, fields: EnumNode[], hash: uint8[], } enum EnumNode { EnumField: EnumField, Comment: string[], } struct EnumField { ident: string, hash: uint8[], } struct TypeConst { ident: string, fields: ConstNode[], constTy: ConstTypes, hash: uint8[], } enum ConstTypes { NatInt, NatFloat, NatString, } enum ConstNode { ConstField: ConstField, Comment: string[], } struct ConstField { ident: string, value: string, hash: uint8[], } enum TypeName { Types: Types, TypeFunction: TypeFunction, TypeTuple: TypeTuple, TypeArray: TypeArray, TypeMap: TypeMap, TypeOption: TypeOption, TypeResult: TypeResult, TypeStream: TypeStream, ListTypeName: string, EnumTypeName: string, StructTypeName: string, InterfaceTypeName: string, ConstTypeName: string, AbstractTypeName: string, } struct TypeFunction { args: TypeName, returnTy: TypeName, } struct TypeArray { ty: TypeName, } struct TypeMap { mapTy: TypeName, indexTy: TypeName, } struct TypeTuple { fields: TupleEntry[], } struct TypeStream { ty: TypeName, } struct TupleEntry { ident: string, ty: TypeName, } struct TypeResult { okTy: TypeName, errTy: TypeName, } struct TypeOption { ty: TypeName, }