我看到了http://matt.might.net/teaching/compilers/spring-2015/说 Python 3.4 是 LL(1)
Python 3.5 的语法是否仍然是 LL(1),因此可以编写递归下降解析器?
最佳答案
是的。这是一种故意的语言特性,而不仅仅是碰巧发生的事情。 PEP 3099明确拒绝对 Python 2 -> 3 转换的任何更改(比任何 3.x -> 3.y 都大得多的转换):
The parser won't be more complex than LL(1).
Simple is better than complex. This idea extends to the parser. Restricting Python's grammar to an LL(1) parser is a blessing, not a curse. It puts us in handcuffs that prevent us from going overboard and ending up with funky grammar rules like some other dynamic languages that will go unnamed, such as Perl.
关于python - Python 3.5 的语法是 LL(1) 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31637435/