mal-toolbox 1.2.0__py3-none-any.whl → 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ import logging
8
8
  import zipfile
9
9
  from dataclasses import dataclass, field
10
10
  from functools import cached_property
11
- from typing import Any, Literal
11
+ from typing import Any, Literal, Optional
12
12
 
13
13
  from maltoolbox.file_utils import (
14
14
  load_dict_from_json_file,
@@ -361,12 +361,12 @@ class LanguageGraphAssociation:
361
361
 
362
362
  @dataclass
363
363
  class LanguageGraphAttackStep:
364
- """An attack step belonging to an asset type in the MAL language
365
- """
364
+ """An attack step belonging to an asset type in the MAL language"""
366
365
 
367
366
  name: str
368
367
  type: Literal["or", "and", "defense", "exist", "notExist"]
369
368
  asset: LanguageGraphAsset
369
+ causal_mode: Optional[Literal["action", "effect"]] = None
370
370
  ttc: dict | None = field(default_factory=dict)
371
371
  overrides: bool = False
372
372
 
@@ -475,8 +475,6 @@ class LanguageGraphAttackStep:
475
475
  requirements.extend(self.inherits.requires)
476
476
  return requirements
477
477
 
478
- def __repr__(self) -> str:
479
- return str(self.to_dict())
480
478
 
481
479
 
482
480
  class ExpressionsChain:
@@ -836,6 +834,7 @@ class LanguageGraph:
836
834
  name=step['name'],
837
835
  type=step['type'],
838
836
  asset=a_node,
837
+ causal_mode=step.get('causal_mode'),
839
838
  ttc=step['ttc'],
840
839
  overrides=step['overrides'],
841
840
  own_children={}, own_parents={},
@@ -1516,6 +1515,7 @@ class LanguageGraph:
1516
1515
  name=step_dict['name'],
1517
1516
  type=step_dict['type'],
1518
1517
  asset=asset,
1518
+ causal_mode=step_dict.get('causal_mode'),
1519
1519
  ttc=step_dict['ttc'],
1520
1520
  overrides=(
1521
1521
  step_dict['reaches']['overrides']
@@ -1555,6 +1555,7 @@ class LanguageGraph:
1555
1555
  name=super_step.name,
1556
1556
  type=super_step.type,
1557
1557
  asset=asset,
1558
+ causal_mode=step_dict.get('causal_mode'),
1558
1559
  ttc=super_step.ttc,
1559
1560
  overrides=False,
1560
1561
  own_children={},
@@ -88,7 +88,7 @@ def render_attack_graph(attack_graph: AttackGraph, path: Optional[PathLike] = No
88
88
  assert attack_graph.model, "Attack graph needs a model"
89
89
 
90
90
  name = attack_graph.model.name + "-attack_graph"
91
- dot = graphviz.Graph(name)
91
+ dot = graphviz.Digraph(name)
92
92
  dot.graph_attr["nodesep"] = "3.0"
93
93
  dot.graph_attr["ratio"] = "compress"
94
94
 
@@ -123,7 +123,7 @@ def render_attack_graph(attack_graph: AttackGraph, path: Optional[PathLike] = No
123
123
  # Create edges
124
124
  for parent in attack_graph.nodes.values():
125
125
  for child in parent.children:
126
- dot.edge(str(parent.id), str(child.id))
126
+ dot.edge(str(parent.id), str(child.id), arrowhead="normal")
127
127
 
128
128
  directory, filename = _resolve_graphviz_path(path, name)
129
129
  dot.render(directory=directory, filename=f"{filename}.gv", view=view, format="pdf")
@@ -1,232 +0,0 @@
1
- # mypy: ignore-errors
2
- # Generated from mal.g4 by ANTLR 4.13.2
3
- import sys
4
-
5
- from antlr4 import *
6
-
7
- if sys.version_info[1] > 5:
8
- from typing import TextIO
9
- else:
10
- from typing.io import TextIO
11
-
12
-
13
- def serializedATN():
14
- return [
15
- 4, 0, 51, 332, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5,
16
- 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2,
17
- 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7,
18
- 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2,
19
- 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7,
20
- 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2,
21
- 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7,
22
- 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 1, 0, 1, 0, 1, 0,
23
- 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2,
24
- 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
25
- 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5,
26
- 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 5, 8,
27
- 170, 8, 8, 10, 8, 12, 8, 173, 9, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 3, 9, 182, 8,
28
- 9, 1, 9, 3, 9, 185, 8, 9, 1, 9, 1, 9, 5, 9, 189, 8, 9, 10, 9, 12, 9, 192, 9, 9, 1, 9, 1, 9,
29
- 1, 9, 1, 9, 1, 10, 4, 10, 199, 8, 10, 11, 10, 12, 10, 200, 1, 11, 5, 11, 204, 8, 11, 10,
30
- 11, 12, 11, 207, 9, 11, 1, 11, 1, 11, 4, 11, 211, 8, 11, 11, 11, 12, 11, 212, 1, 12, 1,
31
- 12, 1, 13, 1, 13, 1, 14, 1, 14, 1, 15, 1, 15, 1, 16, 4, 16, 224, 8, 16, 11, 16, 12, 16,
32
- 225, 1, 17, 1, 17, 1, 18, 1, 18, 1, 19, 1, 19, 1, 20, 1, 20, 1, 21, 1, 21, 1, 22, 1, 22,
33
- 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 26, 1, 26, 1, 27,
34
- 1, 27, 1, 28, 1, 28, 1, 29, 1, 29, 1, 30, 1, 30, 1, 31, 1, 31, 1, 31, 1, 32, 1, 32, 1, 32,
35
- 1, 33, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38,
36
- 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 40, 1, 41, 1, 41, 1, 41, 1, 42, 1, 42, 1, 42, 1, 43,
37
- 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48,
38
- 1, 48, 1, 48, 1, 48, 5, 48, 308, 8, 48, 10, 48, 12, 48, 311, 9, 48, 1, 48, 1, 48, 1, 49,
39
- 1, 49, 1, 49, 1, 49, 5, 49, 319, 8, 49, 10, 49, 12, 49, 322, 9, 49, 1, 49, 1, 49, 1, 49,
40
- 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 50, 1, 320, 0, 51, 1, 1, 3, 2, 5, 3, 7, 4, 9, 5, 11,
41
- 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 15, 31, 16, 33, 17,
42
- 35, 18, 37, 19, 39, 20, 41, 21, 43, 22, 45, 23, 47, 24, 49, 25, 51, 26, 53, 27, 55, 28,
43
- 57, 29, 59, 30, 61, 31, 63, 32, 65, 33, 67, 34, 69, 35, 71, 36, 73, 37, 75, 38, 77, 39,
44
- 79, 40, 81, 41, 83, 42, 85, 43, 87, 44, 89, 45, 91, 46, 93, 47, 95, 48, 97, 49, 99, 50,
45
- 101, 51, 1, 0, 7, 4, 0, 10, 10, 13, 13, 34, 34, 92, 92, 1, 0, 34, 34, 2, 0, 10, 10, 13,
46
- 13, 1, 0, 48, 57, 4, 0, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 33, 33, 3, 0, 9, 10, 13,
47
- 13, 32, 32, 343, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9,
48
- 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19,
49
- 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29,
50
- 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39,
51
- 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49,
52
- 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59,
53
- 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69,
54
- 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79,
55
- 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89,
56
- 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99,
57
- 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 1, 103, 1, 0, 0, 0, 3, 112, 1, 0, 0, 0, 5, 118, 1, 0, 0, 0,
58
- 7, 131, 1, 0, 0, 0, 9, 139, 1, 0, 0, 0, 11, 147, 1, 0, 0, 0, 13, 156, 1, 0, 0, 0, 15, 161,
59
- 1, 0, 0, 0, 17, 165, 1, 0, 0, 0, 19, 176, 1, 0, 0, 0, 21, 198, 1, 0, 0, 0, 23, 205, 1, 0,
60
- 0, 0, 25, 214, 1, 0, 0, 0, 27, 216, 1, 0, 0, 0, 29, 218, 1, 0, 0, 0, 31, 220, 1, 0, 0, 0,
61
- 33, 223, 1, 0, 0, 0, 35, 227, 1, 0, 0, 0, 37, 229, 1, 0, 0, 0, 39, 231, 1, 0, 0, 0, 41, 233,
62
- 1, 0, 0, 0, 43, 235, 1, 0, 0, 0, 45, 237, 1, 0, 0, 0, 47, 239, 1, 0, 0, 0, 49, 243, 1, 0,
63
- 0, 0, 51, 247, 1, 0, 0, 0, 53, 249, 1, 0, 0, 0, 55, 251, 1, 0, 0, 0, 57, 253, 1, 0, 0, 0,
64
- 59, 255, 1, 0, 0, 0, 61, 257, 1, 0, 0, 0, 63, 259, 1, 0, 0, 0, 65, 262, 1, 0, 0, 0, 67, 265,
65
- 1, 0, 0, 0, 69, 268, 1, 0, 0, 0, 71, 270, 1, 0, 0, 0, 73, 272, 1, 0, 0, 0, 75, 274, 1, 0,
66
- 0, 0, 77, 276, 1, 0, 0, 0, 79, 279, 1, 0, 0, 0, 81, 281, 1, 0, 0, 0, 83, 284, 1, 0, 0, 0,
67
- 85, 287, 1, 0, 0, 0, 87, 290, 1, 0, 0, 0, 89, 292, 1, 0, 0, 0, 91, 294, 1, 0, 0, 0, 93, 296,
68
- 1, 0, 0, 0, 95, 298, 1, 0, 0, 0, 97, 302, 1, 0, 0, 0, 99, 314, 1, 0, 0, 0, 101, 328, 1, 0,
69
- 0, 0, 103, 104, 5, 97, 0, 0, 104, 105, 5, 98, 0, 0, 105, 106, 5, 115, 0, 0, 106, 107,
70
- 5, 116, 0, 0, 107, 108, 5, 114, 0, 0, 108, 109, 5, 97, 0, 0, 109, 110, 5, 99, 0, 0, 110,
71
- 111, 5, 116, 0, 0, 111, 2, 1, 0, 0, 0, 112, 113, 5, 97, 0, 0, 113, 114, 5, 115, 0, 0, 114,
72
- 115, 5, 115, 0, 0, 115, 116, 5, 101, 0, 0, 116, 117, 5, 116, 0, 0, 117, 4, 1, 0, 0, 0,
73
- 118, 119, 5, 97, 0, 0, 119, 120, 5, 115, 0, 0, 120, 121, 5, 115, 0, 0, 121, 122, 5, 111,
74
- 0, 0, 122, 123, 5, 99, 0, 0, 123, 124, 5, 105, 0, 0, 124, 125, 5, 97, 0, 0, 125, 126,
75
- 5, 116, 0, 0, 126, 127, 5, 105, 0, 0, 127, 128, 5, 111, 0, 0, 128, 129, 5, 110, 0, 0,
76
- 129, 130, 5, 115, 0, 0, 130, 6, 1, 0, 0, 0, 131, 132, 5, 101, 0, 0, 132, 133, 5, 120,
77
- 0, 0, 133, 134, 5, 116, 0, 0, 134, 135, 5, 101, 0, 0, 135, 136, 5, 110, 0, 0, 136, 137,
78
- 5, 100, 0, 0, 137, 138, 5, 115, 0, 0, 138, 8, 1, 0, 0, 0, 139, 140, 5, 105, 0, 0, 140,
79
- 141, 5, 110, 0, 0, 141, 142, 5, 99, 0, 0, 142, 143, 5, 108, 0, 0, 143, 144, 5, 117, 0,
80
- 0, 144, 145, 5, 100, 0, 0, 145, 146, 5, 101, 0, 0, 146, 10, 1, 0, 0, 0, 147, 148, 5, 99,
81
- 0, 0, 148, 149, 5, 97, 0, 0, 149, 150, 5, 116, 0, 0, 150, 151, 5, 101, 0, 0, 151, 152,
82
- 5, 103, 0, 0, 152, 153, 5, 111, 0, 0, 153, 154, 5, 114, 0, 0, 154, 155, 5, 121, 0, 0,
83
- 155, 12, 1, 0, 0, 0, 156, 157, 5, 105, 0, 0, 157, 158, 5, 110, 0, 0, 158, 159, 5, 102,
84
- 0, 0, 159, 160, 5, 111, 0, 0, 160, 14, 1, 0, 0, 0, 161, 162, 5, 108, 0, 0, 162, 163, 5,
85
- 101, 0, 0, 163, 164, 5, 116, 0, 0, 164, 16, 1, 0, 0, 0, 165, 171, 5, 34, 0, 0, 166, 170,
86
- 8, 0, 0, 0, 167, 168, 5, 92, 0, 0, 168, 170, 9, 0, 0, 0, 169, 166, 1, 0, 0, 0, 169, 167,
87
- 1, 0, 0, 0, 170, 173, 1, 0, 0, 0, 171, 169, 1, 0, 0, 0, 171, 172, 1, 0, 0, 0, 172, 174,
88
- 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 174, 175, 5, 34, 0, 0, 175, 18, 1, 0, 0, 0, 176, 177,
89
- 5, 34, 0, 0, 177, 178, 5, 34, 0, 0, 178, 179, 5, 34, 0, 0, 179, 190, 1, 0, 0, 0, 180, 182,
90
- 5, 34, 0, 0, 181, 180, 1, 0, 0, 0, 181, 182, 1, 0, 0, 0, 182, 184, 1, 0, 0, 0, 183, 185,
91
- 5, 34, 0, 0, 184, 183, 1, 0, 0, 0, 184, 185, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 189,
92
- 8, 1, 0, 0, 187, 189, 7, 2, 0, 0, 188, 181, 1, 0, 0, 0, 188, 187, 1, 0, 0, 0, 189, 192,
93
- 1, 0, 0, 0, 190, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 193, 1, 0, 0, 0, 192, 190,
94
- 1, 0, 0, 0, 193, 194, 5, 34, 0, 0, 194, 195, 5, 34, 0, 0, 195, 196, 5, 34, 0, 0, 196, 20,
95
- 1, 0, 0, 0, 197, 199, 7, 3, 0, 0, 198, 197, 1, 0, 0, 0, 199, 200, 1, 0, 0, 0, 200, 198,
96
- 1, 0, 0, 0, 200, 201, 1, 0, 0, 0, 201, 22, 1, 0, 0, 0, 202, 204, 7, 3, 0, 0, 203, 202, 1,
97
- 0, 0, 0, 204, 207, 1, 0, 0, 0, 205, 203, 1, 0, 0, 0, 205, 206, 1, 0, 0, 0, 206, 208, 1,
98
- 0, 0, 0, 207, 205, 1, 0, 0, 0, 208, 210, 3, 69, 34, 0, 209, 211, 7, 3, 0, 0, 210, 209,
99
- 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 24, 1,
100
- 0, 0, 0, 214, 215, 5, 69, 0, 0, 215, 26, 1, 0, 0, 0, 216, 217, 5, 67, 0, 0, 217, 28, 1,
101
- 0, 0, 0, 218, 219, 5, 73, 0, 0, 219, 30, 1, 0, 0, 0, 220, 221, 5, 65, 0, 0, 221, 32, 1,
102
- 0, 0, 0, 222, 224, 7, 4, 0, 0, 223, 222, 1, 0, 0, 0, 224, 225, 1, 0, 0, 0, 225, 223, 1,
103
- 0, 0, 0, 225, 226, 1, 0, 0, 0, 226, 34, 1, 0, 0, 0, 227, 228, 5, 40, 0, 0, 228, 36, 1, 0,
104
- 0, 0, 229, 230, 5, 41, 0, 0, 230, 38, 1, 0, 0, 0, 231, 232, 5, 123, 0, 0, 232, 40, 1, 0,
105
- 0, 0, 233, 234, 5, 125, 0, 0, 234, 42, 1, 0, 0, 0, 235, 236, 5, 35, 0, 0, 236, 44, 1, 0,
106
- 0, 0, 237, 238, 5, 58, 0, 0, 238, 46, 1, 0, 0, 0, 239, 240, 5, 60, 0, 0, 240, 241, 5, 45,
107
- 0, 0, 241, 242, 5, 45, 0, 0, 242, 48, 1, 0, 0, 0, 243, 244, 5, 45, 0, 0, 244, 245, 5, 45,
108
- 0, 0, 245, 246, 5, 62, 0, 0, 246, 50, 1, 0, 0, 0, 247, 248, 5, 91, 0, 0, 248, 52, 1, 0,
109
- 0, 0, 249, 250, 5, 93, 0, 0, 250, 54, 1, 0, 0, 0, 251, 252, 5, 42, 0, 0, 252, 56, 1, 0,
110
- 0, 0, 253, 254, 5, 49, 0, 0, 254, 58, 1, 0, 0, 0, 255, 256, 5, 61, 0, 0, 256, 60, 1, 0,
111
- 0, 0, 257, 258, 5, 45, 0, 0, 258, 62, 1, 0, 0, 0, 259, 260, 5, 47, 0, 0, 260, 261, 5, 92,
112
- 0, 0, 261, 64, 1, 0, 0, 0, 262, 263, 5, 92, 0, 0, 263, 264, 5, 47, 0, 0, 264, 66, 1, 0,
113
- 0, 0, 265, 266, 5, 46, 0, 0, 266, 267, 5, 46, 0, 0, 267, 68, 1, 0, 0, 0, 268, 269, 5, 46,
114
- 0, 0, 269, 70, 1, 0, 0, 0, 270, 271, 5, 38, 0, 0, 271, 72, 1, 0, 0, 0, 272, 273, 5, 124,
115
- 0, 0, 273, 74, 1, 0, 0, 0, 274, 275, 5, 33, 0, 0, 275, 76, 1, 0, 0, 0, 276, 277, 5, 33,
116
- 0, 0, 277, 278, 5, 69, 0, 0, 278, 78, 1, 0, 0, 0, 279, 280, 5, 64, 0, 0, 280, 80, 1, 0,
117
- 0, 0, 281, 282, 5, 60, 0, 0, 282, 283, 5, 45, 0, 0, 283, 82, 1, 0, 0, 0, 284, 285, 5, 43,
118
- 0, 0, 285, 286, 5, 62, 0, 0, 286, 84, 1, 0, 0, 0, 287, 288, 5, 45, 0, 0, 288, 289, 5, 62,
119
- 0, 0, 289, 86, 1, 0, 0, 0, 290, 291, 5, 44, 0, 0, 291, 88, 1, 0, 0, 0, 292, 293, 5, 43,
120
- 0, 0, 293, 90, 1, 0, 0, 0, 294, 295, 5, 47, 0, 0, 295, 92, 1, 0, 0, 0, 296, 297, 5, 94,
121
- 0, 0, 297, 94, 1, 0, 0, 0, 298, 299, 5, 47, 0, 0, 299, 300, 5, 47, 0, 0, 300, 301, 5, 33,
122
- 0, 0, 301, 96, 1, 0, 0, 0, 302, 303, 5, 47, 0, 0, 303, 304, 5, 47, 0, 0, 304, 305, 1, 0,
123
- 0, 0, 305, 309, 8, 5, 0, 0, 306, 308, 8, 2, 0, 0, 307, 306, 1, 0, 0, 0, 308, 311, 1, 0,
124
- 0, 0, 309, 307, 1, 0, 0, 0, 309, 310, 1, 0, 0, 0, 310, 312, 1, 0, 0, 0, 311, 309, 1, 0,
125
- 0, 0, 312, 313, 6, 48, 0, 0, 313, 98, 1, 0, 0, 0, 314, 315, 5, 47, 0, 0, 315, 316, 5, 42,
126
- 0, 0, 316, 320, 1, 0, 0, 0, 317, 319, 9, 0, 0, 0, 318, 317, 1, 0, 0, 0, 319, 322, 1, 0,
127
- 0, 0, 320, 321, 1, 0, 0, 0, 320, 318, 1, 0, 0, 0, 321, 323, 1, 0, 0, 0, 322, 320, 1, 0,
128
- 0, 0, 323, 324, 5, 42, 0, 0, 324, 325, 5, 47, 0, 0, 325, 326, 1, 0, 0, 0, 326, 327, 6,
129
- 49, 0, 0, 327, 100, 1, 0, 0, 0, 328, 329, 7, 6, 0, 0, 329, 330, 1, 0, 0, 0, 330, 331, 6,
130
- 50, 0, 0, 331, 102, 1, 0, 0, 0, 13, 0, 169, 171, 181, 184, 188, 190, 200, 205, 212,
131
- 225, 309, 320, 1, 6, 0, 0
132
- ]
133
-
134
-
135
- class malLexer(Lexer):
136
-
137
- atn = ATNDeserializer().deserialize(serializedATN())
138
-
139
- decisionsToDFA = [DFA(ds, i) for i, ds in enumerate(atn.decisionToState)]
140
-
141
- ABSTRACT = 1
142
- ASSET = 2
143
- ASSOCIATIONS = 3
144
- EXTENDS = 4
145
- INCLUDE = 5
146
- CATEGORY = 6
147
- INFO = 7
148
- LET = 8
149
- STRING = 9
150
- MULTILINE_STRING = 10
151
- INT = 11
152
- FLOAT = 12
153
- EXISTS = 13
154
- C = 14
155
- I = 15
156
- A = 16
157
- ID = 17
158
- LPAREN = 18
159
- RPAREN = 19
160
- LCURLY = 20
161
- RCURLY = 21
162
- HASH = 22
163
- COLON = 23
164
- LARROW = 24
165
- RARROW = 25
166
- LSQUARE = 26
167
- RSQUARE = 27
168
- STAR = 28
169
- ONE = 29
170
- ASSIGN = 30
171
- MINUS = 31
172
- INTERSECT = 32
173
- UNION = 33
174
- RANGE = 34
175
- DOT = 35
176
- AND = 36
177
- OR = 37
178
- EXCLAMATION = 38
179
- NOTEXISTS = 39
180
- AT = 40
181
- REQUIRES = 41
182
- INHERITS = 42
183
- LEADSTO = 43
184
- COMMA = 44
185
- PLUS = 45
186
- DIVIDE = 46
187
- POWER = 47
188
- EXCLM_COMM = 48
189
- INLINE_COMMENT = 49
190
- MULTILINE_COMMENT = 50
191
- WS = 51
192
-
193
- channelNames = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN"]
194
-
195
- modeNames = ["DEFAULT_MODE"]
196
-
197
- literalNames = ["<INVALID>",
198
- "'abstract'", "'asset'", "'associations'", "'extends'", "'include'",
199
- "'category'", "'info'", "'let'", "'E'", "'C'", "'I'", "'A'",
200
- "'('", "')'", "'{'", "'}'", "'#'", "':'", "'<--'", "'-->'",
201
- "'['", "']'", "'*'", "'1'", "'='", "'-'", "'/\\'", "'\\/'",
202
- "'..'", "'.'", "'&'", "'|'", "'!'", "'!E'", "'@'", "'<-'", "'+>'",
203
- "'->'", "','", "'+'", "'/'", "'^'", "'//!'"]
204
-
205
- symbolicNames = ["<INVALID>",
206
- "ABSTRACT", "ASSET", "ASSOCIATIONS", "EXTENDS", "INCLUDE", "CATEGORY",
207
- "INFO", "LET", "STRING", "MULTILINE_STRING", "INT", "FLOAT",
208
- "EXISTS", "C", "I", "A", "ID", "LPAREN", "RPAREN", "LCURLY",
209
- "RCURLY", "HASH", "COLON", "LARROW", "RARROW", "LSQUARE", "RSQUARE",
210
- "STAR", "ONE", "ASSIGN", "MINUS", "INTERSECT", "UNION", "RANGE",
211
- "DOT", "AND", "OR", "EXCLAMATION", "NOTEXISTS", "AT", "REQUIRES",
212
- "INHERITS", "LEADSTO", "COMMA", "PLUS", "DIVIDE", "POWER", "EXCLM_COMM",
213
- "INLINE_COMMENT", "MULTILINE_COMMENT", "WS"]
214
-
215
- ruleNames = ["ABSTRACT", "ASSET", "ASSOCIATIONS", "EXTENDS", "INCLUDE",
216
- "CATEGORY", "INFO", "LET", "STRING", "MULTILINE_STRING",
217
- "INT", "FLOAT", "EXISTS", "C", "I", "A", "ID", "LPAREN",
218
- "RPAREN", "LCURLY", "RCURLY", "HASH", "COLON", "LARROW",
219
- "RARROW", "LSQUARE", "RSQUARE", "STAR", "ONE", "ASSIGN",
220
- "MINUS", "INTERSECT", "UNION", "RANGE", "DOT", "AND",
221
- "OR", "EXCLAMATION", "NOTEXISTS", "AT", "REQUIRES", "INHERITS",
222
- "LEADSTO", "COMMA", "PLUS", "DIVIDE", "POWER", "EXCLM_COMM",
223
- "INLINE_COMMENT", "MULTILINE_COMMENT", "WS"]
224
-
225
- grammarFileName = "mal.g4"
226
-
227
- def __init__(self, input=None, output: TextIO = sys.stdout):
228
- super().__init__(input, output)
229
- self.checkVersion("4.13.2")
230
- self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
231
- self._actions = None
232
- self._predicates = None