diff options
Diffstat (limited to 'language')
-rw-r--r-- | language/type-definition.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/language/type-definition.rst b/language/type-definition.rst index 327fb4d..b596d0a 100644 --- a/language/type-definition.rst +++ b/language/type-definition.rst @@ -5,7 +5,8 @@ Defining Types Crowbar has three different kinds of user-defined types. -.. crowbar:element:: StructDefinition <- 'struct' identifier '{' VariableDeclaration+ '}' +.. crowbar:element:: StructDefinition <- NormalStructDefinition / OpaqueStructDefinition + NormalStructDefinition <- 'struct' identifier '{' VariableDeclaration+ '}' A ``struct`` defines a composite type with several members. @@ -13,6 +14,11 @@ Defining Types define struct layout in memory +.. crowbar:element:: OpaqueStructDefinition <- 'opaque' 'struct' identifier ';' + + An *opaque struct* is a struct whose name is part of an API boundary but whose contents are not. + Its size is left unspecified, and it can only be used as the target of a pointer. + .. crowbar:element:: EnumDefinition <- 'enum' identifier '{' EnumMember (',' EnumMember)* ','? '}' EnumMember <- identifier ('=' Expression)? |