NumericLiteral 数字字面量
1. 结构声明
- TS Declaration
- JSON Schema
class NumericLiteral extends LogicItem {
value: string;
typeAnnotation: TypeAnnotation;
}
{
"type": "object",
"properties": {
"composedBy": {
"type": "array",
"items": {
"type": "string"
}
},
"label": {
"type": "string"
},
"description": {
"type": "string"
},
"folded": {
"type": "boolean"
},
"offsetX": {
"type": "number"
},
"offsetY": {
"type": "number"
},
"value": {
"type": "string"
},
"typeAnnotation": {
"$ref": "#/definitions/TypeAnnotation"
}
},
"required": [
"value",
"typeAnnotation"
],
"additionalProperties": false
}
2. 节点示例
(1) 示例
AST 如下:
- JSON
- YAML
{
"concept": "NumericLiteral",
"value": "24",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeNamespace": "nasl.core",
"typeKind": "primitive",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
}
}
concept: NumericLiteral
value: "24"
typeAnnotation:
concept: TypeAnnotation
typeNamespace: nasl.core
typeKind: primitive
typeName: Long
inferred: false
ruleMap: {}
对应的代码如下:
- 文本化 NASL
24