我希望内容辅助建议脚本中已声明的变量的名称。这是语法:
Script:
includes+=(Include)* assignments+=(Assignment)* g=GetLog? clock=Clock? tests+=Test*
;
Include:
'INCLUDE' includedScript=[Script|STRING]
;
Test:
'RUN' "(" name=STRING "," com=STRING "," association=STRING ")" '{' instructions+=Instruction* '}'
;
Instruction:
Set |
Get |
Verify |
Execute |
Wait |
Print |
Time |
SetTime |
PowerDown |
PowerUp |
GetIp |
GetLog
Set:
'SET' '(' attribute=AttributeRef ',' value=(AttributeValue ) ')'
;
Get :
'GET' '(' attribute=AttributeRef ')'
;
AttributeRef:
cosem=IDValue "." attributeRef =IDValue
;
cosem
在AttributeRef
部分是之前必须已经声明的部分。
例如,在此脚本中,当点击 Tariffication 时,内容辅助会显示 TarifficationScriptTable
TarifficationScriptTable = COSEM(9,0,"0.0.10.0.100.255")
RUN("CheckConnectivity", "HDLC", "LOCAL_MANAGEMENT") {
GET(Tariffi
最佳答案
这就是交叉引用的目的。您已经将它们用于脚本了。他们看起来像
nameOfTheReference=[TypeYouWantToReference]
这实际上是 for 的缩写
nameOfTheReference=[TypeYouWantToReference|ID]
这意味着“引用 TypeYouWantToReference 并解析 ID”
如果您有其他需要解析的规则,您可以使用
nameOfTheReference=[TypeYouWantToReference|OtherRULE]
关于java - Xtext 内容辅助配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41765013/