/** * a group definition * ``` * person = { * age: int, * name: tstr, * employer: tstr, * } * ``` */ export type Group = { Type: 'group'; Name: string; IsChoiceAddition: boolean; Properties: (Property | Property[])[]; Comments: Comment[]; }; /** * an array definition * ``` * Geography = [ * city: tstr * ] * ``` */ export type Array = { Type: 'array'; Name: string; Values: (Property | Property[])[]; Comments: Comment[]; }; /** * a tag definition * ``` * #6.32(tstr) * ``` */ export type Tag = { NumericPart: number; TypePart: string; }; /** * a variable assignment * ``` * device-address = byte * ``` */ export type Variable = { Type: 'variable'; Name: string; IsChoiceAddition: boolean; PropertyType: PropertyType | PropertyType[]; Operator?: Operator; Comments: Comment[]; }; /** * a comment statement * ``` * ; This is a comment * ``` */ export type Comment = { Type: 'comment'; Content: string; Leading: boolean; }; export type Occurrence = { n: number; m: number; }; export type Property = { HasCut: boolean; Occurrence: Occurrence; Name: PropertyName; Type: PropertyType | PropertyType[]; Comments: Comment[]; Operator?: Operator; }; export declare enum Type { /** * any types */ ANY = "any", /** * boolean types */ BOOL = "bool", /** * numeric types */ INT = "int", UINT = "uint", NINT = "nint", FLOAT = "float", FLOAT16 = "float16", FLOAT32 = "float32", FLOAT64 = "float64", /** * string types */ BSTR = "bstr", BYTES = "bytes", TSTR = "tstr", TEXT = "text", /** * null types */ NIL = "nil", NULL = "null" } /** * can be a number, e.g. "foo = 0..10" * ``` * { * Type: "int", * Value: 6 * } * ``` * or a literal, e.g. "foo = 0..max-byte" * ``` * { * Type: "literal", * Value: "max-byte" * } * ``` */ export type RangePropertyReference = number | string; export type Range = { Min: RangePropertyReference; Max: RangePropertyReference; Inclusive: boolean; }; export type OperatorType = 'default' | 'size' | 'regexp' | 'bits' | 'and' | 'within' | 'eq' | 'ne' | 'lt' | 'le' | 'gt' | 'ge'; export interface Operator { Type: OperatorType; Value: PropertyType; } export type PropertyReferenceType = 'literal' | 'group' | 'group_array' | 'array' | 'range' | 'tag'; export type PropertyReference = { Type: PropertyReferenceType; Value: string | number | boolean | Group | Array | Range | Tag; Unwrapped: boolean; Operator?: Operator; }; export interface NativeTypeWithOperator { Type: Type | PropertyReference; Operator?: Operator; } export type Assignment = Group | Array | Variable; export type PropertyType = Assignment | Array | PropertyReference | string | NativeTypeWithOperator; export type PropertyName = string; //# sourceMappingURL=ast.d.ts.map