Skip to content

Extend the Generator Capabilities for Enum #43

@ilyar

Description

@ilyar

Extend the Generator Capabilities for Enum maby use bit selector for types that are written by more than one combinator aka Enum

schema

// Simple Enum Foo
f_a$00 = Foo;
f_b$01 = Foo;
f_c$10 = Foo;

// Simple Enum Foo
b_a$0 = Bar;
b_b$10 = Bar;
b_c$11 = Bar;

// Simple Enum Quz
q_a$11 = Quz;

// Enum A
a$00 = A 1 1;
b$01 = A 1 2;
d$10 = A 2 1;
e$11 {X:#} {Y:#} = A X Y;
tlbc -qv local-enum.tlb

type #1548: `Foo`, arity 0, 3 constructors
  constructor `f_a`
        f_a$00 = Foo;
        begins with {00*}
        size =2 (fixed) (any bits)
  constructor `f_b`
        f_b$01 = Foo;
        begins with {01*}
        size =2 (fixed) (any bits)
  constructor `f_c`
        f_c$10 = Foo;
        begins with {10*}
        size =2 (fixed) (any bits)
  (SIMPLE ENUM)
  constructor detection: PFX(2) 
  type size =2 (fixed)
  type begins with {0*,10*}

type #1549: `Bar`, arity 0, 3 constructors
  constructor `b_a`
        b_a$0 = Bar;
        begins with {0*}
        size =1 (fixed) (any bits)
  constructor `b_b`
        b_b$10 = Bar;
        begins with {10*}
        size =2 (fixed) (any bits)
  constructor `b_c`
        b_c$11 = Bar;
        begins with {11*}
        size =2 (fixed) (any bits)
  (SIMPLE ENUM)
  constructor detection: PFX(2) 
  type size 1..2 (any bits)
  type begins with {*}

type #1550: `Quz`, arity 0, 1 constructors
  constructor `q_a`
        q_a$11 = Quz;
        begins with {11*}
        size =2 (fixed) (any bits)
  (SIMPLE ENUM)
  type size =2 (fixed)
  type begins with {11*}

type #1551: `A`, arity 2, 4 constructors
  constructor `a`
        a$00 = A 1 1;
        begins with {00*}
        admissibility [0000010000000000]
        size =2 (fixed) (any bits)
  constructor `b`
        b$01 = A 1 2;
        begins with {01*}
        admissibility [0000000001000000]
        size =2 (fixed) (any bits)
  constructor `d`
        d$10 = A 2 1;
        begins with {10*}
        admissibility [0000001000000000]
        size =2 (fixed) (any bits)
  constructor `e`
        e$11 {X:#} {Y:#} = A X Y;
        begins with {11*}
        size =2 (fixed) (any bits)
                field `X`: # (used=0) (is_nat_subtype=1)
                field `Y`: # (used=0) (is_nat_subtype=1)
  (ENUM)
  constructor detection: PFX(2) 
  type size =2 (fixed) (any bits)
  type begins with {*}
  type admissibility [1111111111111111]

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions