2024-05-15 19:44:09 发布
网友
python3.6.3的完整语法规范如下:https://docs.python.org/3/reference/grammar.html
它看起来像是由一些从正则表达式中提取的特殊构造附加的EBNF,例如:()*(重复零次或多次?)和()+(重复一次或多次?)。你知道吗
()*
()+
Python使用什么元语法?在哪里可以找到它的规范?你知道吗
Python的语法是在这个file中定义的(谢谢@larsks)。然而,问题仍然存在——使用什么符号?你知道吗
Python语法由源代码的Parser目录中的解析器解析。你可以在Makefile.pre中看到这一点。这将生成Include/graminit.[ch],用于Python/ast.c和Modules/parsermodule.c。你知道吗
Include/graminit.[ch]
Python/ast.c
Modules/parsermodule.c
语法的格式在bottom of pgen.c中描述:
Input is a grammar in extended BNF (using * for repetition, + for at-least-once repetition, [] for optional parts, | for alternatives and () for grouping).
Python语法由源代码的Parser目录中的解析器解析。你可以在Makefile.pre中看到这一点。这将生成
Include/graminit.[ch]
,用于Python/ast.c
和Modules/parsermodule.c
。你知道吗语法的格式在bottom of pgen.c中描述:
相关问题 更多 >
编程相关推荐