google / pdl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include definitions from other files

iilyak opened this issue · comments

commented

Some of my structures are re-used in multiple places. Also I don't want to put dozens of structures into one giant file. I would prefer to have one file per packet. However currently I don't see a way to refer to packet defined in another file. Of cause the parser fails with "undeclared typedef identifier ...".

Can you share an example of what you would like to achieve with PDL ?

We are not planning on implementing a module system for PDL right now, as it generates difficulties down the line for resolving import paths. Right now the generator does not know about the output path for the generated module, nor would it know about the location of modules to import external definitions from.

As a first measure, we could facilitate the creation of large modules with shared definitions by adding an embed statement to copy the definitions from one file to another, and remove duplicates. Would that be enough for your use case ?