图 15.1 模拟火星和地球围绕太阳旋转 解析器连接符(Parser combinators) 连接符库在函数式编程社区很流行,已用于许多任务。最著名的例子可能是 Parsec 库,用于创建解析器 [[Leijen, Meijer, 2001]。
基于4个网页-相关网页
In the meantime, let's explore Scala's third option for building parsers: parser combinators, built entirely from the functional side of Scala.
同时,我们来探索Scala构建解析器的第3个选项:解析器组合子(parser combinators),它完全是从Scala的函数性方面构建的。
Parsers "combine" to provide higher and higher levels of abstraction over the concept of parsing (hence the name "parser combinators"; elements which combine together to provide parsing behavior).
“组合”解析器可以提供解析概念的越来越高级的抽象(因此称为“解析器组合子”;组合在一起的元素提供解析行为)。
应用推荐