Skip to main content
Version: 3.4

Constant 常量

1. 结构声明

class Constant extends BaseNode {
name: string = '';
description: string;
typeAnnotation: TypeAnnotation;
defaultValue: DefaultValue;
}

2. 节点示例

(1) 示例

AST 如下:

{
"concept": "Constant",
"name": "MAX_COUNT",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
},
"defaultValue": {
"concept": "DefaultValue",
"expression": {
"concept": "NumericLiteral",
"value": "100",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeKind": "primitive",
"typeNamespace": "nasl.core",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
}
},
"playground": []
}
}