Parsing / reading C-Header files using Java

前端 未结 4 1355
后悔当初
后悔当初 2020-12-05 09:07

I have a C-Header file defining a couple of stucts, containing multiple char arrays.

I\'d like to parse these files using Java. Is there a library for reading C-Hea

4条回答
  •  被撕碎了的回忆
    2020-12-05 09:41

    Example using Eclipse CDT with only 2 jars.
    - https://github.com/ricardojlrufino/eclipse-cdt-standalone-astparser
    In the example has a class that displays the structure of the source file as a tree and another example making interactions on the api ...

    A detail is that with this api(Eclipse CDT Parser) you can do the parsing from a string in memory.

    Another example of usage is:
    https://github.com/ricardojlrufino/cplus-libparser
    Library for metadata extraction (information about classes, methods, variables) of source code in C / C ++.

    See file: https://github.com/ricardojlrufino/cplus-libparser/blob/master/src/main/java/br/com/criativasoft/cpluslibparser/SourceParser.java

提交回复
热议问题