解析表达式的资源 [英] Resources on parsing expressions

查看:154
本文介绍了解析表达式的资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个程序,需要使用前缀表示法从表达式构建语法树。你会推荐什么资源,我会研究解析表达式?

解决方案

你的问题相当广泛。我会研究下列事情:





你最好的办法是尝试理解BNF和EBNF。从那里你可以继续编写递归下降的解析器(可以通过几个简单的规则轻松地从您的语法创建)。



此页这里谈论使用BNF的递归下降解析。


I'm writing a program that needs to build syntax trees from expressions in prefix notation. What resources would you recommend I look into to learn about parsing expressions?

解决方案

Your question is rather broad. I'd look into anything dealing with the following:

Your best bet is to try and understand BNF's and EBNF's. From there you can go on to writing recursive-descent parsers (they can be created easily from your grammars with a few simple rules).

This page here talks about recursive-descent parsing using BNF's.

这篇关于解析表达式的资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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