Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for typeof keyword #1012

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Support for typeof keyword #1012

wants to merge 1 commit into from

Conversation

mihaibudiu
Copy link
Contributor

Personnel

Design

  • Document: this PR

Implementation

Process

  • LDWG discussed:
  • LDWG approved:
  • Merged into p4-spec:
  • Merged into p4c:

@mihaibudiu
Copy link
Contributor Author

This would be only really useful in conjunction with #1011. If #1011 is not accepted, a different design should be used for this feature. The reason is that typedef declarations being global confines the use of typeof only for constant expressions, and P4 currently does not have constant expressions of some types, such as header stacks.

@jnfoster
Copy link
Collaborator

jnfoster commented Apr 4, 2022

We discussed this feature at the April '22 LDWG meeting.

  • Folks should try this feature out, as well as Allow local typedef declarations #1011 and come with feedback for the May meeting.
  • @mbudiu-vmw will also prototype a version that allows typeof anywhere a type can be indicated... if Bison allows it.

@jnfoster
Copy link
Collaborator

jnfoster commented Apr 4, 2022

@vgurevich especially, please take a look!

@vgurevich
Copy link
Contributor

@jnfoster -- noted. I'll try to refactor some programs and at least compile them with p4-test backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants