In either case, a grammar is declared in a manner similar to those created to parse artificial languages.
不论在哪种情况下,语法规则的声明都类似于解析人工语言的语法声明。
Parser generators take the grammar of a language and generate code to parse it.
分析器产生器的作用是接收一门语言的文法并产生代码以分析该语言。
We will now showcase specific abilities of the Parse: : RecDescent grammar by adding on to the UI features from a simple event loop and a simple user interface.
现在,通过在简单事件循环和简单用户界面的UI功能基础上再增加一些功能,我们将具体展示Parse:RecDescent文法所具有的特定能力。
The downside of Parse: : RecDescent is that it is moderately slow because it USES extensible grammar rules and on-the-fly lexing and parsing.
RecDescent的缺点是:由于它使用可扩展文法规则并且实时地进行记载和解析,所以比较慢。
This means that if yacc would have to read two tokens before it knew which action to take, it would be unable to parse this grammar.
这就意味着,如果yacc 在知道采取哪个动作之前,必须读取两个标记,那么它将无法解析该语法。
Xpand was then used to parse and translate the grammar into a HashMap-based data structure.
接下来,使用Xpand解析语法并将其转换为基于HashMap的数据结构。
This set of compiled schemas is stored in the grammar pool, and in the subsequent parse is provided to the Xerces2 validator as the initial set of grammars (as described in step 2).
这些编译模式保存在语法池中,在后续的解析中提供给Xerces2验证程序作为初始语法(如第2步所述)。
Also note that the user doesn't need to define grammar for such trivial stuff: Spirit already has the predefined parser real_p to parse real Numbers.
注意,用户并不需要为此类琐碎的操作定义语法:Spirit已经提供了预定义的parser real _ p来解析实数。
In addition, the stat-comments.pl script USES the Lingua: : en: : Fathom module to analyze the comments parsed out by the parse: : RecDescent grammar.
另外,stat - comments . pl脚本使用Lingua:EN:Fathom模块来分析由Parse:RecDescent文法解析出的注释。
At some point when the grammar gets quite complicated, it is desirable to visualize the parse traversal and see what's happening.
当语法变得足够复杂的某一点时,最好进行可视化的分析遍历,看看发生了什么。
At some point when the grammar gets quite complicated, it is desirable to visualize the parse traversal and see what's happening.
当语法变得足够复杂的某一点时,最好进行可视化的分析遍历,看看发生了什么。
应用推荐