GrGen.NET中规则的右边是如何执行的固定顺序? [英] Is there a fixed order of how the right-hand side of a rule is executed in GrGen.NET?
问题描述
规则的右侧(无论是修改还是替换)都可以包含各种各样的语句,例如eval,exec,emit,subpatterns,...
是否有这些语句被执行的定义顺序,或者它们是按照它们出现在右边的顺序执行的 - 手边?
PS:GrGen.NET是一个非常流行的图形转换库(在 http://grgen.net )基于.NET框架。如果有人能为GrGen.NET定义一个标签,那将是很酷的,我没有足够的声望:-)。干杯!
是的,有一个命令,它很重要!
<例如,exec语句总是在最后应用。因此,exec中没有变量可以传递给规则(参见如何在规则中执行脚本并将值传回给booggie 2中的规则?)。
执行顺序可以在GrGen.NET手册中找到,如下所示:
$ b $ ol <
The right-hand side of a rule (no matter if modify or replace) can contain all sorts of statements, e.g. eval, exec, emit, subpatterns, ...
Is there a defined order in which these statements are executed or are they just executed in the order they appear in the right-hand side?
P.S.: GrGen.NET is a quite popular graph transformation library (check it out on http://grgen.net) based on the .NET-framework. It would be cool if someone could define a Tag for GrGen.NET, I don't have enough reputation :-). Cheers!
Yes, there is an order and it matters!
For example, the exec-statement always applies at the end. Hence, no variable from exec can be passed to the rule (cf. to How can I execute a script in a rule and pass a value back to a rule in booggie 2?).
The order of execution can be found in the manual of GrGen.NET and is as follows:
- Extract elements needed from match
- Create new nodes
- Call rewrite code of used subpatterns (and evalhere, emithere, alternative Name, iterated Name)
- Call rewrite code of nested iterateds
- Call rewrite code of nested alternatives
- Redirect edges
- Retype (and merge) nodes
- Create new edges
- Retype edges
- Create subpatterns
- Attribute reevaluation
- Remove edges
- Remove nodes
- Remove subpatterns
- Emit / Exec
- Return
这篇关于GrGen.NET中规则的右边是如何执行的固定顺序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!