我如何使用C ++编程语言源代码对给定的正则表达式隐含词法分析器 [英] how can i impliment a lexer for a given regular expression using c++ progamming language source code
本文介绍了我如何使用C ++编程语言源代码对给定的正则表达式隐含词法分析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用c ++编程语言源代码为给定的正则表达式暗含词法分析器
how can i impliment a lexer for a given regular expression using c++ progamming language source code
推荐答案
^ ]
这可能对您有帮助.
The 30 Minute Regex Tutorial[^]
This might help you.
这可能超出您的范围,但是您可以使用Lexx和Yacc解析器(例如Bison)来生成所需的解析器.
http://dinosaur.compilertools.net/ [ ^ ]
这是非常强大的功能,但是您需要使用C与C ++代码进行接口,但这是可能的.
我本人已经为类似HTML的语言完成了XML兼容的解析器.
http://oreilly.com/catalog/9781565920002 [ http://epaperpress.com/lexandyacc/download/lexyacc.pdf [
This might be a bit out of your scope but you could use a Lexx and Yacc parser such as Bison to generate a parser for what you need.
http://dinosaur.compilertools.net/[^]
This is very powerful but you''ll need to use C to interface with your C++ code but it is possible.
I myself have done an XML compliant parser for an HTML like language.
http://oreilly.com/catalog/9781565920002[^]
I used this book to explain about the concepts and it was very helpful in starting off the parser.
http://epaperpress.com/lexandyacc/download/lexyacc.pdf[^]
this was also very useful.
这篇关于我如何使用C ++编程语言源代码对给定的正则表达式隐含词法分析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文