BindDirective 元素指令
下个版本迁移为 BindDirective。
1. 结构声明
- TS Declaration
- JSON Schema
class BindDirective extends BaseNode {
name: string = '';
rawName?: string;
type: 'string' | 'static' | 'dynamic';
value?: string;
expression?: LogicItem;
arg?: string;
modifiers?: string;
playground: Array<LogicItem>;
i18nKey?: uuid;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "string"
},
"rawName": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"string",
"static",
"dynamic"
]
},
"value": {
"type": "string"
},
"expression": {
"$ref": "#/definitions/LogicItem"
},
"arg": {
"type": "string"
},
"modifiers": {
"type": "string"
},
"playground": {
"type": "array",
"items": {
"$ref": "#/definitions/LogicItem"
}
},
"i18nKey": {
"$ref": "#/definitions/uuid"
}
},
"required": [
"name",
"type",
"playground"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "BindDirective",
"name": "if",
"type": "dynamic",
"expression": {
"concept": "Identifier",
"namespace": "",
"name": "visible"
},
"playground": []
}
concept: BindDirective
name: if
type: dynamic
expression:
concept: Identifier
namespace: ""
name: visible
playground: []
对应的代码如下:
- 文本化 NASL
- Natural TS
if: visible
_if: visible