Most effective way to parse C-like definition strings?

前端 未结 5 1220
滥情空心
滥情空心 2021-01-13 08:24

I\'ve got a set of function definitions written in a C-like language with some additional keywords that can be put before some arguments(the same way as \"unsigned\" or \"re

5条回答
  •  日久生厌
    2021-01-13 08:48

    actually, it depends how complex is your language and whether it's really close to C or not...

    Still, you could use lex as a first step even for regular expression ....

    I would go for lex + menhir and o'caml....

    but any flex/yacc combination would be fine..

    The main problem with regular bison (the gnu implementation of yacc) stems from the C typing.. you have to describe your whole tree (and all the manipulation functions)... Using o'caml would be really easier ...

提交回复
热议问题