DefaultValue 默认值
1. 结构声明
- TS Declaration
- JSON Schema
class DefaultValue extends BaseNode {
expression?: LogicItem;
playground: Array<LogicItem>;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"expression": {
"$ref": "#/definitions/LogicItem"
},
"playground": {
"type": "array",
"items": {
"$ref": "#/definitions/LogicItem"
}
}
},
"required": [
"playground"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "DefaultValue",
"expression": {
"concept": "NumericLiteral",
"value": "120",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
}
},
"playground": []
}
concept: DefaultValue
expression:
concept: NumericLiteral
value: "120"
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Long
inferred: false
ruleMap: {}
playground: []
对应的代码如下:
- 文本化 NASL
- Natural TS
120
120