组合器(Combinators):组合两个或更多的选择器,逐层递进地选择。 多重选择器(Multiple selectors):将以逗号分隔开的多个选择器放在一个CSS规则下...
基于6个网页-相关网页
Child Combinators 子选择器
Sibling Combinators 兄弟选择器
Descendant Combinators 后代选择器
Parser combinators 解析器连接符
Functional Combinators 函数组合子
fixed point combinators 不动点算子
the fixed-point combinators 不动点组合算子
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的函数性方面构建的。
To change it to produce instances of our case class AST hierarchy (Expr objects), the return type of the combinators has to be changed to be Parser[Expr].
要将它更改为生成 case 类 AST 层次结构的实例(Expr 对象),组合子的返回类型必须更改为 Parser[Expr]。
If you make that change on its own, it will fail to compile; the three combinators know how to take in Strings but not how to produce Expr objects from what's parsed.
如果让它自行更改,编译将会失败;这三个组合子知道如何获取String,但不知道如何根据解析的内容生成Expr对象。
应用推荐