Parsing if-else if statement algorithm

后端 未结 3 909
渐次进展
渐次进展 2021-02-09 08:56

I am trying to create a very simple parser for an if-else type structure that will build and execute a SQL statement.

Rather than testing conditions for executing statem

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-09 09:34

    Take a look at Irony:

    Irony is a development kit for implementing languages on .NET platform. Unlike most existing yacc/lex-style solutions Irony does not employ any scanner or parser code generation from grammar specifications written in a specialized meta-language. In Irony the target language grammar is coded directly in c# using operator overloading to express grammar constructs. Irony's scanner and parser modules use the grammar encoded as c# class to control the parsing process. See the expression grammar sample for an example of grammar definition in c# class, and using it in a working parser.

提交回复
热议问题