Expand description
The Lua rule catalogue. Spec §2.
The same constructs the other catalogues cover, mapped onto Lua’s
tree. Reading this against rule/go.rs is the point, because the two
answer four of the same questions differently:
- A module becomes a nested table where Go’s becomes a name
prefix. A Go package is a directory and cannot nest inside one file;
a Lua table nests, so
::common::util::LocationstaysM.common.util.Locationand the IDL scope survives the mapping. - A struct becomes a descriptor and a constructor, not a type. Lua declares nothing, so there is no node for the shape itself — what the rule creates is the table that describes it and the function that builds one.
- An enumeration becomes two maps and an ordered list, where Go gets a defined integer type and one constant per enumerator. Lua has no constant and no defined type; a name-to-value map, its inverse and the declaration order are the three facts an enumerator carries, and each is a table entry.
- A typedef has a rule here and declares nothing. Lua has no alias
to write, so what the rule creates is an entry in the descriptor
table naming the target — which is the only place a
typedefis recoverable from the generated file at all.
Constants§
- ALIAS_
TO_ ENTRY - The name of the rule that maps a typedef to a descriptor entry naming its target.
- BITMASK_
TO_ TABLE - The name of the rule that maps a bitmask to a value table.
- BITSET_
TO_ TABLE - The name of the rule that maps a bitset to a descriptor table.
- BIT_
TO_ ENTRY - The name of the rule that maps a bit to a value entry.
- CASE_
TO_ ENTRY - The name of the rule that maps a union case to a branch entry.
- CONST_
TO_ FIELD - The name of the rule that maps a constant to a module field.
- ENUMERATOR_
TO_ ENTRY - The name of the rule that maps an enumerator to a value entry.
- ENUM_
TO_ TABLE - The name of the rule that maps an enumeration to a value table.
- EXCEPTION_
TO_ TABLE - The name of the rule that maps an exception to a descriptor table.
- INTERFACE_
TO_ TABLE - The name of the rule that maps an interface to a table of operation descriptors.
- MEMBER_
TO_ ENTRY - The name of the rule that maps a member to a descriptor entry.
- MODULE_
TO_ TABLE - The name of the rule that maps a module to a nested table.
- NATIVE_
TO_ TABLE - The name of the rule that maps a native declaration to an opaque descriptor.
- STRUCT_
TO_ TABLE - The name of the rule that maps a struct to a descriptor table.
- UNION_
TO_ TABLE - The name of the rule that maps a union to a descriptor table.
- VALUETYPE_
TO_ TABLE - The name of the rule that maps a valuetype to a descriptor table.
Functions§
- catalogue
- Every Lua rule.