Skip to main content
Version: 3.5

Logic 逻辑

1. 结构声明

class Logic extends BaseNode {
name: string = '';
title?: string;
description?: string;
triggerType?: string;
cron?: string;
overridable?: boolean;
transactional?: Transactional;
typeParams?: Array<TypeParam>;
params: Array<Param>;
returns: Array<Return>;
variables: Array<Variable>;
body: Array<LogicItem>;
playground: Array<LogicItem>;
}

2. 节点示例

(1) 示例

AST 如下:

{
"concept": "Logic",
"name": "logic1",
"title": "标题",
"description": "",
"triggerType": "",
"cron": "",
"overridable": false,
"transactional": {
"concept": "Transactional",
"enabled": false,
"propagation": "REQUIRED",
"isolation": "DEFAULT"
},
"params": [
{
"concept": "Param",
"name": "param1",
"description": "",
"typeAnnotation": {
"concept": "TypeAnnotation",
"typeNamespace": "nasl.core",
"typeKind": "primitive",
"typeName": "Long",
"inferred": false,
"ruleMap": {}
},
"required": false
}
],
"returns": [],
"variables": [],
"body": [
{
"concept": "MemberExpression",
"object": {
"concept": "Identifier",
"namespace": "",
"name": "student"
},
"property": {
"concept": "Identifier",
"namespace": "",
"name": "name"
}
}
],
"playground": []
}