Skip to content

Question about compiling context and build system integration #17

@qobilidop

Description

@qobilidop

P4 doesn't really have a standard build system (to my knowledge), but to properly handle preprocessors like #include and conditionals + macros, a specific compiling context has to be assumed. Clangd (using C++ LSP tool as an example because many other languages don't have to deal with the complexities of complicated preprocessors) solves this problem by standardizing a compilation database (more context here), and integrating with common build systems to generate it automatically. I wonder if something similar is needed for p4analyzer?

Some p4c compiler options that are particularly relevant are the following (similar to C/C++):

These could change how a P4 code should be interpreted. For example, when doing "jump to definition", the definition might be in a #if branch pending on a macro supplied from -D.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions