Commit Graph

13 Commits

Author SHA1 Message Date
Dmitry Vyukov
402a0dc87e sys: support type aliases (aka typedefs)
Complex types that are often repeated can be given short type aliases using the
following syntax:

```
type identifier underlying_type
```

For example:

```
type signalno int32[0:65]
type net_port proc[20000, 4, int16be]
```

Then, type alias can be used instead of the underlying type in any contexts.
Underlying type needs to be described as if it's a struct field, that is,
with the base type if it's required. However, type alias can be used as syscall
arguments as well. Underlying types are currently restricted to integer types,
`ptr`, `ptr64`, `const`, `flags` and `proc` types.
2018-01-08 12:52:31 +01:00
Dmitry Vyukov
f26811f080 pkg/ast: fix TestParseAll 2017-10-19 10:45:27 +02:00
Dmitry Vyukov
af442a22d9 executor, sys/windows: initial windows support 2017-09-25 15:19:06 +02:00
Dmitry Vyukov
94e151ceb5 pkg/ast: prohibit empty strings
This is currently unsupported and unused.
2017-09-04 20:25:22 +02:00
Dmitry Vyukov
f400a0da0f pkg/ast: fix struct comment parsing 2017-09-04 20:25:03 +02:00
Dmitry Vyukov
a7206b24ca pkg/compiler: check and generate types
Move most of the logic from sysgen to pkg/compiler.

Update #217
2017-09-02 13:06:53 +02:00
Dmitry Vyukov
4074aed7c0 pkg/compiler: more static error checking
Update #217
2017-08-27 20:19:41 +02:00
Dmitry Vyukov
e2ffb4fc91 pkg/compiler: move more const-processing code to compiler 2017-08-27 15:28:49 +02:00
Dmitry Vyukov
a3857c4e90 pkg/compiler, sys/syz-sysgen: move const handling to pkg/compiler
Now pkg/compiler deals with consts.
2017-08-27 11:51:40 +02:00
Dmitry Vyukov
4802b0fb74 sys/syz-sysgen: switch to new parser
For now we just generate the old structs from the new AST.
But this allows to delete the old parser entirely.
2017-08-18 18:47:39 +02:00
Dmitry Vyukov
19b893936b sys/syz-extract: switch to the new parser 2017-08-18 17:04:12 +02:00
Dmitry Vyukov
41bbf437e1 Makefile: enforce formatting of sys files in presubmit 2017-08-18 11:26:50 +02:00
Dmitry Vyukov
127a9c2b65 pkg/ast: new parser for sys descriptions
The old parser in sys/sysparser is too hacky, difficult to extend
and drops debug info too early, so that we can't produce proper error messages.

Add a new parser that is build like a proper language parser
and preserves full debug info for every token.
2017-08-18 11:26:50 +02:00