aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-29 10:56:48 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-04-29 12:04:22 +0200
commit1e85f7b9af8e29f06a22eb1ff325de2a40072738 (patch)
treefbbe16d0eb26f84ad22b82e0925420b1177798e2 /docs
parentc7f6891ca7dc623ed77840580cb9270c61d200ee (diff)
pkg/ast: support char constants
Frequently it's useful to do something like: int8['a':'z'] punctuation = ',', '-', ':'
Diffstat (limited to 'docs')
-rw-r--r--docs/syscall_descriptions_syntax.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md
index 5e85a29d6..47986651c 100644
--- a/docs/syscall_descriptions_syntax.md
+++ b/docs/syscall_descriptions_syntax.md
@@ -247,6 +247,21 @@ The `proc[20000, 4, int16be]` type means that we want to generate an `int16be`
integer starting from `20000` and assign `4` values for each process.
As a result the executor number `n` will get values in the `[20000 + n * 4, 20000 + (n + 1) * 4)` range.
+## Integer Constants
+
+Integer constants can be specified as decimal literals, as `0x`-prefixed
+hex literals, as `'`-surrounded char literals, or as symbolic constants
+extracted from kernel headers or defined by `define` directives. For example:
+
+```
+foo(a const[10])
+foo(a const[0xabcd])
+foo(a int8['a':'z'])
+foo(a const[PATH_MAX])
+foo(a ptr[in, array[int8, MY_PATH_MAX]])
+define MY_PATH_MAX PATH_MAX + 2
+```
+
## Misc
Description files also contain `include` directives that refer to Linux kernel header files,