[P4-dev] expecting ACTION or CONST or TABLE

Mihai Budiu mbudiu at vmware.com
Thu Oct 5 14:43:29 EDT 2017


This looks wrong, this is not a p4-14 program.

-----Original Message-----
From: P4-dev [mailto:p4-dev-bounces at lists.p4.org] On Behalf Of Han Wang
Sent: Thursday, October 5, 2017 11:41 AM
To: King, Steven R <steven.r.king at intel.com>
Cc: p4-dev at lists.p4.org
Subject: Re: [P4-dev] expecting ACTION or CONST or TABLE

This works for me.

#include <core.p4>
control foo() {
    action a(in bit<8> x) {}
    table t {
        actions = {
            a(8w5); // binding a's parameter x to 5
        }
    }
    apply{}
}

Compiled with
p4test --p4-14 bug-steve-king.p4

> On Oct 5, 2017, at 11:30 AM, King, Steven R <steven.r.king at intel.com> wrote:
> 
> 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?
> 
> Thanks,
> -steve
> 
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=VU4Sj8CY7Krg194Z0Nos6jNzCEru60pK4yF-t6XEi70&s=L3cRLmqYGzxEXk-xF_uvG0fuErwpsBL9Nfvbs9j6w5E&e= 


_______________________________________________
P4-dev mailing list
P4-dev at lists.p4.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.p4.org_mailman_listinfo_p4-2Ddev-5Flists.p4.org&d=DwICAg&c=uilaK90D4TOVoH58JNXRgQ&r=tGW6TKXajnoXSyy1S1P4DHGPe8sj54GGvw-b21n7aWg&m=VU4Sj8CY7Krg194Z0Nos6jNzCEru60pK4yF-t6XEi70&s=L3cRLmqYGzxEXk-xF_uvG0fuErwpsBL9Nfvbs9j6w5E&e= 




More information about the P4-dev mailing list