
获得徽章 18
In fact, EBNF is designed to mirror closely the actual code of a recursive-descent parser, so a grammar should always translated into EBNF if recursive-descent is to be used.
评论
1
Category theory for programmers, chapter 5.5 products & chapter 5.6 coproduct 这两个部分粗略的读了一下,需要回头细读。
评论
点赞
Indeed, the unrestricted(or type 0) grammars are equivalent to Turing Machines in the same regular grammars are equivalent to finite automata, and thus represent the most general kind of computation known. Context-free grammars also have a corresponding equivalent machine, called a pushdown automaton...
展开
评论
点赞
We have been using the term context-free without explaining why such rules a in fact "free of context". The simple reason is that the nonterminals appears by themselves to the left of the arrow in context-free rules. Thus, a rule A -> α says that A may be replaced by α anywhere, regardless of where the A occurs. On the other hand, we could informally define context as a pair of strings(of terminals and nonterminals) β, γ, such that a rule would apply only if β occurs before and γ occurs after the nonterminal. We would write this as βAγ -> βαγ. Such a rule in which α != ε is called a context-sensitive grammar rule. Context sensitive grammar rule are more powerful than context-free grammar rules but are also more difficult to use as the basis for a parser.
展开
1
2
Compiler construction: principles and practices.
Chapter 3.4.3 The Dangling Else Problem 没有仔细看,粗略的过了一下,有空要回头再看下。
Chapter 3.4.3 The Dangling Else Problem 没有仔细看,粗略的过了一下,有空要回头再看下。
评论
1
赞了这篇文章
赞了这篇文章
赞了这篇文章
赞了这篇文章
赞了这篇文章
It’s common to write a function where the types of the input relate to the type of the output, or where the types of two inputs are related in some way.
generics are used when input and output type have some relations, or two inputs have some relations.
generics are used when input and output type have some relations, or two inputs have some relations.
展开
2
点赞
Typescript 中的 interface 其实和 Java 中的 interface 很像,typescript 中的 type 其实和 Java 中的 class 很像。就是 interface 其实是可以 extends 的,但是 class 是不行的
4
点赞
赞了这篇文章
赞了这篇文章