Open
Description
transition
statements can specify transition to parser states only. However, the below program is not rejected by p4test
.
#include <core.p4>
extern bool ext();
parser P(in bit<6> ttt);
package Pkg(P p);
parser MyParser1(in bit<6> ttt)() {
state start { transition select(ext()) { true: s1; false: s2; } }
state s1 { transition ttt; }
state s2 { transition accept; }
}
Pkg(MyParser1()) main;
After all passes, p4test
gives the below IR where the ill-formed transition ttt
persists:
#include <core.p4>
extern bool ext();
parser P(in bit<6> ttt);
package Pkg(P p);
parser MyParser1(in bit<6> ttt) {
@name("MyParser1.tmp_0") bool tmp_0;
state start {
tmp_0 = ext();
transition select((bit<1>)tmp_0) {
1w1: s1;
1w0: s2;
default: noMatch;
}
}
state s1 {
transition ttt;
}
state s2 {
transition accept;
}
state noMatch {
verify(false, error.NoMatch);
transition reject;
}
}
Pkg(MyParser1()) main;