From ba0f0cfc2f0cec5247b88245e07d0340293746d2 Mon Sep 17 00:00:00 2001 From: Jaehyun Lee <99jaehyunlee@gmail.com> Date: Mon, 25 Nov 2024 14:15:22 +0900 Subject: [PATCH] Add type nesting rules for extern, parser, control, and package types Signed-off-by: Jaehyun Lee <99jaehyunlee@gmail.com> --- p4-16/spec/P4-16-spec.adoc | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/p4-16/spec/P4-16-spec.adoc b/p4-16/spec/P4-16-spec.adoc index 37940fb202..d2ca4088a7 100644 --- a/p4-16/spec/P4-16-spec.adoc +++ b/p4-16/spec/P4-16-spec.adoc @@ -2560,6 +2560,13 @@ arbitrary-precision integer, without a width specified. | `list types` | error | error | error | allowed | error +| `extern types` | error | error | error | error | error + +| `parser types` | error | error | error | error | error + +| `control types` | error | error | error | error | error + +| `package types` | error | error | error | error | error |=== [1] An `enum` type used as a field in a `header` must specify a @@ -2607,19 +2614,27 @@ The table below lists all types that may appear as base types in a | `bool` | allowed | allowed -| enumeration types | allowed | error +| `enumeration types` | allowed | error + +| `header types` | allowed | error + +| `header stacks` | allowed | error + +| `header unions` | allowed | error + +| `struct types` | allowed | error -| header types | allowed | error +| `tuple types` | allowed | error -| header stacks | allowed | error +| `list types` | allowed | error -| header unions | allowed | error +| `extern types` | allowed | error -| struct types | allowed | error +| `parser types` | allowed | error -| tuple types | allowed | error +| `control types` | allowed | error -| list types | allowed | error +| `package types` | allowed | error | a `typedef` name | allowed | allowed [3]