通常在语法的一开始或结束时通常会消耗空格吗?

发布于 2025-02-11 14:46:47 字数 161 浏览 0 评论 0原文

我已经开始使用FPARSEC。这是我第一次使用“语法”编写解析器,而不仅仅是编码行为。我试图弄清楚通常如何处理空白:在任何给定语法的开始时?在最后?取决于?为什么?

例如,符号识别器是否应该在“ ... ABC ...”中解析领先的白色空间,还是应该被以前的语法消费?

I've started using FParsec. This is the first time i'm writing a parser using "grammar" and not just coding the behaviour. I'm trying to figure out how white space should generally be treated: At start of any given syntax? At the end? Depends? And why?

For example, should SymbolIdentifier parse the leading white space in "... abc ...", or should it be consumed by a previous syntax?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文