Constant 常量
1. 结构声明
- TS Declaration
- JSON Schema
class Constant extends BaseNode {
name: string = '';
description: string;
typeAnnotation: TypeAnnotation;
defaultValue: string;
}
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
},
"defaultValue": {
"type": "string"
}
},
"required": [
"name",
"description",
"typeAnnotation",
"defaultValue"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "Constant",
"name": "MAX_COUNT",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
},
"defaultValue": "1000"
}
concept: Constant
name: MAX_COUNT
description: ""
typeAnnotation:
concept: TypeAnnotation
typeKind: primitive
typeNamespace: nasl.core
typeName: Long
inferred: false
ruleMap: {}
defaultValue: "1000"