dragon-book-exercise-answers icon indicating copy to clipboard operation
dragon-book-exercise-answers copied to clipboard

Compilers Principles, Techniques, & Tools (purple dragon book) second edition exercise answers. 编译原理(紫龙书)第2版习题答案。

Results 115 dragon-book-exercise-answers issues
Sort by recently updated
recently updated
newest added

found this answer wrong

found something wrong in solution

![default](https://user-images.githubusercontent.com/18495430/31314566-22fb3a04-ac36-11e7-9a3b-7bf93ac53ea3.png) may be `if (lookahead == t)`

origin answer: \/\*([^*"]*|".*"|\*+[^/])*\*\/ 1.add \ in [^*"], i.e, [^*"] -> [^\*"] 2.remove * after [^*"], i.e, [^*"]* -> [^*"] 3.add (\*)* before the last occurrence of */ so, my answer...

考虑一个例子: `/* a\" */` 它是一个合法的评论却不符合答案所给的形式: `\/\*([^*"]*|".*"|\*+[^/])*\*\/`

One could easily see that it accepts the strings like _1010_ which has 1 and 0 repeated. The given solution seems to be accepting the language of strings of {0,1,2}...

Fix lost label in 2.8.1 exercise code

In state 0, the transfer state of the ε maybe 1 and 3