Dmitry Vyukov 6b52293f4d pkg/compiler: support type templates
Netlink descriptions contain tons of code duplication,
and need much more for proper descriptions. Introduce
type templates to simplify writing such descriptions
and remove code duplication.

Note: type templates are experimental, have poor error handling
and are subject to change.

Type templates can be declared as follows:

```
type buffer[DIR] ptr[DIR, array[int8]]
type fileoff[BASE] BASE
type nlattr[TYPE, PAYLOAD] {
	nla_len		len[parent, int16]
	nla_type	const[TYPE, int16]
	payload		PAYLOAD
} [align_4]
```

and later used as follows:

```
syscall(a buffer[in], b fileoff[int64], c ptr[in, nlattr[FOO, int32]])
```
2018-01-13 12:52:09 +01:00
..
2017-11-01 20:41:02 +03:00
2017-11-07 14:23:57 +01:00
2017-11-02 16:06:19 +01:00
2017-11-29 08:55:05 +01:00
2017-10-27 15:39:00 +02:00
2017-10-19 14:27:36 +02:00
2017-10-25 09:27:47 +02:00
2017-11-01 20:41:02 +03:00
2017-10-27 15:39:00 +02:00