@@ -5628,7 +5628,7 @@ parserState
5628
5628
5629
5629
Each state has a name and a body. The body consists of a sequence of
5630
5630
statements that describe the processing performed when the parser
5631
- transitions to that state including:
5631
+ transitions to that state, including:
5632
5632
5633
5633
- Local variable declarations,
5634
5634
- Assignment statements,
@@ -5800,12 +5800,12 @@ select (p.tcp.port) {
5800
5800
The expression `16w0 &&& 16w0xFC00` describes the set of 16-bit
5801
5801
values whose most significant six bits are zero.
5802
5802
5803
- Some targets may support parser value set, see Section [#sec-value-set]. Given
5803
+ Some targets may support parser value sets; see Section [#sec-value-set]. Given
5804
5804
a type `T` for the type parameter of the value set, the type of the value set
5805
5805
is `set<T>`. The type of the value set must match to the type of all other
5806
- `keysetExpression` in the same `select` expression. If there is a mismatch, the
5807
- compiler must raise an error. The type of the values in the set must be one of
5808
- bit<>, int<>, tuple, struct, and serializable `enum`.
5806
+ `keysetExpression`s in the same `select` expression. If there is a mismatch, the
5807
+ compiler must raise an error. The type of the values in the set must be either
5808
+ bit<>, int<>, tuple, struct, or serializable `enum`.
5809
5809
5810
5810
For example, to allow the control plane API to specify TCP reserved ports at
5811
5811
runtime, one could write:
@@ -5914,7 +5914,7 @@ packet_in {
5914
5914
}
5915
5915
~ End P4Pseudo
5916
5916
5917
- ### Fixed width extraction { #sec-packet-extract-one }
5917
+ ### Fixed- width extraction { #sec-packet-extract-one }
5918
5918
5919
5919
The single-argument `extract` method handles fixed-width headers,
5920
5920
and is declared in P4 as follows:
@@ -5923,7 +5923,7 @@ and is declared in P4 as follows:
5923
5923
void extract<T>(out T headerLeftValue);
5924
5924
~ End P4Example
5925
5925
5926
- The expression `headerLeftValue` must evaluate to a l-value (see
5926
+ The expression `headerLeftValue` must evaluate to an l-value (see
5927
5927
Section [#sec-lvalues]) of type `header` with a fixed width. If
5928
5928
this method executes successfully, on completion the `headerLvalue`
5929
5929
is filled with data from the packet and its validity bit is set to `true`. This
@@ -5933,7 +5933,7 @@ enough bits left in the packet to fill the specified header.
5933
5933
For example, the following program fragment extracts an Ethernet header:
5934
5934
5935
5935
~ Begin P4Example
5936
- struct Result { Ethernet_h ethernet; /* more field omitted */ }
5936
+ struct Result { Ethernet_h ethernet; /* more fields omitted */ }
5937
5937
parser P(packet_in b, out Result r) {
5938
5938
state start {
5939
5939
b.extract(r.ethernet);
@@ -5964,15 +5964,15 @@ void packet_in.extract<T>(out T headerLValue) {
5964
5964
}
5965
5965
~ End P4Pseudo
5966
5966
5967
- ### Variable width extraction { #sec-packet-extract-two }
5967
+ ### Variable- width extraction { #sec-packet-extract-two }
5968
5968
5969
5969
The two-argument `extract` handles variable-width headers, and is declared in P4 as follows:
5970
5970
5971
5971
~ Begin P4Example
5972
5972
void extract<T>(out T headerLvalue, in bit<32> variableFieldSize);
5973
5973
~ End P4Example
5974
5974
5975
- The expression `headerLvalue` must be a l-value representing a
5975
+ The expression `headerLvalue` must be an l-value representing a
5976
5976
header that contains *exactly one* `varbit` field. The expression `variableFieldSize`
5977
5977
must evaluate to a `bit<32>` value that indicates the number of
5978
5978
bits to be extracted into the unique `varbit` field of the header
0 commit comments