~boringcactus/crowbar-spec

ref: 02e06c6a20ecc68325671326f09583b3692fae3b crowbar-spec/language/types.rst -rw-r--r-- 775 bytes
02e06c6a — Melody Horn add colon to punctuator list 1 year, 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Types
-----

.. crowbar:element:: Type <- ConstType / PointerType / ArrayType / FunctionType / BasicType

.. crowbar:element:: ConstType <- 'const' BasicType

.. crowbar:element:: PointerType <- BasicType '*'

.. crowbar:element:: ArrayType <- BasicType '[' Expression ']'

.. crowbar:element:: FunctionType <- BasicType 'function' '(' FunctionTypeArgs? ')'
                     FunctionTypeArgs <- BasicType (',' BasicType)* ','?

.. crowbar:element:: BasicType <- 'void' / 'bool' / 'float32' / 'float64' / 'int8' / 'int16' / 'int32' / 'int64' / 'intaddr' / 'intmax' / 'intsize' / 'uint8' / 'uint16' / 'uint32' / 'uint64' / 'uintaddr' / 'uintmax' / 'uintsize' / 'struct' identifier / 'enum' identifier / 'union' identifier / '(' Type ')'

.. todo:: define like any of these