开发一个简单的解析器 [英] Developing a simple parser

查看:73
本文介绍了开发一个简单的解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的日常工作包括致力于开发类似Pascal的编译器.我一直在进行优化和代码生成.

My day job includes working to develop a Pascal-like compiler. I've been working all along on optimizations and code generation.

我还想开始学习为相同的语言构建一个简单的解析器.但是,我不太确定该怎么做. Flex和Bison似乎是选择.但是,使用C ++或C#编写解析器是不可能的吗?我对C有点毛骨悚然.

I would also like to start learning to build a simple parser for the same language. I'm however, not really sure how to go about this. Flex and Bison seem to be the choice. But, isn't it possible to write a parser using C++ or C#? I'm a bit creepy with C.

Yacc ++支持C#,但它是经过许可的.我正在寻找在这方面可以找到的所有帮助.建议将不胜感激.

Yacc++ supports C#, but it's a licensed one. I'm looking for all the help that I can find in this regard. Suggestions would be highly appreciated.

推荐答案

我相信您可以在C#中使用ANTLR.我还没有尝试过,但是有一个教程此处,可能会为您指明正确的方向.

I believe you can use ANTLR with C#. I've never tried it myself (yet), however there is a tutorial here that might point you in the right direction.

这篇关于开发一个简单的解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆