[P4-dev] expecting ACTION or CONST or TABLE

King, Steven R steven.r.king at intel.com
Thu Oct 5 14:30:42 EDT 2017

Hello P4,

I'm trying and failing to construct a minimal error-free example of a table in a control block.

AFAICT from the p4-16 spec, this code is valid:

    $ cat dummy.p4
    control foo() {
        action a(inout bit<8> x) {}
        table t {
            actions = {
                a(5); // binding a's parameter x to 5

Building this code returns the following error:
    $ p4c -c dummy.p4
    dummy.p4(8):syntax error, unexpected }, expecting ACTION or CONST or TABLE
    error: 1 errors encountered, aborting compilation

Can someone please show the fix needed to make this code compile?


More information about the P4-dev mailing list