[P4-dev] expecting ACTION or CONST or TABLE

Han Wang hanwang at barefootnetworks.com
Thu Oct 5 14:44:36 EDT 2017


Sorry. 

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

> On Oct 5, 2017, at 11:43 AM, Mihai Budiu <mbudiu at vmware.com> wrote:
> 
> This looks wrong, this is not a p4-14 program.
> 
> -----Original Message-----
> From: P4-dev [mailto:p4-dev-bounces at lists.p4.org <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 <mailto:steven.r.king at intel.com>>
> Cc: p4-dev at lists.p4.org <mailto: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= <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 <mailto: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= <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=>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20171005/a4f80278/attachment-0002.html>


More information about the P4-dev mailing list