Hello,
I'm trying to write a script which parse a c header and then ouput basic bindings for multiple languages.

I read from the forum some times ago that the D compiler could be used as a library and found [the lexer page in the documentation](https://dlang.org/library/dmd/lexer/lexer.html)

but `import dmd.lexer: Lexer` fails with the following error :
```
modlibBinder.d(3): Error: unable to read module `lexer`
modlibBinder.d(3): Expected 'dmd/lexer.d' or 'dmd/lexer/package.d' in one of the following import paths:
import path[0] = .
import path[1] = /usr/include/dmd/phobos
import path[2] = /usr/include/dmd/druntime/import
Failed: ["/usr/bin/dmd", "-v", "-o-", "modlibBinder.d", "-I."]
```

What are the steps to take to be able to call the lexer (and maybe also the parser) over a C header file ?

  • how to use dmd.l... jonatjano via Digitalmars-d-learn
    • Re: how to ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn

Reply via email to