MPS 生成器 - 是否可以引用外部语言的标签?
MPS Generator - is it possible to reference an external language's label?
例如,我有语言生成器:
1) A -> baseLanguage
a) defines a concept `a1`
b) defines a label `a1ToClass`, in: `a1` of `A`, out: `ClassConcept` of `baseLanguage`
2) B -> A
a) defines a concept `b1`
b) defines a label `b1ToA1`, in: `b1` of `B`, out: `a1` of `A`
是否可以通过以下形式从后一个生成器中引用标签 a1ToClass
?
node<b1> b1Instance = getB1InstanceNode();
node<a1> a1Instance = genContext.get output by label "b1ToA1" and input `b1Instance`;
node<ClassConcept> classConceptInstance = genContext.get output by label "a1ToClass" and input `a1Instance`;
是的,
您需要 B 生成器对 A 生成器的 "Design" 依赖。然后映射标签可见。
瓦茨拉夫
例如,我有语言生成器:
1) A -> baseLanguage
a) defines a concept `a1`
b) defines a label `a1ToClass`, in: `a1` of `A`, out: `ClassConcept` of `baseLanguage`
2) B -> A
a) defines a concept `b1`
b) defines a label `b1ToA1`, in: `b1` of `B`, out: `a1` of `A`
是否可以通过以下形式从后一个生成器中引用标签 a1ToClass
?
node<b1> b1Instance = getB1InstanceNode();
node<a1> a1Instance = genContext.get output by label "b1ToA1" and input `b1Instance`;
node<ClassConcept> classConceptInstance = genContext.get output by label "a1ToClass" and input `a1Instance`;
是的,
您需要 B 生成器对 A 生成器的 "Design" 依赖。然后映射标签可见。
瓦茨拉夫