Vl-patternkey
A key in an assignment pattern.
This is a tagged union type, introduced by deftagsum.
Member Tags → Types
- :expr → vl-patternkey-expr
- An unambiguous array index pattern key like 5 or foo +
bar.
- :structmem → vl-patternkey-structmem
- A struct member pattern key like opcode. Note that until
annotate is done, this may be a type name which needs to be
disambiguated.
- :type → vl-patternkey-type
- A type pattern key like integer or mytype_t.
- :default → vl-patternkey-default
- The special default pattern key.
A vl-patternkey represents a single key in an key/value
style assignment pattern, such as:
'{ 0: a, 1: b, 2: c, default: 0 } // assign to some array indices, default others...
'{ foo: 3, bar: 5 } // assign to struct members by name (maybe)
'{ integer: 5, opcode_t: 7 } // assign to struct members by type (maybe)
These kinds of pattern keys are, in general, somewhat ambiguous
and difficult to resolve until elaboration time. To avoid the worst
of these ambiguities we impose certain restrictions on the kinds of
assignment patterns we support; vl-patternkey-ambiguity for
some notes about this.
Subtopics
- Vl-patternkey-ambiguity
- Notes about our handling of vl-patternkeys.
- Vl-patternkey-case
- Case macro for the different kinds of vl-patternkey structures.
- Vl-patternkey-equiv
- Basic equivalence relation for vl-patternkey structures.
- Vl-patternkey-structmem
- A struct member pattern key like opcode. Note that until
annotate is done, this may be a type name which needs to be
disambiguated.
- Vl-patternkey-p
- Recognizer for vl-patternkey structures.
- Vl-patternkey-expr
- An unambiguous array index pattern key like 5 or foo +
bar.
- Vl-patternkey-type
- A type pattern key like integer or mytype_t.
- Vl-patternkey-kind
- Get the kind (tag) of a vl-patternkey structure.
- Vl-patternkey-default
- The special default pattern key.
- Vl-patternkey-fix
- Fixing function for vl-patternkey structures.
- Vl-patternkey-count
- Measure for recurring over vl-patternkey structures.