diff --git a/.gitignore b/.gitignore index 308fcab..40bc158 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ _obj/ dist/ *.egg-info *.whl +__pycache__/ # C artifacts *.a diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d5f5f8..12f1b88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.13) project(tree-sitter-mal - VERSION "0.1.0" + VERSION "0.2.0" DESCRIPTION "IT systems are growing in complexity and the threat from cyberattacks is increasing. Threat modeling is a process that can be used to analyze potential attacks to IT systems in order to facilitate secure design. Meta Attack Language (MAL) is a threat modeling language framework for the creation of domain specific languages (DSL). MAL is developed at KTH Royal Institute of Technolog" HOMEPAGE_URL "https://github.com/tobiky/tree-sitter-mal" LANGUAGES C) diff --git a/Cargo.toml b/Cargo.toml index 864f469..77b4f61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tree-sitter-mal" description = "IT systems are growing in complexity and the threat from cyberattacks is increasing. Threat modeling is a process that can be used to analyze potential attacks to IT systems in order to facilitate secure design. Meta Attack Language (MAL) is a threat modeling language framework for the creation of domain specific languages (DSL). MAL is developed at KTH Royal Institute of Technolog" -version = "0.1.0" +version = "0.2.0" authors = ["Andreas Hammarstrand "] license = "MIT" readme = "README.md" diff --git a/Makefile b/Makefile index 646c7fa..311a707 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ endif LANGUAGE_NAME := tree-sitter-mal HOMEPAGE_URL := https://github.com/tobiky/tree-sitter-mal -VERSION := 0.1.0 +VERSION := 0.2.0 # repository SRC_DIR := src diff --git a/examples/visitor/README.md b/examples/visitor/README.md new file mode 100644 index 0000000..995fcd6 --- /dev/null +++ b/examples/visitor/README.md @@ -0,0 +1,13 @@ +# Visitor Pattern Example +This example showcases how a visitor pattern can be built to use the MAL parser. + +# Running +1. Install [tree-sitter-cli](https://github.com/tree-sitter/tree-sitter/tree/master/cli) +2. Build the language in the project root folder using `tree-sitter build` +4. Navigate to `./examples/visitor/` + 1. Create a virtual environment `python -m venv venv` + 2. Activate the environment (e.g. `source ./venv/bin/activate`) + 3. Install dependencies `pip install -r requirements.txt` +6. Build the python dependency using `pip install -e ../..` (Path should direct to project root) +7. (Optional) swap between fast or simple visitor patterns by editing `main.py` imports +8. Execute the main file `python main.py` diff --git a/examples/visitor/distributions.py b/examples/visitor/distributions.py new file mode 100644 index 0000000..2339b92 --- /dev/null +++ b/examples/visitor/distributions.py @@ -0,0 +1,115 @@ +class DistributionsException(Exception): + def __init__(self, error_message): + self._error_message = error_message + super().__init__(self._error_message) + +class Distributions: + def validate(distribution_name: str, params: list) -> None: + match distribution_name: + case 'Bernoulli': + Bernoulli.validate(params) + case 'Binomial': + Binomial.validate(params) + case 'Exponential': + Exponential.validate(params) + case 'Gamma': + Gamma.validate(params) + case 'LogNormal': + LogNormal.validate(params) + case 'Pareto': + Pareto.validate(params) + case 'TruncatedNormal': + TruncatedNormal.validate(params) + case 'Uniform': + Uniform.validate(params) + case 'Enabled' | 'Disabled' | 'Zero' | 'Infinity' | 'EasyAndCertain' | \ + 'EasyAndUncertain' | 'HardAndCertain' | 'HardAndUncertain' | \ + 'VeryHardAndCertain' | 'VeryHardAndUncertain': + Combination.validate(params) + case _: + err_msg = f"Distribution {distribution_name} is not supported" + raise(DistributionsException(err_msg)) + +class Bernoulli: + def validate(params: list) -> None: + if (not params or len(params)!=1): + err_msg = "Expected exactly one parameter (probability), for Bernoulli distribution" + raise(DistributionsException(err_msg)) + if not 0<=params[0]<=1: + err_msg = f"{params[0]} is not in valid range '0 <= probability <= 1', for Bernoulli distribution" + raise(DistributionsException(err_msg)) + +class Binomial: + def validate(params: list) -> None: + if (not params or len(params)!=2): + err_msg = "Expected exactly two parameters (trials, probability), for Binomial distribution" + raise(DistributionsException(err_msg)) + if not 0<=params[1]<=1: + err_msg = f"{params[1]} is not in valid range '0 <= probability <= 1', for Binomial distribution" + raise(DistributionsException(err_msg)) + +class Exponential: + def validate(params: list) -> None: + if (not params or len(params)!=1): + err_msg = "Expected exactly one parameter (lambda), for Exponential distribution" + raise(DistributionsException(err_msg)) + if params[0]<=0: + err_msg = f"{params[0]} is not in valid range 'lambda > 0', for Exponential distribution" + raise(DistributionsException(err_msg)) + +class Gamma: + def validate(params: list) -> None: + if (not params or len(params)!=2): + err_msg = "Expected exactly two parameters (shape, scale), for Gamma distribution" + raise(DistributionsException(err_msg)) + if params[0]<=0: + err_msg = f"{params[0]} is not in valid range 'shape > 0', for Gamma distribution" + raise(DistributionsException(err_msg)) + if params[1]<=0: + err_msg = f"{params[1]} is not in valid range 'scale > 0', for Gamma distribution" + raise(DistributionsException(err_msg)) + +class LogNormal: + def validate(params: list) -> None: + if (not params or len(params)!=2): + err_msg = "Expected exactly two parameters (mean, standardDeviation), for LogNormal distribution" + raise(DistributionsException(err_msg)) + if params[1]<=0: + err_msg = f"{params[1]} is not in valid range 'standardDeviation > 0', for LogNormal distribution" + raise(DistributionsException(err_msg)) + +class Pareto: + def validate(params: list) -> None: + if (not params or len(params)!=2): + err_msg = "Expected exactly two parameters (min, shape), for Pareto distribution" + raise(DistributionsException(err_msg)) + if params[0]<=0: + err_msg = f"{params[0]} is not in valid range 'min > 0', for Pareto distribution" + raise(DistributionsException(err_msg)) + if params[1]<=0: + err_msg = f"{params[1]} is not in valid range 'shape > 0', for Pareto distribution" + raise(DistributionsException(err_msg)) + +class TruncatedNormal: + def validate(params: list) -> None: + if (not params or len(params)!=2): + err_msg = "Expected exactly two parameters (mean, standardDeviation), for TruncatedNormal distribution" + raise(DistributionsException(err_msg)) + if params[1]<=0: + err_msg = f"{params[1]} is not in valid range 'standardDeviation > 0', for TruncatedNormal distribution" + raise(DistributionsException(err_msg)) + +class Uniform: + def validate(params: list) -> None: + if (not params or len(params)!=2): + err_msg = "Expected exactly two parameters (min, max), for Uniform distribution" + raise(DistributionsException(err_msg)) + if params[0] > params[1]: + err_msg = f"({params[0]}, {params[1]}) does not meet requirement 'min <= max', for Uniform distribution" + raise(DistributionsException(err_msg)) + +class Combination: + def validate(params: list) -> None: + if (params and len(params)!=0): + err_msg = "Expected exactly zero parameters, for combination distributions" + raise(DistributionsException(err_msg)) diff --git a/examples/visitor/fast.py b/examples/visitor/fast.py new file mode 100644 index 0000000..78d2a5c --- /dev/null +++ b/examples/visitor/fast.py @@ -0,0 +1,1032 @@ +from tree_sitter import TreeCursor, Range +from typing import Tuple +from collections.abc import MutableMapping, MutableSequence +from pathlib import Path +from lang import PARSER as parser +from mal_analyzer import malAnalyzer + +ASTNode = Tuple[str, object] + +''' +This function is crucial to use instead of cursor.goto_next_sibling() + +Although the `comment` node is included as an extra in the +TreeSitter grammar, it still shows up in the AST. +For this reason, this function exists to go to the next node, +while ignoring `comment` node. + +It returns a boolean which states if there are any nodes left +and if the current node is not a comment. +''' +def go_to_sibling(cursor: TreeCursor) -> bool: + found_sibling = cursor.goto_next_sibling() + while cursor.node.type=='comment' and found_sibling: + found_sibling = cursor.goto_next_sibling() + return found_sibling and cursor.node.type!='comment' + +class ParseTreeVisitor: + def __init__(self): + self.current_file: Path = None + self.visited_files: set[Path] = set() + self.path_stack: list[Path] = [] + self.analyzer = malAnalyzer() + + def compile(self, malfile: Path | str): + current_file = Path(malfile) + + if not current_file.is_absolute() and self.path_stack: + # Only for the first file self.path_stack will be empty. + current_file = self.path_stack[-1] / current_file + + if current_file in self.visited_files: + # Avoid infinite loops due to recursive includes + return {} + + self.visited_files.add(current_file) + self.path_stack.append(current_file.parent) + + result = None + with open(current_file, 'rb') as f: + source = f.read() + tree = parser.parse(source) + result = self.visit(tree.walk()) + + self.path_stack.pop() + + return result + + def visit(self, cursor, params = None): + function_name = f'visit_{cursor.node.type}' # obtain the appropriate function + visitor = getattr(self, function_name, self.skip) + hasChild = cursor.goto_first_child() # enter node's children + result = visitor(cursor) if not params else visitor(cursor, params) + + if hasChild: + cursor.goto_parent() # leave node's children + + analyzer_method_name: str = f'check_{cursor.node.type}' + analyzer_method: function | None = getattr(self.analyzer, analyzer_method_name, None) + + if analyzer_method: + arguments = analyzer_method.__code__.co_argcount + if arguments in [2, 3]: + { + 3: lambda: analyzer_method(cursor.node, result), + 2: lambda: analyzer_method(cursor.node) + }[arguments]() + else: + raise ValueError(f'Unexpected number of arguments: {arguments}') + + return result + + def visit_source_file(self, cursor: TreeCursor) -> ASTNode | list[ASTNode] | None: + langspec = { + "formatVersion": "1.0.0", + "defines": {}, + "categories": [], + "assets": [], + "associations": [], + } + + # Go to first declaration + while True: + if (cursor.node.type == 'comment'): + go_to_sibling(cursor) + + # Obtain node type of declaration + cursor.goto_first_child() + + # Visit declaration + result = self.visit(cursor) + + key, value = result + if key == "categories": + category, assets = value + langspec["categories"].extend(category) + langspec["assets"].extend(assets) + elif key == "defines": + langspec[key].update(value) + elif key == "associations": + langspec[key].extend(value) + elif key == "include": + included_file = self.compile(value) + for k, v in langspec.items(): + if isinstance(v, MutableMapping): + langspec[k].update(included_file.get(k, {})) + if isinstance(v, MutableSequence) and k in included_file: + langspec[k].extend(included_file[k]) + + # Go back to declaration + cursor.goto_parent() + + # Attempt to move to next declaration. If not possible, done processing + if not go_to_sibling(cursor): + break + + for key in ("categories", "assets", "associations"): + unique = [] + for item in langspec[key]: + if item not in unique: + unique.append(item) + langspec[key] = unique + + return langspec + + def skip(self, *args, **kwargs): + pass + + def _visit(self, cursor: TreeCursor) -> ASTNode | list[ASTNode] | None: + # Function name of child class handling the node type + function_name = f'visit_{cursor.node.type}' + + # Enter into the node + has_children = cursor.goto_first_child() + + # Default to skip, in case a specific visitor can't be found + # Generally the case for anonymous nodes (keywords etc) or + # named nodes (rules) that do not have a vistor implemented yet. + visitor = getattr(self, function_name, self.skip) + + # Use visitor implementation + visitor_value = visitor(cursor) + + # Exit the node + if has_children: + cursor.goto_parent() + + return visitor_value + + def _skip(self, cursor: TreeCursor) -> ASTNode | list[ASTNode] | None: + values = [] + if visitor_value := self.visit(cursor): + values.append(visitor_value) + while go_to_sibling(cursor): + if visitor_value := self.visit(cursor): + values.append(visitor_value) + match len(values): + case 0: + return None + case 1: + return values[0] + case _: + return values + + def visit_comment(self, cursor: TreeCursor, params=None): + return (None, None) + +# Concrete visitor to process function definitions +class MalCompiler(ParseTreeVisitor): + + # Named visit_{rule name in grammar.js} + def visit_define_declaration(self, cursor: TreeCursor) -> ASTNode: + ############################### + # '#' (identity) ':' (string) # + ############################### + + # skip '#' node + go_to_sibling(cursor) + # grab (identity) node + key = cursor.node.text + # next node + go_to_sibling(cursor) + # skip ':' node + go_to_sibling(cursor) + # grab (string) node + value = cursor.node.text + + return ("defines", {key.decode(): value.decode().strip("\"")}) + + def visit_category_declaration(self, cursor: TreeCursor) -> ASTNode: + ############################################ + # 'category' (id) (meta)* '{' (asset)* '}' # + ############################################ + + category = {} + + # skip 'category' + go_to_sibling(cursor) + # grab (identity) + category["name"] = cursor.node.text.decode() + # next node + go_to_sibling(cursor) + + # grab (meta) + # + # Since it is optional, we have to make sure we are dealing with a + # grammar rule + meta = {} + while (cursor.node.is_named): + info = self.visit(cursor) + meta[info[0]] = info[1] + go_to_sibling(cursor) + category["meta"] = meta + + # skip '{' node + go_to_sibling(cursor) + + # grab (asset) + assets = [] + while (cursor.node.is_named): + asset = self.visit(cursor, category["name"]) + assets.append(asset) + go_to_sibling(cursor) + + # next node and skip '}' node + go_to_sibling(cursor), cursor.goto_next_sibling() + + return ("categories", ([category], assets)) + + def visit_include_declaration(self, cursor: TreeCursor): + #################### + # 'include' (file) # + #################### + + # skip 'include' + go_to_sibling(cursor) + + # grab (file) which is a (string) + # '"' are ASCII so they are garantueed to only take one byte in UTF-8 (assumed for .decode) + # therefor, we can greedily only take bytes 1:-1 + # strip surrounding quotes (") by slicing + return ("include", cursor.node.text[1:-1].decode()) + + def visit_meta(self, cursor: TreeCursor) -> ASTNode: + ############################ + # (id) 'info' ':' (string) # + ############################ + + # grab (id) node + id = cursor.node.text.decode() + + # next node + go_to_sibling(cursor) + # skip 'info' node + go_to_sibling(cursor) + # skip ':' node + go_to_sibling(cursor) + + # grab (string) node + # '"' are ASCII so they are garantueed to only take one byte in UTF-8 (assumed for .decode) + # therefor, we can greedily only take bytes 1:-1 + # strip surrounding quotes (") by slicing + info_string = cursor.node.text[1:-1].decode() + + return (id, info_string) + + def visit_asset_declaration(self, cursor: TreeCursor, category: str) -> ASTNode: + ############################################################################## + # (abstract)? 'asset' (id) (extends id)? (meta)* '{' (asset_definition)* '}' # + ############################################################################## + + # grab (abstract)? + isAbstract = cursor.node.text == b'abstract' + if (isAbstract): + go_to_sibling(cursor) # We must go to 'asset' + + # skip 'asset' + go_to_sibling(cursor) + + # grab (id) + name = cursor.node.text.decode() + go_to_sibling(cursor) + + # grab (extends id)? + superAsset = None + if (cursor.node.text == b'extends'): + go_to_sibling(cursor) # move to the id + superAsset = cursor.node.text.decode() # get the text + go_to_sibling(cursor) # move to the meta + + # grab (meta)* + meta = {} + while (cursor.node.is_named): + info = self.visit(cursor) + meta[info[0]] = info[1] + go_to_sibling(cursor) + + # skip '{' + go_to_sibling(cursor) + + # visit asset_definition + variables, attackSteps = [], [] + if (cursor.node.is_named): + variables, attackSteps = self.visit(cursor) + + return {"name": name, + "meta": meta, + "category": category, + "isAbstract": isAbstract, + "superAsset": superAsset, + "variables":variables, + "attackSteps": attackSteps} + + def visit_asset_definition(self, cursor: TreeCursor) -> ASTNode: + ####################### + # (variable)* (step)* # + ####################### + + variables, steps = [], [] + while True: + definition, result = self.visit(cursor) + + if definition=='variable': + variables.append(result) + elif definition=='step': + steps.append(result) + + if not go_to_sibling(cursor): + break + + return (variables, steps) + + def visit_asset_variable(self, cursor: TreeCursor) -> ASTNode: + ########################## + # 'let' (id) '=' (value) # + ########################## + + ret = {} + + # skip 'let' + go_to_sibling(cursor) + + # grab id + ret["name"] = cursor.node.text.decode() + go_to_sibling(cursor) + + # skip '=' + go_to_sibling(cursor) + + ret["stepExpression"] = self.visit(cursor) + + # TODO visit step expression + + return ("variable", ret) + + def visit_attack_step(self, cursor: TreeCursor) -> ASTNode: + ############################################################################################################## + # (step_type) (id) ( '@' (id) )* ( '{' (cias) '}' )? (ttc)? (meta)* (detector)? (preconditions)? (reaches)? # + ############################################################################################################## + + # grab (step_type) + # use raw text bytes to avoid decoding as much as possible + step_type_btext = cursor.node.text + step_type_bindings = { + b'&': 'and', + b'|': 'or', + b'#': 'defense', + b'E': 'exist', + b'!E': 'notExist' + } + # decode value only if its really necessary (no binding found) + if (step_type := step_type_bindings.get(step_type_btext)) is None: + step_type = step_type_btext.decode() + go_to_sibling(cursor) + + # grab (id) + name = cursor.node.text.decode() + go_to_sibling(cursor) + + # process all ( '@' (id) ) we might have + tags = [] + + # TODO change grammar to make (@ id)* instead of (@ id)? + while (cursor.node.text == b'@'): + go_to_sibling(cursor) # skip '@' + tags.append(cursor.node.text.decode()) # grab (id) + if not go_to_sibling(cursor): # move to next symbol, break if last + break + + # process all ( '{' (cias) '}' ) we might have + risk = None + if (cursor.node.text == b'{'): + go_to_sibling(cursor) # skip '{' + risk = self.visit(cursor) # grab (cias) + go_to_sibling(cursor) # go to '}' + go_to_sibling(cursor) # and skip it + + ttc = None + if (cursor.node.type == 'ttc'): + # visit ttc + ttc = self.visit(cursor) + go_to_sibling(cursor) + + meta = {} + while (cursor.node.type == 'meta'): + info = self.visit(cursor) + meta[info[0]] = info[1] + if not go_to_sibling(cursor): # in case there is nothing after the meta + break + + detectors = {} + while (cursor.node.type == 'detector'): + detector = self.visit(cursor) + detector[detector['name']] = detector + if not go_to_sibling(cursor): # in case there is nothing after the meta + break + + requires = None + if (cursor.node.type == 'preconditions'): + requires = self.visit(cursor) + go_to_sibling(cursor) + + reaches = None + if (cursor.node.type == 'reaching'): + reaches = self.visit(cursor) + go_to_sibling(cursor) + + ret = { + "name":name, + "meta": meta, + "detectors": detectors, + "type":step_type, + "tags":tags, + "risk": risk, + "ttc": ttc, + "requires":requires, + "reaches": reaches, + } + + return ("step", ret) + + def visit_detector(self, cursor: TreeCursor): + #################################################################### + # ('!' | '//!') (detector_name)? (detector_context) (type)? (ttc)? # + #################################################################### + + # skip bang + go_to_sibling(cursor) + + # grab detector_name + detector_name = None + if cursor.field_name == 'name': + detector_name = cursor.node.text.decode() + go_to_sibling(cursor) + + # grab detector_context + detector_context = self.visit(cursor) + go_to_sibling(cursor) + + # grab id + detector_type = None + if cursor.field_name == 'type': + detector_name = cursor.node.text.decode() + go_to_sibling(cursor) + + # grab ttc + detector_ttc = None + if cursor.field_name == 'ttc': + detector_ttc = self.visit(ttc) + go_to_sibling(cursor) + + return { + "name": detector_name, + "context": detector_context, + "type": detector_type, + "tprate": detector_ttc, + } + + def visit_detector_context(self, cursor: TreeCursor): + #################################################################### + # '(' (detector_context_asset) (',' (detector_context_asset))* ')' # + #################################################################### + + # skip '(' + go_to_sibling(cursor) + + # grab detector_context_asset + context = {} + label, asset = self.visit(cursor) + context[label] = asset + go_to_sibling(cursor) + + while cursor.node.text != b')': + # skip ',' + go_to_sibling(cursor) + # grab another detector_context_asset + label, asset = self.visit(cursor) + context[label] = asset + go_to_sibling(cursor) + + return context + + def visit_detector_context_asset(self, cursor: TreeCursor): + ############### + # (type) (id) # + ############### + asset = cursor.node.text.decode() + label = cursor.node.text.decode() + + return (label, asset) + + def visit_cias(self, cursor: TreeCursor): + ###################### + # (cia) (',' (cia))* # + ###################### + risk = { + "isConfidentiality": False, + "isIntegrity": False, + "isAvailability": False, + } + + while True: + val = self.visit(cursor) + risk.update(val) + + ret = go_to_sibling(cursor) + if not ret: # no more ',' -> done + break + + # Otherwise, process the next CIA + go_to_sibling(cursor) + + return risk + + def visit_cia(self, cursor: TreeCursor): + ############### + # 'C'|'I'|'A' # + ############### + + cia_btext = cursor.node.text + cia_bindings = { + b'C': 'isConfidentiality', + b'I': 'isIntegrity', + b'A': 'isAvailability', + } + key = cia_bindings.get(cia_btext) + + return {key: True} + + def visit_ttc(self, cursor: TreeCursor): + ################################## + # '[' (intermediary_ttc_exp) ']' # + ################################## + + # skip '[' + go_to_sibling(cursor) + + return self._visit_intermediary_ttc_expr(cursor) + + def _visit_intermediary_ttc_expr(self, cursor: TreeCursor): + ################################################################################################### + # '(' (intermediary_ttc_expr) ')' | (integer) | (float) | (id) | (ttc_distribution) | (ttc_binop) # + ################################################################################################### + + # check if we have '(', in this case it's a parenthesized expression + if (cursor.node.text == b'('): + go_to_sibling(cursor) # skip '(' + result = self._visit_intermediary_ttc_expr(cursor) # visit the expression + go_to_sibling(cursor) # skip ')' + return result + + + # if we have an id, just return it + elif (cursor.node.type == 'identifier'): + text = cursor.node.text.decode() + return { + "type": "function", + "name": text, + "arguments": [] + } + + # if we have a number (integer/float) we need to construct + # the dictionary correctly + elif (cursor.node.type == 'float' or cursor.node.type=='integer'): + ret = {"type": "number"} + ret['value'] = self.visit(cursor) + return ret + + # otherwise visit the node + return self.visit(cursor) + + def visit_float(self, cursor: TreeCursor): + ret = float(cursor.node.text) + + return ret + + def visit_integer(self, cursor: TreeCursor): + ret = float(cursor.node.text) + + return ret + + def visit_ttc_binop(self, cursor: TreeCursor): + ######################################################################### + # (intermediary_ttc_expr) ('+'|'-'|'*'|'/'|'^') (intermediary_ttc_expr) # + ######################################################################### + + # grab first (intermediary_ttc_expr) + lhs = self._visit_intermediary_ttc_expr(cursor) + go_to_sibling(cursor) + + # grab operation type + operation = cursor.node.text + operation_type_bindings = { + b'+': 'addition', + b'-': 'subtraction', + b'*': 'multiplication', + b'/': 'division', + b'^': 'exponentiation', + } + operation_type = operation_type_bindings.get(operation) + go_to_sibling(cursor) + + # grab second (intermediary_ttc_expr) + rhs = self._visit_intermediary_ttc_expr(cursor) + + return {"type":operation_type, "lhs":lhs, "rhs": rhs} + + def visit_ttc_distribution(self, cursor: TreeCursor): + ############################################ + # (id) '(' (number)* ( ',' (number) )* ')' # + ############################################ + + # grab (id) + name = cursor.node.text.decode() + go_to_sibling(cursor) + + # skip '(' + go_to_sibling(cursor) + + # parse function arguments + args = [] + while (cursor.node.type in ('float', 'integer')): + # obtain the number + arg = self.visit(cursor) + args.append(arg) + # move to next symbol, if it's not a comma then done + go_to_sibling(cursor) + if (cursor.node.text != b','): + break + # otherwise, ignore the comma + go_to_sibling(cursor) + + return { + "type": "function", + "name": name, + "arguments": args + } + + def visit_preconditions(self, cursor: TreeCursor): + ########################################## + # '<-' (asset_expr) (',' (asset_expr) )* # + ########################################## + + # Skip '<-' + go_to_sibling(cursor) + + ret = {} + ret["overrides"] = True + ret["stepExpressions"] = [self.visit(cursor)] + + while (go_to_sibling(cursor)): # check if we have a ',' + go_to_sibling(cursor) # ignore the ',' + ret["stepExpressions"].append(self.visit(cursor)) + + return ret + + def visit_reaching(self, cursor: TreeCursor): + ################################################ + # ( '+>' | '->' ) (reaches) ( ',' (reaches) )* # + ################################################ + + ret = {} + + # Get type of reaches + ret["overrides"] = cursor.node.text == b'->' + go_to_sibling(cursor) + + # Visit the steps + ret["stepExpressions"] = [self.visit(cursor)] + + while (go_to_sibling(cursor)): # check if we have a ',' + go_to_sibling(cursor) # ignore the ',' + ret["stepExpressions"].append(self.visit(cursor)) + + return ret + + def visit_asset_expr(self,cursor: TreeCursor): + return self._visit_inline_asset_expr(cursor) + + def _visit_inline_asset_expr(self, cursor: TreeCursor): + ############################################################################################################################################# + # '(' (_inline_asset_expr) ')' | (id) | (asset_variable_substitution) | (asset_expr_binop) | (asset_expr_unop) | (asset_expr_type) # + ############################################################################################################################################# + + # The objective of this function is to mimick the _inline_asset_expr + # In other words, this function will figure out the type of the node it just received, + # pretending that it was an _inline_asset_expr + + ret = {} + + if (cursor.node.type=='identifier'): + ret["type"] = self._resolve_part_ID_type(cursor) + ret["name"] = cursor.node.text.decode() + elif (cursor.node.text.decode() == '('): + go_to_sibling(cursor) # ignore the '(' + ret = self._visit_inline_asset_expr(cursor) + go_to_sibling(cursor) # ignore the ')' + else: + ret = self.visit(cursor) + + return ret + + def visit_asset_variable_substitution(self, cursor: TreeCursor): + ################ + # (id) '(' ')' # + ################ + + return { + "type": "variable", + "name": cursor.node.text.decode() + } + + def visit_asset_expr_type(self, cursor: TreeCursor): + ##################################### + # (_inline_asset_expr) '[' (id) ']' # + ##################################### + + # On the ANTLR version, we would visit the subtypes from left to right, + # so we would have to store them recursively. However, in the TreeSitter + # version, we are starting from right to left, so we can just visit + # the `lhs` and return the current subtype + + # Visit the inline expr + stepExpression = self._visit_inline_asset_expr(cursor) + go_to_sibling(cursor) + + # Skip '[' + go_to_sibling(cursor) + + # Get the subType + subType = cursor.node.text.decode() + + return { + "type": "subType", + "subType": subType, + "stepExpression": stepExpression + } + + def visit_asset_expr_binop(self, cursor: TreeCursor): + ######################################################################## + # (_inline_asset_expr) ( '\/' | '/\' | '-' | '.') (_inline_asset_expr) # + ######################################################################## + + # Get the lhs + lhs = self._visit_inline_asset_expr(cursor) + go_to_sibling(cursor) + + # Get the type of operation + op_btext = cursor.node.text + optype_bindings = { + b'.': 'collect', + b'\\/': 'union', + b'/\\': 'intersection', + b'-': 'difference', + } + optype = optype_bindings.get(op_btext) + go_to_sibling(cursor) + + # Get the rhs + rhs = self._visit_inline_asset_expr(cursor) + return { + "type": optype, + "lhs": lhs, + "rhs": rhs + } + + def visit_asset_expr_unop(self, cursor: TreeCursor): + ############################# + # (_inline_asset_expr) '*' # + ############################# + + # Get the associated expression + expr = self._visit_inline_asset_expr(cursor) + go_to_sibling(cursor) + + return { + "type": "transitive", + "stepExpression": expr + } + + def _resolve_part_ID_type(self, cursor: TreeCursor): + # Figure out if we have a `field` or an `attackStep` + original_node = cursor.node + + parent_node = original_node.parent + + while parent_node and parent_node.type != 'reaching': + # The idea is to go up the tree. If we find a "reaching" node, + # we still need to determine if it's a field or a an attackStep + parent_node = parent_node.parent + + if not parent_node: + # If we never find a "reaching" node, eventually we will go to + # the top of the tree, and we won't be able to go further up. + # In this case, we originally were in a `let` or `precondition`, + # which only accepts fields + return "field" + + # We want to know if there is any `.` after the context. + # If there is, we have a field (as an attackStep does not + # have attributes) + # + # To do this, we will find the start position of the the original + # node in the text. Each rule matches to one line in the end, + # so this node will be in the same row as its parent node and in + # a column inside the range of columns of its parent. So, we + # just have to split the whole text of the parent starting at the + # original node's position and iterate from there until the end of + # the text. + + # The following logic was implemented to deal with how TreeSitter + # deals with indents and new lines + + # We start by obtaining the column where the target node starts, + original_node_column = original_node.start_point.column + + # We get the parent's text and split it into the original + # lines (as written in the code) + tokenStream = parent_node.text.decode() + tokenStream = tokenStream.split('\n') + tokenStream_split = None + + # If the parent and the target are defined in the same line, + # then we must remove the start point from the original column, + # since TreeSitter deletes the indent + if original_node.start_point.row == parent_node.start_point.row: + tokenStream_split = tokenStream[0] + original_node_column = original_node.start_point.column - parent_node.start_point.column + # However, if they are in different rows, the indent must be included, + # so we use the same column + else: + tokenStream_split = tokenStream[original_node.start_point.row-parent_node.start_point.row] + + # Afterwards, we just do the normal checks, knowing what column to start in + tokenStream_split = tokenStream_split[original_node_column+len(original_node.text.decode()):] + for char in tokenStream_split: + if char == '.': + return "field" # Only a field can have attributes + if char == ',': + return "attackStep" # A `,` means we are starting a new reaches + + return "attackStep" + + def visit_associations_declaration(self, cursor: TreeCursor): + ######################################### + # 'associations' '{' (association)* '}' # + ######################################### + + # skip 'associations' + go_to_sibling(cursor) + + # skip '{' + go_to_sibling(cursor) + + # visit all associations + associations = [] + while cursor.node.text != b'}': + associations.append(self.visit(cursor)) + go_to_sibling(cursor) + + return ('associations', associations) + + def visit_association(self, cursor: TreeCursor): + ############################################################################################## + # (id) '[' (id) ']' (multiplicity) '<--' (id) '-->' (multiplicity) '[' (id) ']' (id) (meta)* # + ############################################################################################## + + # Get 1st id - left asset + left_asset = cursor.node.text.decode() + go_to_sibling(cursor) + + # skip '[' + go_to_sibling(cursor) + + # Get 2nd id - left field + left_field = cursor.node.text.decode() + go_to_sibling(cursor) + + # skip ']' + go_to_sibling(cursor) + + # Get left multiplicity + left_multiplicity = self.visit(cursor) + go_to_sibling(cursor) + + # skip '<--' + go_to_sibling(cursor) + + # Get 3rd id - name of the association + name = cursor.node.text.decode() + go_to_sibling(cursor) + + # skip '-->' + go_to_sibling(cursor) + + # Get right multiplicity + right_multiplicity = self.visit(cursor) + go_to_sibling(cursor) + + # skip '[' + go_to_sibling(cursor) + + # Get 4th id - right field + right_field = cursor.node.text.decode() + go_to_sibling(cursor) + + # skip ']' + go_to_sibling(cursor) + + # Get 5th id - right asset + right_asset = cursor.node.text.decode() + + # Get all metas + meta = {} + while go_to_sibling(cursor): + res = self.visit(cursor) + meta[res[0]] = res[1] + + association = { + "name" : name, + "meta" : meta, + "leftAsset" : left_asset, + "leftField" : left_field, + "leftMultiplicity" : left_multiplicity, + "rightAsset" : right_asset, + "rightField" : right_field, + "rightMultiplicity" : right_multiplicity, + } + + self._process_multitudes(association) + + return association + + def visit_multiplicity(self, cursor: TreeCursor): + ############################################### + # (_multiplicity_atom) | (multiplicity_range) # + ############################################### + + if cursor.node.type == 'multiplicity_range': + return self.visit(cursor) + + # Otherwise we need to visit an intermediary function for + # atomic multiplicity expressions + min = self._visit_multiplicity_atom(cursor) + return { + "min": min, + "max": None, + } + + def visit_multiplicity_range(self, cursor: TreeCursor): + ################################################## + # (_multiplicity_atom) '..' (_multiplicity_atom) # + ################################################## + + min = self._visit_multiplicity_atom(cursor) + go_to_sibling(cursor) + + # skip '..' + go_to_sibling(cursor) + + max = self._visit_multiplicity_atom(cursor) + + return { + "min": min, + "max": max, + } + + def _visit_multiplicity_atom(self, cursor: TreeCursor): + ###################### + # (integer) | (star) # + ###################### + return cursor.node.text.decode() + + def _process_multitudes(self, association): + mult_keys = [ + # start the multatoms from right to left to make sure the rules + # below get applied cleanly + "rightMultiplicity.max", + "rightMultiplicity.min", + "leftMultiplicity.max", + "leftMultiplicity.min", + ] + + for mult_key in mult_keys: + key, subkey = mult_key.split(".") + + # upper limit equals lower limit if not given + if subkey == "max" and association[key][subkey] is None: + association[key][subkey] = association[key]["min"] + + if association[key][subkey] == "*": + # 'any' as lower limit means start from 0 + if subkey == "min": + association[key][subkey] = 0 + + # 'any' as upper limit means not limit + else: + association[key][subkey] = None + + # cast numerical strings to integers + if (multatom := association[key][subkey]) and multatom.isdigit(): + association[key][subkey] = int(association[key][subkey]) + diff --git a/examples/visitor/lang.py b/examples/visitor/lang.py new file mode 100644 index 0000000..7eddf90 --- /dev/null +++ b/examples/visitor/lang.py @@ -0,0 +1,5 @@ +from tree_sitter import Language, Parser +import tree_sitter_mal as ts_mal + +MAL_LANGUAGE = Language(ts_mal.language()) +PARSER = Parser(MAL_LANGUAGE) diff --git a/examples/visitor/main.py b/examples/visitor/main.py new file mode 100644 index 0000000..0a0d331 --- /dev/null +++ b/examples/visitor/main.py @@ -0,0 +1,38 @@ +#from simple import MalCompiler +# or +from fast import MalCompiler + + +# Example Python source code +source_code = b''' +#version: "1.2.3" +category Test +developer info : "something" +{ + asset foo { + let a = b + let b = c + let c = d + | testStep + @ tomas + { C, A } + [ test(5.5) + 1 - test2(6)^7 / (8 * wrong()) + 999 ] + developer info : "tomas2" + modeler info : "tomas3" + } + abstract asset bar { } + asset bar1 extends bar { } + abstract asset foo1 extends foo { } +} +category Test1 { +} +''' +''' + // + // + // +''' + +# Run the visitor pattern on the tree +compiler = MalCompiler() +compiler.compile(source_code) diff --git a/examples/visitor/mal_analyzer.py b/examples/visitor/mal_analyzer.py new file mode 100644 index 0000000..2c9b41c --- /dev/null +++ b/examples/visitor/mal_analyzer.py @@ -0,0 +1,784 @@ +import logging +import re +from tree_sitter import Node +from distributions import Distributions, DistributionsException +from typing import Any, Tuple, List + +class malAnalyzerException(Exception): + def __init__(self, error_message): + self._error_message = error_message + super().__init__(self._error_message) + +class malAnalyzer(): + ''' + A class to preform syntax-checks for MAL. + ''' + + def __init__(self, *args, **kwargs) -> None: + self._error: bool = False + self._warn: bool = False + self._preform_post_analysis = 0 + + self._defines: dict = {} + self._assets: dict = {} + self._category: dict = {} + self._metas: dict = {} + self._steps: dict = {} + self._vars: dict = {} + self._associations: dict = {} + + self._all_associations = [] + self._current_vars = [] + self._include_stack = [] + + self._error_msg:str = "" + + super().__init__(*args, **kwargs) + + def _raise_analyzer_exception(self, error_msg:str): + logging.error(error_msg) + raise malAnalyzerException(error_msg) + + def has_error(self) -> bool: + return self._error + + def has_warning(self) -> bool: + return self._warn + + def _post_analysis(self) -> None: + ''' + Perform a post-analysis to confirm that the + mandatory fields and relations are met. + ''' + self._analyse_defines() + self._analyse_extends() + self._analyse_abstract() + self._analyse_parents() + self._analyse_association() + self._analyse_steps() + self._analyse_fields() + self._analyse_variables() + self._analyse_reaches() + + def _analyse_defines(self) -> None: + ''' + Check for mandatory defines: ID & Version + ''' + if 'id' in self._defines.keys(): + define_value: str = self._defines['id']['value'] + if (len(define_value) == 0): + error_msg = 'Define \'id\' cannot be empty' + self._raise_analyzer_exception(error_msg) + else: + error_msg = 'Missing required define \'#id: ""\'' + self._raise_analyzer_exception(error_msg) + + if 'version' in self._defines.keys(): + version: str = self._defines['version']['value'] + if not re.match(r"\d+\.\d+\.\d+", version): + error_msg = 'Define \'version\' must be valid semantic versioning without pre-release identifier and build metadata' + self._raise_analyzer_exception(error_msg) + else: + error_msg = 'Missing required define \'#version: ""\'' + self._raise_analyzer_exception(error_msg) + + def _analyse_extends(self) -> None: + ''' + For all assets which extend another, verify if the extended asset exists + ''' + raise_error: bool = False + extend_asset_name: str = '' + for asset in self._assets: + asset_node: Node = self._assets[asset]['node'] + if(asset_node.child_by_field_name('extends')): + # Next sibling is the identifier itself + extend_asset_name = asset_node.child_by_field_name('extends').next_sibling.text.decode() + if(not extend_asset_name in self._assets): + ''' + Do we need to check if the extended asset is + in the same category? If so we can load the asset + and check it's parent + ''' + error_msg = f'Asset \'{extend_asset_name}\' not defined' + self._raise_analyzer_exception(error_msg) + + def _analyse_abstract(self) -> None: + ''' + For every abstract asset, verify if it is extended by another asset + ''' + for parent in self._assets: + parent_node: Node = self._assets[parent]['node'] + parent_node_name: str = parent_node.child_by_field_name('id').text.decode() + if(parent_node.children[0].text.decode()=='abstract'): + found: bool = False + for extendee in self._assets: + extendee_node: Node = self._assets[extendee]['node'] + extendee_node_extender = extendee_node.child_by_field_name('extends') + if(extendee_node_extender and \ + extendee_node_extender.next_sibling.text.decode() == parent_node_name): + found = True + break + if not found: + self._warn = True + logging.warning(f'Asset \'{parent_node_name}\' is abstract but never extended to') + + def _analyse_parents(self) -> None: + ''' + Verify if there are circular extend relations + ''' + error: bool = False + for asset in self._assets: + parents: list[str] = [] + parent_node: malParser.AssetContext = self._assets[asset]['node'] + while (parent_node and parent_node.type=='asset_declaration'): + parent_name: str = parent_node.child_by_field_name('id').text.decode() + if (parent_name in parents): + error_msg: str = ' -> '.join(parents) + error_msg += f' -> {parent_name}' + error_msg = f'Asset \'{parent_name}\' extends in loop \'{error_msg}\'' + self._raise_analyzer_exception(error_msg) + parents.append(parent_name) + parent_node = self._get_assets_extendee(parent_node) + + def _get_assets_extendee(self, node: Node) -> Node: + ''' + Verifies if the current asset extends another and, if so, return the parent's context + ''' + if (node.child_by_field_name('extends')): + extender_node = node.child_by_field_name('extends') + extender_node_name = extender_node.next_sibling.text.decode() + return self._assets[extender_node_name]['node'] + return None + + def _analyse_reaches(self) -> None: + ''' + For every attackStep in every asset, verify if the prerequisites point to assets and that the reaches point to + attack steps + ''' + for asset in self._assets.keys(): + attack_steps = self._assets[asset]['obj']['attackSteps'] + for attack_step in attack_steps: + if (attack_step['type'] in ['exist', 'notExist']): + if (attack_step['ttc']): + error_msg = f'Attack step of type \'{attack_step["type"]}\' must not have TTC' + self._raise_analyzer_exception(error_msg) + if (attack_step['requires']): + # Verify if every requires expression returns an asset + for expr in attack_step['requires']['stepExpressions']: + if not self._check_to_asset(asset, expr): + error_msg = f"Line {self._steps[asset][attack_step['name']]['node'].start_point.row}: " + \ + f"All expressions in requires ('<-') must point to a valid asset" + self._raise_analyzer_exception(self._error_msg + error_msg) + else: + error_msg = f'Attack step of type \'{attack_step["type"]}\' must have require \'<-\'' + self._raise_analyzer_exception(error_msg) + elif (attack_step['requires']): + error_msg = 'Require \'<-\' may only be defined for attack step type exist \'E\' or not-exist \'!E\'' + self._raise_analyzer_exception(error_msg) + if (attack_step['reaches']): + # Verify if every reaches expresion returns an attack step + for expr in attack_step['reaches']['stepExpressions']: + if not self._check_to_step(asset, expr): + error_msg = f"Line {self._steps[asset][attack_step['name']]['node'].start_point.row}: " + \ + f"All expressions in reaches ('->') must point to a valid attack step" + self._raise_analyzer_exception(self._error_msg + error_msg) + + def _analyse_association(self) -> None: + ''' + For every association, verify if the assets exist + ''' + for association in self._all_associations: + leftAsset = association['association']['leftAsset'] + rightAsset= association['association']['rightAsset'] + + if (not leftAsset in self._assets.keys()): + error_msg =f'Left asset \'{leftAsset}\' is not defined' + self._raise_analyzer_exception(error_msg) + if (not rightAsset in self._assets.keys()): + error_msg = f'Right asset \'{leftAsset}\' is not defined' + self._raise_analyzer_exception(error_msg) + + def _analyse_fields(self) -> None: + ''' + Update a variable's fields (associations) to include its parents associations. + Also checks if an association has been defined more than once in a hierarchy + ''' + for asset in self._assets.keys(): + parents = self._get_parents(self._assets[asset]['node']) + for parent in parents: + for association in self._all_associations: + leftAsset = association['association']['leftAsset'] + rightAsset= association['association']['rightAsset'] + if leftAsset==parent: + rightField = association['association']['rightField'] + self._add_field(parent, asset, rightField, association) + if rightAsset==parent: + leftField = association['association']['leftField'] + self._add_field(parent, asset, leftField, association) + + def _add_field(self, parent: str, asset: str, field: str, association: dict): + # Check that this asset does not have an assoication with the same name + if asset not in self._associations or field not in self._associations[asset]: + # Check if there isn't a step with the same name + step_node = self._has_step(asset, field) + if not step_node: + if not asset in self._associations.keys(): + self._associations[asset] = {field: {k: association[k] for k in ["association", "node"]}} + else: + self._associations[asset][field] = {k: association[k] for k in ["association", "node"]} + # Otherwise, this will be an error + else: + error_msg = f'Field {field} previously defined as an attack step at {step_node.start_point.row}' + self._raise_analyzer_exception(error_msg) + # Association field was already defined for this asset + else: + error_msg = f'Field {parent}.{field} previously defined at {self._associations[asset][field]['node'].start_point.row}' + self._raise_analyzer_exception(error_msg) + + def _has_step(self, asset, field): + if asset in self._steps.keys() and field in self._steps[asset]: + return self._steps[asset][field]['node'] + return None + + def _variable_to_asset(self, asset: str, var: str): + ''' + Checks if there is no cycle in the variables and verifies that it points to + an existing asset + ''' + if var not in self._current_vars: + self._current_vars.append(var) + res = self._check_to_asset(asset, self._vars[asset][var]['var']['stepExpression']) + self._current_vars.pop() + return res + + cycle = '->'.join(self._current_vars)+'->'+var + error_msg = f'Variable \'{var}\' contains cycle {cycle}' + self._raise_analyzer_exception(error_msg) + + def _analyse_variables(self): + ''' + This function will verify if an asset which extends another does not redefine a variable. + It also updates the list of variables for an asset to includes its parent's variables + + Once that is done, we need to guarantee that the variable points to an asset and that + there are no loops in the variables, i.e. a variable does not somehow reference itself + ''' + for asset in self._assets.keys(): + parents = self._get_parents(self._assets[asset]['node']) + parents.pop() # The last element is the asset itself, no need to check again if variable is defined twice + for parent in parents: + if parent not in self._vars.keys(): + continue # If parent has no variables, we don't need to do anything + if asset not in self._vars.keys(): + self._vars[asset] = self._vars[parent] # If asset has no variables, just inherit its parents variables + continue + # Otherwise, we do need to check if variables are defined more than once + for var in self._vars[asset].keys(): + if parent in self._vars.keys() and var in self._vars[parent].keys() and self._vars[asset][var]['node']!=self._vars[parent][var]['node']: + error_msg = f'Variable \'{var}\' previously defined at {self._vars[parent][var]['node'].start_point.row}' + self._raise_analyzer_exception(error_msg) + self._vars[asset].update(self._vars[parent]) + + # If the current asset has variables, we want to check they point to an asset + if asset in self._vars.keys(): + for var in self._vars[asset].keys(): + if self._variable_to_asset(asset, var)==None: + error_msg = f'Variable \'{var}\' defined at {self._vars[asset][var]['node'].start_point.row} does not point to an asset' + self._raise_analyzer_exception(self._error_msg + error_msg) + + def _check_to_step(self, asset, expr) -> None: + ''' + Given a reaches, verify if the expression resolves to a valid AttackStep for an existing Asset + ''' + match (expr['type']): + # Returns an attackStep if it exists for this asset + case 'attackStep': + if (asset in self._assets.keys()): + for attackStep in self._steps[asset].keys(): + if (attackStep == expr['name']): + return self._steps[asset][attackStep]['step'] + error_msg = f'Attack step \'{expr["name"]}\' not defined for asset \'{asset}\'' + self._raise_analyzer_exception(error_msg) + # Returns an attackStep if it exists for the asset returned by the lhs expression + case 'collect': + if (left_target := self._check_to_asset(asset, expr['lhs'])): + return self._check_to_step(left_target, expr['rhs']) + return None + case _: + error_msg='Last step is not attack step' + self._raise_analyzer_exception(error_msg) + + def _check_to_asset(self, asset, expr) -> None: + ''' + Verify if the expression resolves to an existing Asset + ''' + match (expr['type']): + # field - verify if asset exists via associations + case 'field': + return self._check_field_expr(asset, expr) + # variable - verify if there is a variable with this name + case 'variable': + return self._check_variable_expr(asset, expr) + # collect - return asset pointed by all the parts in the expression + case 'collect': + return self._check_collect_expr(asset, expr) + # set - verify if the assets in the operation have an common ancestor + case 'union' | 'intersection' | 'difference': + return self._check_set_expr(asset, expr) + # transitive - verify if the asset before * (STAR) exists + case 'transitive': + return self._check_transitive_expr(asset, expr) + # subtype - verifies if the asset inside [] is a child from the asset preceding it + case 'subType': + return self._check_sub_type_expr(asset, expr) + case _: + logging.error(f'Unexpected expression \'{expr["type"]}\'') + self._error = True + return None + + def _check_field_expr(self, asset, expr): + ''' + Check if an asset exists by checking the associations for the current asset + ''' + if asset in self._associations.keys(): + for association in self._associations[asset].keys(): + association = self._associations[asset][association]['association'] + if (expr['name'] == association['leftField']): + if (self._get_asset_name(association['leftAsset'])): + return association['leftAsset'] + if (expr['name'] == association['rightField']): + if (self._get_asset_name(association['rightAsset'])): + return association['rightAsset'] + + # Verify if there is a variable defined with the same name; possible the user forgot to call it + extra="" + if (asset in self._vars.keys() and expr['name'] in self._vars[asset].keys()): + extra=f', did you mean the variable \'{expr['name']}()\'?' + self._warn = True + + self._error_msg = f'Field \'{expr["name"]}\' not defined for asset \'{asset}\''+extra+'\n' + + def _check_variable_expr(self, asset, expr): + ''' + Check if there is a variable reference in this asset with the user identifier. + ''' + if (asset in self._vars.keys() and expr['name'] in self._vars[asset].keys()): + return self._variable_to_asset(asset, expr['name']) + + self._error_msg = f'Variable \'{expr["name"]}\' is not defined\n' + return None + + def _check_collect_expr(self, asset, expr): + ''' + Iteratively, retrieve the asset pointed by the leftmost expression and, recursively, check the rhs associated + with each lhs. + ''' + if (left_target := self._check_to_asset(asset, expr['lhs'])): + return self._check_to_asset(left_target, expr['rhs']) + return None + + def _check_set_expr(self, asset, expr) -> None: + ''' + Obtains the assets pointed by boths hs's and verifies if they have a common ancestor + ''' + lhs_target = self._check_to_asset(asset, expr['lhs']) + rhs_target = self._check_to_asset(asset, expr['rhs']) + if (not lhs_target or not rhs_target): + return None + + if (target := self._get_LCA(lhs_target, rhs_target)): + return target + + self._error_msg = f'Types \'{lhs_target}\' and \'{rhs_target}\' have no common ancestor\n' + return None + + def _get_LCA(self, lhs_target, rhs_target): + ''' + Receives two assets and verifies if they have an ancestor in common + ''' + if (self._is_child(lhs_target, rhs_target)): + return lhs_target + elif (self._is_child(rhs_target, lhs_target)): + return rhs_target + else: + lhs_node = self._assets[lhs_target]['node'] + rhs_node = self._assets[rhs_target]['node'] + lhs_parent_node = self._get_assets_extendee(lhs_node) + rhs_parent_node = self._get_assets_extendee(rhs_node) + if (not lhs_parent_node or not rhs_parent_node): + return None + return self._get_LCA(lhs_parent_node.child_by_field_name('id').text.decode(), rhs_parent_node.child_by_field_name('id').text.decode()) + + def _check_sub_type_expr(self, asset, expr) -> None: + ''' + Given expr[ID], obtains the assets given by expr and ID and verifies if ID is + a child of expr + ''' + target = self._check_to_asset(asset, expr['stepExpression']) + if (not target): + return None + + if (asset_type := self._get_asset_name(expr['subType'])): + if (self._is_child(target, asset_type)): + return asset_type + + self._error_msg = f'Asset \'{asset_type}\' cannot be of type \'{target}\'\n' + return None + + def _check_transitive_expr(self, asset, expr) -> None: + ''' + Given expr*, obtain the asset given by expr and verify if it is a child of the current asset + ''' + if (res := self._check_to_asset(asset, expr['stepExpression'])): + if (self._is_child(asset,res)): + return res + + self._error_msg = f'Previous asset \'{asset}\' is not of type \'{res}\'\n' + return None + + def _is_child(self, parent_name, child_name): + ''' + Receives two assets and verifies if one extends the other + ''' + if (parent_name == child_name): + return True + + if (valid_asset := self._get_asset_name(child_name)): + asset_node: Node = self._assets[valid_asset]['node'] + if (parent_node := self._get_assets_extendee(asset_node)): + child_parent_name = self._get_asset_name(parent_node.child_by_field_name('id').text.decode()) + return self._is_child(parent_name, child_parent_name) + + return False + + def _get_parents(self, node: Node) -> List[dict[str, Node]]: + ''' + Given an asset, obtain its parents in inverse order. + I.e., A->B->C returns [C,B,A] for asset A + ''' + parents = [node.child_by_field_name('id').text.decode()] + while node.child_by_field_name('extends'): + parent_name = node.child_by_field_name('extends').next_sibling.text.decode() + if parent_name in parents: + break + parents.insert(0, parent_name) + node = self._assets[parent_name]['node'] + return parents + + def _get_asset_name(self, name): + if (name in self._assets.keys()): + return name + + logging.error(f'Asset \'{name}\' not defined') + self._error = True + return None + + def _analyse_steps(self) -> None: + ''' + For each asset, obtain its parents and analyse each step + ''' + for asset in self._assets.keys(): + parents = self._get_parents(self._assets[asset]['node']) + self._read_steps(asset, parents) + + def _attackStep_seen_in_parent(self, attackStep: str, seen_steps: List) -> str: + ''' + Given a list of parent scopes, verify if the attackStep has been defined + ''' + for parent, parent_scope in seen_steps: + if attackStep in parent_scope: + return parent + return None + + def _read_steps(self, asset: str, parents: List) -> None: + ''' + For an asset, check if every step is properly defined in accordance to its hierarchy, i.e. if any of the asset's parents + also defines this step + ''' + + seen_steps = [] + for parent in parents: + # If this parent has no steps, skip it + if parent not in self._steps.keys(): + continue + + current_steps = [] + for attackStep in self._steps[parent].keys(): + # Verify if attackStep has not been defined in the current asset + if attackStep not in current_steps: + # Verify if attackStep has not been defined in any parent asset + prevDef_parent = self._attackStep_seen_in_parent(attackStep, seen_steps) + if not prevDef_parent: + # Since this attackStep has never been defined, it must either not reach or reach with '->' + attackStep_node = self._steps[parent][attackStep]['node'] + attackStep_node_reaches = attackStep_node.child_by_field_name('reaches') + if (not attackStep_node_reaches or attackStep_node_reaches.child_by_field_name('operator').text.decode()=='->'): + # Valid step + current_steps.append(attackStep) + else: + # Step was defined using '+>', but there is nothing to inherit from + error_msg = f'Cannot inherit attack step \'{attackStep}\' without previous definition' + self._raise_analyzer_exception(error_msg) + else: + # Step was previously defined in a parent + # So it must be of the same type (&, |, #, E, !E) + attackStep_node = self._steps[parent][attackStep]['node'] + parent_attackStep_node = self._steps[prevDef_parent][attackStep]['node'] + if attackStep_node.child_by_field_name('step_type').text==parent_attackStep_node.child_by_field_name('step_type').text: + # Valid step + current_steps.append(attackStep) + else: + # Invalid, type mismatches that of parent + error_msg = f"Cannot override attack step \'{attackStep}\' previously defined " + \ + f"at {parent_attackStep_node.start_point.row} with different type \'{attackStep_node.child_by_field_name('step_type').text.decode()}\' " + \ + f"=/= \'{parent_attackStep_node.child_by_field_name('step_type').text.decode()}\'" + self._raise_analyzer_exception(error_msg) + seen_steps.append((parent,current_steps)) + + for parent, steps in seen_steps: + for step in steps: + if asset not in self._steps.keys(): + self._steps[asset] = {step: self._steps[parent][step]} + else: + self._steps[asset][step] = self._steps[parent][step] + + def check_source_file(self, node: Node) -> None: + ''' + We only want to preform _post_analysis as the very last step. + ''' + if (self._preform_post_analysis==0): + self._post_analysis() + else: + self._include_stack.pop() + self._preform_post_analysis -= 1 + + def check_asset_declaration(self, node: Node, asset: dict) -> None: + ''' + Given an asset, verify if it has been previously defined in the same category + + { + 'asset': + { + 'node': node, + 'obj' : dict, + 'parent': + { + 'name': str, + 'node': node, + } + } + } + ''' + asset_name = asset['name'] + category_name = node.parent.child_by_field_name('id').text.decode() + + if (not asset_name): + logging.error(f"Asset was defined without a name at line {node.start_point.row}") + self._error = True + return + + # Check if asset was previously defined in the same category. + if asset_name in self._assets.keys(): + prev_asset_line = self._assets[asset_name]['node'].start_point.row + error_msg = f"Asset '{asset_name}' previously defined at {prev_asset_line}" + self._raise_analyzer_exception(error_msg) + else: + self._assets[asset_name] = {'node': node, 'obj': asset, 'parent': {'name': category_name,'node': node.parent}} + + def check_meta(self, node: Node, data: Tuple[str, str]) -> None: + ''' + Given a meta, verify if it was previously defined for the same type (category, asset, step or association) + ''' + + meta_name, _ = data + + # Check if we don't have the metas for this parent (category, asset, step or association) + if node.parent not in self._metas.keys(): + self._metas[node.parent] = {meta_name:node} + # Check if the new meta is not already defined + elif node.parent in self._metas.keys() and meta_name not in self._metas[node.parent]: + self._metas[node.parent][meta_name] = node + # Otherwise, throw error + else: + prev_node = self._metas[node.parent][meta_name] + error_msg = f'Metadata {meta_name} previously defined at {prev_node.start_point.row}' + self._raise_analyzer_exception(error_msg) + + def check_category_declaration(self, node: Node, data: Tuple[str, Tuple[List, Any]]) -> None: + ''' + Given a category, verify if it has a name and if contains metadata or assets + ''' + _, [[category], assets] = data + + # TODO: is this really needed? doesn't the grammar prevent this? + if(str(category['name']) == '>'): + category_line = node.start_point.row + logging.error(f'Category has no name at line {category_line}') + self._error = True + return + + if len(category['meta']) == 0 and len(assets) == 0: + logging.warning(f'Category \'{category["name"]}\' contains no assets or metadata') + + self._category[category['name']] = {'node': node, 'obj': {'category': category, 'assets': assets}} + + def check_define_declaration(self, node: Node, data: Tuple[str, dict]) -> None: + ''' + Given a new define, verify if it has been previously defined + ''' + _, obj = data + key, value = list(obj.items())[0] + + # ID and version can be defined multiple times + if(key!='id' and key!='version' and key in self._defines.keys()): + prev_define_line = self._defines[key]['node'].start_point.row + error_msg = f'Define \'{key}\' previously defined at line {prev_define_line}' + self._raise_analyzer_exception(error_msg) + + self._defines[key] = {'node': node, 'value': value} + + def check_include_declaration(self, node: Node, data: Tuple[str, str]) -> None: + ''' + When an include is found, it triggers the analysis of a new MAL file. To prevent + checkMal from being performed before all files have been analysed, we increment + the variable and, every time the file is finished being analysed, it is decreased + again (in checkMal()). This prevents out-of-order analysis. + ''' + self._preform_post_analysis += 1 + + include_file = node.child_by_field_name('file').text.decode() + if include_file in self._include_stack: + cycle = '->'.join([file.replace('"',"") for file in self._include_stack])+' -> '+include_file.replace('"',"") + error_msg = f'Include sequence contains cycle: {cycle}' + self._raise_analyzer_exception(error_msg) + self._include_stack.append(include_file) + + def check_attack_step(self, node: Node, step: dict) -> None: + ''' + Given a step, check if it is already defined in the current asset. Otherwise, add it to the list of + steps related to this asset + ''' + _, step = step + + step_name = step['name'] + asset_name = node.parent.parent.child_by_field_name('id').text.decode() + + # Check if asset has no steps + if not asset_name in self._steps.keys(): + self._steps[asset_name] = {step_name: {'node': node, 'step': step}} + # If so, check if the there is no step with this name in the current asset + elif not step_name in self._steps[asset_name].keys(): + self._steps[asset_name][step_name] = {'node': node, 'step': step} + # Otherwise, log error + else: + prev_node = self._steps[asset_name][step_name]['node'] + error_msg = f'Attack step \'{step_name}\' previously defined at {prev_node.start_point.row}' + self._raise_analyzer_exception(error_msg) + + self._validate_CIA(node, step) + self._validate_TTC(node, asset_name, step) + + def _validate_CIA(self, node: Node, step: dict) -> None: + ''' + Given a step, check if it has CIAs. In that case, verify if the step is not of type + defense and that it does not have repeated CIAs. + ''' + if not node.child_by_field_name('cias'): + return + + step_name = step['name'] + asset_name = node.parent.parent.child_by_field_name('id').text.decode() + + if (step['type'] == 'defense' or step['type'] == 'exist' or step['type'] == 'notExist'): + error_msg = f'Line {node.start_point.row}: {step['type']}: Defenses cannot have CIA classifications' + self._raise_analyzer_exception(error_msg) + + index = 0 + cias = [] + + # Get the CIAs node and iterate over the individual CIA + cias_node = node.child_by_field_name('cias').next_sibling + for cia in cias_node.named_children: + letter = cia.text.decode() + + if (letter in cias): + logging.warning(f'Attack step {asset_name}.{step_name} contains duplicate classification {letter}') + self._warn = True + return + cias.append(letter) + + def _validate_TTC(self, node: Node, asset_name, step: dict) -> None: + if not step['ttc']: + return + match step['type']: + case 'defense': + if (step['ttc']['type'] != 'function'): + error_msg = f'Defense {asset_name}.{step["name"]} may not have advanced TTC expressions' + self._raise_analyzer_exception(error_msg) + + match step['ttc']['name']: + case 'Enabled' | 'Disabled' | 'Bernoulli': + try: + Distributions.validate(step['ttc']['name'], step['ttc']['arguments']) + except DistributionsException as e: + self._raise_analyzer_exception(e._error_message) + case _: + error_msg = f'Defense {asset_name}.{step["name"]} may only have \'Enabled\', \'Disabled\', or \'Bernoulli(p)\' as TTC' + self._raise_analyzer_exception(error_msg) + case 'exist' | 'notExist': + # This should log error, but it happens later in the code + pass + case _: + self._check_TTC_expr(step['ttc']) + + def _check_TTC_expr(self, expr, isSubDivExp = False): + match expr['type']: + case 'subtraction' | 'exponentiation' | 'division': + self._check_TTC_expr(expr['lhs'], True) + self._check_TTC_expr(expr['rhs'], True) + case 'multiplication' | 'addition': + self._check_TTC_expr(expr['lhs'], False) + self._check_TTC_expr(expr['rhs'], False) + case 'function': + if (expr['name'] in ['Enabled', 'Disabled']): + error_msg = 'Distributions \'Enabled\' or \'Disabled\' may not be used as TTC values in \'&\' and \'|\' attack steps' + self._raise_analyzer_exception(error_msg) + if (isSubDivExp and expr['name'] in ['Bernoulli', 'EasyAndUncertain']): + error_msg = f'TTC distribution \'{expr["name"]}\' is not available in subtraction, division or exponential expressions.' + self._raise_analyzer_exception(error_msg) + try: + Distributions.validate(expr['name'], expr['arguments']) + except DistributionsException as e: + self._raise_analyzer_exception(e._error_message) + case 'number': + # Always ok + pass + case _: + error_msg = f'Unexpected expression {expr}' + self._raise_analyzer_exception(error_msg) + + def check_association(self, node: Node, association: dict): + self._all_associations.append({'name': association['name'], 'association': association,'node':node}) + + def check_asset_variable(self, node: Node, var: dict) -> None: + ''' + This checks if the variable has been defined in the current asset. + + self._vars = { + : { + : {'node': , 'var' } + } + } + ''' + _, var = var + parent = node.parent.parent # Twice to skip asset_definition + asset_name: str = str(parent.child_by_field_name('id').text.decode()) + var_name: str = var['name'] + if (asset_name not in self._vars.keys()): + self._vars[asset_name] = {var_name: {'node': node, 'var': var}} + elif (var_name not in self._vars[asset_name]): + self._vars[asset_name][var_name] = {'node': node, 'var': var} + else: + prev_define_line = self._vars[asset_name][var_name]['node'].start_point.row + error_msg = f'Variable \'{var_name}\' previously defined at line {prev_define_line}' + self._raise_analyzer_exception(error_msg) diff --git a/examples/visitor/requirements.txt b/examples/visitor/requirements.txt new file mode 100644 index 0000000..eca3be8 --- /dev/null +++ b/examples/visitor/requirements.txt @@ -0,0 +1 @@ +tree_sitter diff --git a/examples/visitor/simple.py b/examples/visitor/simple.py new file mode 100644 index 0000000..cec737c --- /dev/null +++ b/examples/visitor/simple.py @@ -0,0 +1,50 @@ +from tree_sitter import Node +from typing import Tuple +from lang import PARSER as parser + +ASTNode = Tuple[str, object] + + +class ParseTreeVisitor: + def visit(self, node: Node) -> ASTNode | list[ASTNode] | None: + # Function name of child class handling the node type + function_name = f'visit_{node.type}' + # Default to skip, in case a specific visitor can't be found + # Generally the case for anonymous nodes (keywords etc) or + # named nodes (rules) that do not have a vistor implemented yet. + visitor = getattr(self, function_name, self.skip) + # Use visitor implementaiton + return visitor(node) + + def skip(self, node: Node) -> ASTNode | list[ASTNode] | None: + values = [] + for child in node.children: + if visitor_value := self.visit(child): + values.append(visitor_value) + match len(values): + case 0: + return None + case 1: + return values[0] + case _: + return values + + +# Concrete visitor to process function definitions +class MalCompiler(ParseTreeVisitor): + def compile(self, source: bytes): + tree = parser.parse(source) + self.visit(tree.root_node) + + # Named visit_{rule name in grammar.js} + def visit_define_declaration(self, node: Node) -> ASTNode: + key = node.child_by_field_name("id").text + value = node.child_by_field_name("value").text + + # Need to call decode because the text field is a `bytes` type. + print(f"Found definition -> {key.decode()}: '{value.decode()}'") + + # Iterate children nodes for whatever reason + # self.skip(node) + + return ("defines", {key.decode(): value.decode()}) diff --git a/examples/visitor/tests/__init__.py b/examples/visitor/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/visitor/tests/conftest.py b/examples/visitor/tests/conftest.py new file mode 100644 index 0000000..0d9a974 --- /dev/null +++ b/examples/visitor/tests/conftest.py @@ -0,0 +1,11 @@ +import pytest +import os + +@pytest.fixture(scope="module") +def setup_test_environment(request): + """Runs once before all tests and temporarily sets the working directory to use the file tests.""" + old_dir = os.getcwd() + TEST_DIR = request.param + os.chdir(TEST_DIR) + yield # Run tests + os.chdir(old_dir) diff --git a/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_1.mal b/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_1.mal new file mode 100644 index 0000000..6db2c57 --- /dev/null +++ b/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_1.mal @@ -0,0 +1,7 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + abstract asset {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_2.mal b/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_2.mal new file mode 100644 index 0000000..e546c2c --- /dev/null +++ b/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_2.mal @@ -0,0 +1,8 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + abstract asset Foo {} + asset Bar extends Foo {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_3.mal b/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_3.mal new file mode 100644 index 0000000..1bb4064 --- /dev/null +++ b/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_3.mal @@ -0,0 +1,8 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + abstract asset Foo {} + abstract asset Bar extends Foo {} + asset Baz extends Bar {} +} diff --git a/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_4.mal b/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_4.mal new file mode 100644 index 0000000..def1ae5 --- /dev/null +++ b/examples/visitor/tests/fixtures/abstract_asset_test_files/test_abstract_asset_4.mal @@ -0,0 +1,7 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + abstract asset Foo {} + asset Bar {} +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/append_test_files/test_append_1.mal b/examples/visitor/tests/fixtures/append_test_files/test_append_1.mal new file mode 100644 index 0000000..155a902 --- /dev/null +++ b/examples/visitor/tests/fixtures/append_test_files/test_append_1.mal @@ -0,0 +1,36 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | machineStep + +> computerStep + + | computerStep + } + + asset Server extends Machine + { + | overwhelm + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Network [network] 1 <-- L --> * [servers] Server +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/append_test_files/test_append_2.mal b/examples/visitor/tests/fixtures/append_test_files/test_append_2.mal new file mode 100644 index 0000000..397279a --- /dev/null +++ b/examples/visitor/tests/fixtures/append_test_files/test_append_2.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | machineStep + +> computerStep, + server.overwhelm, + shutDown + + + | computerStep + + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Server [server] 1 <-- L --> * [hosts] Computer +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/append_test_files/test_append_3.mal b/examples/visitor/tests/fixtures/append_test_files/test_append_3.mal new file mode 100644 index 0000000..bc9c819 --- /dev/null +++ b/examples/visitor/tests/fixtures/append_test_files/test_append_3.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | machineStep + +> computerStep, + server.WRONG_ATTACK_STEP, // WRONG!!! + shutDown + + + | computerStep + + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Server [server] 1 <-- L --> * [hosts] Computer +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/append_test_files/test_append_4.mal b/examples/visitor/tests/fixtures/append_test_files/test_append_4.mal new file mode 100644 index 0000000..e0ce0ac --- /dev/null +++ b/examples/visitor/tests/fixtures/append_test_files/test_append_4.mal @@ -0,0 +1,44 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + } + + asset Machine { + | machineStep + + | anotherMachineStep + } + + asset Computer extends Machine + { + | machineStep + +> computerStep, + server.overwhelm, + anotherMachineStep, + shutDown + + + | computerStep + + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Server [server] 1 <-- L --> * [hosts] Computer +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/append_test_files/test_append_5.mal b/examples/visitor/tests/fixtures/append_test_files/test_append_5.mal new file mode 100644 index 0000000..9217dd0 --- /dev/null +++ b/examples/visitor/tests/fixtures/append_test_files/test_append_5.mal @@ -0,0 +1,44 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + } + + asset Machine { + | machineStep + + | anotherMachineStep + } + + asset Computer extends Machine + { + | machineStep + +> computerStep, + server.overwhelm, + lenovoStep, + shutDown + + + | computerStep + + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Server [server] 1 <-- L --> * [hosts] Computer +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/append_test_files/test_append_6.mal b/examples/visitor/tests/fixtures/append_test_files/test_append_6.mal new file mode 100644 index 0000000..59d4eb4 --- /dev/null +++ b/examples/visitor/tests/fixtures/append_test_files/test_append_6.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | machineStep + +> computerStep, + server, + shutDown + + + | computerStep + + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Server [server] 1 <-- L --> * [hosts] Computer +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/append_test_files/test_append_7.mal b/examples/visitor/tests/fixtures/append_test_files/test_append_7.mal new file mode 100644 index 0000000..088d53d --- /dev/null +++ b/examples/visitor/tests/fixtures/append_test_files/test_append_7.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | lenovoStep + +> computerStep, + server.overwhelm, + shutDown + + + | computerStep + + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Server [server] 1 <-- L --> * [hosts] Computer +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_1.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_1.mal new file mode 100644 index 0000000..36ddca7 --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_1.mal @@ -0,0 +1,6 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset {} +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_2.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_2.mal new file mode 100644 index 0000000..517fc65 --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_2.mal @@ -0,0 +1,7 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_3.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_3.mal new file mode 100644 index 0000000..957659e --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_3.mal @@ -0,0 +1,8 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test {} + asset Test {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_4.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_4.mal new file mode 100644 index 0000000..cdc4b7d --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_4.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test {} +} +category System { + asset Test {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_5.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_5.mal new file mode 100644 index 0000000..2b65ad0 --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_5.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test {} +} +category AnotherSystem { + asset Test {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_6.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_6.mal new file mode 100644 index 0000000..f049d27 --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_6.mal @@ -0,0 +1,5 @@ +include "./test_assets_6_aux.mal" + +category System { + asset Test {} +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_6_aux.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_6_aux.mal new file mode 100644 index 0000000..8929ae0 --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_6_aux.mal @@ -0,0 +1,7 @@ +// Auxiliary file for the test +#version:"0.0.0" +#id: "org.mal-lang.testAnalyzer" + +category AnotherSystem { + asset AnotherTest {} +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_7.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_7.mal new file mode 100644 index 0000000..0e99369 --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_7.mal @@ -0,0 +1,5 @@ +include "test_assets_7_aux.mal" + +category System { + asset Test {} +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_7_aux.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_7_aux.mal new file mode 100644 index 0000000..1eba428 --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_7_aux.mal @@ -0,0 +1,6 @@ +#version:"0.0.0" +#id: "org.mal-lang.testAnalyzer" + +category AnotherSystem { + asset Test {} +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_8.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_8.mal new file mode 100644 index 0000000..b2fa844 --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_8.mal @@ -0,0 +1,5 @@ +include "test_assets_8_aux.mal" + +category System { + asset Test {} +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/asset_test_files/test_assets_8_aux.mal b/examples/visitor/tests/fixtures/asset_test_files/test_assets_8_aux.mal new file mode 100644 index 0000000..a90acf2 --- /dev/null +++ b/examples/visitor/tests/fixtures/asset_test_files/test_assets_8_aux.mal @@ -0,0 +1,6 @@ +#version:"0.0.0" +#id: "org.mal-lang.testAnalyzer" + +category System { + asset Test {} +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/association_test_files/test_association_1.mal b/examples/visitor/tests/fixtures/association_test_files/test_association_1.mal new file mode 100644 index 0000000..8668f84 --- /dev/null +++ b/examples/visitor/tests/fixtures/association_test_files/test_association_1.mal @@ -0,0 +1,11 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 {} + asset Asset2 {} +} +associations { + Asset1 [foo] * <-- connects --> * [bar] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/association_test_files/test_association_2.mal b/examples/visitor/tests/fixtures/association_test_files/test_association_2.mal new file mode 100644 index 0000000..f1a0224 --- /dev/null +++ b/examples/visitor/tests/fixtures/association_test_files/test_association_2.mal @@ -0,0 +1,11 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 {} +} + +associations { + Asset1 [foo] * <-- connects --> * [bar] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/association_test_files/test_association_3.mal b/examples/visitor/tests/fixtures/association_test_files/test_association_3.mal new file mode 100644 index 0000000..ac8315e --- /dev/null +++ b/examples/visitor/tests/fixtures/association_test_files/test_association_3.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset2 {} +} +associations { + Asset1 [foo] * <-- connects --> * [bar] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/association_test_files/test_association_4.mal b/examples/visitor/tests/fixtures/association_test_files/test_association_4.mal new file mode 100644 index 0000000..ba2abd3 --- /dev/null +++ b/examples/visitor/tests/fixtures/association_test_files/test_association_4.mal @@ -0,0 +1,19 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category Example { + asset Asset1 + { + | compromise + -> b.compromise + } + asset Asset2 + { + | compromise + } +} +associations +{ + Asset1 [a] * <-- L --> * [b] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/association_test_files/test_association_5.mal b/examples/visitor/tests/fixtures/association_test_files/test_association_5.mal new file mode 100644 index 0000000..d7b47a9 --- /dev/null +++ b/examples/visitor/tests/fixtures/association_test_files/test_association_5.mal @@ -0,0 +1,19 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category Example { + asset Asset1 + { + | compromise + -> b.compromise + } + asset Asset2 + { + | compromise + } +} +associations +{ + Asset1 [a] * <-- L --> * [c] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/association_test_files/test_association_6.mal b/examples/visitor/tests/fixtures/association_test_files/test_association_6.mal new file mode 100644 index 0000000..41d933f --- /dev/null +++ b/examples/visitor/tests/fixtures/association_test_files/test_association_6.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { +} +associations { + Asset1 [foo] * <-- connects --> * [bar] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/category_test_files/test_category_1.mal b/examples/visitor/tests/fixtures/category_test_files/test_category_1.mal new file mode 100644 index 0000000..360c0ff --- /dev/null +++ b/examples/visitor/tests/fixtures/category_test_files/test_category_1.mal @@ -0,0 +1,5 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category Test {} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/category_test_files/test_category_2.mal b/examples/visitor/tests/fixtures/category_test_files/test_category_2.mal new file mode 100644 index 0000000..ddb2d64 --- /dev/null +++ b/examples/visitor/tests/fixtures/category_test_files/test_category_2.mal @@ -0,0 +1,6 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category Test {} +category Test {} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_1.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_1.mal new file mode 100644 index 0000000..36b1f9e --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_1.mal @@ -0,0 +1,26 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let hostsOperatingSystems = hosts.operatingSystems + | access + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_10.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_10.mal new file mode 100644 index 0000000..cde9006 --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_10.mal @@ -0,0 +1,86 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let thisNetworkHosts = hosts + | access + // Error (no longer common ancestor) + // | + // v + -> thisNetworkHosts().(operatingSystems[Windows] \/ operatingSystems[Linux] - operatingSystems[WindowsVista]).fileSystems.folders.subfolders*.(configfiles /\ nonrootfiles).open + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } + + asset Linux extends OperatingSystem + { + | linuxStep + } + + asset Windows extends OperatingSystem + { + | windowsStep + } + + asset WindowsVista extends Windows + { + | windowsVistaStep + } + + asset FileSystem + { + | compromise + } + + asset Folder + { + | folderStep + } + + asset SubFolder extends Folder + { + | subFolderStep + } + + asset File + { + | open + } + + asset ConfigFile extends File + { + | openConfigFile + } + + asset RootFile extends File + { + | openRootFile + } + + asset NonRootFile // GONE!!! extends File + { + | openNonRootFile + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem + OperatingSystem [os] 1 <-- L --> 1..* [fileSystems] FileSystem + FileSystem [fs] 1 <-- L --> * [folders] Folder + Folder [parent] 1 <-- L --> * [subfolders] SubFolder + SubFolder [location] 1 <-- L --> * [configfiles] ConfigFile + SubFolder [location] 1 <-- L --> * [rootfiles] RootFile + SubFolder [location] 1 <-- L --> * [nonrootfiles] NonRootFile +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_2.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_2.mal new file mode 100644 index 0000000..9eb02d4 --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_2.mal @@ -0,0 +1,26 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + -> hosts.operatingSystems.attack + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_3.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_3.mal new file mode 100644 index 0000000..c21082e --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_3.mal @@ -0,0 +1,38 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let hostsOperatingSystems = hosts.operatingSystems.fileSystems.files + | access + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } + + asset FileSystem + { + | compromise + } + + asset File + { + | open + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem + OperatingSystem [os] 1 <-- L --> 1..* [fileSystems] FileSystem + FileSystem [fs] 1 <-- L --> * [files] File +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_4.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_4.mal new file mode 100644 index 0000000..954bd78 --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_4.mal @@ -0,0 +1,38 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + -> hosts.operatingSystems.fileSystems.files.open + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } + + asset FileSystem + { + | compromise + } + + asset File + { + | open + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem + OperatingSystem [os] 1 <-- L --> 1..* [fileSystems] FileSystem + FileSystem [fs] 1 <-- L --> * [files] File +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_5.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_5.mal new file mode 100644 index 0000000..f59a3d0 --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_5.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + // Error + // | + // V + -> hosts.operatingSystems.fileSystems.files + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } + + asset FileSystem + { + | compromise + } + + asset File + { + | open + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem + // GONE! OperatingSystem [os] 1 <-- L --> 1..* [fileSystems] FileSystem + FileSystem [fs] 1 <-- L --> * [files] File +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_6.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_6.mal new file mode 100644 index 0000000..491f797 --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_6.mal @@ -0,0 +1,83 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let thisNetworkHosts = hosts + | access + -> thisNetworkHosts().(operatingSystems[Windows] \/ operatingSystems[Linux] - operatingSystems[WindowsVista]).fileSystems.folders.subfolders*.(configfiles /\ nonrootfiles).open + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } + + asset Linux extends OperatingSystem + { + | linuxStep + } + + asset Windows extends OperatingSystem + { + | windowsStep + } + + asset WindowsVista extends Windows + { + | windowsVistaStep + } + + asset FileSystem + { + | compromise + } + + asset Folder + { + | folderStep + } + + asset SubFolder extends Folder + { + | subFolderStep + } + + asset File + { + | open + } + + asset ConfigFile extends File + { + | openConfigFile + } + + asset RootFile extends File + { + | openRootFile + } + + asset NonRootFile extends File + { + | openNonRootFile + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem + OperatingSystem [os] 1 <-- L --> 1..* [fileSystems] FileSystem + FileSystem [fs] 1 <-- L --> * [folders] Folder + Folder [parent] 1 <-- L --> * [subfolders] SubFolder + SubFolder [location] 1 <-- L --> * [configfiles] ConfigFile + SubFolder [location] 1 <-- L --> * [rootfiles] RootFile + SubFolder [location] 1 <-- L --> * [nonrootfiles] NonRootFile +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_7.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_7.mal new file mode 100644 index 0000000..87e6565 --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_7.mal @@ -0,0 +1,86 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let thisNetworkHosts = hosts + | access + // This is wrong + // | + // v + -> thisNetworkHosts().(operatingSystems[Windows] \/ operatingSystems[Linux] - operatingSystems[WindowsVista]).fileSystems.folders.subfolders*.(configfiles /\ nonrootfiles).open + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } + + asset Linux extends OperatingSystem + { + | linuxStep + } + + asset Windows extends OperatingSystem + { + | windowsStep + } + + asset WindowsVista // GONE!!! extends Windows + { + | windowsVistaStep + } + + asset FileSystem + { + | compromise + } + + asset Folder + { + | folderStep + } + + asset SubFolder extends Folder + { + | subFolderStep + } + + asset File + { + | open + } + + asset ConfigFile extends File + { + | openConfigFile + } + + asset RootFile extends File + { + | openRootFile + } + + asset NonRootFile extends File + { + | openNonRootFile + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem + OperatingSystem [os] 1 <-- L --> 1..* [fileSystems] FileSystem + FileSystem [fs] 1 <-- L --> * [folders] Folder + Folder [parent] 1 <-- L --> * [subfolders] SubFolder + SubFolder [location] 1 <-- L --> * [configfiles] ConfigFile + SubFolder [location] 1 <-- L --> * [rootfiles] RootFile + SubFolder [location] 1 <-- L --> * [nonrootfiles] NonRootFile +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_8.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_8.mal new file mode 100644 index 0000000..be03995 --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_8.mal @@ -0,0 +1,86 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let thisNetworkHosts = hosts + | access + // This is wrong (no such association) + // | + // v + -> thisNetworkHosts().(operatingSystems[Windows] \/ operatingSystems[Linux] - operatingSystems[WindowsVista]).fileSystems.folders.subfolders*.(configfiles /\ nonrootfiles).open + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } + + asset Linux extends OperatingSystem + { + | linuxStep + } + + asset Windows extends OperatingSystem + { + | windowsStep + } + + asset WindowsVista extends Windows + { + | windowsVistaStep + } + + asset FileSystem + { + | compromise + } + + asset Folder + { + | folderStep + } + + asset SubFolder extends Folder + { + | subFolderStep + } + + asset File + { + | open + } + + asset ConfigFile extends File + { + | openConfigFile + } + + asset RootFile extends File + { + | openRootFile + } + + asset NonRootFile extends File + { + | openNonRootFile + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem + // GONE!!!! OperatingSystem [os] 1 <-- L --> 1..* [fileSystems] FileSystem + FileSystem [fs] 1 <-- L --> * [folders] Folder + Folder [parent] 1 <-- L --> * [subfolders] SubFolder + SubFolder [location] 1 <-- L --> * [configfiles] ConfigFile + SubFolder [location] 1 <-- L --> * [rootfiles] RootFile + SubFolder [location] 1 <-- L --> * [nonrootfiles] NonRootFile +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/collect_test_files/test_collect_9.mal b/examples/visitor/tests/fixtures/collect_test_files/test_collect_9.mal new file mode 100644 index 0000000..bc18f15 --- /dev/null +++ b/examples/visitor/tests/fixtures/collect_test_files/test_collect_9.mal @@ -0,0 +1,86 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let thisNetworkHosts = hosts + | access + // Error (no longer child of folder) + // | + // v + -> thisNetworkHosts().(operatingSystems[Windows] \/ operatingSystems[Linux] - operatingSystems[WindowsVista]).fileSystems.folders.subfolders*.(configfiles /\ nonrootfiles).open + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } + + asset Linux extends OperatingSystem + { + | linuxStep + } + + asset Windows extends OperatingSystem + { + | windowsStep + } + + asset WindowsVista extends Windows + { + | windowsVistaStep + } + + asset FileSystem + { + | compromise + } + + asset Folder + { + | folderStep + } + + asset SubFolder // GONE!!! extends Folder + { + | subFolderStep + } + + asset File + { + | open + } + + asset ConfigFile extends File + { + | openConfigFile + } + + asset RootFile extends File + { + | openRootFile + } + + asset NonRootFile extends File + { + | openNonRootFile + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem + OperatingSystem [os] 1 <-- L --> 1..* [fileSystems] FileSystem + FileSystem [fs] 1 <-- L --> * [folders] Folder + Folder [parent] 1 <-- L --> * [subfolders] SubFolder + SubFolder [location] 1 <-- L --> * [configfiles] ConfigFile + SubFolder [location] 1 <-- L --> * [rootfiles] RootFile + SubFolder [location] 1 <-- L --> * [nonrootfiles] NonRootFile +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/define_test_files/test_define_1.mal b/examples/visitor/tests/fixtures/define_test_files/test_define_1.mal new file mode 100644 index 0000000..302cf62 --- /dev/null +++ b/examples/visitor/tests/fixtures/define_test_files/test_define_1.mal @@ -0,0 +1 @@ +#version:"0.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/define_test_files/test_define_2.mal b/examples/visitor/tests/fixtures/define_test_files/test_define_2.mal new file mode 100644 index 0000000..3a6a002 --- /dev/null +++ b/examples/visitor/tests/fixtures/define_test_files/test_define_2.mal @@ -0,0 +1 @@ +#id: "org.mal-lang.testAnalyzer" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/define_test_files/test_define_3.mal b/examples/visitor/tests/fixtures/define_test_files/test_define_3.mal new file mode 100644 index 0000000..cdba44c --- /dev/null +++ b/examples/visitor/tests/fixtures/define_test_files/test_define_3.mal @@ -0,0 +1,2 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"version1" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/define_test_files/test_define_4.mal b/examples/visitor/tests/fixtures/define_test_files/test_define_4.mal new file mode 100644 index 0000000..0017387 --- /dev/null +++ b/examples/visitor/tests/fixtures/define_test_files/test_define_4.mal @@ -0,0 +1,2 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/define_test_files/test_define_5.mal b/examples/visitor/tests/fixtures/define_test_files/test_define_5.mal new file mode 100644 index 0000000..b674a97 --- /dev/null +++ b/examples/visitor/tests/fixtures/define_test_files/test_define_5.mal @@ -0,0 +1,3 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" +#version:"1.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/define_test_files/test_define_6.mal b/examples/visitor/tests/fixtures/define_test_files/test_define_6.mal new file mode 100644 index 0000000..a447acd --- /dev/null +++ b/examples/visitor/tests/fixtures/define_test_files/test_define_6.mal @@ -0,0 +1,3 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" +#key:"value" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/define_test_files/test_define_7.mal b/examples/visitor/tests/fixtures/define_test_files/test_define_7.mal new file mode 100644 index 0000000..9147085 --- /dev/null +++ b/examples/visitor/tests/fixtures/define_test_files/test_define_7.mal @@ -0,0 +1,4 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" +#key:"value" +#key:"value" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/define_test_files/test_define_8.mal b/examples/visitor/tests/fixtures/define_test_files/test_define_8.mal new file mode 100644 index 0000000..b674a97 --- /dev/null +++ b/examples/visitor/tests/fixtures/define_test_files/test_define_8.mal @@ -0,0 +1,3 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" +#version:"1.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/exists_test_files/test_exists_1.mal b/examples/visitor/tests/fixtures/exists_test_files/test_exists_1.mal new file mode 100644 index 0000000..a013790 --- /dev/null +++ b/examples/visitor/tests/fixtures/exists_test_files/test_exists_1.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + E step1 + <- a3 + !E step2 + <- a2 + } + asset Asset2 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/exists_test_files/test_exists_2.mal b/examples/visitor/tests/fixtures/exists_test_files/test_exists_2.mal new file mode 100644 index 0000000..a338cd4 --- /dev/null +++ b/examples/visitor/tests/fixtures/exists_test_files/test_exists_2.mal @@ -0,0 +1,17 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + E step1 + <- a3 + -> wrongStep + } + asset Asset2 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/exists_test_files/test_exists_3.mal b/examples/visitor/tests/fixtures/exists_test_files/test_exists_3.mal new file mode 100644 index 0000000..91db393 --- /dev/null +++ b/examples/visitor/tests/fixtures/exists_test_files/test_exists_3.mal @@ -0,0 +1,20 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + E step1 + <- a2 + } + asset Asset2 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + + // COMMENTED + // | + // V + //Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/exists_test_files/test_exists_4.mal b/examples/visitor/tests/fixtures/exists_test_files/test_exists_4.mal new file mode 100644 index 0000000..1635f17 --- /dev/null +++ b/examples/visitor/tests/fixtures/exists_test_files/test_exists_4.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + !E step1 + <- a2.attack + } + asset Asset2 { + & attack + } + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/exists_test_files/test_exists_5.mal b/examples/visitor/tests/fixtures/exists_test_files/test_exists_5.mal new file mode 100644 index 0000000..cfd8805 --- /dev/null +++ b/examples/visitor/tests/fixtures/exists_test_files/test_exists_5.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + E step1 [Bernoulli(0.2)] + <- a2 + } + asset Asset2 { + & attack + } + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/exists_test_files/test_exists_6.mal b/examples/visitor/tests/fixtures/exists_test_files/test_exists_6.mal new file mode 100644 index 0000000..6592baa --- /dev/null +++ b/examples/visitor/tests/fixtures/exists_test_files/test_exists_6.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + !E step1 [Bernoulli(0.2)] + <- a2 + } + asset Asset2 { + & attack + } + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/exists_test_files/test_exists_7.mal b/examples/visitor/tests/fixtures/exists_test_files/test_exists_7.mal new file mode 100644 index 0000000..c77676e --- /dev/null +++ b/examples/visitor/tests/fixtures/exists_test_files/test_exists_7.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + E step1 + -> a2.attack + } + asset Asset2 { + & attack + } + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/exists_test_files/test_exists_8.mal b/examples/visitor/tests/fixtures/exists_test_files/test_exists_8.mal new file mode 100644 index 0000000..4e28ef2 --- /dev/null +++ b/examples/visitor/tests/fixtures/exists_test_files/test_exists_8.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + & step1 + <- a2.attack + } + asset Asset2 { + & attack + } + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/extend_test_files/test_extends_1.mal b/examples/visitor/tests/fixtures/extend_test_files/test_extends_1.mal new file mode 100644 index 0000000..bf7e480 --- /dev/null +++ b/examples/visitor/tests/fixtures/extend_test_files/test_extends_1.mal @@ -0,0 +1,8 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/extend_test_files/test_extends_2.mal b/examples/visitor/tests/fixtures/extend_test_files/test_extends_2.mal new file mode 100644 index 0000000..fd0c948 --- /dev/null +++ b/examples/visitor/tests/fixtures/extend_test_files/test_extends_2.mal @@ -0,0 +1,7 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Foo1 extends Foo2 {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/extend_test_files/test_extends_3.mal b/examples/visitor/tests/fixtures/extend_test_files/test_extends_3.mal new file mode 100644 index 0000000..7165164 --- /dev/null +++ b/examples/visitor/tests/fixtures/extend_test_files/test_extends_3.mal @@ -0,0 +1,11 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Foo1 extends Foo2 {} + asset Foo2 extends Foo3 {} + asset Foo3 extends Foo4 {} + asset Foo4 extends Foo5 {} + asset Foo5 extends Foo1 {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/extend_test_files/test_extends_4.mal b/examples/visitor/tests/fixtures/extend_test_files/test_extends_4.mal new file mode 100644 index 0000000..edc6cd7 --- /dev/null +++ b/examples/visitor/tests/fixtures/extend_test_files/test_extends_4.mal @@ -0,0 +1,5 @@ +include "test_extends_4_aux.mal" + +category System { + asset SubTest extends Test {} +} diff --git a/examples/visitor/tests/fixtures/extend_test_files/test_extends_4_aux.mal b/examples/visitor/tests/fixtures/extend_test_files/test_extends_4_aux.mal new file mode 100644 index 0000000..a90acf2 --- /dev/null +++ b/examples/visitor/tests/fixtures/extend_test_files/test_extends_4_aux.mal @@ -0,0 +1,6 @@ +#version:"0.0.0" +#id: "org.mal-lang.testAnalyzer" + +category System { + asset Test {} +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/fields_test_files/test_fields_1.mal b/examples/visitor/tests/fixtures/fields_test_files/test_fields_1.mal new file mode 100644 index 0000000..aa9aebd --- /dev/null +++ b/examples/visitor/tests/fixtures/fields_test_files/test_fields_1.mal @@ -0,0 +1,13 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 {} + asset Asset2 extends Asset1 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset2 [a2] * <-- connects --> * [a3_again] Asset3 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/fields_test_files/test_fields_2.mal b/examples/visitor/tests/fixtures/fields_test_files/test_fields_2.mal new file mode 100644 index 0000000..401ed31 --- /dev/null +++ b/examples/visitor/tests/fixtures/fields_test_files/test_fields_2.mal @@ -0,0 +1,13 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 {} + asset Asset2 extends Asset1 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset2 [a2] * <-- connects --> * [a3] Asset3 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/fields_test_files/test_fields_3.mal b/examples/visitor/tests/fixtures/fields_test_files/test_fields_3.mal new file mode 100644 index 0000000..dbe612d --- /dev/null +++ b/examples/visitor/tests/fixtures/fields_test_files/test_fields_3.mal @@ -0,0 +1,15 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 {} + asset Asset2 extends Asset1 { + | attack + } + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset2 [a2] * <-- connects --> * [attack] Asset3 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_1.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_1.mal new file mode 100644 index 0000000..5178a94 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_1.mal @@ -0,0 +1 @@ +include "test_include_empty.mal" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_2.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_2.mal new file mode 100644 index 0000000..1b1e756 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_2.mal @@ -0,0 +1 @@ +include "test_include_2_aux.mal" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_2_aux.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_2_aux.mal new file mode 100644 index 0000000..0017387 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_2_aux.mal @@ -0,0 +1,2 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_3.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_3.mal new file mode 100644 index 0000000..66136a8 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_3.mal @@ -0,0 +1,3 @@ +include "test_include_3_aux.mal" +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_3_aux.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_3_aux.mal new file mode 100644 index 0000000..0017387 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_3_aux.mal @@ -0,0 +1,2 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_4.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_4.mal new file mode 100644 index 0000000..f1861c0 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_4.mal @@ -0,0 +1,2 @@ +include "test_include_4_aux.mal" +#key: "test" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_4_aux.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_4_aux.mal new file mode 100644 index 0000000..0017387 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_4_aux.mal @@ -0,0 +1,2 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_5.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_5.mal new file mode 100644 index 0000000..69295db --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_5.mal @@ -0,0 +1,3 @@ +include "test_include_5_aux1.mal" +include "test_include_5_aux2.mal" +#key: "test" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_5_aux1.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_5_aux1.mal new file mode 100644 index 0000000..302cf62 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_5_aux1.mal @@ -0,0 +1 @@ +#version:"0.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_5_aux2.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_5_aux2.mal new file mode 100644 index 0000000..3a6a002 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_5_aux2.mal @@ -0,0 +1 @@ +#id: "org.mal-lang.testAnalyzer" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_6.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_6.mal new file mode 100644 index 0000000..4007c3a --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_6.mal @@ -0,0 +1,5 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +include "test_include_empty.mal" +include "test_include_empty.mal" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_7.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_7.mal new file mode 100644 index 0000000..c9e46bd --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_7.mal @@ -0,0 +1,4 @@ +include "test_include_empty.mal" + +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_8.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_8.mal new file mode 100644 index 0000000..9447b48 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_8.mal @@ -0,0 +1,4 @@ +include "test_include_8_aux1.mal" + +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_8_aux1.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_8_aux1.mal new file mode 100644 index 0000000..4f80845 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_8_aux1.mal @@ -0,0 +1 @@ +include "test_include_8_aux2.mal" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_8_aux2.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_8_aux2.mal new file mode 100644 index 0000000..f4dfa56 --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_8_aux2.mal @@ -0,0 +1 @@ +include "test_include_8.mal" \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/include_test_files/test_include_empty.mal b/examples/visitor/tests/fixtures/include_test_files/test_include_empty.mal new file mode 100644 index 0000000..6c1b6ba --- /dev/null +++ b/examples/visitor/tests/fixtures/include_test_files/test_include_empty.mal @@ -0,0 +1 @@ +// Purposely left empty \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_1.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_1.mal new file mode 100644 index 0000000..8f470c2 --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_1.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Foo + random info: "Hello" + {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_10.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_10.mal new file mode 100644 index 0000000..c8faa11 --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_10.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" +{ + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + } +} + +category AnotherSystem + random info: "This is another category" +{ + asset Bar + random info: "Hello from another category" + { + | compromise + random info: "Hello from another attack step" + } +} + +associations { + Foo [foo] 1 <-- RandomAssociation --> 0 [bar] Bar + random info: "This is an association" + random info: "This is another comment on association" +} diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_11.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_11.mal new file mode 100644 index 0000000..b20e078 --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_11.mal @@ -0,0 +1,31 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" +{ + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + } +} + +category AnotherSystem + random info: "This is another category" +{ + asset Bar + random info: "Hello from another category" + { + | compromise + random info: "Hello from another attack step" + } +} + +associations { + Foo [foo] 1 <-- RandomAssociation --> 0 [bar] Bar + random info: "This is an association" + Foo [foos] * <-- AnotherRandomAssociation --> * [bars] Bar + random info: "This is another association" +} diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_12.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_12.mal new file mode 100644 index 0000000..f06916f --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_12.mal @@ -0,0 +1,21 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" +{ + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + } + + asset Bar + random info: "Hello from Bar!" + { + | compromise + random info: "Hello from Bar's attack step" + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_13.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_13.mal new file mode 100644 index 0000000..03d5823 --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_13.mal @@ -0,0 +1,19 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" + modeler info: "This is to trick" + random info: "This is the same category" +{ + asset Foo + random info: "Hello" + { + & compromise + random info: "Hello from the attack step" + | beforeCompromise + random info: "Stepping stone to compromise" + -> compromise + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_14.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_14.mal new file mode 100644 index 0000000..73d9a14 --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_14.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_15.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_15.mal new file mode 100644 index 0000000..9781201 --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_15.mal @@ -0,0 +1,17 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" +{ + asset Foo + random info: "Hello" + { + & compromise + random info: "Hello from the attack step" + | beforeCompromise + random info: "Stepping stone to compromise" + -> compromise + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_2.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_2.mal new file mode 100644 index 0000000..79e71f5 --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_2.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Foo + random info: "Hello" + random info: "Hello once more!" + {} +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_3.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_3.mal new file mode 100644 index 0000000..85e6a6f --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_3.mal @@ -0,0 +1,13 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + random info: "Hello from the attack step once more" + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_4.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_4.mal new file mode 100644 index 0000000..2463c0e --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_4.mal @@ -0,0 +1,13 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + another_random info: "Hello from the attack step once more" + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_5.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_5.mal new file mode 100644 index 0000000..a5e4c56 --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_5.mal @@ -0,0 +1,15 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" +{ + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + another_random info: "Hello from the attack step once more" + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_6.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_6.mal new file mode 100644 index 0000000..709f65c --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_6.mal @@ -0,0 +1,16 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" + random info: "This is a repetition" +{ + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + another_random info: "Hello from the attack step once more" + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_7.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_7.mal new file mode 100644 index 0000000..cb515bf --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_7.mal @@ -0,0 +1,17 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" + another_random info: "This is more" +{ + asset Foo + random info: "Hello" + another_random info: "Hello again" + { + | compromise + random info: "Hello from the attack step" + another_random info: "Hello from the attack step once more" + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_8.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_8.mal new file mode 100644 index 0000000..cceeebe --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_8.mal @@ -0,0 +1,24 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" +{ + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + } +} + +category AnotherSystem + random info: "This is another category" +{ + asset Bar + random info: "Hello from another category" + { + | compromise + random info: "Hello from another attack step" + } +} diff --git a/examples/visitor/tests/fixtures/info_test_files/test_asset_info_9.mal b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_9.mal new file mode 100644 index 0000000..8795d1b --- /dev/null +++ b/examples/visitor/tests/fixtures/info_test_files/test_asset_info_9.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System + random info: "This is a category" +{ + asset Foo + random info: "Hello" + { + | compromise + random info: "Hello from the attack step" + } +} + +category AnotherSystem + random info: "This is another category" +{ + asset Bar + random info: "Hello from another category" + { + | compromise + random info: "Hello from another attack step" + } +} + +associations { + Foo [foo] 1 <-- RandomAssociation --> 0 [bar] Bar + random info: "This is an association" +} diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_1.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_1.mal new file mode 100644 index 0000000..9938bdd --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_1.mal @@ -0,0 +1,23 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Platform { + | access + } + asset Computer { + let components = software \/ hardware + | access + } + asset Software extends Platform { + | compromise + } + asset Hardware extends Platform { + | overheat + } +} +associations { + Computer [host] 1 <-- Programs --> * [software] Software + Computer [host] 1 <-- SpecificHardware --> * [hardware] Hardware +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_10.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_10.mal new file mode 100644 index 0000000..d1f0334 --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_10.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + let component = asset3 + } + asset Asset2 extends Asset1 { + } + asset Asset3 extends Asset2 { + } + asset Asset4 extends Asset3 { + let component = asset3 + } +} +associations { + Asset1 [asset1] 1 <-- One --> 1 [asset3] Asset3 +} diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_2.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_2.mal new file mode 100644 index 0000000..690bd3d --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_2.mal @@ -0,0 +1,23 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Platform { + | access + } + asset Computer { + let component = software + let component = hardware + | access + } + asset Software extends Platform { + | compromise + } + asset Hardware extends Platform { + | overheat + } +} +associations { + Computer [host] 1 <-- Programs --> * [software] Software + Computer [host] 1 <-- SpecificHardware --> * [hardware] Hardware +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_3.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_3.mal new file mode 100644 index 0000000..eed9e9c --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_3.mal @@ -0,0 +1,15 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer { + let component = hardware.overheat + } + asset Hardware { + | overheat + } +} +associations { + Computer [host] 1 <-- SpecificHardware --> * [hardware] Hardware +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_4.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_4.mal new file mode 100644 index 0000000..5561cbb --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_4.mal @@ -0,0 +1,19 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + let component = asset3 + } + asset Asset2 extends Asset1 { + let another_component = asset4 + } + asset Asset3 { + } + asset Asset4 { + } +} +associations { + Asset1 [asset1] 1 <-- One --> 1 [asset3] Asset3 + Asset2 [asset2] 1 <-- Two --> 1 [asset4] Asset4 +} diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_5.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_5.mal new file mode 100644 index 0000000..a583732 --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_5.mal @@ -0,0 +1,19 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + let component = asset3 + } + asset Asset2 extends Asset1 { + let component = asset4 + } + asset Asset3 { + } + asset Asset4 { + } +} +associations { + Asset1 [asset1] 1 <-- One --> 1 [asset3] Asset3 + Asset2 [asset2] 1 <-- Two --> 1 [asset4] Asset4 +} diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_6.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_6.mal new file mode 100644 index 0000000..a10c976 --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_6.mal @@ -0,0 +1,17 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + let component1 = component2() + let component2 = component1() + } + asset Asset3 { + } + asset Asset4 { + } +} +associations { + Asset1 [asset1] 1 <-- One --> 1 [asset3] Asset3 + Asset1 [asset1] 1 <-- Two --> 1 [asset4] Asset4 +} diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_7.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_7.mal new file mode 100644 index 0000000..b27ddc8 --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_7.mal @@ -0,0 +1,15 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + } + asset Asset3 extends Asset1 { + let component = asset4 + } + asset Asset4 { + } +} +associations { + Asset3 [asset3] 1 <-- One --> 1 [asset4] Asset4 +} diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_8.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_8.mal new file mode 100644 index 0000000..f10e921 --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_8.mal @@ -0,0 +1,15 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + } + asset Asset3 extends Asset1 { + let component = asset4 + } + asset Asset4 { + } +} +associations { + Asset1 [asset1] 1 <-- One --> 1 [asset4] Asset4 +} diff --git a/examples/visitor/tests/fixtures/let_test_files/test_let_9.mal b/examples/visitor/tests/fixtures/let_test_files/test_let_9.mal new file mode 100644 index 0000000..40178f1 --- /dev/null +++ b/examples/visitor/tests/fixtures/let_test_files/test_let_9.mal @@ -0,0 +1,15 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + let component = asset4 + } + asset Asset3 extends Asset1 { + } + asset Asset4 { + } +} +associations { + Asset1 [asset1] 1 <-- One --> 1 [asset4] Asset4 +} diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_1.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_1.mal new file mode 100644 index 0000000..19b2ce7 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_1.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let allTargets = operatingSystems[Windows] /\ operatingSystems[Linux] + | findWindowsAndLinux + -> allTargets().attack + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_10.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_10.mal new file mode 100644 index 0000000..2edb6bb --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_10.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | findWindowsAndLinux + -> (computers.operatingSystems[Windows] \/ computers.operatingSystems[Linux]) + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_11.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_11.mal new file mode 100644 index 0000000..6300371 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_11.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | findWindowsAndLinux + -> (computers.operatingSystems[Windows] \/ computers.operatingSystems[Linux]).foundWindows + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_12.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_12.mal new file mode 100644 index 0000000..edbe255 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_12.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let targets = windows \/ linux + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows + { + | attack + } + asset Linux + { + | attack + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [linux] Linux + Computer [computers] * <-- L --> 0..1 [windows] Windows +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_13.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_13.mal new file mode 100644 index 0000000..a8aaa28 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_13.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network + { + let allComputers = computers[ThinkPad] \/ computers[Asus] + | access + -> allComputers().compromise + } + + asset Machine { + | compromise + } + + asset Computer extends Machine { + } + + asset ThinkPad extends Computer { + } + + asset Asus extends Computer { + } +} + +associations +{ + Network [network] 1 <-- L --> * [computers] Computer +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_14.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_14.mal new file mode 100644 index 0000000..6eea7df --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_14.mal @@ -0,0 +1,34 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | do + -> (windows \/ linux).softwareStep + } + + abstract asset Software { + | softwareStep + } + + abstract asset OperatingSystem extends Software + { + | attack + } + asset Windows extends OperatingSystem + { + | attack + } + asset Linux extends OperatingSystem + { + | attack + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [linux] Linux + Computer [computers] * <-- L --> 0..1 [windows] Windows +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_15.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_15.mal new file mode 100644 index 0000000..ff05509 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_15.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let allTargets = operatingSystems[Windows] - operatingSystems[Linux] + | findWindowsAndLinux + -> allTargets().attack + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_16.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_16.mal new file mode 100644 index 0000000..ae008e9 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_16.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | findWindowsAndLinux + -> (operatingSystems[Windows] - operatingSystems[Linux]).attack + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_17.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_17.mal new file mode 100644 index 0000000..f63080f --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_17.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | findWindowsAndLinux + -> (computers.operatingSystems[Windows] - computers.operatingSystems[Linux]) + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_18.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_18.mal new file mode 100644 index 0000000..0b7cb65 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_18.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | findWindowsAndLinux + -> (computers.operatingSystems[Windows] - computers.operatingSystems[Linux]).foundWindows + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_19.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_19.mal new file mode 100644 index 0000000..5459315 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_19.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let targets = windows - linux + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows + { + | attack + } + asset Linux + { + | attack + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [linux] Linux + Computer [computers] * <-- L --> 0..1 [windows] Windows +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_2.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_2.mal new file mode 100644 index 0000000..2aa5464 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_2.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | findWindowsAndLinux + -> (operatingSystems[Windows] /\ operatingSystems[Linux]).attack + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_20.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_20.mal new file mode 100644 index 0000000..b525a2c --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_20.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network + { + let allComputers = computers[ThinkPad] - computers[Asus] + | access + -> allComputers().compromise + } + + asset Machine { + | compromise + } + + asset Computer extends Machine { + } + + asset ThinkPad extends Computer { + } + + asset Asus extends Computer { + } +} + +associations +{ + Network [network] 1 <-- L --> * [computers] Computer +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_21.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_21.mal new file mode 100644 index 0000000..d49db1f --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_21.mal @@ -0,0 +1,34 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | do + -> (windows - linux).softwareStep + } + + abstract asset Software { + | softwareStep + } + + abstract asset OperatingSystem extends Software + { + | attack + } + asset Windows extends OperatingSystem + { + | attack + } + asset Linux extends OperatingSystem + { + | attack + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [linux] Linux + Computer [computers] * <-- L --> 0..1 [windows] Windows +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_22.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_22.mal new file mode 100644 index 0000000..6f1df6c --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_22.mal @@ -0,0 +1,40 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Main + { + | do + -> (((grandchild \/ child) /\ parent) - grandparent).bigAttack + } + + asset Generator { + | bigAttack + } + + asset Grandparent extends Generator { + | attack + } + + asset Parent extends Grandparent + { + | attack + } + asset Child extends Parent + { + | attack + } + asset Grandchild extends Child + { + | attack + } +} + +associations +{ + Main [host] * <-- L --> 0..1 [grandparent] Grandparent + Main [host1] * <-- L --> 0..1 [parent] Parent + Main [host2] * <-- L --> 0..1 [child] Child + Main [host3] * <-- L --> 0..1 [grandchild] Grandchild +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_3.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_3.mal new file mode 100644 index 0000000..07a1f61 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_3.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | findWindowsAndLinux + -> (computers.operatingSystems[Windows] /\ computers.operatingSystems[Linux]) + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_4.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_4.mal new file mode 100644 index 0000000..148eab8 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_4.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | findWindowsAndLinux + -> (computers.operatingSystems[Windows] /\ computers.operatingSystems[Linux]).foundWindows + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_5.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_5.mal new file mode 100644 index 0000000..64f5647 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_5.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let targets = windows /\ linux + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows + { + | attack + } + asset Linux + { + | attack + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [linux] Linux + Computer [computers] * <-- L --> 0..1 [windows] Windows +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_6.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_6.mal new file mode 100644 index 0000000..a8aaa28 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_6.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network + { + let allComputers = computers[ThinkPad] \/ computers[Asus] + | access + -> allComputers().compromise + } + + asset Machine { + | compromise + } + + asset Computer extends Machine { + } + + asset ThinkPad extends Computer { + } + + asset Asus extends Computer { + } +} + +associations +{ + Network [network] 1 <-- L --> * [computers] Computer +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_7.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_7.mal new file mode 100644 index 0000000..7a892da --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_7.mal @@ -0,0 +1,34 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | do + -> (windows /\ linux).softwareStep + } + + abstract asset Software { + | softwareStep + } + + abstract asset OperatingSystem extends Software + { + | attack + } + asset Windows extends OperatingSystem + { + | attack + } + asset Linux extends OperatingSystem + { + | attack + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [linux] Linux + Computer [computers] * <-- L --> 0..1 [windows] Windows +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_8.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_8.mal new file mode 100644 index 0000000..6eea399 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_8.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let allTargets = operatingSystems[Windows] \/ operatingSystems[Linux] + | findWindowsAndLinux + -> allTargets().attack + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/operation_test_files/test_operation_9.mal b/examples/visitor/tests/fixtures/operation_test_files/test_operation_9.mal new file mode 100644 index 0000000..07369a4 --- /dev/null +++ b/examples/visitor/tests/fixtures/operation_test_files/test_operation_9.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | findWindowsAndLinux + -> (operatingSystems[Windows] \/ operatingSystems[Linux]).attack + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_1.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_1.mal new file mode 100644 index 0000000..99f5c39 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_1.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0.2, 0.5) ^ Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_10.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_10.mal new file mode 100644 index 0000000..279e7a2 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_10.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0, 0.5) / Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_11.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_11.mal new file mode 100644 index 0000000..a8e4133 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_11.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Bernoulli(0.2) / Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_12.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_12.mal new file mode 100644 index 0000000..942fcaf --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_12.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [EasyAndUncertain / Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_13.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_13.mal new file mode 100644 index 0000000..b2a1ef4 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_13.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0.2, 0.5) + Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_14.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_14.mal new file mode 100644 index 0000000..dcc8155 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_14.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0, 0.5) + Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_15.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_15.mal new file mode 100644 index 0000000..62a29f4 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_15.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Bernoulli(0.5) + Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_16.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_16.mal new file mode 100644 index 0000000..5e50535 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_16.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0.2, 0.5) * Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_17.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_17.mal new file mode 100644 index 0000000..84d8ea6 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_17.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0, 0.5) * Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_18.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_18.mal new file mode 100644 index 0000000..32f91ea --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_18.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Bernoulli(0.2) * Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_19.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_19.mal new file mode 100644 index 0000000..7845870 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_19.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Bernoulli(0.2) * (Exponential(0.1) + Gamma(0.2, 0.5) / (TruncatedNormal(0.5,0.8) ^ Pareto(0.1,0.1))) - 4 * (Uniform(0.1,0.5) - EasyAndCertain) / Binomial(5, 0.6)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_2.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_2.mal new file mode 100644 index 0000000..9c367b2 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_2.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0, 0.2) ^ Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_20.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_20.mal new file mode 100644 index 0000000..116a52d --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_20.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Bernoulli(0.2) * (Exponential(0.1) ^ (EasyAndCertain + (Bernoulli(0.2) + EasyAndUncertain)) / (VeryHardAndUncertain * VeryHardAndCertain) - Gamma(0.2, 0.77))] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_21.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_21.mal new file mode 100644 index 0000000..ccebec6 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_21.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Bernoulli(0.2) * (Exponential(0.1) - (Bernoulli(0.4) * 20 + EasyAndUncertain))] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_22.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_22.mal new file mode 100644 index 0000000..bae6c0e --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_22.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + // WRONG!!! + // | + // v + | login [Bernoulli(0.2) * (Exponential(0.1) / (Gamma(0.5, 0.2) * EasyAndCertain - (LogNormal(0.1, 0.45) ^ 5) * Uniform(0.4, 0.3)))] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_23.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_23.mal new file mode 100644 index 0000000..c4fd742 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_23.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + // WRONG!!! + // | + // v + | login [Bernoulli(0.2) * (Exponential(0.1) ^ (EasyAndCertain + (Bernoulli(0.2) + EasyAndUncertain)) / (VeryHardAndUncertain * Enabled) - Gamma(0.2, 0.77))] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_24.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_24.mal new file mode 100644 index 0000000..653c4ff --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_24.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Bernoulli(0.2) * (Exponential(0.1) + Gamma(0.2, 0.5) / (TruncatedNormal(0.5,0.8) ^ Pareto(0.1,0.1))) - 4 * (Uniform(0.1,0.5) - EasyAndCertain) ^ Bernoulli(0.5)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_3.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_3.mal new file mode 100644 index 0000000..520626b --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_3.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Bernoulli(0.5) ^ Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_4.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_4.mal new file mode 100644 index 0000000..ec42f9b --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_4.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [EasyAndUncertain ^ Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_5.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_5.mal new file mode 100644 index 0000000..b2ff2f6 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_5.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0.2, 0.5) - Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_6.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_6.mal new file mode 100644 index 0000000..b6ac0ee --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_6.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0, 0.5) - Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_7.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_7.mal new file mode 100644 index 0000000..d7a2ba5 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_7.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Bernoulli(0.5) - Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_8.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_8.mal new file mode 100644 index 0000000..e8da7c6 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_8.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [EasyAndUncertain - Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_9.mal b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_9.mal new file mode 100644 index 0000000..1836f22 --- /dev/null +++ b/examples/visitor/tests/fixtures/probability_distributions_test_files/test_probability_distributions_9.mal @@ -0,0 +1,9 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem {} + asset Linux extends OperatingSystem { + | login [Gamma(0.2, 0.5) / Exponential(0.1)] + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_1.mal b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_1.mal new file mode 100644 index 0000000..21cb890 --- /dev/null +++ b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_1.mal @@ -0,0 +1,34 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + -> hosts.shutDown + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Network [network] 1 <-- L --> * [servers] Server +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_2.mal b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_2.mal new file mode 100644 index 0000000..274e4cf --- /dev/null +++ b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_2.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + -> hosts.shutDown, + servers.overwhelm, + routers.dropAllPackets + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Router extends Machine { + | dropAllPackets + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Network [network] 1 <-- L --> * [servers] Server + Network [network] 1 <-- L --> * [routers] Router +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_3.mal b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_3.mal new file mode 100644 index 0000000..40a2c59 --- /dev/null +++ b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_3.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + -> hosts.shutDown, + servers.WRONG_ATTACK_STEP, // <- WRONG!!! + routers.dropAllPackets + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Router extends Machine { + | dropAllPackets + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Network [network] 1 <-- L --> * [servers] Server + Network [network] 1 <-- L --> * [routers] Router +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_4.mal b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_4.mal new file mode 100644 index 0000000..7396cb5 --- /dev/null +++ b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_4.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + -> hosts.shutDown, + servers.machineStep, + routers.dropAllPackets + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Router extends Machine { + | dropAllPackets + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Network [network] 1 <-- L --> * [servers] Server + Network [network] 1 <-- L --> * [routers] Router +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_5.mal b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_5.mal new file mode 100644 index 0000000..30add68 --- /dev/null +++ b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_5.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + -> servers.overwhelm, + hosts.lenovoStep, + routers.dropAllPackets + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Router extends Machine { + | dropAllPackets + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Network [network] 1 <-- L --> * [servers] Server + Network [network] 1 <-- L --> * [routers] Router +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_6.mal b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_6.mal new file mode 100644 index 0000000..b797672 --- /dev/null +++ b/examples/visitor/tests/fixtures/reaches_test_files/test_reaches_6.mal @@ -0,0 +1,41 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | access + -> hosts.shutDown, + servers.overwhelm, + routers + } + + asset Machine { + | machineStep + } + + asset Computer extends Machine + { + | shutDown + } + + asset Server extends Machine + { + | overwhelm + } + + asset Router extends Machine { + | dropAllPackets + } + + asset Lenovo extends Computer { + | lenovoStep + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Network [network] 1 <-- L --> * [servers] Server + Network [network] 1 <-- L --> * [routers] Router +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/require_test_files/test_require_1.mal b/examples/visitor/tests/fixtures/require_test_files/test_require_1.mal new file mode 100644 index 0000000..9bd593e --- /dev/null +++ b/examples/visitor/tests/fixtures/require_test_files/test_require_1.mal @@ -0,0 +1,21 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 + { + E step1 + <- a3 + -> step + !E step2 + <- a2 + | step + } + asset Asset2 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/require_test_files/test_require_2.mal b/examples/visitor/tests/fixtures/require_test_files/test_require_2.mal new file mode 100644 index 0000000..2fc0839 --- /dev/null +++ b/examples/visitor/tests/fixtures/require_test_files/test_require_2.mal @@ -0,0 +1,19 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 + { + E step1 + <- a3, a2 + -> step + | step + } + asset Asset2 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/require_test_files/test_require_3.mal b/examples/visitor/tests/fixtures/require_test_files/test_require_3.mal new file mode 100644 index 0000000..4042f63 --- /dev/null +++ b/examples/visitor/tests/fixtures/require_test_files/test_require_3.mal @@ -0,0 +1,20 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 + { + E step1 + <- a3, + a4 // <- WRONG!!! + -> step + | step + } + asset Asset2 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/require_test_files/test_require_4.mal b/examples/visitor/tests/fixtures/require_test_files/test_require_4.mal new file mode 100644 index 0000000..e94d13f --- /dev/null +++ b/examples/visitor/tests/fixtures/require_test_files/test_require_4.mal @@ -0,0 +1,23 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset0 { + | randomStep + } + + asset Asset1 extends Asset0 + { + E step1 + <- a3, + a2 + -> step + | step + } + asset Asset2 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset0 [a0] * <-- connects --> * [a2] Asset2 +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/require_test_files/test_require_5.mal b/examples/visitor/tests/fixtures/require_test_files/test_require_5.mal new file mode 100644 index 0000000..6c06d8c --- /dev/null +++ b/examples/visitor/tests/fixtures/require_test_files/test_require_5.mal @@ -0,0 +1,23 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset0 extends Asset1 { + | randomStep + } + + asset Asset1 + { + E step1 + <- a3, + a2 + -> step + | step + } + asset Asset2 {} + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset0 [a0] * <-- connects --> * [a2] Asset2 +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/require_test_files/test_require_6.mal b/examples/visitor/tests/fixtures/require_test_files/test_require_6.mal new file mode 100644 index 0000000..6f9adfc --- /dev/null +++ b/examples/visitor/tests/fixtures/require_test_files/test_require_6.mal @@ -0,0 +1,21 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 + { + E step1 + <- a3, a2.asset2_Step // <- WRONG!!! + -> step + | step + } + asset Asset2 { + | asset2_Step + } + asset Asset3 {} +} +associations { + Asset1 [a1] * <-- connects --> * [a3] Asset3 + Asset1 [a1] * <-- connects --> * [a2] Asset2 +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/require_test_files/test_require_7.mal b/examples/visitor/tests/fixtures/require_test_files/test_require_7.mal new file mode 100644 index 0000000..ea8a1ca --- /dev/null +++ b/examples/visitor/tests/fixtures/require_test_files/test_require_7.mal @@ -0,0 +1,84 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let thisNetworkHosts = hosts + E access + <- thisNetworkHosts().(operatingSystems[Windows] \/ operatingSystems[Linux] - operatingSystems[WindowsVista]).fileSystems.folders.subfolders*.(configfiles /\ nonrootfiles) + -> hosts.shutDown + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } + + asset Linux extends OperatingSystem + { + | linuxStep + } + + asset Windows extends OperatingSystem + { + | windowsStep + } + + asset WindowsVista extends Windows + { + | windowsVistaStep + } + + asset FileSystem + { + | compromise + } + + asset Folder + { + | folderStep + } + + asset SubFolder extends Folder + { + | subFolderStep + } + + asset File + { + | open + } + + asset ConfigFile extends File + { + | openConfigFile + } + + asset RootFile extends File + { + | openRootFile + } + + asset NonRootFile extends File + { + | openNonRootFile + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem + OperatingSystem [os] 1 <-- L --> 1..* [fileSystems] FileSystem + FileSystem [fs] 1 <-- L --> * [folders] Folder + Folder [parent] 1 <-- L --> * [subfolders] SubFolder + SubFolder [location] 1 <-- L --> * [configfiles] ConfigFile + SubFolder [location] 1 <-- L --> * [rootfiles] RootFile + SubFolder [location] 1 <-- L --> * [nonrootfiles] NonRootFile +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_1.mal b/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_1.mal new file mode 100644 index 0000000..08c6b85 --- /dev/null +++ b/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_1.mal @@ -0,0 +1,13 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset CIA_TEST + { + | readOnly {C} + | readAndAppend {C, I} + | appendAndRead {I, C} + | fullAccess {C, I, A} + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_2.mal b/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_2.mal new file mode 100644 index 0000000..1cb5636 --- /dev/null +++ b/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_2.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset CIA_TEST + { + | readOnly {C} + | readAndAppend {C, I, I} + | fullAccess {C, I, A} + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_3.mal b/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_3.mal new file mode 100644 index 0000000..923eeff --- /dev/null +++ b/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_3.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset CIA_TEST + { + E step {C} + <- mock + } + + asset Mock { + } +} + +association { + CIA_TEST [test] 1 <-- L --> 1 [mock] Mock +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_4.mal b/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_4.mal new file mode 100644 index 0000000..682572b --- /dev/null +++ b/examples/visitor/tests/fixtures/risk_type_test_files/test_risk_type_4.mal @@ -0,0 +1,17 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset CIA_TEST + { + # step {C} + } + + asset Mock { + } +} + +association { + CIA_TEST [test] 1 <-- L --> 1 [mock] Mock +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/step_test_files/test_step_1.mal b/examples/visitor/tests/fixtures/step_test_files/test_step_1.mal new file mode 100644 index 0000000..0f93afe --- /dev/null +++ b/examples/visitor/tests/fixtures/step_test_files/test_step_1.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test + { + | step1 + | step2 + | step3 + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/step_test_files/test_step_2.mal b/examples/visitor/tests/fixtures/step_test_files/test_step_2.mal new file mode 100644 index 0000000..4bfc003 --- /dev/null +++ b/examples/visitor/tests/fixtures/step_test_files/test_step_2.mal @@ -0,0 +1,11 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test + { + | step1 + & step1 + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/step_test_files/test_step_3.mal b/examples/visitor/tests/fixtures/step_test_files/test_step_3.mal new file mode 100644 index 0000000..55682cd --- /dev/null +++ b/examples/visitor/tests/fixtures/step_test_files/test_step_3.mal @@ -0,0 +1,11 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test + { + | step1 + | step1 + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/step_test_files/test_step_4.mal b/examples/visitor/tests/fixtures/step_test_files/test_step_4.mal new file mode 100644 index 0000000..f5f8dd1 --- /dev/null +++ b/examples/visitor/tests/fixtures/step_test_files/test_step_4.mal @@ -0,0 +1,14 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test + { + | step1 + -> step3 + | step2 + -> step3 + | step3 + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/step_test_files/test_step_5.mal b/examples/visitor/tests/fixtures/step_test_files/test_step_5.mal new file mode 100644 index 0000000..8b033f9 --- /dev/null +++ b/examples/visitor/tests/fixtures/step_test_files/test_step_5.mal @@ -0,0 +1,14 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test + { + | step1 + } + asset AnotherTest + { + | step1 + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_1.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_1.mal new file mode 100644 index 0000000..7170848 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_1.mal @@ -0,0 +1,14 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Test + { + | guessPassword + -> authenticate + | stealPassword + -> authenticate + | authenticate + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_10.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_10.mal new file mode 100644 index 0000000..23ddf3e --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_10.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Machine { + | compromise + } + + asset Computer extends Machine { + | stealCredentials + } + + asset Thinkpad extends Computer { + & compromise + +> shutDown + & shutDown + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_11.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_11.mal new file mode 100644 index 0000000..494c838 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_11.mal @@ -0,0 +1,15 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem + { + | spyware + } + + asset Linux + { + & spyware + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_12.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_12.mal new file mode 100644 index 0000000..dedd301 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_12.mal @@ -0,0 +1,13 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +include "test_steps_12_aux2.mal" + +category System { + asset Thinkpad extends Computer { + | compromise + +> logIn + & logIn + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_12_aux1.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_12_aux1.mal new file mode 100644 index 0000000..2b162c1 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_12_aux1.mal @@ -0,0 +1,5 @@ +category System { + asset Machine { + | compromise + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_12_aux2.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_12_aux2.mal new file mode 100644 index 0000000..30603d7 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_12_aux2.mal @@ -0,0 +1,6 @@ +include "test_steps_12_aux1.mal" +category System { + asset Computer extends Machine { + & logKeyStrokes + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_13.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_13.mal new file mode 100644 index 0000000..7f13138 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_13.mal @@ -0,0 +1,13 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +include "test_steps_13_aux2.mal" + +category System { + asset Thinkpad extends Computer { + & compromise + +> logIn + & logIn + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_13_aux1.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_13_aux1.mal new file mode 100644 index 0000000..2b162c1 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_13_aux1.mal @@ -0,0 +1,5 @@ +category System { + asset Machine { + | compromise + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_13_aux2.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_13_aux2.mal new file mode 100644 index 0000000..6921b8b --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_13_aux2.mal @@ -0,0 +1,6 @@ +include "test_steps_13_aux1.mal" +category System { + asset Computer extends Machine { + & logKeyStrokes + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_14.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_14.mal new file mode 100644 index 0000000..c72203a --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_14.mal @@ -0,0 +1,26 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + + +category System { + asset Asset1 { + | step1 + } + + asset Asset2 extends Asset1 { + | step2 + } + + asset Asset3 extends Asset2 { + | step3 + } + + asset Asset4 extends Asset3 { + | step4 + } +} + +associations +{ +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_15.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_15.mal new file mode 100644 index 0000000..38d30ec --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_15.mal @@ -0,0 +1,21 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + + +category System { + asset Linux { + E hasCamera + <- hardware[Camera] + -> hijackCamera + | hijackCamera + } + asset Camera { + | photo + } +} + +associations +{ + Linux [linux] * <-- L --> * [hardware] Camera +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_2.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_2.mal new file mode 100644 index 0000000..a24c161 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_2.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Linux + { + | spyware + +> readBashHistory + & readBashHistory + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_3.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_3.mal new file mode 100644 index 0000000..5e6b65a --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_3.mal @@ -0,0 +1,19 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem + { + | spyware + -> logKeystrokes + | logKeystrokes + } + + asset Linux + { + | spyware + +> readBashHistory + & readBashHistory + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_4.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_4.mal new file mode 100644 index 0000000..61e5de2 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_4.mal @@ -0,0 +1,17 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem + { + | spyware + } + + asset Linux + { + & logIn + -> access + & access + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_5.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_5.mal new file mode 100644 index 0000000..c100a74 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_5.mal @@ -0,0 +1,15 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem + { + & spyware + } + + asset Linux extends OperatingSystem + { + | spyware + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_6.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_6.mal new file mode 100644 index 0000000..b1aee76 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_6.mal @@ -0,0 +1,15 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset OperatingSystem + { + | spyware + } + + asset Linux extends OperatingSystem + { + & spyware + } +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_7.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_7.mal new file mode 100644 index 0000000..5fddb04 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_7.mal @@ -0,0 +1,24 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + E compromiseCamera + <- camera + } + + asset ThinkPad extends Computer + { + !E compromiseCamera + <- camera + } + + asset Camera { + | turnOn + } +} + +associations { + Computer [computer] 1 <-- CameraUsage --> 1 [camera] Camera +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_8.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_8.mal new file mode 100644 index 0000000..834d113 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_8.mal @@ -0,0 +1,25 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + !E noCamera + <- camera + } + + asset ThinkPad extends Computer + { + E noCamera + <- camera + } + + asset Camera { + | turnOn + } +} + +associations { + Computer [computer] 1 <-- CameraUsage --> 1 [camera] Camera +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/steps_test_files/test_steps_9.mal b/examples/visitor/tests/fixtures/steps_test_files/test_steps_9.mal new file mode 100644 index 0000000..5fc2333 --- /dev/null +++ b/examples/visitor/tests/fixtures/steps_test_files/test_steps_9.mal @@ -0,0 +1,18 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Machine { + | compromise + } + + asset Computer extends Machine { + | stealCredentials + } + + asset Thinkpad extends Computer { + | compromise + +> shutDown + & shutDown + } +} diff --git a/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_1.mal b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_1.mal new file mode 100644 index 0000000..751116c --- /dev/null +++ b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_1.mal @@ -0,0 +1,27 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let hostsOperatingSystems = hosts.operatingSystems + | access + -> hostsOperatingSystems().attack + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_2.mal b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_2.mal new file mode 100644 index 0000000..896ae87 --- /dev/null +++ b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_2.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + // COMMENTED + // | + // v + // let hostsOperatingSystems = hosts.operatingSystems + | access + -> hostsOperatingSystems().attack + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_3.mal b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_3.mal new file mode 100644 index 0000000..1f856f2 --- /dev/null +++ b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_3.mal @@ -0,0 +1,27 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let hostsOperatingSystems = hosts.operatingSystems + | access + -> hostsOperatingSystems.attack + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_4.mal b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_4.mal new file mode 100644 index 0000000..a2edf04 --- /dev/null +++ b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_4.mal @@ -0,0 +1,31 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + let hostsOperatingSystems = hosts.operatingSystems + | access + } + + asset SubNet extends Network { + | accessParent + -> hostsOperatingSystems().attack + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } +} + +associations +{ + Network [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_5.mal b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_5.mal new file mode 100644 index 0000000..785fbf5 --- /dev/null +++ b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_5.mal @@ -0,0 +1,33 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Hardware { + | overHeat + } + asset Machine { + let hardwareComponents = components + | access + } + + asset Computer extends Machine { + | turnOff + } + + asset Lenovo extends Computer + { + | shutDown + } + + asset LenovoThinkPad extends Lenovo + { + | attack + -> hardwareComponents().overHeat + } +} + +associations +{ + Machine [host] 1 <-- L --> * [components] Hardware +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_6.mal b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_6.mal new file mode 100644 index 0000000..b68ba50 --- /dev/null +++ b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_6.mal @@ -0,0 +1,32 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Network { + | accessChild + -> hostsOperatingSystems().attack + } + + asset SubNet extends Network { + let hostsOperatingSystems = hosts.operatingSystems + | acces + -> hostsOperatingSystems().attack + } + + asset Computer + { + | shutDown + } + + asset OperatingSystem + { + | attack + } +} + +associations +{ + SubNet [network] 1 <-- L --> * [hosts] Computer + Computer [computer] 1 <-- L --> * [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_7.mal b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_7.mal new file mode 100644 index 0000000..851f956 --- /dev/null +++ b/examples/visitor/tests/fixtures/substitution_test_files/test_substitution_7.mal @@ -0,0 +1,24 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Hardware { + let physicalComponents = components + | overHeat + } + + asset PhysicalComponent { + | destroy + } + + asset Computer { + | attack + -> physicalComponents().destroy + } +} + +associations +{ + Hardware [host] 1 <-- L --> * [components] PhysicalComponent +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_1.mal b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_1.mal new file mode 100644 index 0000000..48f8312 --- /dev/null +++ b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_1.mal @@ -0,0 +1,28 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let windowsOSes = operatingSystems[Windows] + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_2.mal b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_2.mal new file mode 100644 index 0000000..866ff42 --- /dev/null +++ b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_2.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | attack + -> operatingSystems[Windows].foundWindows + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_3.mal b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_3.mal new file mode 100644 index 0000000..f8d5f42 --- /dev/null +++ b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_3.mal @@ -0,0 +1,32 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | attack + -> operatingSystems[Windows].foundWindows + } + + abstract asset OperatingSystem + { + | attack + } + // COMMENTED + // | + // v + asset Windows // extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_4.mal b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_4.mal new file mode 100644 index 0000000..0b23f88 --- /dev/null +++ b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_4.mal @@ -0,0 +1,29 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | attack + -> operatingSystems[Windows].foundLinux + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset Linux extends OperatingSystem + { + | foundLinux + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_5.mal b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_5.mal new file mode 100644 index 0000000..1b774b1 --- /dev/null +++ b/examples/visitor/tests/fixtures/subtype_test_files/test_subtype_5.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | attack + -> operatingSystems[WindowsVistaProfessional].foundWindowsVistaProfessional + } + + abstract asset OperatingSystem + { + | attack + } + asset Windows extends OperatingSystem + { + | foundWindows + } + asset WindowsVista extends Windows { + } + asset WindowsVistaProfessional extends WindowsVista { + | foundWindowsVistaProfessional + } +} + +associations +{ + Computer [computers] * <-- L --> 0..1 [operatingSystems] OperatingSystem +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_1.mal b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_1.mal new file mode 100644 index 0000000..8c90d7c --- /dev/null +++ b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_1.mal @@ -0,0 +1,26 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + | openAllSubFolders + -> folders.subFolder*.access + } + + asset Folder + { + } + + asset SubFolder extends Folder + { + | access + } +} + +associations +{ + Computer [host] * <-- L --> 0..1 [folders] Folder + Folder [parent] 1 <-- L --> 0..* [subFolder] SubFolder +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_2.mal b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_2.mal new file mode 100644 index 0000000..ba9436a --- /dev/null +++ b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_2.mal @@ -0,0 +1,27 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let recursive_subfolders = folders.subFolder* + | openAllSubFolders + -> recursive_subfolders().access + } + + asset Folder + { + } + + asset SubFolder extends Folder + { + | access + } +} + +associations +{ + Computer [host] * <-- L --> 0..1 [folders] Folder + Folder [parent] 1 <-- L --> 0..* [subFolder] SubFolder +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_3.mal b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_3.mal new file mode 100644 index 0000000..7a93444 --- /dev/null +++ b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_3.mal @@ -0,0 +1,30 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let recursive_subfolders = folders.subFolder* + | openAllSubFolders + -> recursive_subfolders().access + } + + asset Folder + { + } + + // COMMENTED + // | + // v + asset SubFolder // extends Folder + { + | access + } +} + +associations +{ + Computer [host] * <-- L --> 0..1 [folders] Folder + Folder [parent] 1 <-- L --> 0..* [subFolder] SubFolder +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_4.mal b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_4.mal new file mode 100644 index 0000000..eaad6de --- /dev/null +++ b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_4.mal @@ -0,0 +1,35 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let recursive_subfolders = fileSystem.fileSystemEntries.folders.subFolder* + | openAllSubFolders + -> recursive_subfolders().access + } + + asset FileSystem { + } + + asset FileSystemEntries { + } + + asset Folder + { + } + + asset SubFolder extends Folder + { + | access + } +} + +associations +{ + Computer [host] * <-- L --> 0..1 [fileSystem] FileSystem + FileSystem [host] * <-- L --> 0..1 [fileSystemEntries] FileSystemEntries + Folder [folders] * <-- L --> 0..1 [holder] FileSystemEntries + Folder [parent] 1 <-- L --> 0..* [subFolder] SubFolder +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_5.mal b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_5.mal new file mode 100644 index 0000000..90240b3 --- /dev/null +++ b/examples/visitor/tests/fixtures/transitive_test_files/test_transitive_5.mal @@ -0,0 +1,27 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Computer + { + let recursive_subfolders = folders.subFolder* + | openAllSubFolders + -> recursive_subfolders().wrongStep + } + + asset Folder + { + } + + asset SubFolder extends Folder + { + | access + } +} + +associations +{ + Computer [host] * <-- L --> 0..1 [folders] Folder + Folder [parent] 1 <-- L --> 0..* [subFolder] SubFolder +} + \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_1.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_1.mal new file mode 100644 index 0000000..95ecded --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_1.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + # test [Bernoulli(0.2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_10.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_10.mal new file mode 100644 index 0000000..8f4bf76 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_10.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Exponential(4, 5)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_11.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_11.mal new file mode 100644 index 0000000..fdc95e8 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_11.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Exponential()] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_12.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_12.mal new file mode 100644 index 0000000..4d2e4e2 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_12.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Exponential(0)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_13.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_13.mal new file mode 100644 index 0000000..4ed2909 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_13.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Gamma(0.1, 0.5)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_14.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_14.mal new file mode 100644 index 0000000..22f2464 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_14.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Gamma(0.1, 0.5, 0.10)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_15.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_15.mal new file mode 100644 index 0000000..fac3dd7 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_15.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Gamma(0.1)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_16.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_16.mal new file mode 100644 index 0000000..da000eb --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_16.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Gamma(0, 0.2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_17.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_17.mal new file mode 100644 index 0000000..0b3affb --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_17.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Gamma(0.2, 0)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_18.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_18.mal new file mode 100644 index 0000000..5a0fdee --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_18.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [LogNormal(0.1, 0.5)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_19.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_19.mal new file mode 100644 index 0000000..b03ced4 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_19.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [LogNormal(0.1, 0.5, 0.10)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_2.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_2.mal new file mode 100644 index 0000000..3d8f104 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_2.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + # test [Bernoulli(0.2, 0.33)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_20.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_20.mal new file mode 100644 index 0000000..95dd927 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_20.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [LogNormal()] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_21.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_21.mal new file mode 100644 index 0000000..90b5b23 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_21.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [LogNormal(0.5, 0)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_22.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_22.mal new file mode 100644 index 0000000..91033a5 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_22.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Pareto(0.1, 0.2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_23.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_23.mal new file mode 100644 index 0000000..feec462 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_23.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Pareto(0.1, 0.2, 0.3)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_24.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_24.mal new file mode 100644 index 0000000..0b37f15 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_24.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Pareto(0.1)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_25.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_25.mal new file mode 100644 index 0000000..ac0f903 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_25.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Pareto(0, 0.2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_26.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_26.mal new file mode 100644 index 0000000..91c338e --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_26.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Pareto(0.1, 0)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_27.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_27.mal new file mode 100644 index 0000000..8fab6df --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_27.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [TruncatedNormal(2.6, 0.2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_28.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_28.mal new file mode 100644 index 0000000..57eb782 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_28.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [TruncatedNormal(2.6, 0.2, 0.6)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_29.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_29.mal new file mode 100644 index 0000000..3f8f1a1 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_29.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [TruncatedNormal()] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_3.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_3.mal new file mode 100644 index 0000000..e742349 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_3.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + # test [Bernoulli()] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_30.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_30.mal new file mode 100644 index 0000000..a773add --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_30.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [TruncatedNormal(2.6, 0)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_31.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_31.mal new file mode 100644 index 0000000..2256cd5 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_31.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Uniform(2,3)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_32.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_32.mal new file mode 100644 index 0000000..91f1301 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_32.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Uniform(2,3,4)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_33.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_33.mal new file mode 100644 index 0000000..86d78ab --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_33.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Uniform(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_34.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_34.mal new file mode 100644 index 0000000..aa236bd --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_34.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Uniform(5,4)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_35.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_35.mal new file mode 100644 index 0000000..5720fd1 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_35.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Infinity()] + -> done + | test1 [Infinity] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_36.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_36.mal new file mode 100644 index 0000000..ea29592 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_36.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Infinity(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_37.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_37.mal new file mode 100644 index 0000000..b3ac759 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_37.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Zero()] + -> done + | test1 [Zero] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_38.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_38.mal new file mode 100644 index 0000000..393b2a0 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_38.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Zero(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_39.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_39.mal new file mode 100644 index 0000000..629ed5a --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_39.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [EasyAndCertain()] + -> done + | test1 [EasyAndCertain] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_4.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_4.mal new file mode 100644 index 0000000..673d79b --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_4.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + # test [Bernoulli(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_40.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_40.mal new file mode 100644 index 0000000..cc1636e --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_40.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [EasyAndCertain(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_41.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_41.mal new file mode 100644 index 0000000..11bb64b --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_41.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [EasyAndUncertain()] + -> done + | test1 [EasyAndUncertain] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_42.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_42.mal new file mode 100644 index 0000000..166d31e --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_42.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [EasyAndUncertain(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_43.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_43.mal new file mode 100644 index 0000000..64a7779 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_43.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [HardAndCertain()] + -> done + | test1 [HardAndCertain] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_44.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_44.mal new file mode 100644 index 0000000..b882a04 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_44.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [HardAndCertain(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_45.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_45.mal new file mode 100644 index 0000000..bd7d214 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_45.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [HardAndUncertain()] + -> done + | test1 [HardAndUncertain] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_46.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_46.mal new file mode 100644 index 0000000..4e51734 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_46.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [HardAndUncertain(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_47.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_47.mal new file mode 100644 index 0000000..39ea938 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_47.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [VeryHardAndCertain()] + -> done + | test1 [VeryHardAndCertain] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_48.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_48.mal new file mode 100644 index 0000000..9736995 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_48.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [VeryHardAndCertain(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_49.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_49.mal new file mode 100644 index 0000000..243dfa7 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_49.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [VeryHardAndUncertain()] + -> done + | test1 [VeryHardAndUncertain] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_5.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_5.mal new file mode 100644 index 0000000..a9aabda --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_5.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Binomial(10, 0.2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_50.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_50.mal new file mode 100644 index 0000000..b5de61e --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_50.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [VeryHardAndUncertain(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_51.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_51.mal new file mode 100644 index 0000000..51620c2 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_51.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + # test [Enabled()] + -> done + # test1 [Enabled] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_52.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_52.mal new file mode 100644 index 0000000..2c75b14 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_52.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + # test [Enabled(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_53.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_53.mal new file mode 100644 index 0000000..0974716 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_53.mal @@ -0,0 +1,12 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + # test [Disabled()] + -> done + # test1 [Disabled] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_54.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_54.mal new file mode 100644 index 0000000..c94a541 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_54.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + # test [Disabled(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_6.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_6.mal new file mode 100644 index 0000000..171c62e --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_6.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Binomial(10, 0.2, 2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_7.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_7.mal new file mode 100644 index 0000000..0c092bc --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_7.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Binomial(2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_8.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_8.mal new file mode 100644 index 0000000..9980640 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_8.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Binomial(10, 2)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_9.mal b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_9.mal new file mode 100644 index 0000000..aa00ed0 --- /dev/null +++ b/examples/visitor/tests/fixtures/ttc_test_files/test_ttc_9.mal @@ -0,0 +1,10 @@ +#id: "org.mal-lang.testAnalyzer" +#version:"0.0.0" + +category System { + asset Asset1 { + | test [Exponential(4.5)] + -> done + | done + } +} \ No newline at end of file diff --git a/examples/visitor/tests/mal_analyzer_test_wrapper.py b/examples/visitor/tests/mal_analyzer_test_wrapper.py new file mode 100644 index 0000000..b021e5d --- /dev/null +++ b/examples/visitor/tests/mal_analyzer_test_wrapper.py @@ -0,0 +1,54 @@ +from fast import MalCompiler +from mal_analyzer import malAnalyzer, malAnalyzerException + +import os +import pytest +import re +from pathlib import Path + +class AnalyzerTestWrapper(malAnalyzer): + def __init__(self, input_string: str = None, test_file: str = None, error_msg: str = None) -> None: + super().__init__() + + self.compiler = MalCompiler() + try: + if error_msg: + with pytest.raises(malAnalyzerException, match=re.escape(error_msg)): + self._result = self.compiler.compile(test_file) + else: + self._result = self.compiler.compile(test_file) + except SyntaxError: + self._error = True + except RuntimeError: + self._error = True + + def test(self, + error:bool=False, + warn:bool=False, + defines:list=[], + categories:list=[], + assets:list=[], + lets:list=[], + associations:list=[], + steps: list=[]): + assert(self.compiler.analyzer.has_error() == error) + if (warn): + assert(self.compiler.analyzer.has_warning() == warn) + if (defines): + assert(set(defines) == set(self.compiler.analyzer._defines.keys())) + if (categories): + assert(set(categories) == set(self.compiler.analyzer._category.keys())) + if (assets): + assert(set(assets) == set(self.compiler.analyzer._assets.keys())) + if (lets): + assert(set(self.compiler.analyzer._vars.keys())==set([asset for asset, _ in lets])) + for asset, variables in lets: + assert(set(variables)==set(self.compiler.analyzer._vars[asset].keys())) + if (associations): + assert(set(self.compiler.analyzer._associations.keys())==set([asset for asset, _ in associations])) + for asset, association_list in associations: + assert(set(association_list)==set(self.compiler.analyzer._associations[asset].keys())) + if (steps): + assert(set(self.compiler.analyzer._steps.keys())==set([asset for asset, _ in steps])) + for asset, step_list in steps: + assert(set(step_list)==set(self.compiler.analyzer._steps[asset].keys())) diff --git a/examples/visitor/tests/test_mal_abstract_asset.py b/examples/visitor/tests/test_mal_abstract_asset.py new file mode 100644 index 0000000..c586f12 --- /dev/null +++ b/examples/visitor/tests/test_mal_abstract_asset.py @@ -0,0 +1,67 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest +import os + +''' +A file to test different cases of the `abstract` instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/abstract_asset_test_files"], indirect=True) + +# TODO: is this test really needed? Doesn't the grammar prevent this kind of situation? +def test_abstract_assets_1() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines abstract asset without name. + ''' + AnalyzerTestWrapper( + test_file="test_abstract_asset_1.mal" + ).test( + error=True, + defines=['id', 'version'], + categories=['System'] + ) + +def test_abstract_assets_2() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines abstract asset with name. + Extends asset with abstract asset. + ''' + AnalyzerTestWrapper( + test_file="test_abstract_asset_2.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Foo', 'Bar'] + ) + +def test_abstract_assets_3() -> None: + ''' + Test if chain of abstract extentions works + ''' + AnalyzerTestWrapper( + test_file="test_abstract_asset_3.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Foo','Bar','Baz'] + ) + +def test_abstract_assets_4() -> None: + ''' + Abstract asset is never extended + ''' + AnalyzerTestWrapper( + test_file="test_abstract_asset_4.mal" + ).test( + warn=True, + defines=['id','version'], + categories=['System'], + assets=['Foo','Bar'] + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_append.py b/examples/visitor/tests/test_mal_append.py new file mode 100644 index 0000000..0ebba6f --- /dev/null +++ b/examples/visitor/tests/test_mal_append.py @@ -0,0 +1,82 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +# This file aims to test the append operator (+>) in MAL. Since a lot of it is already tested in the `steps` test file, +# the objective is to test if the general functionality is working (much like the tests for reaches (->)) + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/append_test_files"], indirect=True) + +def test_append_1() -> None: + ''' + Test append correctly + ''' + AnalyzerTestWrapper( + test_file='test_append_1.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'Machine', 'Lenovo', 'Server'] + ) + +def test_append_2() -> None: + ''' + Test append correctly with many steps appended + ''' + AnalyzerTestWrapper( + test_file='test_append_2.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'Machine', 'Lenovo', 'Server'] + ) + +def test_append_3() -> None: + ''' + Test append with wrong steps + ''' + AnalyzerTestWrapper( + test_file='test_append_3.mal', + error_msg="Attack step 'WRONG_ATTACK_STEP' not defined for asset 'Server'" + ) + +def test_append_4() -> None: + ''' + Test append with attack step from parent + ''' + AnalyzerTestWrapper( + test_file='test_append_4.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'Machine', 'Lenovo', 'Server'] + ) + +def test_append_5() -> None: + ''' + Test append with attack step from child + ''' + AnalyzerTestWrapper( + test_file='test_append_5.mal', + error_msg="Attack step 'lenovoStep' not defined for asset 'Computer'" + ) + +def test_append_6() -> None: + ''' + Test append not pointing to attack step + ''' + AnalyzerTestWrapper( + test_file='test_append_6.mal', + error_msg="Attack step 'server' not defined for asset 'Computer'" + ) + +def test_append_7() -> None: + ''' + Test append to a child's step + ''' + AnalyzerTestWrapper( + test_file='test_append_7.mal', + error_msg="Cannot inherit attack step 'lenovoStep' without previous definition" + ) diff --git a/examples/visitor/tests/test_mal_assets.py b/examples/visitor/tests/test_mal_assets.py new file mode 100644 index 0000000..c60fe57 --- /dev/null +++ b/examples/visitor/tests/test_mal_assets.py @@ -0,0 +1,89 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest +import os + +''' +A file to test different cases of the `asset` instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/asset_test_files"], indirect=True) + +def test_assets_1() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + ''' + AnalyzerTestWrapper( + test_file="test_assets_2.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Test'] + ) + +def test_assets_2() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset twice. + ''' + AnalyzerTestWrapper( + test_file="test_assets_3.mal", + error_msg ="Asset 'Test' previously defined at 4" + ) + +def test_assets_3() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset twice. + ''' + AnalyzerTestWrapper( + test_file="test_assets_4.mal", + error_msg ="Asset 'Test' previously defined at 4" + ) + +def test_assets_4() -> None: + ''' + Defines same asset in different categories + ''' + AnalyzerTestWrapper( + test_file="test_assets_5.mal", + error_msg ="Asset 'Test' previously defined at 4" + ) + +def test_assets_5() -> None: + ''' + Defines assets correctly in different files + ''' + + AnalyzerTestWrapper( + test_file="test_assets_6.mal" + ).test( + defines=['id', 'version'], + categories=['System','AnotherSystem'], + assets=['Test','AnotherTest'], + ) + +def test_assets_6() -> None: + ''' + Defines same asset in different files in different categories + ''' + + AnalyzerTestWrapper( + test_file="test_assets_7.mal", + error_msg ="Asset 'Test' previously defined at 4" + ) + +def test_assets_7() -> None: + ''' + Defines same asset in different files in same category + ''' + AnalyzerTestWrapper( + test_file="test_assets_8.mal", + error_msg ="Asset 'Test' previously defined at 4" + ) diff --git a/examples/visitor/tests/test_mal_association.py b/examples/visitor/tests/test_mal_association.py new file mode 100644 index 0000000..acdcca3 --- /dev/null +++ b/examples/visitor/tests/test_mal_association.py @@ -0,0 +1,85 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +A file to test different cases of the `association` instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/association_test_files"], indirect=True) + +def test_association_1() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines two asset with name. + Defines an association between the assets. + ''' + AnalyzerTestWrapper( + test_file="test_association_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1', 'Asset2'] + ) + +def test_association_2() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines one asset with name. + Defines an association between the asset + and one undefined right asset. + ''' + AnalyzerTestWrapper( + test_file="test_association_2.mal", + error_msg="Right asset 'Asset1' is not defined" + ) + +def test_association_3() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines one asset with name. + Defines an association between the asset + and one undefined left asset. + ''' + AnalyzerTestWrapper( + test_file="test_association_3.mal", + error_msg="Left asset 'Asset1' is not defined" + ) + +def test_association_4() -> None: + ''' + Creates an association correctly and tries to access an attack step via association + ''' + AnalyzerTestWrapper( + test_file="test_association_4.mal" + ).test( + defines=['id', 'version'], + categories=['Example'], + assets=['Asset1', 'Asset2'] + ) + +def test_association_5() -> None: + ''' + Creates an association correctly and tries to access an attack step via association which is not defined + ''' + AnalyzerTestWrapper( + test_file="test_association_5.mal", + error_msg="Field 'b' not defined for asset 'Asset1'\n" + \ + "Line 6: All expressions in reaches ('->') must point to a valid attack step" + ) + +def test_association_6() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines an association between undefined assets. + ''' + AnalyzerTestWrapper( + test_file="test_association_6.mal", + error_msg="Left asset 'Asset1' is not defined" + ) diff --git a/examples/visitor/tests/test_mal_category.py b/examples/visitor/tests/test_mal_category.py new file mode 100644 index 0000000..65f57f7 --- /dev/null +++ b/examples/visitor/tests/test_mal_category.py @@ -0,0 +1,35 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +A file to test different cases of the `category` instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/category_test_files"], indirect=True) + +def test_category_1() -> None: + ''' + Defines correct version and ID. + Defines category with name. + ''' + AnalyzerTestWrapper( + test_file="test_category_1.mal" + ).test( + defines=['id', 'version'], + categories=['Test'] + ) + +def test_category_2() -> None: + ''' + Defines correct version and ID. + Defines category with same name twice. + ''' + AnalyzerTestWrapper( + test_file="test_category_2.mal" + ).test( + defines=['id', 'version'], + categories=['Test'] + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_collect.py b/examples/visitor/tests/test_mal_collect.py new file mode 100644 index 0000000..ec2ac84 --- /dev/null +++ b/examples/visitor/tests/test_mal_collect.py @@ -0,0 +1,123 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +# This file aims to test the collect operator (X.A) in MAL + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/collect_test_files"], indirect=True) + +def test_collect_1() -> None: + ''' + Test collect correctly (used in variable) + ''' + AnalyzerTestWrapper( + test_file='test_collect_1.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'OperatingSystem'] + ) + +def test_collect_2() -> None: + ''' + Test collect correctly (used in step) + ''' + AnalyzerTestWrapper( + test_file="test_collect_2.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'OperatingSystem'] + ) + +def test_collect_3() -> None: + ''' + Test complex collect correctly (used in variable) + ''' + AnalyzerTestWrapper( + test_file="test_collect_3.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'OperatingSystem', 'FileSystem', 'File'] + ) + +def test_collect_4() -> None: + ''' + Test complex collect correctly (used in step) + ''' + AnalyzerTestWrapper( + test_file="test_collect_4.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'OperatingSystem', 'FileSystem', 'File'] + ) + +def test_collect_5() -> None: + ''' + Test correctly with non-existing field + ''' + AnalyzerTestWrapper( + test_file="test_collect_5.mal", + error_msg="Field 'fileSystems' not defined for asset 'OperatingSystem'\n" + \ + "Line 5: All expressions in reaches ('->') must point to a valid attack step" + ) + +# Since many tests require that collect works correctly, the objective of the following tests is to check that +# using many expressions in the same collect works properly and any error inside the expression itself is noticed. + +def test_collect_6() -> None: + ''' + Test complex set of expressions + ''' + AnalyzerTestWrapper( + test_file="test_collect_6.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'OperatingSystem', 'Linux', 'Windows', 'WindowsVista', + 'FileSystem', 'SubFolder', 'Folder', 'File', 'ConfigFile', 'RootFile', 'NonRootFile'] + ) + +def test_collect_7() -> None: + ''' + Test complex set of expressions with error + ''' + AnalyzerTestWrapper( + test_file="test_collect_7.mal", + error_msg="Asset 'WindowsVista' cannot be of type 'OperatingSystem'\n" +\ + "Line 6: All expressions in reaches ('->') must point to a valid attack step" + ) + +def test_collect_8() -> None: + ''' + Test complex set of expressions with error (field without existing association) + ''' + AnalyzerTestWrapper( + test_file="test_collect_8.mal", + error_msg="Field 'fileSystems' not defined for asset 'OperatingSystem'\n" + \ + "Line 6: All expressions in reaches ('->') must point to a valid attack step" + ) + +def test_collect_9() -> None: + ''' + Test complex set of expressions with error (transitive step without hierarchy relationship) + ''' + AnalyzerTestWrapper( + test_file="test_collect_9.mal", + error_msg="Previous asset 'Folder' is not of type 'SubFolder'\n" + \ + "Line 6: All expressions in reaches ('->') must point to a valid attack step" + ) + +def test_collect_10() -> None: + ''' + Test complex set of expressions with error (no common ancestor) + ''' + AnalyzerTestWrapper( + test_file="test_collect_10.mal", + error_msg="Types 'ConfigFile' and 'NonRootFile' have no common ancestor\n" + \ + "Line 6: All expressions in reaches ('->') must point to a valid attack step" + ) diff --git a/examples/visitor/tests/test_mal_define.py b/examples/visitor/tests/test_mal_define.py new file mode 100644 index 0000000..7354fa7 --- /dev/null +++ b/examples/visitor/tests/test_mal_define.py @@ -0,0 +1,89 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +A file to test different cases of the `define` instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/define_test_files"], indirect=True) + +def test_define_1() -> None: + ''' + Defines only version. + ''' + AnalyzerTestWrapper( + test_file="test_define_1.mal", + error_msg = 'Missing required define \'#id: ""\'' + ) + +def test_define_2() -> None: + ''' + Defines only ID. + ''' + AnalyzerTestWrapper( + test_file="test_define_2.mal", + error_msg='Missing required define \'#version: ""\'' + ) + +def test_define_3() -> None: + ''' + Defines correct ID but wrong version. + ''' + AnalyzerTestWrapper( + test_file="test_define_3.mal", + error_msg='Define \'version\' must be valid semantic versioning without pre-release identifier and build metadata' + ) + +def test_define_4() -> None: + ''' + Defines correct version and ID. + ''' + AnalyzerTestWrapper( + test_file="test_define_4.mal" + ).test( + defines=['id', 'version'] + ) + +def test_define_5() -> None: + ''' + Defines correct version and ID, but version twice. + ''' + AnalyzerTestWrapper( + test_file="test_define_5.mal" + ).test( + defines=['id', 'version'] + ) + +def test_define_6() -> None: + ''' + Defines correct version, ID. + Defines Key with value. + ''' + AnalyzerTestWrapper( + test_file="test_define_6.mal" + ).test( + defines=['id', 'version', 'key'] + ) + +def test_define_7() -> None: + ''' + Defines correct version, ID. + Defines Key with value twice. + ''' + AnalyzerTestWrapper( + test_file="test_define_7.mal", + error_msg="Define 'key' previously defined at line 2" + ) + +def test_define_8() -> None: + ''' + Defines correct version and ID, but id twice. + ''' + AnalyzerTestWrapper( + test_file="test_define_8.mal" + ).test( + defines=['id', 'version'] + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_exists.py b/examples/visitor/tests/test_mal_exists.py new file mode 100644 index 0000000..8477c0a --- /dev/null +++ b/examples/visitor/tests/test_mal_exists.py @@ -0,0 +1,88 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +A file to test existance operators (E and !E) in MAL +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/exists_test_files"], indirect=True) + +def test_exists_1() -> None: + ''' + Correctly define defenses + ''' + AnalyzerTestWrapper( + test_file="test_exists_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1','Asset2','Asset3'], + ) + +def test_exists_2() -> None: + ''' + Test existance with a reach with a non-existing attack step + ''' + AnalyzerTestWrapper( + test_file="test_exists_2.mal", + error_msg="Attack step 'wrongStep' not defined for asset 'Asset1'" + ) + +def test_exists_3() -> None: + ''' + Test existence with non-existing asset + ''' + AnalyzerTestWrapper( + test_file="test_exists_3.mal", + error_msg="Field 'a2' not defined for asset 'Asset1'\n" + \ + "Line 5: All expressions in requires ('<-') must point to a valid asset" + ) + +def test_exists_4() -> None: + ''' + Test existence with a requires which points to a step + ''' + AnalyzerTestWrapper( + test_file="test_exists_4.mal", + error_msg="Field 'attack' not defined for asset 'Asset2'\n" + \ + "Line 5: All expressions in requires ('<-') must point to a valid asset" + ) + +def test_exists_5() -> None: + ''' + Test existence with a TTC expression + ''' + AnalyzerTestWrapper( + test_file="test_exists_5.mal", + error_msg="Attack step of type 'exist' must not have TTC" + ) + +def test_exists_6() -> None: + ''' + Test non-existence with a TTC expression + ''' + AnalyzerTestWrapper( + test_file="test_exists_6.mal", + error_msg = "Attack step of type 'notExist' must not have TTC" + ) + +def test_exists_7() -> None: + ''' + Test existence without a requires + ''' + AnalyzerTestWrapper( + test_file="test_exists_7.mal", + error_msg="Attack step of type 'exist' must have require '<-'" + ) + +def test_exists_8() -> None: + ''' + Test normal step with a requires + ''' + AnalyzerTestWrapper( + test_file="test_exists_8.mal", + error_msg="Require '<-' may only be defined for attack step type exist 'E' or not-exist '!E'" + ) diff --git a/examples/visitor/tests/test_mal_extends.py b/examples/visitor/tests/test_mal_extends.py new file mode 100644 index 0000000..61555b2 --- /dev/null +++ b/examples/visitor/tests/test_mal_extends.py @@ -0,0 +1,63 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +import os +import pytest +from pathlib import Path + +''' +A file to test different cases of the `extends` instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/extend_test_files"], indirect=True) + +def test_extends_1() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines asset with extends. + ''' + AnalyzerTestWrapper( + test_file="test_extends_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +def test_extends_2() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Extends asset with undefined asset. + ''' + AnalyzerTestWrapper( + test_file="test_extends_2.mal", + error_msg = "Asset \'Foo2\' not defined" + ) + +def test_extends_3() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Tests circular dependency with extends + ''' + AnalyzerTestWrapper( + test_file="test_extends_3.mal", + error_msg = "Asset 'Foo1' extends in loop 'Foo1 -> Foo2 -> Foo3 -> Foo4 -> Foo5 -> Foo1'" + ) + +def test_extends_4() -> None: + ''' + Tests valid extends across files + ''' + AnalyzerTestWrapper( + test_file="test_extends_4.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Test','SubTest'], + ) diff --git a/examples/visitor/tests/test_mal_fields.py b/examples/visitor/tests/test_mal_fields.py new file mode 100644 index 0000000..14bd23d --- /dev/null +++ b/examples/visitor/tests/test_mal_fields.py @@ -0,0 +1,48 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +A file to test fields in MAL +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/fields_test_files"], indirect=True) + +def test_fields_1() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines associations correctly + ''' + AnalyzerTestWrapper( + test_file="test_fields_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1','Asset2','Asset3'], + associations=[('Asset1',['a3']), ('Asset2',['a3','a3_again']), ('Asset3',['a1','a2'])] + ) + +def test_fields_2() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines association in child with same name as parent + ''' + AnalyzerTestWrapper( + test_file="test_fields_2.mal", + error_msg="Field Asset2.a3 previously defined at 9" + ) + +def test_fields_3() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines association with same name as attack step + ''' + AnalyzerTestWrapper( + test_file="test_fields_3.mal", + error_msg = "Field attack previously defined as an attack step at 6" + ) diff --git a/examples/visitor/tests/test_mal_include.py b/examples/visitor/tests/test_mal_include.py new file mode 100644 index 0000000..bd587e1 --- /dev/null +++ b/examples/visitor/tests/test_mal_include.py @@ -0,0 +1,94 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest +import os + +''' +A file to test different cases of the `include` instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/include_test_files"], indirect=True) + +def test_include_1() -> None: + ''' + Missing keys ID and version. + ''' + AnalyzerTestWrapper( + test_file="test_include_1.mal", + error_msg = 'Missing required define \'#id: ""\'' + ) + +def test_include_2() -> None: + ''' + Including file with ID and version. + ''' + AnalyzerTestWrapper( + test_file="test_include_2.mal" + ).test( + defines=['id', 'version'] + ) + +def test_include_3() -> None: + ''' + Including file with ID and version. + Defining ID and version both files (this is ok). + ''' + AnalyzerTestWrapper( + test_file="test_include_3.mal" + ).test( + defines=['id', 'version'] + ) + +def test_include_4() -> None: + ''' + Including file with ID and version. + Defining key with value. + ''' + AnalyzerTestWrapper( + test_file="test_include_4.mal" + ).test( + defines=['id', 'version', 'key'] + ) + +def test_include_5() -> None: + ''' + Including one file with ID and another with version. + Defining key with value. + ''' + AnalyzerTestWrapper( + test_file="test_include_5.mal" + ).test( + defines=['id', 'version', 'key'] + ) + +def test_include_6() -> None: + ''' + Include same file twice. + ''' + AnalyzerTestWrapper( + test_file="test_include_6.mal" + ).test( + defines=['id', 'version'] + ) + +def test_include_7() -> None: + ''' + Defining keys ID and version after include. + ''' + AnalyzerTestWrapper( + test_file="test_include_7.mal" + ).test( + defines=['id', 'version'] + ) + +# TODO this might have been fixed by the compiler itself +def test_include_8() -> None: + ''' + Test if circular includes are noticed + ''' + AnalyzerTestWrapper( + test_file="test_include_8.mal", + error_msg="Include sequence contains cycle: test_include_8_aux1.mal->test_include_8_aux2.mal->test_include_8.mal -> test_include_8_aux1.mal" + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_info.py b/examples/visitor/tests/test_mal_info.py new file mode 100644 index 0000000..5658791 --- /dev/null +++ b/examples/visitor/tests/test_mal_info.py @@ -0,0 +1,192 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +A file to test different cases of the `info` instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/info_test_files"], indirect=True) + +def test_asset_info_1() -> None: + ''' + Defines asset with name. + Defines random info. (this should be allowed as to not break previous custom metas) + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Foo'] + ) + +def test_asset_info_2() -> None: + ''' + Defines asset with name. + Defines random info twice. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_2.mal", + error_msg = "Metadata random previously defined at 5" + ) + +def test_asset_info_3() -> None: + ''' + Defines asset with name. + Defines random info in asset and attack step twice. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_3.mal", + error_msg = "Metadata random previously defined at 8" + ) + +def test_asset_info_4() -> None: + ''' + Defines asset with name. + Defines random info in asset and attack step. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_4.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Foo'] + ) + +def test_asset_info_5() -> None: + ''' + Defines asset with name. + Defines random info in asset, attack step and category. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_5.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Foo'] + ) + +def test_asset_info_6() -> None: + ''' + Defines asset with name. + Defines random info in asset, attack step and category twice. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_6.mal", + error_msg = "Metadata random previously defined at 4" + ) + +def test_asset_info_7() -> None: + ''' + Defines asset with name. + Defines random info in asset, attack step and category. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_7.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Foo'] + ) + +def test_asset_info_8() -> None: + ''' + Defines asset with name. + Defines random info in asset, attack step and category for two different categories. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_8.mal" + ).test( + defines=['id', 'version'], + categories=['System','AnotherSystem'], + assets=['Foo','Bar'] + ) + +def test_asset_info_9() -> None: + ''' + Defines asset with name. + Defines random info in asset, attack step, category and association + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_9.mal" + ).test( + defines=['id', 'version'], + categories=['System','AnotherSystem'], + assets=['Foo','Bar'] + ) + +def test_asset_info_10() -> None: + ''' + Defines asset with name. + Defines random info in asset, attack step, category and twice in the association + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_10.mal", + error_msg = "Metadata random previously defined at 27" + ) + +def test_asset_info_11() -> None: + ''' + Defines asset with name. + Defines random info in asset, attack step, category and association + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_11.mal" + ).test( + defines=['id', 'version'], + categories=['System','AnotherSystem'], + assets=['Foo','Bar'] + ) + +def test_asset_info_12() -> None: + ''' + Defines asset with name. + Defines random info in two assets in the same category. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_12.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Foo','Bar'] + ) + + +def test_asset_info_13() -> None: + ''' + Defines asset with name. + Defines random info in asset twice but with a different meta between them + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_13.mal", + error_msg = "Metadata random previously defined at 4" + ) + +def test_asset_info_14() -> None: + ''' + Defines asset with name. + Defines random info in asset and attack step. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_14.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Foo'] + ) + +def test_asset_info_15() -> None: + ''' + Defines asset with name. + Defines random info in two steps in the same asset. + ''' + AnalyzerTestWrapper( + test_file="test_asset_info_15.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Foo'] + ) diff --git a/examples/visitor/tests/test_mal_let.py b/examples/visitor/tests/test_mal_let.py new file mode 100644 index 0000000..80aa89e --- /dev/null +++ b/examples/visitor/tests/test_mal_let.py @@ -0,0 +1,152 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +A file to test different cases of the `let` instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/let_test_files"], indirect=True) + +def test_let_1() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines let. + ''' + AnalyzerTestWrapper( + test_file="test_let_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer','Platform','Software','Hardware'], + lets=[('Computer', ['components'])] + ) + +def test_let_2() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines two assets with name. + Defines same let twice. + ''' + AnalyzerTestWrapper( + test_file="test_let_2.mal", + error_msg = 'Variable \'component\' previously defined at line 8' + ) + +def test_let_3() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines let not pointing to asset. + ''' + AnalyzerTestWrapper( + test_file="test_let_3.mal", + error_msg="Variable 'component' defined at 5 does not point to an asset" + ) + +def test_let_4() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines let in asset in a hierarchy. + ''' + AnalyzerTestWrapper( + test_file="test_let_4.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1','Asset2','Asset3','Asset4'], + lets=[('Asset1', ['component']),('Asset2', ['component','another_component'])] + ) + + +def test_let_5() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Redefines let in asset in a hierarchy. + ''' + AnalyzerTestWrapper( + test_file="test_let_5.mal", + error_msg = 'Variable \'component\' previously defined at 5' + ) + +def test_let_6() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines let in circular manner. + ''' + AnalyzerTestWrapper( + test_file="test_let_6.mal", + error_msg="Variable 'component1' contains cycle component1->component2->component1" + ) + +def test_let_7() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines let when a parent has no association. + ''' + AnalyzerTestWrapper( + test_file="test_let_7.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1','Asset3','Asset4'], + lets=[('Asset3', ['component'])] + ) + +def test_let_8() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines let using a parents association. + ''' + AnalyzerTestWrapper( + test_file="test_let_8.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1','Asset3','Asset4'], + lets=[('Asset3', ['component'])] + ) + +def test_let_9() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines let only in a parent. + ''' + AnalyzerTestWrapper( + test_file="test_let_9.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1','Asset3','Asset4'], + lets=[('Asset1', ['component']),('Asset3', ['component'])] + ) + +def test_let_10() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Redefines the exact same let in asset in a hierarchy. + ''' + AnalyzerTestWrapper( + test_file="test_let_10.mal", + error_msg="Variable 'component' previously defined at 5" + ) diff --git a/examples/visitor/tests/test_mal_operations.py b/examples/visitor/tests/test_mal_operations.py new file mode 100644 index 0000000..583a1f7 --- /dev/null +++ b/examples/visitor/tests/test_mal_operations.py @@ -0,0 +1,267 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +File to test set operations (/\\ and \\/ and -) +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/operation_test_files"], indirect=True) + +# TESTS FOR /\ +def test_operation_1() -> None: + ''' + Test /\\ correctly (used in variable) + ''' + AnalyzerTestWrapper( + test_file="test_operation_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem'] + ) + +def test_operation_2() -> None: + ''' + Test /\\ correctly (used directly in step) + ''' + AnalyzerTestWrapper( + test_file="test_operation_2.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem'] + ) + +def test_operation_3() -> None: + ''' + Test /\\ directly in the step but do not point to a step (only point to asset) + ''' + AnalyzerTestWrapper( + test_file="test_operation_3.mal", + error_msg="Last step is not attack step" + ) + +def test_operation_4() -> None: + ''' + Test /\\ directly in the step but do not use an attack step belonging to the LCA + ''' + AnalyzerTestWrapper( + test_file="test_operation_4.mal", + error_msg="Attack step 'foundWindows' not defined for asset 'OperatingSystem'" + ) + +def test_operation_5() -> None: + ''' + Test /\\ in variable but use assets without an LCA + ''' + AnalyzerTestWrapper( + test_file="test_operation_5.mal", + error_msg="Types 'Windows' and 'Linux' have no common ancestor\n" + \ + "Variable 'targets' defined at 6 does not point to an asset" + ) + +def test_operation_6() -> None: + ''' + Test /\\ directly in the step but use assets without an LCA + ''' + AnalyzerTestWrapper( + test_file="test_operation_6.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Machine', 'Computer', 'ThinkPad', 'Asus'] + ) + +def test_operation_7() -> None: + ''' + Test /\\ directly in the step using an attack step from the LCA's parent + ''' + AnalyzerTestWrapper( + test_file="test_operation_7.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem', 'Software'] + ) + + + + + + +# Tests for \/ +def test_operation_8() -> None: + ''' + Test \\/ correctly (used in variable) + ''' + AnalyzerTestWrapper( + test_file="test_operation_8.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem'] + ) + +def test_operation_9() -> None: + ''' + Test \\/ correctly (used directly in step) + ''' + AnalyzerTestWrapper( + test_file="test_operation_9.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem'] + ) + +def test_operation_10() -> None: + ''' + Test \\/ directly in the step but do not point to a step (only point to asset) + ''' + AnalyzerTestWrapper( + test_file="test_operation_10.mal", + error_msg="Last step is not attack step" + ) + +def test_operation_11() -> None: + ''' + Test \\/ directly in the step but do not use an attack step belonging to the LCA + ''' + AnalyzerTestWrapper( + test_file="test_operation_11.mal", + error_msg="Attack step 'foundWindows' not defined for asset 'OperatingSystem'" + ) + +def test_operation_12() -> None: + ''' + Test \\/ in variable but use assets without an LCA + ''' + AnalyzerTestWrapper( + test_file="test_operation_12.mal", + error_msg="Types 'Windows' and 'Linux' have no common ancestor\n" + \ + "Variable 'targets' defined at 6 does not point to an asset" + ) + +def test_operation_13() -> None: + ''' + Test \\/ directly in the step but use assets without an LCA + ''' + AnalyzerTestWrapper( + test_file="test_operation_13.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Machine', 'Computer', 'ThinkPad', 'Asus'] + ) + +def test_operation_14() -> None: + ''' + Test \\/ directly in the step using an attack step from the LCA's parent + ''' + AnalyzerTestWrapper( + test_file="test_operation_14.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem', 'Software'] + ) + + + + + +# TESTS FOR - +def test_operation_15() -> None: + ''' + Test - correctly (used in variable) + ''' + AnalyzerTestWrapper( + test_file="test_operation_15.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem'] + ) + +def test_operation_16() -> None: + ''' + Test - correctly (used directly in step) + ''' + AnalyzerTestWrapper( + test_file="test_operation_16.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem'] + ) + +def test_operation_17() -> None: + ''' + Test - directly in the step but do not point to a step (only point to asset) + ''' + AnalyzerTestWrapper( + test_file="test_operation_17.mal", + error_msg="Last step is not attack step" + ) + +def test_operation_18() -> None: + ''' + Test - directly in the step but do not use an attack step belonging to the LCA + ''' + AnalyzerTestWrapper( + test_file="test_operation_18.mal", + error_msg="Attack step 'foundWindows' not defined for asset 'OperatingSystem'" + ) + +def test_operation_19() -> None: + ''' + Test - directly in the step but use assets without an LCA + ''' + AnalyzerTestWrapper( + test_file="test_operation_19.mal", + error_msg="Types 'Windows' and 'Linux' have no common ancestor\n" + \ + "Variable 'targets' defined at 6 does not point to an asset" + ) + +def test_operation_20() -> None: + ''' + Test - directly in the step but use assets without an LCA + ''' + AnalyzerTestWrapper( + test_file="test_operation_20.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Machine', 'Computer', 'ThinkPad', 'Asus'] + ) + +def test_operation_21() -> None: + ''' + Test - directly in the step using an attack step from the LCA's parent + ''' + AnalyzerTestWrapper( + test_file="test_operation_21.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem', 'Software'] + ) + + + + +# General functionality test +def test_operation_22() -> None: + ''' + Test complex operation + ''' + AnalyzerTestWrapper( + test_file="test_operation_22.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Main','Generator','Grandparent','Parent','Child','Grandchild'] + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_probability_distributions.py b/examples/visitor/tests/test_mal_probability_distributions.py new file mode 100644 index 0000000..e0ca0b5 --- /dev/null +++ b/examples/visitor/tests/test_mal_probability_distributions.py @@ -0,0 +1,272 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +File to test complex Time To Compromise (TTC) expressions in MAL + +While 'test_mal_ttc' tests individual expressions, this file will test the same expressions +when used together +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/probability_distributions_test_files/"], indirect=True) + +# Basic exponentiation tests + +def test_probability_distributions_1() -> None: + ''' + Test correct exponentiation + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_1.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +def test_probability_distributions_2() -> None: + ''' + Test exponentiation with an expression with the wrong parameters + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_2.mal', + error_msg="0 is not in valid range 'shape > 0', for Gamma distribution" + ) + +def test_probability_distributions_3() -> None: + ''' + Test exponentiation with Bernoulli + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_3.mal', + error_msg="TTC distribution 'Bernoulli' is not available in subtraction, division or exponential expressions." + ) + +def test_probability_distributions_4() -> None: + ''' + Test exponentiation with EasyAndUncertaion + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_4.mal', + error_msg="TTC distribution 'EasyAndUncertain' is not available in subtraction, division or exponential expressions." + ) + +# Basic subtraction tests + +def test_probability_distributions_5() -> None: + ''' + Test correct subtraction + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_5.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +def test_probability_distributions_6() -> None: + ''' + Test subtraction with an expression with the wrong parameters + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_6.mal', + error_msg="0 is not in valid range 'shape > 0', for Gamma distribution" + ) + +def test_probability_distributions_7() -> None: + ''' + Test subtraction with Bernoulli + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_7.mal', + error_msg="TTC distribution 'Bernoulli' is not available in subtraction, division or exponential expressions." + ) + +def test_probability_distributions_8() -> None: + ''' + Test subtraction with EasyAndUncertaion + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_8.mal', + error_msg="TTC distribution 'EasyAndUncertain' is not available in subtraction, division or exponential expressions." + ) + +# Basic division tests + +def test_probability_distributions_9() -> None: + ''' + Test correct division + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_9.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +def test_probability_distributions_10() -> None: + ''' + Test division with an expression with the wrong parameters + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_10.mal', + error_msg="0 is not in valid range 'shape > 0', for Gamma distribution" + ) + +def test_probability_distributions_11() -> None: + ''' + Test division with Bernoulli + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_11.mal', + error_msg="TTC distribution 'Bernoulli' is not available in subtraction, division or exponential expressions." + ) + +def test_probability_distributions_12() -> None: + ''' + Test division with EasyAndUncertaion + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_12.mal', + error_msg="TTC distribution 'EasyAndUncertain' is not available in subtraction, division or exponential expressions." + ) + +# Basic addition tests + +def test_probability_distributions_13() -> None: + ''' + Test correct addition + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_13.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +def test_probability_distributions_14() -> None: + ''' + Test addition with an expression with the wrong parameters + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_14.mal', + error_msg="0 is not in valid range 'shape > 0', for Gamma distribution" + ) + +def test_probability_distributions_15() -> None: + ''' + Test addition with Bernoulli + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_15.mal', + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +# Basic multiplication tests + +def test_probability_distributions_16() -> None: + ''' + Test correct multiplication + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_16.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +def test_probability_distributions_17() -> None: + ''' + Test multiplication with an expression with the wrong parameters + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_17.mal', + error_msg="0 is not in valid range 'shape > 0', for Gamma distribution" + ) + +def test_probability_distributions_18() -> None: + ''' + Test multiplication with Bernoulli + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_18.mal', + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +# Complex operation tests + +def test_probability_distributions_19() -> None: + ''' + Test correct complex operation I + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_19.mal', + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +def test_probability_distributions_20() -> None: + ''' + Test correct complex operation II + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_20.mal', + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +def test_probability_distributions_21() -> None: + ''' + Test correct complex operation III + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_21.mal', + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['OperatingSystem', 'Linux'] + ) + +def test_probability_distributions_22() -> None: + ''' + Test incorrect complex operation I + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_22.mal', + error_msg="(0.4, 0.3) does not meet requirement 'min <= max', for Uniform distribution" + ) + +def test_probability_distributions_23() -> None: + ''' + Test incorrect complex operation II + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_23.mal', + error_msg="Distributions 'Enabled' or 'Disabled' may not be used as TTC values in '&' and '|' attack steps" + ) + +def test_probability_distributions_24() -> None: + ''' + Test incorrect complex operation III + ''' + AnalyzerTestWrapper( + test_file='test_probability_distributions_24.mal', + error_msg="TTC distribution 'Bernoulli' is not available in subtraction, division or exponential expressions." + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_reaches.py b/examples/visitor/tests/test_mal_reaches.py new file mode 100644 index 0000000..66dc0f9 --- /dev/null +++ b/examples/visitor/tests/test_mal_reaches.py @@ -0,0 +1,72 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +# This file aims to test the reaches operator (->) in MAL + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/reaches_test_files"], indirect=True) + +def test_reaches_1() -> None: + ''' + Test reaches correctly + ''' + AnalyzerTestWrapper( + test_file='test_reaches_1.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'Machine', 'Lenovo', 'Server'] + ) + +def test_reaches_2() -> None: + ''' + Test many reaches in the same step + ''' + AnalyzerTestWrapper( + test_file='test_reaches_2.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'Machine', 'Lenovo', 'Server', 'Router'] + ) + +def test_reaches_3() -> None: + ''' + Test reaches with wrong attack step + ''' + AnalyzerTestWrapper( + test_file='test_reaches_3.mal', + error_msg= "Attack step 'WRONG_ATTACK_STEP' not defined for asset 'Server'" + ) + +def test_reaches_4() -> None: + ''' + Test reaches with attack step from father + ''' + AnalyzerTestWrapper( + test_file='test_reaches_4.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'Machine', 'Lenovo', 'Server', 'Router'] + ) + +def test_reaches_5() -> None: + ''' + Test reaches with attack step from child + ''' + AnalyzerTestWrapper( + test_file='test_reaches_5.mal', + error_msg="Attack step 'lenovoStep' not defined for asset 'Computer'" + ) + +def test_reaches_6() -> None: + ''' + Test reaches not pointing to attack step + ''' + AnalyzerTestWrapper( + test_file='test_reaches_6.mal', + error_msg="Attack step 'routers' not defined for asset 'Network'" + ) diff --git a/examples/visitor/tests/test_mal_require.py b/examples/visitor/tests/test_mal_require.py new file mode 100644 index 0000000..9e7d2d4 --- /dev/null +++ b/examples/visitor/tests/test_mal_require.py @@ -0,0 +1,90 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +# This file aims to test the require operator (<-) in MAL. Since a lot of it is already tested in the `exists` test file, +# the objective is to test if the general functionality is working (much like the tests for reaches (->)) + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/require_test_files"], indirect=True) + +def test_require_1() -> None: + ''' + Test require correctly + ''' + AnalyzerTestWrapper( + test_file='test_require_1.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1','Asset2','Asset3'] + ) + +def test_require_2() -> None: + ''' + Test require correctly with many assets required + ''' + AnalyzerTestWrapper( + test_file='test_require_2.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1','Asset2','Asset3'] + ) + +def test_require_3() -> None: + ''' + Test require with non-existing asset + ''' + AnalyzerTestWrapper( + test_file='test_require_3.mal', + error_msg="Field 'a4' not defined for asset 'Asset1'\n" + + "Line 6: All expressions in requires ('<-') must point to a valid asset" + ) + +def test_require_4() -> None: + ''' + Test require with asset from parent's association + ''' + AnalyzerTestWrapper( + test_file='test_require_4.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1','Asset2','Asset3', 'Asset0'] + ) + +def test_require_5() -> None: + ''' + Test require with asset from child's association + ''' + AnalyzerTestWrapper( + test_file='test_require_5.mal', + error_msg="Field 'a2' not defined for asset 'Asset1'\n" + + "Line 10: All expressions in requires ('<-') must point to a valid asset" + + ) + +def test_require_6() -> None: + ''' + Test require pointing to attack step + ''' + AnalyzerTestWrapper( + test_file='test_require_6.mal', + error_msg="Field 'asset2_Step' not defined for asset 'Asset2'\n" + \ + "Line 6: All expressions in requires ('<-') must point to a valid asset" + ) + +def test_require_7() -> None: + ''' + Test require using complex expression + ''' + AnalyzerTestWrapper( + test_file='test_require_7.mal' + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'OperatingSystem', 'Linux', 'Windows', 'WindowsVista', + 'FileSystem', 'SubFolder', 'Folder', 'File', 'ConfigFile', 'RootFile', 'NonRootFile'] + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_risk_type.py b/examples/visitor/tests/test_mal_risk_type.py new file mode 100644 index 0000000..cfa6d0f --- /dev/null +++ b/examples/visitor/tests/test_mal_risk_type.py @@ -0,0 +1,58 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +A file to test different cases of the Risk type (C, I, A) instruction in MAL. +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/risk_type_test_files"], indirect=True) + +def test_risk_type_1() -> None: + ''' + Defines risk types correctly + ''' + AnalyzerTestWrapper( + test_file="test_risk_type_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['CIA_TEST'] + ) + +def test_risk_type_2() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines risk types. + define I twice + ''' + AnalyzerTestWrapper( + test_file="test_risk_type_2.mal" + ).test( + warn=True, + defines=['id', 'version'], + categories=['System'], + assets=['CIA_TEST'] + ) + +def test_risk_type_3() -> None: + ''' + Defines CIA for an existance step + ''' + AnalyzerTestWrapper( + test_file="test_risk_type_3.mal", + error_msg="Line 6: exist: Defenses cannot have CIA classifications" + ) + +def test_risk_type_4() -> None: + ''' + Defines CIA for a defense step + ''' + AnalyzerTestWrapper( + test_file="test_risk_type_4.mal", + error_msg="Line 6: defense: Defenses cannot have CIA classifications" + ) diff --git a/examples/visitor/tests/test_mal_step.py b/examples/visitor/tests/test_mal_step.py new file mode 100644 index 0000000..155ff81 --- /dev/null +++ b/examples/visitor/tests/test_mal_step.py @@ -0,0 +1,76 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +A file to test different cases of the step creation in MAL, i.e. if step repetition in the same asset is detected +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/step_test_files"], indirect=True) + +def test_step_1() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines steps with name. + ''' + AnalyzerTestWrapper( + test_file="test_step_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Test'] + ) + +def test_step_2() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines steps with same name and other type. + ''' + AnalyzerTestWrapper( + test_file="test_step_2.mal", + error_msg="Attack step 'step1' previously defined at 6" + ) + +def test_step_3() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines steps with same name and same type. + ''' + AnalyzerTestWrapper( + test_file="test_step_3.mal", + error_msg="Attack step 'step1' previously defined at 6" + ) + +def test_step_4() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + ''' + AnalyzerTestWrapper( + test_file="test_step_4.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Test'] + ) + +def test_step_5() -> None: + ''' + Test if two assets with steps with the same name can exist + ''' + AnalyzerTestWrapper( + test_file="test_step_5.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Test','AnotherTest'] + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_steps.py b/examples/visitor/tests/test_mal_steps.py new file mode 100644 index 0000000..28d9239 --- /dev/null +++ b/examples/visitor/tests/test_mal_steps.py @@ -0,0 +1,181 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest +import os + +''' +A file to test different if steps respect the hierarchy of the assets, namely when using '+>' +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/steps_test_files"], indirect=True) + +def test_steps_1() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + ''' + AnalyzerTestWrapper( + test_file="test_steps_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Test'] + ) + +def test_steps_2() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines a step with '+>' when there isn't parent asset with that step + ''' + AnalyzerTestWrapper( + test_file="test_steps_2.mal", + error_msg="Cannot inherit attack step 'spyware' without previous definition" + ) + +def test_steps_3() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Defines a step with '+>' when there is another asset with that step but it isn't extended + ''' + AnalyzerTestWrapper( + test_file="test_steps_3.mal", + error_msg="Cannot inherit attack step 'spyware' without previous definition" + ) + +def test_steps_4() -> None: + ''' + Define two assets which do not extend a parent and have steps without '+>' + ''' + AnalyzerTestWrapper( + test_file="test_steps_4.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Linux', 'OperatingSystem'] + ) + +def test_steps_5() -> None: + ''' + Define an asset with a step inherited from the parent but with different types (&) + ''' + AnalyzerTestWrapper( + test_file="test_steps_5.mal", + error_msg="Cannot override attack step 'spyware' previously defined at 6 with different type '|' =/= '&" + ) + +def test_steps_6() -> None: + ''' + Define an asset with a step inherited from the parent but with different types (|) + ''' + AnalyzerTestWrapper( + test_file="test_steps_6.mal", + error_msg="Cannot override attack step 'spyware' previously defined at 6 with different type '&' =/= '|'" + ) + +def test_steps_7() -> None: + ''' + Define an asset with a step inherited from the parent but with different types (E) + ''' + AnalyzerTestWrapper( + test_file="test_steps_7.mal", + error_msg="Cannot override attack step 'compromiseCamera' previously defined at 6 with different type '!E' =/= 'E'" + ) + +def test_steps_8() -> None: + ''' + Define an asset with a step inherited from the parent but with different types (!E) + ''' + AnalyzerTestWrapper( + test_file="test_steps_8.mal", + error_msg="Cannot override attack step 'noCamera' previously defined at 6 with different type 'E' =/= '!E'" + ) + +def test_steps_9() -> None: + ''' + Test '+>' in a longer hierarchy + ''' + AnalyzerTestWrapper( + test_file="test_steps_9.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Machine', 'Computer','Thinkpad'] + ) + +def test_steps_10() -> None: + ''' + Test wrong type of extend step in a longer hierarchy + ''' + AnalyzerTestWrapper( + test_file="test_steps_10.mal", + error_msg="Cannot override attack step 'compromise' previously defined at 5 with different type '&' =/= '|'" + ) + +def test_steps_11() -> None: + ''' + Defines correct version and ID. + Defines category with name. + Defines asset with name. + Tests if two steps with the same names in different assets with different types does not throw error + ''' + AnalyzerTestWrapper( + test_file="test_steps_11.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Linux', 'OperatingSystem'] + ) + +def test_steps_12() -> None: + ''' + Test if '+>' works if the extended asset is in another file + ''' + AnalyzerTestWrapper( + test_file="test_steps_12.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Machine', 'Computer','Thinkpad'] + ) + +def test_steps_13() -> None: + ''' + Test if mismatched step types works if the extended asset is in another file + ''' + AnalyzerTestWrapper( + test_file="test_steps_13.mal", + error_msg="Cannot override attack step 'compromise' previously defined at 2 with different type '&' =/= '|'" + ) + +def test_steps_14() -> None: + ''' + Test inherit parent steps + ''' + AnalyzerTestWrapper( + test_file="test_steps_14.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1', 'Asset2', 'Asset3', 'Asset4'], + steps = [('Asset1',['step1']), ('Asset2',['step1','step2']), ( + 'Asset3', ['step1','step2','step3']), ('Asset4',['step1','step2','step3','step4'])] + ) + +def test_steps_15() -> None: + ''' + A complex example which should work + ''' + AnalyzerTestWrapper( + test_file="test_steps_15.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Linux', 'Camera'] + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_substitution.py b/examples/visitor/tests/test_mal_substitution.py new file mode 100644 index 0000000..4238444 --- /dev/null +++ b/examples/visitor/tests/test_mal_substitution.py @@ -0,0 +1,87 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +This file aims to test the call/substitution operator (A.X()) in MAL +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/substitution_test_files"], indirect=True) + +def test_substitution_1() -> None: + ''' + Test substitution correctly + ''' + AnalyzerTestWrapper( + test_file="test_substitution_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'Computer', 'OperatingSystem'] + ) + +def test_substitution_2() -> None: + ''' + Test substitution with a non existing variable + ''' + AnalyzerTestWrapper( + test_file="test_substitution_2.mal", + error_msg="Variable 'hostsOperatingSystems' is not defined\n" + \ + "Line 9: All expressions in reaches ('->') must point to a valid attack step" + ) + +def test_substitution_3() -> None: + ''' + Test substitution with an existing variable, but forget to call it, i.e. do not use parenthesis + ''' + AnalyzerTestWrapper( + test_file="test_substitution_3.mal", + error_msg="Field 'hostsOperatingSystems' not defined for asset 'Network', did you mean the variable 'hostsOperatingSystems()'?\n" + \ + "Line 6: All expressions in reaches ('->') must point to a valid attack step" + ) + +def test_substitution_4() -> None: + ''' + Try to call a variable defined in the parent + ''' + AnalyzerTestWrapper( + test_file="test_substitution_4.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Network', 'SubNet', 'Computer', 'OperatingSystem'] + ) + +def test_substitution_5() -> None: + ''' + Try to call a variable defined in a parent in a complex hierarchy + ''' + AnalyzerTestWrapper( + test_file="test_substitution_5.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Hardware', 'Machine', 'Computer', 'Lenovo', 'LenovoThinkPad'] + ) + +def test_substitution_6() -> None: + ''' + Try to call a variable defined in the child + ''' + AnalyzerTestWrapper( + test_file="test_substitution_6.mal", + error_msg="Variable 'hostsOperatingSystems' is not defined\n" + \ + "Line 5: All expressions in reaches ('->') must point to a valid attack step" + ) + +def test_substitution_7() -> None: + ''' + Try to call a variable defined in another asset + ''' + AnalyzerTestWrapper( + test_file="test_substitution_7.mal", + error_msg="Variable 'physicalComponents' is not defined\n" + \ + "Line 14: All expressions in reaches ('->') must point to a valid attack step" + ) diff --git a/examples/visitor/tests/test_mal_subtype.py b/examples/visitor/tests/test_mal_subtype.py new file mode 100644 index 0000000..cd20c3f --- /dev/null +++ b/examples/visitor/tests/test_mal_subtype.py @@ -0,0 +1,66 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +File to test the subtype expression in MAL +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/subtype_test_files"], indirect=True) + +def test_subtype_1() -> None: + ''' + Test subtype correctly (defined in variable) + ''' + AnalyzerTestWrapper( + test_file="test_subtype_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem'] + ) + +def test_subtype_2() -> None: + ''' + Test subtype correctly (defined in step) + ''' + AnalyzerTestWrapper( + test_file="test_subtype_2.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'Linux', 'OperatingSystem'] + ) + +def test_subtype_3() -> None: + ''' + Test subtype without inheritance relationship (given X[A], a is not a child of X) + ''' + AnalyzerTestWrapper( + test_file="test_subtype_3.mal", + error_msg="Asset 'Windows' cannot be of type 'OperatingSystem'\n" + \ + "Line 6: All expressions in reaches ('->') must point to a valid attack step" + ) + +def test_subtype_4() -> None: + ''' + Test subtype, but with a wrong attack step + ''' + AnalyzerTestWrapper( + test_file="test_subtype_4.mal", + error_msg="Attack step 'foundLinux' not defined for asset 'Windows'" + ) + +def test_subtype_5() -> None: + ''' + Test subtype in a long hierarchy + ''' + AnalyzerTestWrapper( + test_file="test_subtype_5.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Windows', 'WindowsVista', 'WindowsVistaProfessional', 'OperatingSystem'] + ) \ No newline at end of file diff --git a/examples/visitor/tests/test_mal_transitive.py b/examples/visitor/tests/test_mal_transitive.py new file mode 100644 index 0000000..8f0aa7a --- /dev/null +++ b/examples/visitor/tests/test_mal_transitive.py @@ -0,0 +1,67 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +File to test the transitive step (X*.A) in MAL +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/transitive_test_files"], indirect=True) + +def test_transitive_1() -> None: + ''' + Correctly define a transitive expression (in a step) + ''' + AnalyzerTestWrapper( + test_file="test_transitive_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Folder', 'SubFolder'] + ) + +def test_transitive_2() -> None: + ''' + Correctly define a transitive expression (in a variable) + ''' + AnalyzerTestWrapper( + test_file="test_transitive_2.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'Folder', 'SubFolder'] + ) + +def test_transitive_3() -> None: + ''' + Create a transitive expression when there is no inheritance + relationship between X and A (A is not a child of X, given X.A*) + ''' + AnalyzerTestWrapper( + test_file="test_transitive_3.mal", + error_msg="Previous asset 'Folder' is not of type 'SubFolder'\n" + \ + "Variable 'recursive_subfolders' defined at 6 does not point to an asset" + ) + +def test_transitive_4() -> None: + ''' + Test transitive step in a long hierarchy + ''' + AnalyzerTestWrapper( + test_file="test_transitive_4.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Computer', 'FileSystem', 'FileSystemEntries', 'Folder', 'SubFolder'] + ) + +def test_transitive_5() -> None: + ''' + Define a transitive expression, but call it without a step belonging to the asset + ''' + AnalyzerTestWrapper( + test_file="test_transitive_5.mal", + error_msg="Attack step 'wrongStep' not defined for asset 'SubFolder'" + ) diff --git a/examples/visitor/tests/test_mal_ttc.py b/examples/visitor/tests/test_mal_ttc.py new file mode 100644 index 0000000..5a8780f --- /dev/null +++ b/examples/visitor/tests/test_mal_ttc.py @@ -0,0 +1,568 @@ +from .mal_analyzer_test_wrapper import AnalyzerTestWrapper + +from pathlib import Path +import pytest + +''' +File to test Time To Compromise (TTC) expressions in MAL +''' + +@pytest.mark.usefixtures("setup_test_environment") +@pytest.mark.parametrize("setup_test_environment", [Path(__file__).parent / "fixtures/ttc_test_files/"], indirect=True) + +# TESTS FOR BERNOULLI + +def test_ttc_1() -> None: + ''' + Test correct Bernoulli + ''' + AnalyzerTestWrapper( + test_file="test_ttc_1.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_2() -> None: + ''' + Test Bernoulli with more than one parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_2.mal", + error_msg="Expected exactly one parameter (probability), for Bernoulli distribution" + ) + +def test_ttc_3() -> None: + ''' + Test Bernoulli without parameters + ''' + AnalyzerTestWrapper( + test_file="test_ttc_3.mal", + error_msg="Expected exactly one parameter (probability), for Bernoulli distribution" + ) + +def test_ttc_4() -> None: + ''' + Test Bernoulli with invalid parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_4.mal", + error_msg="2.0 is not in valid range '0 <= probability <= 1', for Bernoulli distribution" + ) + +# TESTS FOR BINOMIAL + +def test_ttc_5() -> None: + ''' + Test correct Binomial + ''' + AnalyzerTestWrapper( + test_file="test_ttc_5.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_6() -> None: + ''' + Test Binomial with more than two parameters + ''' + AnalyzerTestWrapper( + test_file="test_ttc_6.mal", + error_msg="Expected exactly two parameters (trials, probability), for Binomial distribution" + ) + +def test_ttc_7() -> None: + ''' + Test Binomial with one parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_7.mal", + error_msg="Expected exactly two parameters (trials, probability), for Binomial distribution" + ) + +def test_ttc_8() -> None: + ''' + Test Binomial with invalid parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_8.mal", + error_msg="2.0 is not in valid range '0 <= probability <= 1', for Binomial distribution" + ) + +# TESTS FOR EXPONENTIAL + +def test_ttc_9() -> None: + ''' + Test correct Exponential + ''' + AnalyzerTestWrapper( + test_file="test_ttc_9.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_10() -> None: + ''' + Test Exponential with more than one parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_10.mal", + error_msg = "Expected exactly one parameter (lambda), for Exponential distribution" + ) + +def test_ttc_11() -> None: + ''' + Test Exponential without parameters + ''' + AnalyzerTestWrapper( + test_file="test_ttc_11.mal", + error_msg = "Expected exactly one parameter (lambda), for Exponential distribution" + ) + +def test_ttc_12() -> None: + ''' + Test Exponential with invalid parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_12.mal", + error_msg = "0 is not in valid range 'lambda > 0', for Exponential distribution" + ) + +# TESTS FOR GAMMA + +def test_ttc_13() -> None: + ''' + Test correct Gamma + ''' + AnalyzerTestWrapper( + test_file="test_ttc_13.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_14() -> None: + ''' + Test Gamma with more than two parameters + ''' + AnalyzerTestWrapper( + test_file="test_ttc_14.mal", + error_msg = "Expected exactly two parameters (shape, scale), for Gamma distribution" + ) + +def test_ttc_15() -> None: + ''' + Test Gamma with one parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_15.mal", + error_msg = "Expected exactly two parameters (shape, scale), for Gamma distribution" + ) + +def test_ttc_16() -> None: + ''' + Test Gamma with invalid first parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_16.mal", + error_msg = "0 is not in valid range 'shape > 0', for Gamma distribution" + ) + +def test_ttc_17() -> None: + ''' + Test Gamma with invalid second parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_17.mal", + error_msg = "0 is not in valid range 'scale > 0', for Gamma distribution" + ) + +# TESTS FOR LOGNORMAL + +def test_ttc_18() -> None: + ''' + Test correct LogNormal + ''' + AnalyzerTestWrapper( + test_file="test_ttc_18.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_19() -> None: + ''' + Test LogNormal with more than two parameters + ''' + AnalyzerTestWrapper( + test_file="test_ttc_19.mal", + error_msg = "Expected exactly two parameters (mean, standardDeviation), for LogNormal distribution" + ) + +def test_ttc_20() -> None: + ''' + Test LogNormal with one parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_20.mal", + error_msg = "Expected exactly two parameters (mean, standardDeviation), for LogNormal distribution" + ) + +def test_ttc_21() -> None: + ''' + Test LogNormal with invalid standardDeviation + ''' + AnalyzerTestWrapper( + test_file="test_ttc_21.mal", + error_msg = "0 is not in valid range 'standardDeviation > 0', for LogNormal distribution" + ) + +# TESTS FOR PARETO + +def test_ttc_22() -> None: + ''' + Test correct Pareto + ''' + AnalyzerTestWrapper( + test_file="test_ttc_22.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_23() -> None: + ''' + Test Pareto with more than two parameters + ''' + AnalyzerTestWrapper( + test_file="test_ttc_23.mal", + error_msg = "Expected exactly two parameters (min, shape), for Pareto distribution" + ) + +def test_ttc_24() -> None: + ''' + Test Pareto with one parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_24.mal", + error_msg = "Expected exactly two parameters (min, shape), for Pareto distribution" + ) + +def test_ttc_25() -> None: + ''' + Test Pareto with invalid min + ''' + AnalyzerTestWrapper( + test_file="test_ttc_25.mal", + error_msg = "0 is not in valid range 'min > 0', for Pareto distribution" + ) + +def test_ttc_26() -> None: + ''' + Test Pareto with invalid shape + ''' + AnalyzerTestWrapper( + test_file="test_ttc_26.mal", + error_msg = "0 is not in valid range 'shape > 0', for Pareto distribution" + ) + +# TESTS FOR TRUNCATEDNORMAL + +def test_ttc_27() -> None: + ''' + Test correct TruncatedNormal + ''' + AnalyzerTestWrapper( + test_file="test_ttc_27.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_28() -> None: + ''' + Test TruncatedNormal with more than two parameters + ''' + AnalyzerTestWrapper( + test_file="test_ttc_28.mal", + error_msg = "Expected exactly two parameters (mean, standardDeviation), for TruncatedNormal distribution" + ) + +def test_ttc_29() -> None: + ''' + Test TruncatedNormal with one parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_29.mal", + error_msg = "Expected exactly two parameters (mean, standardDeviation), for TruncatedNormal distribution" + ) + +def test_ttc_30() -> None: + ''' + Test TruncatedNormal with invalid standard deviation + ''' + AnalyzerTestWrapper( + test_file="test_ttc_30.mal", + error_msg = "0 is not in valid range 'standardDeviation > 0', for TruncatedNormal distribution" + ) + +# TESTS FOR UNIFORM + +def test_ttc_31() -> None: + ''' + Test correct Uniform + ''' + AnalyzerTestWrapper( + test_file="test_ttc_31.mal" + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_32() -> None: + ''' + Test Uniform with more than two parameters + ''' + AnalyzerTestWrapper( + test_file="test_ttc_32.mal", + error_msg = "Expected exactly two parameters (min, max), for Uniform distribution" + ) + +def test_ttc_33() -> None: + ''' + Test Uniform with one parameter + ''' + AnalyzerTestWrapper( + test_file="test_ttc_33.mal", + error_msg = "Expected exactly two parameters (min, max), for Uniform distribution" + ) + +def test_ttc_34() -> None: + ''' + Test Uniform with min greater than max + ''' + AnalyzerTestWrapper( + test_file="test_ttc_34.mal", + error_msg = "(5.0, 4.0) does not meet requirement 'min <= max', for Uniform distribution" + ) + +# TESTS FOR COMBINATIONS +def test_ttc_35() -> None: + ''' + Test correct Infinity + ''' + AnalyzerTestWrapper( + test_file="test_ttc_35.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_36() -> None: + ''' + Test incorrect Infinity + ''' + AnalyzerTestWrapper( + test_file="test_ttc_36.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) + +def test_ttc_37() -> None: + ''' + Test correct Zero + ''' + AnalyzerTestWrapper( + test_file="test_ttc_37.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_38() -> None: + ''' + Test incorrect Zero + ''' + AnalyzerTestWrapper( + test_file="test_ttc_38.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) + +def test_ttc_39() -> None: + ''' + Test correct EasyAndCertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_39.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_40() -> None: + ''' + Test incorrect EasyAndCertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_40.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) + +def test_ttc_41() -> None: + ''' + Test correct EasyAndUncertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_41.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_42() -> None: + ''' + Test incorrect EasyAndUncertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_42.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) + +def test_ttc_43() -> None: + ''' + Test correct HardAndCertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_43.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_44() -> None: + ''' + Test incorrect HardAndCertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_44.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) + +def test_ttc_45() -> None: + ''' + Test correct HardAndUncertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_45.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_46() -> None: + ''' + Test incorrect HardAndUncertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_46.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) + +def test_ttc_47() -> None: + ''' + Test correct VeryHardAndCertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_47.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_48() -> None: + ''' + Test incorrect VeryHardAndCertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_48.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) + +def test_ttc_49() -> None: + ''' + Test correct VeryHardAndUncertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_49.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_50() -> None: + ''' + Test incorrect VeryHardAndUncertain + ''' + AnalyzerTestWrapper( + test_file="test_ttc_50.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) + +def test_ttc_51() -> None: + ''' + Test correct Enabled + ''' + AnalyzerTestWrapper( + test_file="test_ttc_51.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_52() -> None: + ''' + Test incorrect Enabled + ''' + AnalyzerTestWrapper( + test_file="test_ttc_52.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) + +def test_ttc_53() -> None: + ''' + Test correct Disabled + ''' + AnalyzerTestWrapper( + test_file="test_ttc_53.mal", + ).test( + defines=['id', 'version'], + categories=['System'], + assets=['Asset1'] + ) + +def test_ttc_54() -> None: + ''' + Test incorrect Disabled + ''' + AnalyzerTestWrapper( + test_file="test_ttc_54.mal", + error_msg = "Expected exactly zero parameters, for combination distributions" + ) \ No newline at end of file diff --git a/grammar.js b/grammar.js index 7f23f45..d6df58e 100644 --- a/grammar.js +++ b/grammar.js @@ -15,7 +15,7 @@ module.exports = grammar({ $.comment, ], - word: $ => $.identity, + word: $ => $.identifier, conflicts: $ => [ // FIXME: Conflict at end of association when there shouldn't be one @@ -55,7 +55,7 @@ module.exports = grammar({ category_declaration: $ => seq( 'category', - field('id', $.identity), + field('id', $.identifier), field('meta', repeat($.meta)), '{', field('assets', repeat($.asset_declaration)), @@ -66,8 +66,8 @@ module.exports = grammar({ asset_declaration: $ => seq( optional(alias('abstract', 'abstract')), 'asset', - field('id', $.identity), - field('extends', optional(seq('extends', $.identity))), + field('id', $.identifier), + field('extends', optional(seq('extends', $.identifier))), field('meta', repeat($.meta)), '{', optional(field('body', $.asset_definition)), @@ -79,22 +79,16 @@ module.exports = grammar({ // A varaible within an asset asset_variable: $ => seq( 'let', - field('id', $.identity), + field('id', $.identifier), '=', field('value', $.asset_expr), ), // Attack step for an asset attack_step: $ => seq( - field('step_type', choice( - '|', - '&', - '#', - 'E', - '!E', - )), - field('id', $.identity), - repeat(field('tag', seq('@', $.identity))), + field('step_type', $.step_type), + field('id', $.identifier), + optional(field('tag', repeat(seq('@', $.identifier)))), optional(field('cias', seq( '{', $.cias, @@ -102,11 +96,19 @@ module.exports = grammar({ ))), optional(field('ttc', $.ttc)), field('meta', repeat($.meta)), - optional(field('detector', $.detector)), + optional(field('detector', repeat($.detector))), optional(field('preconditions', $.preconditions)), optional(field('reaches', $.reaching)), ), + step_type: $ => token(choice( + '|', + '&', + '#', + 'E', + '!E', + )), + cias: $ => commaSep1($.cia), // Detector for attack steps @@ -115,11 +117,11 @@ module.exports = grammar({ choice('!', token(prec(1, '//!'))), optional(field('name', $.detector_name)), field('context', $.detector_context), - optional(field('type', $.identity)), + optional(field('type', $.identifier)), optional(field('ttc', $.ttc)), ), - detector_name: $ => sep1($.identity, '.'), + detector_name: $ => sep1($.identifier, '.'), detector_context: $ => seq( '(', @@ -128,8 +130,8 @@ module.exports = grammar({ ), detector_context_asset: $ => seq( - field('type', $.identity), - field('id', $.identity), + field('type', $.identifier), + field('id', $.identifier), ), // Precondition for attack steps @@ -164,14 +166,14 @@ module.exports = grammar({ _ttc_primary: $ => choice( $._number, - $.identity, + $.identifier, $.ttc_distribution, ), ttc_distribution: $ => seq( - field('id', $.identity), + field('id', $.identifier), '(', - field('values', commaSep1($._number)), + field('values', optional(commaSep1($._number))), ')', ), @@ -207,12 +209,12 @@ module.exports = grammar({ _asset_expr_primary: $ => choice( - $.identity, + $.identifier, $.asset_variable_substitution ), asset_variable_substitution: $ => seq( - field('id', $.identity), + field('id', $.identifier), '(', ')', ), @@ -220,16 +222,16 @@ module.exports = grammar({ asset_expr_type: $ => prec.left('binary_exp', seq( field('expression', $._inline_asset_expr), '[', - field('type_id', $.identity), + field('type_id', $.identifier), ']', )), asset_expr_binop: $ => choice( ...[ ['\\/', 'binary_plus'], - ['/\\', 'binary_mul'], - ['-', 'binary_mul'], - ['.', 'binary_exp'], + ['/\\', 'binary_plus'], + ['-', 'binary_plus'], + ['.', 'binary_mul'], ].map(([operator, precedence, associativity]) => (associativity === 'right' ? prec.right : prec.left)(precedence, seq( field('left', $._inline_asset_expr), @@ -254,7 +256,7 @@ module.exports = grammar({ // Define values, i.e. global string constants define_declaration: $ => seq( '#', - field('id', $.identity), + field('id', $.identifier), ':', field('value', $.string) ), @@ -269,15 +271,15 @@ module.exports = grammar({ ), association: $ => seq( - field('left_id', $.identity), - '[', field('left_field_id', $.identity), ']', + field('left_id', $.identifier), + '[', field('left_field_id', $.identifier), ']', field('left_mult', $.multiplicity), '<--', - field('id', $.identity), + field('id', $.identifier), '-->', field('right_mult', $.multiplicity), - '[', field('right_field_id', $.identity), ']', - field('right_id', $.identity), + '[', field('right_field_id', $.identifier), ']', + field('right_id', $.identifier), field('meta', repeat($.meta)), ), @@ -300,7 +302,7 @@ module.exports = grammar({ // Meta information for category, asset, or otherwise. meta: $ => seq( - field('id', $.identity), + field('id', $.identifier), 'info', ':', field('info', alias($.string, $.meta_string)), @@ -311,7 +313,7 @@ module.exports = grammar({ _number: $ => choice($.integer, $.float), integer: _ => token(/[0-9]+/), float: _ => token(/(:?[0-9]+(:?[.][0-9]*)?|[.][0-9]+)/), - identity: _ => token(/[a-zA-Z0-9_]+/), + identifier: _ => token(/[a-zA-Z0-9_]+/), star: _ => token('*'), cia: _ => token(/[CIA]/) diff --git a/package-lock.json b/package-lock.json index c6354db..e14a16d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tree-sitter-mal", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tree-sitter-mal", - "version": "0.1.0", + "version": "0.2.0", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 8a4a6d1..f5a8214 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tree-sitter-mal", - "version": "0.1.0", + "version": "0.2.0", "description": "IT systems are growing in complexity and the threat from cyberattacks is increasing. Threat modeling is a process that can be used to analyze potential attacks to IT systems in order to facilitate secure design. Meta Attack Language (MAL) is a threat modeling language framework for the creation of domain specific languages (DSL). MAL is developed at KTH Royal Institute of Technolog", "repository": "https://github.com/tobiky/tree-sitter-mal", "license": "MIT", diff --git a/pyproject.toml b/pyproject.toml index e306af3..32efba8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "tree-sitter-mal" description = "IT systems are growing in complexity and the threat from cyberattacks is increasing. Threat modeling is a process that can be used to analyze potential attacks to IT systems in order to facilitate secure design. Meta Attack Language (MAL) is a threat modeling language framework for the creation of domain specific languages (DSL). MAL is developed at KTH Royal Institute of Technolog" -version = "0.1.0" +version = "0.2.0" keywords = ["incremental", "parsing", "tree-sitter", "mal"] classifiers = [ "Intended Audience :: Developers", diff --git a/queries/highlights.scm b/queries/highlights.scm index b5155ae..6c796e4 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -9,49 +9,32 @@ ] @punctuation.bracket ; Operators -(association ["<--" "-->"] @operator) - -(ttc_binop - [ +([ + "<--" + "-->" "+" "-" "/" "^" - "*" - ] @operator) - -(attack_step - [ - "|" - "&" + (step_type) + "=" + "!" + "//!" + "<-" + "+>" + "->" "#" - "E" - "!E" - "@" - ] @operator) - -(asset_variable "=" @operator) - -(detector ["!" "//!"] @operator) - -(preconditions "<-" @operator) - -(reaching ["+>" "->"] @operator) - -(define_declaration "#" @operator) - -(asset_expr_binop - [ "\\/" "/\\" "-" "." - ] @operator) + ".." + "@" + ] @operator) +(ttc_binop "*" @operator) (asset_expr_unop "*" @operator) -(multiplicity_range ".." @operator) - ; Keywords "include" @keyword.import @@ -84,36 +67,36 @@ (float) @number.float ; Semantic objects -(define_declaration id: (identity) @constant) -(ttc_distribution id: (identity) @function.builtin) -(ttc (identity) @type) -(category_declaration id: (identity) @module) +(define_declaration id: (identifier) @constant) +(ttc_distribution id: (identifier) @function.builtin) +(ttc (identifier) @type) +(category_declaration id: (identifier) @module) (association - left_id: (identity) @type - left_field_id: (identity) @property - right_field_id: (identity) @property - right_id: (identity) @type) + left_id: (identifier) @type + left_field_id: (identifier) @property + right_field_id: (identifier) @property + right_id: (identifier) @type) (asset_declaration - [id: (identity) - extends: (identity)] @type) + [id: (identifier) + extends: (identifier)] @type) (detector_context_asset - type: (identity) @type - id: (identity) @property) + type: (identifier) @type + id: (identifier) @property) (asset_variable_substitution - id: (identity) @variable) + id: (identifier) @variable) (asset_variable - id: (identity) @variable) + id: (identifier) @variable) -(asset_expr (identity) @property) -(asset_expr [(identity) @function +(asset_expr (identifier) @property) +(asset_expr [(identifier) @function (asset_expr_binop left: (_)* operator: "." - right: (identity) @function)] .) + right: (identifier) @function)] .) ; Miscellaneous (comment) @comment -(attack_step tag: (identity) @tag +(attack_step (identifier) @tag (#not-match? @tag "hidden|debug|trace")) -(attack_step tag: (identity) @tag.builtin +(attack_step (identifier) @tag.builtin (#match? @tag.builtin "hidden|debug|trace")) diff --git a/src/grammar.json b/src/grammar.json index 460702c..9e7adcc 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -1,7 +1,7 @@ { "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json", "name": "mal", - "word": "identity", + "word": "identifier", "rules": { "source_file": { "type": "REPEAT", @@ -102,7 +102,7 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -166,7 +166,7 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -184,7 +184,7 @@ }, { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } ] }, @@ -259,7 +259,7 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -283,29 +283,8 @@ "type": "FIELD", "name": "step_type", "content": { - "type": "CHOICE", - "members": [ - { - "type": "STRING", - "value": "|" - }, - { - "type": "STRING", - "value": "&" - }, - { - "type": "STRING", - "value": "#" - }, - { - "type": "STRING", - "value": "E" - }, - { - "type": "STRING", - "value": "!E" - } - ] + "type": "SYMBOL", + "name": "step_type" } }, { @@ -313,28 +292,36 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { - "type": "REPEAT", - "content": { - "type": "FIELD", - "name": "tag", - "content": { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "@" - }, - { - "type": "SYMBOL", - "name": "identity" + "type": "CHOICE", + "members": [ + { + "type": "FIELD", + "name": "tag", + "content": { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "@" + }, + { + "type": "SYMBOL", + "name": "identifier" + } + ] } - ] + } + }, + { + "type": "BLANK" } - } + ] }, { "type": "CHOICE", @@ -399,8 +386,11 @@ "type": "FIELD", "name": "detector", "content": { - "type": "SYMBOL", - "name": "detector" + "type": "REPEAT", + "content": { + "type": "SYMBOL", + "name": "detector" + } } }, { @@ -442,6 +432,34 @@ } ] }, + "step_type": { + "type": "TOKEN", + "content": { + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": "|" + }, + { + "type": "STRING", + "value": "&" + }, + { + "type": "STRING", + "value": "#" + }, + { + "type": "STRING", + "value": "E" + }, + { + "type": "STRING", + "value": "!E" + } + ] + } + }, "cias": { "type": "SEQ", "members": [ @@ -522,7 +540,7 @@ "name": "type", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -553,7 +571,7 @@ "members": [ { "type": "SYMBOL", - "name": "identity" + "name": "identifier" }, { "type": "REPEAT", @@ -566,7 +584,7 @@ }, { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } ] } @@ -619,7 +637,7 @@ "name": "type", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -627,7 +645,7 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } } ] @@ -781,7 +799,7 @@ }, { "type": "SYMBOL", - "name": "identity" + "name": "identifier" }, { "type": "SYMBOL", @@ -797,7 +815,7 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -808,27 +826,35 @@ "type": "FIELD", "name": "values", "content": { - "type": "SEQ", + "type": "CHOICE", "members": [ { - "type": "SYMBOL", - "name": "_number" + "type": "SEQ", + "members": [ + { + "type": "SYMBOL", + "name": "_number" + }, + { + "type": "REPEAT", + "content": { + "type": "SEQ", + "members": [ + { + "type": "STRING", + "value": "," + }, + { + "type": "SYMBOL", + "name": "_number" + } + ] + } + } + ] }, { - "type": "REPEAT", - "content": { - "type": "SEQ", - "members": [ - { - "type": "STRING", - "value": "," - }, - { - "type": "SYMBOL", - "name": "_number" - } - ] - } + "type": "BLANK" } ] } @@ -1056,7 +1082,7 @@ "members": [ { "type": "SYMBOL", - "name": "identity" + "name": "identifier" }, { "type": "SYMBOL", @@ -1072,7 +1098,7 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -1108,7 +1134,7 @@ "name": "type_id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -1156,7 +1182,7 @@ }, { "type": "PREC_LEFT", - "value": "binary_mul", + "value": "binary_plus", "content": { "type": "SEQ", "members": [ @@ -1189,7 +1215,7 @@ }, { "type": "PREC_LEFT", - "value": "binary_mul", + "value": "binary_plus", "content": { "type": "SEQ", "members": [ @@ -1222,7 +1248,7 @@ }, { "type": "PREC_LEFT", - "value": "binary_exp", + "value": "binary_mul", "content": { "type": "SEQ", "members": [ @@ -1297,7 +1323,7 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -1346,7 +1372,7 @@ "name": "left_id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -1358,7 +1384,7 @@ "name": "left_field_id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -1382,7 +1408,7 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -1406,7 +1432,7 @@ "name": "right_field_id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -1418,7 +1444,7 @@ "name": "right_id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -1493,7 +1519,7 @@ "name": "id", "content": { "type": "SYMBOL", - "name": "identity" + "name": "identifier" } }, { @@ -1566,7 +1592,7 @@ "value": "(:?[0-9]+(:?[.][0-9]*)?|[.][0-9]+)" } }, - "identity": { + "identifier": { "type": "TOKEN", "content": { "type": "PATTERN", diff --git a/src/node-types.json b/src/node-types.json index 914aca5..d85d39d 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -22,7 +22,7 @@ "named": false }, { - "type": "identity", + "type": "identifier", "named": true } ] @@ -32,7 +32,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -93,7 +93,7 @@ "named": true }, { - "type": "identity", + "type": "identifier", "named": true } ] @@ -132,7 +132,7 @@ "named": true }, { - "type": "identity", + "type": "identifier", "named": true } ] @@ -188,7 +188,7 @@ "named": true }, { - "type": "identity", + "type": "identifier", "named": true } ] @@ -228,7 +228,7 @@ "named": true }, { - "type": "identity", + "type": "identifier", "named": true } ] @@ -238,7 +238,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -278,7 +278,7 @@ "named": true }, { - "type": "identity", + "type": "identifier", "named": true } ] @@ -304,7 +304,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -330,7 +330,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -346,7 +346,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -356,7 +356,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -366,7 +366,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -396,7 +396,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -406,7 +406,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -461,7 +461,7 @@ ] }, "detector": { - "multiple": false, + "multiple": true, "required": false, "types": [ { @@ -475,7 +475,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -515,24 +515,8 @@ "required": true, "types": [ { - "type": "!E", - "named": false - }, - { - "type": "#", - "named": false - }, - { - "type": "&", - "named": false - }, - { - "type": "E", - "named": false - }, - { - "type": "|", - "named": false + "type": "step_type", + "named": true } ] }, @@ -545,7 +529,7 @@ "named": false }, { - "type": "identity", + "type": "identifier", "named": true } ] @@ -581,7 +565,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -649,7 +633,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -705,7 +689,7 @@ "required": false, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -736,7 +720,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -746,7 +730,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -762,7 +746,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -793,7 +777,7 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] @@ -955,7 +939,7 @@ "named": true }, { - "type": "identity", + "type": "identifier", "named": true }, { @@ -994,7 +978,7 @@ "named": true }, { - "type": "identity", + "type": "identifier", "named": true }, { @@ -1054,7 +1038,7 @@ "named": true }, { - "type": "identity", + "type": "identifier", "named": true }, { @@ -1082,14 +1066,14 @@ "required": true, "types": [ { - "type": "identity", + "type": "identifier", "named": true } ] }, "values": { "multiple": true, - "required": true, + "required": false, "types": [ { "type": ",", @@ -1111,18 +1095,10 @@ "type": "!", "named": false }, - { - "type": "!E", - "named": false - }, { "type": "#", "named": false }, - { - "type": "&", - "named": false - }, { "type": "(", "named": false @@ -1199,10 +1175,6 @@ "type": "@", "named": false }, - { - "type": "E", - "named": false - }, { "type": "[", "named": false @@ -1253,7 +1225,7 @@ "named": true }, { - "type": "identity", + "type": "identifier", "named": true }, { @@ -1277,15 +1249,15 @@ "named": true }, { - "type": "string", + "type": "step_type", "named": true }, { - "type": "{", - "named": false + "type": "string", + "named": true }, { - "type": "|", + "type": "{", "named": false }, { diff --git a/src/parser.c b/src/parser.c index 8415e53..7df5b0c 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,4 +1,4 @@ -/* Automatically generated by tree-sitter v0.25.3 */ +/* Automatically @generated by tree-sitter v0.25.4 */ #include "tree_sitter/parser.h" @@ -9,18 +9,18 @@ #define LANGUAGE_VERSION 15 #define STATE_COUNT 326 #define LARGE_STATE_COUNT 2 -#define SYMBOL_COUNT 94 +#define SYMBOL_COUNT 92 #define ALIAS_COUNT 1 -#define TOKEN_COUNT 46 +#define TOKEN_COUNT 43 #define EXTERNAL_TOKEN_COUNT 0 #define FIELD_COUNT 33 #define MAX_ALIAS_SEQUENCE_LENGTH 14 #define MAX_RESERVED_WORD_SET_SIZE 0 -#define PRODUCTION_ID_COUNT 174 +#define PRODUCTION_ID_COUNT 172 #define SUPERTYPE_COUNT 0 enum ts_symbol_identifiers { - sym_identity = 1, + sym_identifier = 1, sym_comment = 2, anon_sym_include = 3, anon_sym_category = 4, @@ -31,94 +31,92 @@ enum ts_symbol_identifiers { anon_sym_extends = 9, anon_sym_let = 10, anon_sym_EQ = 11, - anon_sym_PIPE = 12, - anon_sym_AMP = 13, - anon_sym_POUND = 14, - anon_sym_E = 15, - anon_sym_BANGE = 16, - anon_sym_AT = 17, - anon_sym_COMMA = 18, - anon_sym_BANG = 19, - anon_sym_SLASH_SLASH_BANG = 20, - anon_sym_DOT = 21, - anon_sym_LPAREN = 22, - anon_sym_RPAREN = 23, - anon_sym_LT_DASH = 24, - anon_sym_PLUS_GT = 25, - anon_sym_DASH_GT = 26, - anon_sym_LBRACK = 27, - anon_sym_RBRACK = 28, - anon_sym_PLUS = 29, - anon_sym_DASH = 30, - anon_sym_STAR = 31, - anon_sym_SLASH = 32, - anon_sym_CARET = 33, - anon_sym_BSLASH_SLASH = 34, - anon_sym_SLASH_BSLASH = 35, - anon_sym_COLON = 36, - anon_sym_associations = 37, - anon_sym_LT_DASH_DASH = 38, - anon_sym_DASH_DASH_GT = 39, - anon_sym_DOT_DOT = 40, - anon_sym_info = 41, - sym_string = 42, - sym_integer = 43, - sym_float = 44, - sym_cia = 45, - sym_source_file = 46, - sym_declaration = 47, - sym_include_declaration = 48, - sym_category_declaration = 49, - sym_asset_declaration = 50, - sym_asset_definition = 51, - sym_asset_variable = 52, - sym_attack_step = 53, - sym_cias = 54, - sym_detector = 55, - sym_detector_name = 56, - sym_detector_context = 57, - sym_detector_context_asset = 58, - sym_preconditions = 59, - sym_reaching = 60, - sym_ttc = 61, - sym__ttc_expr = 62, - sym__ttc_parenthesized = 63, - sym__ttc_primary = 64, - sym_ttc_distribution = 65, - sym_ttc_binop = 66, - sym_asset_expr = 67, - sym__inline_asset_expr = 68, - sym__asset_expr_primary = 69, - sym_asset_variable_substitution = 70, - sym_asset_expr_type = 71, - sym_asset_expr_binop = 72, - sym_asset_expr_unop = 73, - sym_define_declaration = 74, - sym_associations_declaration = 75, - sym_association = 76, - sym_multiplicity = 77, - sym__multiplicity_atom = 78, - sym_multiplicity_range = 79, - sym_meta = 80, - sym__number = 81, - sym_star = 82, - aux_sym_source_file_repeat1 = 83, - aux_sym_category_declaration_repeat1 = 84, - aux_sym_category_declaration_repeat2 = 85, - aux_sym_asset_definition_repeat1 = 86, - aux_sym_attack_step_repeat1 = 87, - aux_sym_cias_repeat1 = 88, - aux_sym_detector_name_repeat1 = 89, - aux_sym_detector_context_repeat1 = 90, - aux_sym_preconditions_repeat1 = 91, - aux_sym_ttc_distribution_repeat1 = 92, - aux_sym_associations_declaration_repeat1 = 93, - alias_sym_meta_string = 94, + anon_sym_AT = 12, + sym_step_type = 13, + anon_sym_COMMA = 14, + anon_sym_BANG = 15, + anon_sym_SLASH_SLASH_BANG = 16, + anon_sym_DOT = 17, + anon_sym_LPAREN = 18, + anon_sym_RPAREN = 19, + anon_sym_LT_DASH = 20, + anon_sym_PLUS_GT = 21, + anon_sym_DASH_GT = 22, + anon_sym_LBRACK = 23, + anon_sym_RBRACK = 24, + anon_sym_PLUS = 25, + anon_sym_DASH = 26, + anon_sym_STAR = 27, + anon_sym_SLASH = 28, + anon_sym_CARET = 29, + anon_sym_BSLASH_SLASH = 30, + anon_sym_SLASH_BSLASH = 31, + anon_sym_POUND = 32, + anon_sym_COLON = 33, + anon_sym_associations = 34, + anon_sym_LT_DASH_DASH = 35, + anon_sym_DASH_DASH_GT = 36, + anon_sym_DOT_DOT = 37, + anon_sym_info = 38, + sym_string = 39, + sym_integer = 40, + sym_float = 41, + sym_cia = 42, + sym_source_file = 43, + sym_declaration = 44, + sym_include_declaration = 45, + sym_category_declaration = 46, + sym_asset_declaration = 47, + sym_asset_definition = 48, + sym_asset_variable = 49, + sym_attack_step = 50, + sym_cias = 51, + sym_detector = 52, + sym_detector_name = 53, + sym_detector_context = 54, + sym_detector_context_asset = 55, + sym_preconditions = 56, + sym_reaching = 57, + sym_ttc = 58, + sym__ttc_expr = 59, + sym__ttc_parenthesized = 60, + sym__ttc_primary = 61, + sym_ttc_distribution = 62, + sym_ttc_binop = 63, + sym_asset_expr = 64, + sym__inline_asset_expr = 65, + sym__asset_expr_primary = 66, + sym_asset_variable_substitution = 67, + sym_asset_expr_type = 68, + sym_asset_expr_binop = 69, + sym_asset_expr_unop = 70, + sym_define_declaration = 71, + sym_associations_declaration = 72, + sym_association = 73, + sym_multiplicity = 74, + sym__multiplicity_atom = 75, + sym_multiplicity_range = 76, + sym_meta = 77, + sym__number = 78, + sym_star = 79, + aux_sym_source_file_repeat1 = 80, + aux_sym_category_declaration_repeat1 = 81, + aux_sym_category_declaration_repeat2 = 82, + aux_sym_asset_definition_repeat1 = 83, + aux_sym_attack_step_repeat1 = 84, + aux_sym_attack_step_repeat2 = 85, + aux_sym_cias_repeat1 = 86, + aux_sym_detector_name_repeat1 = 87, + aux_sym_detector_context_repeat1 = 88, + aux_sym_preconditions_repeat1 = 89, + aux_sym_ttc_distribution_repeat1 = 90, + aux_sym_associations_declaration_repeat1 = 91, + alias_sym_meta_string = 92, }; static const char * const ts_symbol_names[] = { [ts_builtin_sym_end] = "end", - [sym_identity] = "identity", + [sym_identifier] = "identifier", [sym_comment] = "comment", [anon_sym_include] = "include", [anon_sym_category] = "category", @@ -129,12 +127,8 @@ static const char * const ts_symbol_names[] = { [anon_sym_extends] = "extends", [anon_sym_let] = "let", [anon_sym_EQ] = "=", - [anon_sym_PIPE] = "|", - [anon_sym_AMP] = "&", - [anon_sym_POUND] = "#", - [anon_sym_E] = "E", - [anon_sym_BANGE] = "!E", [anon_sym_AT] = "@", + [sym_step_type] = "step_type", [anon_sym_COMMA] = ",", [anon_sym_BANG] = "!", [anon_sym_SLASH_SLASH_BANG] = "//!", @@ -153,6 +147,7 @@ static const char * const ts_symbol_names[] = { [anon_sym_CARET] = "^", [anon_sym_BSLASH_SLASH] = "\\/", [anon_sym_SLASH_BSLASH] = "/\\", + [anon_sym_POUND] = "#", [anon_sym_COLON] = ":", [anon_sym_associations] = "associations", [anon_sym_LT_DASH_DASH] = "<--", @@ -205,6 +200,7 @@ static const char * const ts_symbol_names[] = { [aux_sym_category_declaration_repeat2] = "category_declaration_repeat2", [aux_sym_asset_definition_repeat1] = "asset_definition_repeat1", [aux_sym_attack_step_repeat1] = "attack_step_repeat1", + [aux_sym_attack_step_repeat2] = "attack_step_repeat2", [aux_sym_cias_repeat1] = "cias_repeat1", [aux_sym_detector_name_repeat1] = "detector_name_repeat1", [aux_sym_detector_context_repeat1] = "detector_context_repeat1", @@ -216,7 +212,7 @@ static const char * const ts_symbol_names[] = { static const TSSymbol ts_symbol_map[] = { [ts_builtin_sym_end] = ts_builtin_sym_end, - [sym_identity] = sym_identity, + [sym_identifier] = sym_identifier, [sym_comment] = sym_comment, [anon_sym_include] = anon_sym_include, [anon_sym_category] = anon_sym_category, @@ -227,12 +223,8 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_extends] = anon_sym_extends, [anon_sym_let] = anon_sym_let, [anon_sym_EQ] = anon_sym_EQ, - [anon_sym_PIPE] = anon_sym_PIPE, - [anon_sym_AMP] = anon_sym_AMP, - [anon_sym_POUND] = anon_sym_POUND, - [anon_sym_E] = anon_sym_E, - [anon_sym_BANGE] = anon_sym_BANGE, [anon_sym_AT] = anon_sym_AT, + [sym_step_type] = sym_step_type, [anon_sym_COMMA] = anon_sym_COMMA, [anon_sym_BANG] = anon_sym_BANG, [anon_sym_SLASH_SLASH_BANG] = anon_sym_SLASH_SLASH_BANG, @@ -251,6 +243,7 @@ static const TSSymbol ts_symbol_map[] = { [anon_sym_CARET] = anon_sym_CARET, [anon_sym_BSLASH_SLASH] = anon_sym_BSLASH_SLASH, [anon_sym_SLASH_BSLASH] = anon_sym_SLASH_BSLASH, + [anon_sym_POUND] = anon_sym_POUND, [anon_sym_COLON] = anon_sym_COLON, [anon_sym_associations] = anon_sym_associations, [anon_sym_LT_DASH_DASH] = anon_sym_LT_DASH_DASH, @@ -303,6 +296,7 @@ static const TSSymbol ts_symbol_map[] = { [aux_sym_category_declaration_repeat2] = aux_sym_category_declaration_repeat2, [aux_sym_asset_definition_repeat1] = aux_sym_asset_definition_repeat1, [aux_sym_attack_step_repeat1] = aux_sym_attack_step_repeat1, + [aux_sym_attack_step_repeat2] = aux_sym_attack_step_repeat2, [aux_sym_cias_repeat1] = aux_sym_cias_repeat1, [aux_sym_detector_name_repeat1] = aux_sym_detector_name_repeat1, [aux_sym_detector_context_repeat1] = aux_sym_detector_context_repeat1, @@ -317,7 +311,7 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = true, }, - [sym_identity] = { + [sym_identifier] = { .visible = true, .named = true, }, @@ -361,29 +355,13 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, - [anon_sym_PIPE] = { - .visible = true, - .named = false, - }, - [anon_sym_AMP] = { - .visible = true, - .named = false, - }, - [anon_sym_POUND] = { - .visible = true, - .named = false, - }, - [anon_sym_E] = { - .visible = true, - .named = false, - }, - [anon_sym_BANGE] = { + [anon_sym_AT] = { .visible = true, .named = false, }, - [anon_sym_AT] = { + [sym_step_type] = { .visible = true, - .named = false, + .named = true, }, [anon_sym_COMMA] = { .visible = true, @@ -457,6 +435,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = true, .named = false, }, + [anon_sym_POUND] = { + .visible = true, + .named = false, + }, [anon_sym_COLON] = { .visible = true, .named = false, @@ -665,6 +647,10 @@ static const TSSymbolMetadata ts_symbol_metadata[] = { .visible = false, .named = false, }, + [aux_sym_attack_step_repeat2] = { + .visible = false, + .named = false, + }, [aux_sym_cias_repeat1] = { .visible = false, .named = false, @@ -792,156 +778,154 @@ static const TSMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { [21] = {.index = 46, .length = 2}, [22] = {.index = 48, .length = 3}, [23] = {.index = 51, .length = 3}, - [24] = {.index = 54, .length = 2}, - [25] = {.index = 56, .length = 1}, - [26] = {.index = 57, .length = 1}, - [27] = {.index = 58, .length = 2}, - [28] = {.index = 60, .length = 4}, - [29] = {.index = 64, .length = 4}, - [30] = {.index = 68, .length = 4}, - [31] = {.index = 72, .length = 4}, - [32] = {.index = 76, .length = 4}, - [33] = {.index = 80, .length = 4}, - [34] = {.index = 84, .length = 4}, - [35] = {.index = 88, .length = 4}, - [36] = {.index = 92, .length = 4}, - [37] = {.index = 96, .length = 4}, - [38] = {.index = 100, .length = 4}, - [39] = {.index = 104, .length = 4}, - [40] = {.index = 108, .length = 4}, - [41] = {.index = 112, .length = 4}, - [42] = {.index = 116, .length = 4}, - [43] = {.index = 120, .length = 2}, - [44] = {.index = 122, .length = 4}, - [45] = {.index = 126, .length = 4}, - [46] = {.index = 130, .length = 4}, - [47] = {.index = 134, .length = 4}, - [48] = {.index = 138, .length = 2}, - [49] = {.index = 140, .length = 5}, + [24] = {.index = 54, .length = 1}, + [25] = {.index = 55, .length = 1}, + [26] = {.index = 56, .length = 2}, + [27] = {.index = 58, .length = 4}, + [28] = {.index = 62, .length = 4}, + [29] = {.index = 66, .length = 4}, + [30] = {.index = 70, .length = 4}, + [31] = {.index = 74, .length = 4}, + [32] = {.index = 78, .length = 4}, + [33] = {.index = 82, .length = 4}, + [34] = {.index = 86, .length = 4}, + [35] = {.index = 90, .length = 4}, + [36] = {.index = 94, .length = 4}, + [37] = {.index = 98, .length = 4}, + [38] = {.index = 102, .length = 4}, + [39] = {.index = 106, .length = 4}, + [40] = {.index = 110, .length = 4}, + [41] = {.index = 114, .length = 4}, + [42] = {.index = 118, .length = 4}, + [43] = {.index = 122, .length = 4}, + [44] = {.index = 126, .length = 4}, + [45] = {.index = 130, .length = 4}, + [46] = {.index = 134, .length = 2}, + [47] = {.index = 136, .length = 5}, + [48] = {.index = 141, .length = 2}, + [49] = {.index = 143, .length = 2}, [50] = {.index = 145, .length = 2}, [51] = {.index = 147, .length = 2}, - [52] = {.index = 149, .length = 2}, - [53] = {.index = 151, .length = 2}, - [54] = {.index = 153, .length = 3}, - [55] = {.index = 156, .length = 5}, - [56] = {.index = 161, .length = 5}, - [57] = {.index = 166, .length = 5}, - [58] = {.index = 171, .length = 5}, - [59] = {.index = 176, .length = 5}, - [60] = {.index = 181, .length = 5}, - [61] = {.index = 186, .length = 5}, - [62] = {.index = 191, .length = 5}, - [63] = {.index = 196, .length = 5}, - [64] = {.index = 201, .length = 5}, - [65] = {.index = 206, .length = 5}, - [66] = {.index = 211, .length = 5}, - [67] = {.index = 216, .length = 5}, - [68] = {.index = 221, .length = 5}, - [69] = {.index = 226, .length = 5}, - [70] = {.index = 231, .length = 5}, - [71] = {.index = 236, .length = 5}, - [72] = {.index = 241, .length = 5}, - [73] = {.index = 246, .length = 5}, - [74] = {.index = 251, .length = 5}, - [75] = {.index = 256, .length = 5}, - [76] = {.index = 261, .length = 5}, - [77] = {.index = 266, .length = 1}, - [78] = {.index = 267, .length = 3}, - [79] = {.index = 270, .length = 6}, - [80] = {.index = 276, .length = 6}, - [81] = {.index = 282, .length = 6}, - [82] = {.index = 288, .length = 6}, - [83] = {.index = 294, .length = 6}, - [84] = {.index = 300, .length = 2}, - [85] = {.index = 302, .length = 3}, - [86] = {.index = 305, .length = 3}, - [87] = {.index = 308, .length = 3}, - [88] = {.index = 311, .length = 6}, - [89] = {.index = 317, .length = 6}, - [90] = {.index = 323, .length = 6}, - [91] = {.index = 329, .length = 6}, - [92] = {.index = 335, .length = 6}, - [93] = {.index = 341, .length = 6}, - [94] = {.index = 347, .length = 6}, - [95] = {.index = 353, .length = 6}, - [96] = {.index = 359, .length = 6}, - [97] = {.index = 365, .length = 6}, - [98] = {.index = 371, .length = 6}, - [99] = {.index = 377, .length = 6}, - [100] = {.index = 383, .length = 6}, - [101] = {.index = 389, .length = 6}, - [102] = {.index = 395, .length = 6}, - [103] = {.index = 401, .length = 6}, - [104] = {.index = 407, .length = 2}, - [105] = {.index = 409, .length = 7}, - [106] = {.index = 416, .length = 7}, - [107] = {.index = 423, .length = 7}, - [108] = {.index = 430, .length = 7}, - [109] = {.index = 437, .length = 7}, - [110] = {.index = 444, .length = 7}, - [111] = {.index = 451, .length = 7}, - [112] = {.index = 458, .length = 7}, - [113] = {.index = 465, .length = 7}, - [114] = {.index = 472, .length = 7}, - [115] = {.index = 479, .length = 4}, - [116] = {.index = 483, .length = 2}, - [117] = {.index = 485, .length = 7}, - [118] = {.index = 492, .length = 7}, - [119] = {.index = 499, .length = 7}, - [120] = {.index = 506, .length = 7}, - [121] = {.index = 513, .length = 7}, - [122] = {.index = 520, .length = 7}, - [123] = {.index = 527, .length = 7}, - [124] = {.index = 534, .length = 7}, - [125] = {.index = 541, .length = 7}, - [126] = {.index = 548, .length = 7}, - [127] = {.index = 555, .length = 7}, - [128] = {.index = 562, .length = 8}, - [129] = {.index = 570, .length = 8}, - [130] = {.index = 578, .length = 8}, - [131] = {.index = 586, .length = 8}, - [132] = {.index = 594, .length = 8}, - [133] = {.index = 602, .length = 8}, - [134] = {.index = 610, .length = 8}, - [135] = {.index = 618, .length = 8}, - [136] = {.index = 626, .length = 8}, - [137] = {.index = 634, .length = 8}, - [138] = {.index = 642, .length = 3}, - [139] = {.index = 645, .length = 8}, - [140] = {.index = 653, .length = 8}, - [141] = {.index = 661, .length = 8}, - [142] = {.index = 669, .length = 8}, - [143] = {.index = 677, .length = 8}, - [144] = {.index = 685, .length = 8}, - [145] = {.index = 693, .length = 8}, - [146] = {.index = 701, .length = 8}, - [147] = {.index = 709, .length = 8}, - [148] = {.index = 717, .length = 8}, - [149] = {.index = 725, .length = 8}, - [150] = {.index = 733, .length = 9}, - [151] = {.index = 742, .length = 9}, - [152] = {.index = 751, .length = 9}, - [153] = {.index = 760, .length = 9}, - [154] = {.index = 769, .length = 9}, - [155] = {.index = 778, .length = 9}, - [156] = {.index = 787, .length = 9}, - [157] = {.index = 796, .length = 9}, - [158] = {.index = 805, .length = 9}, - [159] = {.index = 814, .length = 9}, - [160] = {.index = 823, .length = 9}, - [161] = {.index = 832, .length = 9}, - [162] = {.index = 841, .length = 9}, - [163] = {.index = 850, .length = 9}, - [164] = {.index = 859, .length = 9}, - [165] = {.index = 868, .length = 7}, - [166] = {.index = 875, .length = 10}, - [167] = {.index = 885, .length = 10}, - [168] = {.index = 895, .length = 10}, - [169] = {.index = 905, .length = 10}, - [170] = {.index = 915, .length = 10}, - [171] = {.index = 925, .length = 10}, - [172] = {.index = 935, .length = 8}, - [173] = {.index = 943, .length = 11}, + [52] = {.index = 149, .length = 3}, + [53] = {.index = 152, .length = 5}, + [54] = {.index = 157, .length = 5}, + [55] = {.index = 162, .length = 5}, + [56] = {.index = 167, .length = 5}, + [57] = {.index = 172, .length = 5}, + [58] = {.index = 177, .length = 5}, + [59] = {.index = 182, .length = 5}, + [60] = {.index = 187, .length = 5}, + [61] = {.index = 192, .length = 5}, + [62] = {.index = 197, .length = 5}, + [63] = {.index = 202, .length = 5}, + [64] = {.index = 207, .length = 5}, + [65] = {.index = 212, .length = 5}, + [66] = {.index = 217, .length = 5}, + [67] = {.index = 222, .length = 5}, + [68] = {.index = 227, .length = 5}, + [69] = {.index = 232, .length = 5}, + [70] = {.index = 237, .length = 5}, + [71] = {.index = 242, .length = 5}, + [72] = {.index = 247, .length = 5}, + [73] = {.index = 252, .length = 5}, + [74] = {.index = 257, .length = 5}, + [75] = {.index = 262, .length = 1}, + [76] = {.index = 263, .length = 3}, + [77] = {.index = 266, .length = 6}, + [78] = {.index = 272, .length = 6}, + [79] = {.index = 278, .length = 6}, + [80] = {.index = 284, .length = 6}, + [81] = {.index = 290, .length = 6}, + [82] = {.index = 296, .length = 2}, + [83] = {.index = 298, .length = 3}, + [84] = {.index = 301, .length = 3}, + [85] = {.index = 304, .length = 3}, + [86] = {.index = 307, .length = 6}, + [87] = {.index = 313, .length = 6}, + [88] = {.index = 319, .length = 6}, + [89] = {.index = 325, .length = 6}, + [90] = {.index = 331, .length = 6}, + [91] = {.index = 337, .length = 6}, + [92] = {.index = 343, .length = 6}, + [93] = {.index = 349, .length = 6}, + [94] = {.index = 355, .length = 6}, + [95] = {.index = 361, .length = 6}, + [96] = {.index = 367, .length = 6}, + [97] = {.index = 373, .length = 6}, + [98] = {.index = 379, .length = 6}, + [99] = {.index = 385, .length = 6}, + [100] = {.index = 391, .length = 6}, + [101] = {.index = 397, .length = 6}, + [102] = {.index = 403, .length = 2}, + [103] = {.index = 405, .length = 7}, + [104] = {.index = 412, .length = 7}, + [105] = {.index = 419, .length = 7}, + [106] = {.index = 426, .length = 7}, + [107] = {.index = 433, .length = 7}, + [108] = {.index = 440, .length = 7}, + [109] = {.index = 447, .length = 7}, + [110] = {.index = 454, .length = 7}, + [111] = {.index = 461, .length = 7}, + [112] = {.index = 468, .length = 7}, + [113] = {.index = 475, .length = 4}, + [114] = {.index = 479, .length = 2}, + [115] = {.index = 481, .length = 7}, + [116] = {.index = 488, .length = 7}, + [117] = {.index = 495, .length = 7}, + [118] = {.index = 502, .length = 7}, + [119] = {.index = 509, .length = 7}, + [120] = {.index = 516, .length = 7}, + [121] = {.index = 523, .length = 7}, + [122] = {.index = 530, .length = 7}, + [123] = {.index = 537, .length = 7}, + [124] = {.index = 544, .length = 7}, + [125] = {.index = 551, .length = 7}, + [126] = {.index = 558, .length = 8}, + [127] = {.index = 566, .length = 8}, + [128] = {.index = 574, .length = 8}, + [129] = {.index = 582, .length = 8}, + [130] = {.index = 590, .length = 8}, + [131] = {.index = 598, .length = 8}, + [132] = {.index = 606, .length = 8}, + [133] = {.index = 614, .length = 8}, + [134] = {.index = 622, .length = 8}, + [135] = {.index = 630, .length = 8}, + [136] = {.index = 638, .length = 3}, + [137] = {.index = 641, .length = 8}, + [138] = {.index = 649, .length = 8}, + [139] = {.index = 657, .length = 8}, + [140] = {.index = 665, .length = 8}, + [141] = {.index = 673, .length = 8}, + [142] = {.index = 681, .length = 8}, + [143] = {.index = 689, .length = 8}, + [144] = {.index = 697, .length = 8}, + [145] = {.index = 705, .length = 8}, + [146] = {.index = 713, .length = 8}, + [147] = {.index = 721, .length = 8}, + [148] = {.index = 729, .length = 9}, + [149] = {.index = 738, .length = 9}, + [150] = {.index = 747, .length = 9}, + [151] = {.index = 756, .length = 9}, + [152] = {.index = 765, .length = 9}, + [153] = {.index = 774, .length = 9}, + [154] = {.index = 783, .length = 9}, + [155] = {.index = 792, .length = 9}, + [156] = {.index = 801, .length = 9}, + [157] = {.index = 810, .length = 9}, + [158] = {.index = 819, .length = 9}, + [159] = {.index = 828, .length = 9}, + [160] = {.index = 837, .length = 9}, + [161] = {.index = 846, .length = 9}, + [162] = {.index = 855, .length = 9}, + [163] = {.index = 864, .length = 7}, + [164] = {.index = 871, .length = 10}, + [165] = {.index = 881, .length = 10}, + [166] = {.index = 891, .length = 10}, + [167] = {.index = 901, .length = 10}, + [168] = {.index = 911, .length = 10}, + [169] = {.index = 921, .length = 10}, + [170] = {.index = 931, .length = 8}, + [171] = {.index = 939, .length = 11}, }; static const TSFieldMapEntry ts_field_map_entries[] = { @@ -980,29 +964,29 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_id, 2}, {field_meta, 3}, [22] = - {field_detector, 2}, {field_id, 1}, + {field_preconditions, 2}, {field_step_type, 0}, [25] = {field_id, 1}, - {field_preconditions, 2}, + {field_reaches, 2}, {field_step_type, 0}, [28] = {field_id, 1}, - {field_reaches, 2}, {field_step_type, 0}, + {field_ttc, 2}, [31] = {field_id, 1}, + {field_meta, 2}, {field_step_type, 0}, - {field_ttc, 2}, [34] = {field_id, 1}, - {field_meta, 2}, {field_step_type, 0}, + {field_tag, 2}, [37] = + {field_detector, 2}, {field_id, 1}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, [40] = {field_extends, 2}, {field_extends, 3}, @@ -1023,498 +1007,492 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_id, 2}, {field_meta, 3}, [54] = - {field_tag, 0}, - {field_tag, 1}, - [56] = {field_context, 1}, - [57] = + [55] = {field_condition, 1}, - [58] = + [56] = {field_operator, 0}, {field_reaches, 1}, - [60] = - {field_detector, 2}, - {field_id, 1}, - {field_preconditions, 3}, - {field_step_type, 0}, - [64] = - {field_detector, 2}, - {field_id, 1}, - {field_reaches, 3}, - {field_step_type, 0}, - [68] = + [58] = {field_id, 1}, {field_preconditions, 2}, {field_reaches, 3}, {field_step_type, 0}, - [72] = - {field_detector, 3}, - {field_id, 1}, - {field_step_type, 0}, - {field_ttc, 2}, - [76] = + [62] = {field_id, 1}, {field_preconditions, 3}, {field_step_type, 0}, {field_ttc, 2}, - [80] = + [66] = {field_id, 1}, {field_reaches, 3}, {field_step_type, 0}, {field_ttc, 2}, - [84] = + [70] = {field_id, 1}, {field_meta, 3}, {field_step_type, 0}, {field_ttc, 2}, - [88] = + [74] = {field_detector, 3}, {field_id, 1}, - {field_meta, 2}, {field_step_type, 0}, - [92] = + {field_ttc, 2}, + [78] = {field_id, 1}, {field_meta, 2}, {field_preconditions, 3}, {field_step_type, 0}, - [96] = + [82] = {field_id, 1}, {field_meta, 2}, {field_reaches, 3}, {field_step_type, 0}, - [100] = + [86] = {field_detector, 3}, {field_id, 1}, + {field_meta, 2}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [104] = + [90] = {field_id, 1}, {field_preconditions, 3}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [108] = + {field_tag, 2}, + [94] = {field_id, 1}, {field_reaches, 3}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [112] = + {field_tag, 2}, + [98] = {field_id, 1}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [116] = + [102] = {field_id, 1}, {field_meta, 3}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [120] = - {field_tag, 0, .inherited = true}, - {field_tag, 1, .inherited = true}, - [122] = + {field_tag, 2}, + [106] = + {field_detector, 3}, + {field_id, 1}, + {field_step_type, 0}, + {field_tag, 2}, + [110] = + {field_detector, 2}, + {field_id, 1}, + {field_preconditions, 3}, + {field_step_type, 0}, + [114] = + {field_detector, 2}, + {field_id, 1}, + {field_reaches, 3}, + {field_step_type, 0}, + [118] = {field_body, 5}, {field_extends, 2}, {field_extends, 3}, {field_id, 1}, - [126] = + [122] = {field_extends, 2}, {field_extends, 3}, {field_id, 1}, {field_meta, 4}, - [130] = + [126] = {field_body, 6}, {field_extends, 3}, {field_extends, 4}, {field_id, 2}, - [134] = + [130] = {field_extends, 3}, {field_extends, 4}, {field_id, 2}, {field_meta, 5}, - [138] = + [134] = {field_expression, 0}, {field_operator, 1}, - [140] = + [136] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, {field_id, 1}, {field_step_type, 0}, - [145] = + [141] = {field_context, 2}, {field_name, 1}, - [147] = + [143] = {field_context, 1}, {field_type, 2}, - [149] = + [145] = {field_context, 1}, {field_ttc, 2}, - [151] = + [147] = {field_condition, 1}, {field_condition, 2}, - [153] = + [149] = {field_operator, 0}, {field_reaches, 1}, {field_reaches, 2}, - [156] = - {field_detector, 2}, + [152] = {field_id, 1}, {field_preconditions, 3}, {field_reaches, 4}, {field_step_type, 0}, - [161] = - {field_detector, 3}, - {field_id, 1}, - {field_preconditions, 4}, - {field_step_type, 0}, {field_ttc, 2}, - [166] = - {field_detector, 3}, + [157] = {field_id, 1}, - {field_reaches, 4}, + {field_meta, 3}, + {field_preconditions, 4}, {field_step_type, 0}, {field_ttc, 2}, - [171] = + [162] = {field_id, 1}, - {field_preconditions, 3}, + {field_meta, 3}, {field_reaches, 4}, {field_step_type, 0}, {field_ttc, 2}, - [176] = + [167] = {field_detector, 4}, {field_id, 1}, {field_meta, 3}, {field_step_type, 0}, {field_ttc, 2}, - [181] = + [172] = + {field_detector, 3}, {field_id, 1}, - {field_meta, 3}, {field_preconditions, 4}, {field_step_type, 0}, {field_ttc, 2}, - [186] = + [177] = + {field_detector, 3}, {field_id, 1}, - {field_meta, 3}, {field_reaches, 4}, {field_step_type, 0}, {field_ttc, 2}, - [191] = + [182] = + {field_id, 1}, + {field_meta, 2}, + {field_preconditions, 3}, + {field_reaches, 4}, + {field_step_type, 0}, + [187] = {field_detector, 3}, {field_id, 1}, {field_meta, 2}, {field_preconditions, 4}, {field_step_type, 0}, - [196] = + [192] = {field_detector, 3}, {field_id, 1}, {field_meta, 2}, {field_reaches, 4}, {field_step_type, 0}, - [201] = + [197] = {field_id, 1}, - {field_meta, 2}, {field_preconditions, 3}, {field_reaches, 4}, {field_step_type, 0}, - [206] = - {field_detector, 3}, + {field_tag, 2}, + [202] = {field_id, 1}, {field_preconditions, 4}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [211] = - {field_detector, 3}, + {field_tag, 2}, + {field_ttc, 3}, + [207] = {field_id, 1}, {field_reaches, 4}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [216] = + {field_tag, 2}, + {field_ttc, 3}, + [212] = {field_id, 1}, - {field_preconditions, 3}, - {field_reaches, 4}, + {field_meta, 4}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [221] = + {field_tag, 2}, + {field_ttc, 3}, + [217] = {field_detector, 4}, {field_id, 1}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [226] = + [222] = {field_id, 1}, + {field_meta, 3}, {field_preconditions, 4}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - {field_ttc, 3}, - [231] = + {field_tag, 2}, + [227] = {field_id, 1}, + {field_meta, 3}, {field_reaches, 4}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - {field_ttc, 3}, - [236] = - {field_id, 1}, - {field_meta, 4}, - {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - {field_ttc, 3}, - [241] = + {field_tag, 2}, + [232] = {field_detector, 4}, {field_id, 1}, {field_meta, 3}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [246] = + {field_tag, 2}, + [237] = + {field_detector, 3}, {field_id, 1}, - {field_meta, 3}, {field_preconditions, 4}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [251] = + {field_tag, 2}, + [242] = + {field_detector, 3}, {field_id, 1}, - {field_meta, 3}, {field_reaches, 4}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [256] = + {field_tag, 2}, + [247] = + {field_detector, 2}, + {field_id, 1}, + {field_preconditions, 3}, + {field_reaches, 4}, + {field_step_type, 0}, + [252] = {field_body, 6}, {field_extends, 2}, {field_extends, 3}, {field_id, 1}, {field_meta, 4}, - [261] = + [257] = {field_body, 7}, {field_extends, 3}, {field_extends, 4}, {field_id, 2}, {field_meta, 5}, - [266] = + [262] = {field_id, 0}, - [267] = + [263] = {field_left, 0}, {field_operator, 1}, {field_right, 2}, - [270] = + [266] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, - {field_detector, 5}, {field_id, 1}, + {field_preconditions, 5}, {field_step_type, 0}, - [276] = + [272] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, {field_id, 1}, - {field_preconditions, 5}, + {field_reaches, 5}, {field_step_type, 0}, - [282] = + [278] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, {field_id, 1}, - {field_reaches, 5}, {field_step_type, 0}, - [288] = + {field_ttc, 5}, + [284] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, {field_id, 1}, + {field_meta, 5}, {field_step_type, 0}, - {field_ttc, 5}, - [294] = + [290] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, + {field_detector, 5}, {field_id, 1}, - {field_meta, 5}, {field_step_type, 0}, - [300] = + [296] = {field_id, 1}, {field_type, 0}, - [302] = + [298] = {field_context, 2}, {field_name, 1}, {field_type, 3}, - [305] = + [301] = {field_context, 2}, {field_name, 1}, {field_ttc, 3}, - [308] = + [304] = {field_context, 1}, {field_ttc, 3}, {field_type, 2}, - [311] = - {field_detector, 3}, + [307] = {field_id, 1}, + {field_meta, 3}, {field_preconditions, 4}, {field_reaches, 5}, {field_step_type, 0}, {field_ttc, 2}, - [317] = + [313] = {field_detector, 4}, {field_id, 1}, {field_meta, 3}, {field_preconditions, 5}, {field_step_type, 0}, {field_ttc, 2}, - [323] = + [319] = {field_detector, 4}, {field_id, 1}, {field_meta, 3}, {field_reaches, 5}, {field_step_type, 0}, {field_ttc, 2}, - [329] = + [325] = + {field_detector, 3}, {field_id, 1}, - {field_meta, 3}, {field_preconditions, 4}, {field_reaches, 5}, {field_step_type, 0}, {field_ttc, 2}, - [335] = + [331] = {field_detector, 3}, {field_id, 1}, {field_meta, 2}, {field_preconditions, 4}, {field_reaches, 5}, {field_step_type, 0}, - [341] = + [337] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, {field_id, 1}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [347] = - {field_detector, 3}, + {field_tag, 2}, + [343] = {field_id, 1}, {field_preconditions, 4}, {field_reaches, 5}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [353] = - {field_detector, 4}, - {field_id, 1}, - {field_preconditions, 5}, - {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [359] = - {field_detector, 4}, + [349] = {field_id, 1}, - {field_reaches, 5}, + {field_meta, 4}, + {field_preconditions, 5}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [365] = + [355] = {field_id, 1}, - {field_preconditions, 4}, + {field_meta, 4}, {field_reaches, 5}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [371] = + [361] = {field_detector, 5}, {field_id, 1}, {field_meta, 4}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [377] = + [367] = + {field_detector, 4}, {field_id, 1}, - {field_meta, 4}, {field_preconditions, 5}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [383] = + [373] = + {field_detector, 4}, {field_id, 1}, - {field_meta, 4}, {field_reaches, 5}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [389] = + [379] = + {field_id, 1}, + {field_meta, 3}, + {field_preconditions, 4}, + {field_reaches, 5}, + {field_step_type, 0}, + {field_tag, 2}, + [385] = {field_detector, 4}, {field_id, 1}, {field_meta, 3}, {field_preconditions, 5}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [395] = + {field_tag, 2}, + [391] = {field_detector, 4}, {field_id, 1}, {field_meta, 3}, {field_reaches, 5}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [401] = + {field_tag, 2}, + [397] = + {field_detector, 3}, {field_id, 1}, - {field_meta, 3}, {field_preconditions, 4}, {field_reaches, 5}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [407] = + {field_tag, 2}, + [403] = {field_expression, 0}, {field_type_id, 2}, - [409] = + [405] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, - {field_detector, 5}, {field_id, 1}, - {field_preconditions, 6}, + {field_preconditions, 5}, + {field_reaches, 6}, {field_step_type, 0}, - [416] = + [412] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, - {field_detector, 5}, {field_id, 1}, - {field_reaches, 6}, + {field_preconditions, 6}, {field_step_type, 0}, - [423] = + {field_ttc, 5}, + [419] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, {field_id, 1}, - {field_preconditions, 5}, {field_reaches, 6}, {field_step_type, 0}, - [430] = + {field_ttc, 5}, + [426] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, - {field_detector, 6}, {field_id, 1}, + {field_meta, 6}, {field_step_type, 0}, {field_ttc, 5}, - [437] = + [433] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, + {field_detector, 6}, {field_id, 1}, - {field_preconditions, 6}, {field_step_type, 0}, {field_ttc, 5}, - [444] = + [440] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, {field_id, 1}, - {field_reaches, 6}, + {field_meta, 5}, + {field_preconditions, 6}, {field_step_type, 0}, - {field_ttc, 5}, - [451] = + [447] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, {field_id, 1}, - {field_meta, 6}, + {field_meta, 5}, + {field_reaches, 6}, {field_step_type, 0}, - {field_ttc, 5}, - [458] = + [454] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, @@ -1522,31 +1500,31 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_id, 1}, {field_meta, 5}, {field_step_type, 0}, - [465] = + [461] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, + {field_detector, 5}, {field_id, 1}, - {field_meta, 5}, {field_preconditions, 6}, {field_step_type, 0}, - [472] = + [468] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, + {field_detector, 5}, {field_id, 1}, - {field_meta, 5}, {field_reaches, 6}, {field_step_type, 0}, - [479] = + [475] = {field_context, 2}, {field_name, 1}, {field_ttc, 4}, {field_type, 3}, - [483] = + [479] = {field_id, 0}, {field_values, 2}, - [485] = + [481] = {field_detector, 4}, {field_id, 1}, {field_meta, 3}, @@ -1554,150 +1532,150 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_reaches, 6}, {field_step_type, 0}, {field_ttc, 2}, - [492] = + [488] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, - {field_detector, 6}, {field_id, 1}, + {field_preconditions, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [499] = + {field_tag, 2}, + [495] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, {field_id, 1}, - {field_preconditions, 6}, + {field_reaches, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [506] = + {field_tag, 2}, + [502] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, {field_id, 1}, - {field_reaches, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [513] = + {field_tag, 2}, + {field_ttc, 6}, + [509] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, {field_id, 1}, + {field_meta, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - {field_ttc, 6}, - [520] = + {field_tag, 2}, + [516] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, + {field_detector, 6}, {field_id, 1}, - {field_meta, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [527] = - {field_detector, 4}, + {field_tag, 2}, + [523] = {field_id, 1}, + {field_meta, 4}, {field_preconditions, 5}, {field_reaches, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [534] = + [530] = {field_detector, 5}, {field_id, 1}, {field_meta, 4}, {field_preconditions, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [541] = + [537] = {field_detector, 5}, {field_id, 1}, {field_meta, 4}, {field_reaches, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [548] = + [544] = + {field_detector, 4}, {field_id, 1}, - {field_meta, 4}, {field_preconditions, 5}, {field_reaches, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [555] = + [551] = {field_detector, 4}, {field_id, 1}, {field_meta, 3}, {field_preconditions, 5}, {field_reaches, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [562] = + {field_tag, 2}, + [558] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, - {field_detector, 5}, {field_id, 1}, {field_preconditions, 6}, {field_reaches, 7}, {field_step_type, 0}, - [570] = + {field_ttc, 5}, + [566] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, - {field_detector, 6}, {field_id, 1}, + {field_meta, 6}, {field_preconditions, 7}, {field_step_type, 0}, {field_ttc, 5}, - [578] = + [574] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, - {field_detector, 6}, {field_id, 1}, + {field_meta, 6}, {field_reaches, 7}, {field_step_type, 0}, {field_ttc, 5}, - [586] = + [582] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, + {field_detector, 7}, {field_id, 1}, - {field_preconditions, 6}, - {field_reaches, 7}, + {field_meta, 6}, {field_step_type, 0}, {field_ttc, 5}, - [594] = + [590] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, - {field_detector, 7}, + {field_detector, 6}, {field_id, 1}, - {field_meta, 6}, + {field_preconditions, 7}, {field_step_type, 0}, {field_ttc, 5}, - [602] = + [598] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, + {field_detector, 6}, {field_id, 1}, - {field_meta, 6}, - {field_preconditions, 7}, + {field_reaches, 7}, {field_step_type, 0}, {field_ttc, 5}, - [610] = + [606] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, {field_id, 1}, - {field_meta, 6}, + {field_meta, 5}, + {field_preconditions, 6}, {field_reaches, 7}, {field_step_type, 0}, - {field_ttc, 5}, - [618] = + [614] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, @@ -1706,7 +1684,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_meta, 5}, {field_preconditions, 7}, {field_step_type, 0}, - [626] = + [622] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, @@ -1715,83 +1693,83 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_meta, 5}, {field_reaches, 7}, {field_step_type, 0}, - [634] = + [630] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, + {field_detector, 5}, {field_id, 1}, - {field_meta, 5}, {field_preconditions, 6}, {field_reaches, 7}, {field_step_type, 0}, - [642] = + [638] = {field_id, 0}, {field_values, 2}, {field_values, 3}, - [645] = + [641] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, - {field_detector, 6}, {field_id, 1}, - {field_preconditions, 7}, + {field_preconditions, 6}, + {field_reaches, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [653] = + {field_tag, 2}, + [649] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, - {field_detector, 6}, {field_id, 1}, - {field_reaches, 7}, + {field_preconditions, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [661] = + {field_tag, 2}, + {field_ttc, 6}, + [657] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, {field_id, 1}, - {field_preconditions, 6}, {field_reaches, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [669] = + {field_tag, 2}, + {field_ttc, 6}, + [665] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, - {field_detector, 7}, {field_id, 1}, + {field_meta, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [677] = + [673] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, + {field_detector, 7}, {field_id, 1}, - {field_preconditions, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [685] = + [681] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, {field_id, 1}, - {field_reaches, 7}, + {field_meta, 6}, + {field_preconditions, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - {field_ttc, 6}, - [693] = + {field_tag, 2}, + [689] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, {field_id, 1}, - {field_meta, 7}, + {field_meta, 6}, + {field_reaches, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - {field_ttc, 6}, - [701] = + {field_tag, 2}, + [697] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, @@ -1799,45 +1777,45 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_id, 1}, {field_meta, 6}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [709] = + {field_tag, 2}, + [705] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, + {field_detector, 6}, {field_id, 1}, - {field_meta, 6}, {field_preconditions, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [717] = + {field_tag, 2}, + [713] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, + {field_detector, 6}, {field_id, 1}, - {field_meta, 6}, {field_reaches, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [725] = + {field_tag, 2}, + [721] = {field_detector, 5}, {field_id, 1}, {field_meta, 4}, {field_preconditions, 6}, {field_reaches, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 3}, - [733] = + [729] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, - {field_detector, 6}, {field_id, 1}, + {field_meta, 6}, {field_preconditions, 7}, {field_reaches, 8}, {field_step_type, 0}, {field_ttc, 5}, - [742] = + [738] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, @@ -1847,7 +1825,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_preconditions, 8}, {field_step_type, 0}, {field_ttc, 5}, - [751] = + [747] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, @@ -1857,17 +1835,17 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_reaches, 8}, {field_step_type, 0}, {field_ttc, 5}, - [760] = + [756] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, + {field_detector, 6}, {field_id, 1}, - {field_meta, 6}, {field_preconditions, 7}, {field_reaches, 8}, {field_step_type, 0}, {field_ttc, 5}, - [769] = + [765] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, @@ -1877,77 +1855,77 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_preconditions, 7}, {field_reaches, 8}, {field_step_type, 0}, - [778] = + [774] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, - {field_detector, 6}, {field_id, 1}, {field_preconditions, 7}, {field_reaches, 8}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [787] = + {field_tag, 2}, + {field_ttc, 6}, + [783] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, - {field_detector, 7}, {field_id, 1}, + {field_meta, 7}, {field_preconditions, 8}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [796] = + [792] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, - {field_detector, 7}, {field_id, 1}, + {field_meta, 7}, {field_reaches, 8}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [805] = + [801] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, + {field_detector, 8}, {field_id, 1}, - {field_preconditions, 7}, - {field_reaches, 8}, + {field_meta, 7}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [814] = + [810] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, - {field_detector, 8}, + {field_detector, 7}, {field_id, 1}, - {field_meta, 7}, + {field_preconditions, 8}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [823] = + [819] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, + {field_detector, 7}, {field_id, 1}, - {field_meta, 7}, - {field_preconditions, 8}, + {field_reaches, 8}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [832] = + [828] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, {field_id, 1}, - {field_meta, 7}, + {field_meta, 6}, + {field_preconditions, 7}, {field_reaches, 8}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - {field_ttc, 6}, - [841] = + {field_tag, 2}, + [837] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, @@ -1956,8 +1934,8 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_meta, 6}, {field_preconditions, 8}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [850] = + {field_tag, 2}, + [846] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, @@ -1966,18 +1944,18 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_meta, 6}, {field_reaches, 8}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [859] = + {field_tag, 2}, + [855] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, + {field_detector, 6}, {field_id, 1}, - {field_meta, 6}, {field_preconditions, 7}, {field_reaches, 8}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [868] = + {field_tag, 2}, + [864] = {field_id, 6}, {field_left_field_id, 2}, {field_left_id, 0}, @@ -1985,7 +1963,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_right_field_id, 10}, {field_right_id, 12}, {field_right_mult, 8}, - [875] = + [871] = {field_cias, 2}, {field_cias, 3}, {field_cias, 4}, @@ -1996,18 +1974,18 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_reaches, 9}, {field_step_type, 0}, {field_ttc, 5}, - [885] = + [881] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, - {field_detector, 7}, {field_id, 1}, + {field_meta, 7}, {field_preconditions, 8}, {field_reaches, 9}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [895] = + [891] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, @@ -2016,9 +1994,9 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_meta, 7}, {field_preconditions, 9}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [905] = + [901] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, @@ -2027,20 +2005,20 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_meta, 7}, {field_reaches, 9}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [915] = + [911] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, + {field_detector, 7}, {field_id, 1}, - {field_meta, 7}, {field_preconditions, 8}, {field_reaches, 9}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, - [925] = + [921] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, @@ -2050,8 +2028,8 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_preconditions, 8}, {field_reaches, 9}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, - [935] = + {field_tag, 2}, + [931] = {field_id, 6}, {field_left_field_id, 2}, {field_left_id, 0}, @@ -2060,7 +2038,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_right_field_id, 10}, {field_right_id, 12}, {field_right_mult, 8}, - [943] = + [939] = {field_cias, 3}, {field_cias, 4}, {field_cias, 5}, @@ -2070,7 +2048,7 @@ static const TSFieldMapEntry ts_field_map_entries[] = { {field_preconditions, 9}, {field_reaches, 10}, {field_step_type, 0}, - {field_tag, 2, .inherited = true}, + {field_tag, 2}, {field_ttc, 6}, }; @@ -2141,7 +2119,7 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [52] = 52, [53] = 53, [54] = 54, - [55] = 55, + [55] = 52, [56] = 56, [57] = 57, [58] = 58, @@ -2159,7 +2137,7 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [70] = 70, [71] = 71, [72] = 72, - [73] = 73, + [73] = 64, [74] = 74, [75] = 75, [76] = 76, @@ -2196,8 +2174,8 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [107] = 107, [108] = 108, [109] = 109, - [110] = 30, - [111] = 100, + [110] = 110, + [111] = 111, [112] = 112, [113] = 113, [114] = 114, @@ -2218,11 +2196,11 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [129] = 129, [130] = 130, [131] = 131, - [132] = 132, + [132] = 95, [133] = 133, [134] = 134, [135] = 135, - [136] = 136, + [136] = 48, [137] = 137, [138] = 138, [139] = 139, @@ -2286,7 +2264,7 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [197] = 197, [198] = 198, [199] = 199, - [200] = 198, + [200] = 200, [201] = 201, [202] = 202, [203] = 203, @@ -2299,7 +2277,7 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [210] = 210, [211] = 211, [212] = 212, - [213] = 29, + [213] = 213, [214] = 214, [215] = 215, [216] = 216, @@ -2322,14 +2300,14 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [233] = 233, [234] = 234, [235] = 235, - [236] = 236, + [236] = 65, [237] = 237, [238] = 238, [239] = 239, [240] = 240, [241] = 241, [242] = 242, - [243] = 31, + [243] = 243, [244] = 244, [245] = 245, [246] = 246, @@ -2406,12 +2384,12 @@ static const TSStateId ts_primary_state_ids[STATE_COUNT] = { [317] = 317, [318] = 318, [319] = 319, - [320] = 299, + [320] = 320, [321] = 321, - [322] = 304, + [322] = 291, [323] = 323, - [324] = 302, - [325] = 325, + [324] = 299, + [325] = 320, }; static bool ts_lex(TSLexer *lexer, TSStateId state) { @@ -2419,57 +2397,61 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (eof) ADVANCE(25); + if (eof) ADVANCE(28); ADVANCE_MAP( - '!', 38, - '"', 2, - '#', 34, - '&', 33, - '(', 42, - ')', 43, - '*', 55, - '+', 51, - ',', 37, - '-', 53, - '.', 41, - '/', 57, - ':', 61, - '<', 11, - '=', 31, - '@', 36, - '[', 48, - '\\', 18, - ']', 49, - '^', 58, - '{', 29, - '|', 32, - '}', 30, - 'A', 71, - 'C', 71, - 'I', 71, + '!', 41, + '"', 4, + '#', 64, + '(', 45, + ')', 46, + '*', 58, + '+', 54, + ',', 40, + '-', 56, + '.', 44, + '/', 60, + ':', 65, + '<', 13, + '=', 36, + '@', 37, + 'E', 39, + '[', 51, + '\\', 19, + ']', 52, + '^', 61, + 'l', 75, + '{', 32, + '}', 33, + '&', 38, + '|', 38, + 'A', 77, + 'C', 77, + 'I', 77, ); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(68); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(72); if (('B' <= lookahead && lookahead <= '_') || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(71); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); END_STATE(); case 1: ADVANCE_MAP( - '!', 38, - '#', 34, - '&', 33, - '+', 19, - '-', 20, - '/', 7, - '<', 13, - '@', 36, - '[', 48, - '{', 29, - '|', 32, - '}', 30, + '!', 41, + '+', 20, + '-', 21, + '/', 9, + '<', 15, + '@', 37, + 'E', 39, + '[', 51, + 'l', 75, + '{', 32, + '}', 33, + '#', 38, + '&', 38, + '|', 38, ); if (lookahead == '\t' || lookahead == '\n' || @@ -2478,331 +2460,394 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) { if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(71); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); END_STATE(); case 2: - if (lookahead == '"') ADVANCE(65); - if (lookahead == '\\') ADVANCE(3); - if (lookahead != 0) ADVANCE(2); + ADVANCE_MAP( + '!', 41, + '+', 20, + '-', 21, + '/', 9, + '<', 15, + '[', 51, + 'l', 24, + '}', 33, + '#', 38, + '&', 38, + 'E', 38, + '|', 38, + ); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(2); END_STATE(); case 3: - if (lookahead == '"') ADVANCE(66); - if (lookahead == '\\') ADVANCE(3); - if (lookahead != 0) ADVANCE(2); - END_STATE(); - case 4: ADVANCE_MAP( - '(', 42, - ')', 43, - '*', 55, - '+', 50, - '-', 52, - '.', 16, - '/', 56, - ':', 23, - '<', 14, - '[', 48, - ']', 49, - '^', 58, + '!', 23, + '(', 45, + ')', 46, + '*', 58, + '+', 20, + ',', 40, + '-', 57, + '.', 43, + '/', 8, + '[', 51, + '\\', 19, + 'l', 24, + '}', 33, + 'A', 78, + 'C', 78, + 'I', 78, + '#', 38, + '&', 38, + 'E', 38, + '|', 38, ); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || - lookahead == ' ') SKIP(4); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(67); - if (('A' <= lookahead && lookahead <= 'Z') || - lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(71); + lookahead == ' ') SKIP(3); + END_STATE(); + case 4: + if (lookahead == '"') ADVANCE(69); + if (lookahead == '\\') ADVANCE(5); + if (lookahead != 0) ADVANCE(4); END_STATE(); case 5: - if (lookahead == '*') ADVANCE(9); - if (lookahead == '/') ADVANCE(28); + if (lookahead == '"') ADVANCE(70); + if (lookahead == '\\') ADVANCE(5); + if (lookahead != 0) ADVANCE(4); END_STATE(); case 6: - if (lookahead == '*') ADVANCE(9); - if (lookahead == '/') ADVANCE(28); - if (lookahead == '\\') ADVANCE(60); + ADVANCE_MAP( + '(', 45, + ')', 46, + '-', 12, + '.', 17, + '/', 7, + ':', 26, + '<', 16, + '[', 51, + ); + if (lookahead == '\t' || + lookahead == '\n' || + lookahead == '\r' || + lookahead == ' ') SKIP(6); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(71); + if (('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); END_STATE(); case 7: - if (lookahead == '*') ADVANCE(9); - if (lookahead == '/') ADVANCE(27); + if (lookahead == '*') ADVANCE(11); + if (lookahead == '/') ADVANCE(31); END_STATE(); case 8: - if (lookahead == '*') ADVANCE(8); - if (lookahead == '/') ADVANCE(26); - if (lookahead != 0) ADVANCE(9); + if (lookahead == '*') ADVANCE(11); + if (lookahead == '/') ADVANCE(31); + if (lookahead == '\\') ADVANCE(63); END_STATE(); case 9: - if (lookahead == '*') ADVANCE(8); - if (lookahead != 0) ADVANCE(9); + if (lookahead == '*') ADVANCE(11); + if (lookahead == '/') ADVANCE(30); END_STATE(); case 10: - if (lookahead == '-') ADVANCE(21); + if (lookahead == '*') ADVANCE(10); + if (lookahead == '/') ADVANCE(29); + if (lookahead != 0) ADVANCE(11); END_STATE(); case 11: - if (lookahead == '-') ADVANCE(45); + if (lookahead == '*') ADVANCE(10); + if (lookahead != 0) ADVANCE(11); END_STATE(); case 12: - if (lookahead == '-') ADVANCE(62); + if (lookahead == '-') ADVANCE(22); END_STATE(); case 13: - if (lookahead == '-') ADVANCE(44); + if (lookahead == '-') ADVANCE(48); END_STATE(); case 14: - if (lookahead == '-') ADVANCE(12); + if (lookahead == '-') ADVANCE(66); END_STATE(); case 15: - if (lookahead == '-') ADVANCE(10); - if (lookahead == '/') ADVANCE(5); - if (lookahead == 'A' || - lookahead == 'C' || - lookahead == 'I') ADVANCE(72); - if (lookahead == '\t' || - lookahead == '\n' || - lookahead == '\r' || - lookahead == ' ') SKIP(15); + if (lookahead == '-') ADVANCE(47); END_STATE(); case 16: - if (lookahead == '.') ADVANCE(64); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(70); + if (lookahead == '-') ADVANCE(14); END_STATE(); case 17: - if (lookahead == '.') ADVANCE(70); + if (lookahead == '.') ADVANCE(68); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(74); END_STATE(); case 18: - if (lookahead == '/') ADVANCE(59); + if (lookahead == '.') ADVANCE(74); END_STATE(); case 19: - if (lookahead == '>') ADVANCE(46); + if (lookahead == '/') ADVANCE(62); END_STATE(); case 20: - if (lookahead == '>') ADVANCE(47); + if (lookahead == '>') ADVANCE(49); END_STATE(); case 21: - if (lookahead == '>') ADVANCE(63); + if (lookahead == '>') ADVANCE(50); END_STATE(); case 22: - if (lookahead == 'E') ADVANCE(35); + if (lookahead == '>') ADVANCE(67); END_STATE(); case 23: - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(69); + if (lookahead == 'E') ADVANCE(38); END_STATE(); case 24: - if (eof) ADVANCE(25); + if (lookahead == 'e') ADVANCE(25); + END_STATE(); + case 25: + if (lookahead == 't') ADVANCE(34); + END_STATE(); + case 26: + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(73); + END_STATE(); + case 27: + if (eof) ADVANCE(28); ADVANCE_MAP( - '!', 22, - '#', 34, - '&', 33, - '(', 42, - ')', 43, - '*', 55, - '+', 19, - ',', 37, - '-', 54, - '.', 40, - '/', 6, - '<', 13, - '[', 48, - '\\', 18, - '{', 29, - '|', 32, - '}', 30, + '#', 64, + '(', 45, + ')', 46, + '*', 58, + '+', 53, + '-', 55, + '.', 43, + '/', 59, + '<', 16, + '[', 51, + ']', 52, + '^', 61, + '{', 32, + '}', 33, ); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || - lookahead == ' ') SKIP(24); + lookahead == ' ') SKIP(27); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(71); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); END_STATE(); - case 25: + case 28: ACCEPT_TOKEN(ts_builtin_sym_end); END_STATE(); - case 26: + case 29: ACCEPT_TOKEN(sym_comment); END_STATE(); - case 27: + case 30: ACCEPT_TOKEN(sym_comment); - if (lookahead == '!') ADVANCE(39); + if (lookahead == '!') ADVANCE(42); if (lookahead != 0 && lookahead != '\n' && lookahead != '\r' && lookahead != 0x2028 && - lookahead != 0x2029) ADVANCE(28); + lookahead != 0x2029) ADVANCE(31); END_STATE(); - case 28: + case 31: ACCEPT_TOKEN(sym_comment); if (lookahead != 0 && lookahead != '\n' && lookahead != '\r' && lookahead != 0x2028 && - lookahead != 0x2029) ADVANCE(28); - END_STATE(); - case 29: - ACCEPT_TOKEN(anon_sym_LBRACE); - END_STATE(); - case 30: - ACCEPT_TOKEN(anon_sym_RBRACE); - END_STATE(); - case 31: - ACCEPT_TOKEN(anon_sym_EQ); + lookahead != 0x2029) ADVANCE(31); END_STATE(); case 32: - ACCEPT_TOKEN(anon_sym_PIPE); + ACCEPT_TOKEN(anon_sym_LBRACE); END_STATE(); case 33: - ACCEPT_TOKEN(anon_sym_AMP); + ACCEPT_TOKEN(anon_sym_RBRACE); END_STATE(); case 34: - ACCEPT_TOKEN(anon_sym_POUND); + ACCEPT_TOKEN(anon_sym_let); END_STATE(); case 35: - ACCEPT_TOKEN(anon_sym_BANGE); + ACCEPT_TOKEN(anon_sym_let); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); END_STATE(); case 36: - ACCEPT_TOKEN(anon_sym_AT); + ACCEPT_TOKEN(anon_sym_EQ); END_STATE(); case 37: - ACCEPT_TOKEN(anon_sym_COMMA); + ACCEPT_TOKEN(anon_sym_AT); END_STATE(); case 38: - ACCEPT_TOKEN(anon_sym_BANG); - if (lookahead == 'E') ADVANCE(35); + ACCEPT_TOKEN(sym_step_type); END_STATE(); case 39: - ACCEPT_TOKEN(anon_sym_SLASH_SLASH_BANG); + ACCEPT_TOKEN(sym_step_type); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); END_STATE(); case 40: - ACCEPT_TOKEN(anon_sym_DOT); + ACCEPT_TOKEN(anon_sym_COMMA); END_STATE(); case 41: - ACCEPT_TOKEN(anon_sym_DOT); - if (lookahead == '.') ADVANCE(64); + ACCEPT_TOKEN(anon_sym_BANG); + if (lookahead == 'E') ADVANCE(38); END_STATE(); case 42: - ACCEPT_TOKEN(anon_sym_LPAREN); + ACCEPT_TOKEN(anon_sym_SLASH_SLASH_BANG); END_STATE(); case 43: - ACCEPT_TOKEN(anon_sym_RPAREN); + ACCEPT_TOKEN(anon_sym_DOT); END_STATE(); case 44: - ACCEPT_TOKEN(anon_sym_LT_DASH); + ACCEPT_TOKEN(anon_sym_DOT); + if (lookahead == '.') ADVANCE(68); END_STATE(); case 45: - ACCEPT_TOKEN(anon_sym_LT_DASH); - if (lookahead == '-') ADVANCE(62); + ACCEPT_TOKEN(anon_sym_LPAREN); END_STATE(); case 46: - ACCEPT_TOKEN(anon_sym_PLUS_GT); + ACCEPT_TOKEN(anon_sym_RPAREN); END_STATE(); case 47: - ACCEPT_TOKEN(anon_sym_DASH_GT); + ACCEPT_TOKEN(anon_sym_LT_DASH); END_STATE(); case 48: - ACCEPT_TOKEN(anon_sym_LBRACK); + ACCEPT_TOKEN(anon_sym_LT_DASH); + if (lookahead == '-') ADVANCE(66); END_STATE(); case 49: - ACCEPT_TOKEN(anon_sym_RBRACK); + ACCEPT_TOKEN(anon_sym_PLUS_GT); END_STATE(); case 50: - ACCEPT_TOKEN(anon_sym_PLUS); + ACCEPT_TOKEN(anon_sym_DASH_GT); END_STATE(); case 51: - ACCEPT_TOKEN(anon_sym_PLUS); - if (lookahead == '>') ADVANCE(46); + ACCEPT_TOKEN(anon_sym_LBRACK); END_STATE(); case 52: - ACCEPT_TOKEN(anon_sym_DASH); + ACCEPT_TOKEN(anon_sym_RBRACK); END_STATE(); case 53: - ACCEPT_TOKEN(anon_sym_DASH); - if (lookahead == '-') ADVANCE(21); - if (lookahead == '>') ADVANCE(47); + ACCEPT_TOKEN(anon_sym_PLUS); END_STATE(); case 54: - ACCEPT_TOKEN(anon_sym_DASH); - if (lookahead == '>') ADVANCE(47); + ACCEPT_TOKEN(anon_sym_PLUS); + if (lookahead == '>') ADVANCE(49); END_STATE(); case 55: - ACCEPT_TOKEN(anon_sym_STAR); + ACCEPT_TOKEN(anon_sym_DASH); END_STATE(); case 56: - ACCEPT_TOKEN(anon_sym_SLASH); - if (lookahead == '*') ADVANCE(9); - if (lookahead == '/') ADVANCE(28); + ACCEPT_TOKEN(anon_sym_DASH); + if (lookahead == '-') ADVANCE(22); + if (lookahead == '>') ADVANCE(50); END_STATE(); case 57: - ACCEPT_TOKEN(anon_sym_SLASH); - if (lookahead == '*') ADVANCE(9); - if (lookahead == '/') ADVANCE(28); - if (lookahead == '\\') ADVANCE(60); + ACCEPT_TOKEN(anon_sym_DASH); + if (lookahead == '>') ADVANCE(50); END_STATE(); case 58: - ACCEPT_TOKEN(anon_sym_CARET); + ACCEPT_TOKEN(anon_sym_STAR); END_STATE(); case 59: - ACCEPT_TOKEN(anon_sym_BSLASH_SLASH); + ACCEPT_TOKEN(anon_sym_SLASH); + if (lookahead == '*') ADVANCE(11); + if (lookahead == '/') ADVANCE(31); END_STATE(); case 60: - ACCEPT_TOKEN(anon_sym_SLASH_BSLASH); + ACCEPT_TOKEN(anon_sym_SLASH); + if (lookahead == '*') ADVANCE(11); + if (lookahead == '/') ADVANCE(31); + if (lookahead == '\\') ADVANCE(63); END_STATE(); case 61: - ACCEPT_TOKEN(anon_sym_COLON); + ACCEPT_TOKEN(anon_sym_CARET); END_STATE(); case 62: - ACCEPT_TOKEN(anon_sym_LT_DASH_DASH); + ACCEPT_TOKEN(anon_sym_BSLASH_SLASH); END_STATE(); case 63: - ACCEPT_TOKEN(anon_sym_DASH_DASH_GT); + ACCEPT_TOKEN(anon_sym_SLASH_BSLASH); END_STATE(); case 64: - ACCEPT_TOKEN(anon_sym_DOT_DOT); + ACCEPT_TOKEN(anon_sym_POUND); END_STATE(); case 65: - ACCEPT_TOKEN(sym_string); + ACCEPT_TOKEN(anon_sym_COLON); END_STATE(); case 66: - ACCEPT_TOKEN(sym_string); - if (lookahead == '"') ADVANCE(65); - if (lookahead == '\\') ADVANCE(3); - if (lookahead != 0) ADVANCE(2); + ACCEPT_TOKEN(anon_sym_LT_DASH_DASH); END_STATE(); case 67: + ACCEPT_TOKEN(anon_sym_DASH_DASH_GT); + END_STATE(); + case 68: + ACCEPT_TOKEN(anon_sym_DOT_DOT); + END_STATE(); + case 69: + ACCEPT_TOKEN(sym_string); + END_STATE(); + case 70: + ACCEPT_TOKEN(sym_string); + if (lookahead == '"') ADVANCE(69); + if (lookahead == '\\') ADVANCE(5); + if (lookahead != 0) ADVANCE(4); + END_STATE(); + case 71: ACCEPT_TOKEN(sym_integer); - if (lookahead == '.') ADVANCE(70); - if (lookahead == ':') ADVANCE(17); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(67); + if (lookahead == '.') ADVANCE(74); + if (lookahead == ':') ADVANCE(18); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(71); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(71); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); END_STATE(); - case 68: + case 72: ACCEPT_TOKEN(sym_integer); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(68); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(72); if (('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(71); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); END_STATE(); - case 69: + case 73: ACCEPT_TOKEN(sym_float); - if (lookahead == '.') ADVANCE(70); - if (lookahead == ':') ADVANCE(17); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(69); + if (lookahead == '.') ADVANCE(74); + if (lookahead == ':') ADVANCE(18); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(73); END_STATE(); - case 70: + case 74: ACCEPT_TOKEN(sym_float); - if (('0' <= lookahead && lookahead <= '9')) ADVANCE(70); + if (('0' <= lookahead && lookahead <= '9')) ADVANCE(74); END_STATE(); - case 71: - ACCEPT_TOKEN(sym_identity); + case 75: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 'e') ADVANCE(76); if (('0' <= lookahead && lookahead <= '9') || ('A' <= lookahead && lookahead <= 'Z') || lookahead == '_' || - ('a' <= lookahead && lookahead <= 'z')) ADVANCE(71); + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); END_STATE(); - case 72: + case 76: + ACCEPT_TOKEN(sym_identifier); + if (lookahead == 't') ADVANCE(35); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); + END_STATE(); + case 77: + ACCEPT_TOKEN(sym_identifier); + if (('0' <= lookahead && lookahead <= '9') || + ('A' <= lookahead && lookahead <= 'Z') || + lookahead == '_' || + ('a' <= lookahead && lookahead <= 'z')) ADVANCE(77); + END_STATE(); + case 78: ACCEPT_TOKEN(sym_cia); END_STATE(); default: @@ -2815,165 +2860,151 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) { eof = lexer->eof(lexer); switch (state) { case 0: - if (lookahead == 'E') ADVANCE(1); - if (lookahead == 'a') ADVANCE(2); - if (lookahead == 'c') ADVANCE(3); - if (lookahead == 'e') ADVANCE(4); - if (lookahead == 'i') ADVANCE(5); - if (lookahead == 'l') ADVANCE(6); + if (lookahead == 'a') ADVANCE(1); + if (lookahead == 'c') ADVANCE(2); + if (lookahead == 'e') ADVANCE(3); + if (lookahead == 'i') ADVANCE(4); if (lookahead == '\t' || lookahead == '\n' || lookahead == '\r' || lookahead == ' ') SKIP(0); END_STATE(); case 1: - ACCEPT_TOKEN(anon_sym_E); + if (lookahead == 'b') ADVANCE(5); + if (lookahead == 's') ADVANCE(6); END_STATE(); case 2: - if (lookahead == 'b') ADVANCE(7); - if (lookahead == 's') ADVANCE(8); + if (lookahead == 'a') ADVANCE(7); END_STATE(); case 3: - if (lookahead == 'a') ADVANCE(9); + if (lookahead == 'x') ADVANCE(8); END_STATE(); case 4: - if (lookahead == 'x') ADVANCE(10); + if (lookahead == 'n') ADVANCE(9); END_STATE(); case 5: - if (lookahead == 'n') ADVANCE(11); + if (lookahead == 's') ADVANCE(10); END_STATE(); case 6: - if (lookahead == 'e') ADVANCE(12); + if (lookahead == 's') ADVANCE(11); END_STATE(); case 7: - if (lookahead == 's') ADVANCE(13); + if (lookahead == 't') ADVANCE(12); END_STATE(); case 8: - if (lookahead == 's') ADVANCE(14); + if (lookahead == 't') ADVANCE(13); END_STATE(); case 9: - if (lookahead == 't') ADVANCE(15); + if (lookahead == 'c') ADVANCE(14); + if (lookahead == 'f') ADVANCE(15); END_STATE(); case 10: if (lookahead == 't') ADVANCE(16); END_STATE(); case 11: - if (lookahead == 'c') ADVANCE(17); - if (lookahead == 'f') ADVANCE(18); + if (lookahead == 'e') ADVANCE(17); + if (lookahead == 'o') ADVANCE(18); END_STATE(); case 12: - if (lookahead == 't') ADVANCE(19); + if (lookahead == 'e') ADVANCE(19); END_STATE(); case 13: - if (lookahead == 't') ADVANCE(20); + if (lookahead == 'e') ADVANCE(20); END_STATE(); case 14: - if (lookahead == 'e') ADVANCE(21); - if (lookahead == 'o') ADVANCE(22); + if (lookahead == 'l') ADVANCE(21); END_STATE(); case 15: - if (lookahead == 'e') ADVANCE(23); + if (lookahead == 'o') ADVANCE(22); END_STATE(); case 16: - if (lookahead == 'e') ADVANCE(24); + if (lookahead == 'r') ADVANCE(23); END_STATE(); case 17: - if (lookahead == 'l') ADVANCE(25); + if (lookahead == 't') ADVANCE(24); END_STATE(); case 18: - if (lookahead == 'o') ADVANCE(26); + if (lookahead == 'c') ADVANCE(25); END_STATE(); case 19: - ACCEPT_TOKEN(anon_sym_let); + if (lookahead == 'g') ADVANCE(26); END_STATE(); case 20: - if (lookahead == 'r') ADVANCE(27); + if (lookahead == 'n') ADVANCE(27); END_STATE(); case 21: - if (lookahead == 't') ADVANCE(28); + if (lookahead == 'u') ADVANCE(28); END_STATE(); case 22: - if (lookahead == 'c') ADVANCE(29); + ACCEPT_TOKEN(anon_sym_info); END_STATE(); case 23: - if (lookahead == 'g') ADVANCE(30); + if (lookahead == 'a') ADVANCE(29); END_STATE(); case 24: - if (lookahead == 'n') ADVANCE(31); + ACCEPT_TOKEN(anon_sym_asset); END_STATE(); case 25: - if (lookahead == 'u') ADVANCE(32); + if (lookahead == 'i') ADVANCE(30); END_STATE(); case 26: - ACCEPT_TOKEN(anon_sym_info); + if (lookahead == 'o') ADVANCE(31); END_STATE(); case 27: - if (lookahead == 'a') ADVANCE(33); + if (lookahead == 'd') ADVANCE(32); END_STATE(); case 28: - ACCEPT_TOKEN(anon_sym_asset); + if (lookahead == 'd') ADVANCE(33); END_STATE(); case 29: - if (lookahead == 'i') ADVANCE(34); + if (lookahead == 'c') ADVANCE(34); END_STATE(); case 30: - if (lookahead == 'o') ADVANCE(35); + if (lookahead == 'a') ADVANCE(35); END_STATE(); case 31: - if (lookahead == 'd') ADVANCE(36); + if (lookahead == 'r') ADVANCE(36); END_STATE(); case 32: - if (lookahead == 'd') ADVANCE(37); + if (lookahead == 's') ADVANCE(37); END_STATE(); case 33: - if (lookahead == 'c') ADVANCE(38); + if (lookahead == 'e') ADVANCE(38); END_STATE(); case 34: - if (lookahead == 'a') ADVANCE(39); + if (lookahead == 't') ADVANCE(39); END_STATE(); case 35: - if (lookahead == 'r') ADVANCE(40); + if (lookahead == 't') ADVANCE(40); END_STATE(); case 36: - if (lookahead == 's') ADVANCE(41); + if (lookahead == 'y') ADVANCE(41); END_STATE(); case 37: - if (lookahead == 'e') ADVANCE(42); + ACCEPT_TOKEN(anon_sym_extends); END_STATE(); case 38: - if (lookahead == 't') ADVANCE(43); + ACCEPT_TOKEN(anon_sym_include); END_STATE(); case 39: - if (lookahead == 't') ADVANCE(44); + ACCEPT_TOKEN(anon_sym_abstract); END_STATE(); case 40: - if (lookahead == 'y') ADVANCE(45); + if (lookahead == 'i') ADVANCE(42); END_STATE(); case 41: - ACCEPT_TOKEN(anon_sym_extends); + ACCEPT_TOKEN(anon_sym_category); END_STATE(); case 42: - ACCEPT_TOKEN(anon_sym_include); + if (lookahead == 'o') ADVANCE(43); END_STATE(); case 43: - ACCEPT_TOKEN(anon_sym_abstract); + if (lookahead == 'n') ADVANCE(44); END_STATE(); case 44: - if (lookahead == 'i') ADVANCE(46); + if (lookahead == 's') ADVANCE(45); END_STATE(); case 45: - ACCEPT_TOKEN(anon_sym_category); - END_STATE(); - case 46: - if (lookahead == 'o') ADVANCE(47); - END_STATE(); - case 47: - if (lookahead == 'n') ADVANCE(48); - END_STATE(); - case 48: - if (lookahead == 's') ADVANCE(49); - END_STATE(); - case 49: ACCEPT_TOKEN(anon_sym_associations); END_STATE(); default: @@ -2983,7 +3014,7 @@ static bool ts_lex_keywords(TSLexer *lexer, TSStateId state) { static const TSLexerMode ts_lex_modes[STATE_COUNT] = { [0] = {.lex_state = 0}, - [1] = {.lex_state = 24}, + [1] = {.lex_state = 27}, [2] = {.lex_state = 1}, [3] = {.lex_state = 1}, [4] = {.lex_state = 1}, @@ -2991,7 +3022,7 @@ static const TSLexerMode ts_lex_modes[STATE_COUNT] = { [6] = {.lex_state = 1}, [7] = {.lex_state = 1}, [8] = {.lex_state = 1}, - [9] = {.lex_state = 24}, + [9] = {.lex_state = 1}, [10] = {.lex_state = 1}, [11] = {.lex_state = 1}, [12] = {.lex_state = 1}, @@ -3000,320 +3031,320 @@ static const TSLexerMode ts_lex_modes[STATE_COUNT] = { [15] = {.lex_state = 1}, [16] = {.lex_state = 1}, [17] = {.lex_state = 1}, - [18] = {.lex_state = 1}, - [19] = {.lex_state = 24}, - [20] = {.lex_state = 1}, - [21] = {.lex_state = 24}, - [22] = {.lex_state = 24}, - [23] = {.lex_state = 24}, - [24] = {.lex_state = 24}, - [25] = {.lex_state = 24}, - [26] = {.lex_state = 24}, - [27] = {.lex_state = 1}, - [28] = {.lex_state = 24}, - [29] = {.lex_state = 1}, - [30] = {.lex_state = 1}, - [31] = {.lex_state = 1}, - [32] = {.lex_state = 24}, - [33] = {.lex_state = 24}, - [34] = {.lex_state = 24}, - [35] = {.lex_state = 24}, - [36] = {.lex_state = 24}, - [37] = {.lex_state = 24}, - [38] = {.lex_state = 24}, - [39] = {.lex_state = 24}, - [40] = {.lex_state = 24}, - [41] = {.lex_state = 24}, - [42] = {.lex_state = 24}, - [43] = {.lex_state = 24}, - [44] = {.lex_state = 24}, - [45] = {.lex_state = 24}, - [46] = {.lex_state = 24}, - [47] = {.lex_state = 24}, - [48] = {.lex_state = 24}, - [49] = {.lex_state = 24}, - [50] = {.lex_state = 24}, - [51] = {.lex_state = 24}, - [52] = {.lex_state = 24}, - [53] = {.lex_state = 24}, - [54] = {.lex_state = 24}, - [55] = {.lex_state = 24}, - [56] = {.lex_state = 24}, - [57] = {.lex_state = 24}, - [58] = {.lex_state = 24}, - [59] = {.lex_state = 24}, - [60] = {.lex_state = 24}, - [61] = {.lex_state = 24}, - [62] = {.lex_state = 24}, - [63] = {.lex_state = 24}, - [64] = {.lex_state = 24}, - [65] = {.lex_state = 24}, - [66] = {.lex_state = 24}, - [67] = {.lex_state = 24}, - [68] = {.lex_state = 24}, - [69] = {.lex_state = 24}, - [70] = {.lex_state = 24}, - [71] = {.lex_state = 24}, - [72] = {.lex_state = 24}, - [73] = {.lex_state = 24}, - [74] = {.lex_state = 24}, - [75] = {.lex_state = 4}, - [76] = {.lex_state = 24}, - [77] = {.lex_state = 24}, - [78] = {.lex_state = 24}, - [79] = {.lex_state = 24}, - [80] = {.lex_state = 24}, - [81] = {.lex_state = 24}, - [82] = {.lex_state = 24}, - [83] = {.lex_state = 24}, - [84] = {.lex_state = 24}, - [85] = {.lex_state = 24}, - [86] = {.lex_state = 24}, - [87] = {.lex_state = 4}, - [88] = {.lex_state = 24}, - [89] = {.lex_state = 4}, - [90] = {.lex_state = 24}, - [91] = {.lex_state = 24}, - [92] = {.lex_state = 24}, - [93] = {.lex_state = 24}, - [94] = {.lex_state = 24}, - [95] = {.lex_state = 24}, - [96] = {.lex_state = 24}, - [97] = {.lex_state = 24}, - [98] = {.lex_state = 24}, - [99] = {.lex_state = 24}, - [100] = {.lex_state = 4}, - [101] = {.lex_state = 24}, - [102] = {.lex_state = 24}, - [103] = {.lex_state = 24}, - [104] = {.lex_state = 24}, - [105] = {.lex_state = 24}, - [106] = {.lex_state = 24}, - [107] = {.lex_state = 24}, - [108] = {.lex_state = 24}, - [109] = {.lex_state = 24}, - [110] = {.lex_state = 24}, - [111] = {.lex_state = 4}, - [112] = {.lex_state = 4}, - [113] = {.lex_state = 24}, - [114] = {.lex_state = 24}, - [115] = {.lex_state = 24}, - [116] = {.lex_state = 24}, - [117] = {.lex_state = 24}, - [118] = {.lex_state = 24}, - [119] = {.lex_state = 24}, - [120] = {.lex_state = 24}, - [121] = {.lex_state = 24}, - [122] = {.lex_state = 24}, - [123] = {.lex_state = 4}, - [124] = {.lex_state = 24}, - [125] = {.lex_state = 24}, - [126] = {.lex_state = 24}, - [127] = {.lex_state = 24}, - [128] = {.lex_state = 24}, - [129] = {.lex_state = 24}, - [130] = {.lex_state = 24}, - [131] = {.lex_state = 24}, - [132] = {.lex_state = 24}, - [133] = {.lex_state = 24}, - [134] = {.lex_state = 24}, - [135] = {.lex_state = 24}, - [136] = {.lex_state = 24}, - [137] = {.lex_state = 24}, - [138] = {.lex_state = 24}, - [139] = {.lex_state = 4}, - [140] = {.lex_state = 4}, - [141] = {.lex_state = 4}, - [142] = {.lex_state = 4}, - [143] = {.lex_state = 24}, - [144] = {.lex_state = 24}, - [145] = {.lex_state = 24}, - [146] = {.lex_state = 24}, - [147] = {.lex_state = 24}, - [148] = {.lex_state = 24}, - [149] = {.lex_state = 24}, - [150] = {.lex_state = 24}, - [151] = {.lex_state = 24}, - [152] = {.lex_state = 24}, - [153] = {.lex_state = 24}, - [154] = {.lex_state = 24}, - [155] = {.lex_state = 24}, - [156] = {.lex_state = 24}, - [157] = {.lex_state = 24}, - [158] = {.lex_state = 4}, - [159] = {.lex_state = 24}, - [160] = {.lex_state = 24}, - [161] = {.lex_state = 24}, - [162] = {.lex_state = 24}, - [163] = {.lex_state = 24}, - [164] = {.lex_state = 24}, - [165] = {.lex_state = 24}, - [166] = {.lex_state = 24}, - [167] = {.lex_state = 24}, - [168] = {.lex_state = 24}, - [169] = {.lex_state = 24}, - [170] = {.lex_state = 24}, - [171] = {.lex_state = 24}, - [172] = {.lex_state = 4}, - [173] = {.lex_state = 24}, - [174] = {.lex_state = 24}, - [175] = {.lex_state = 24}, - [176] = {.lex_state = 24}, - [177] = {.lex_state = 24}, - [178] = {.lex_state = 24}, - [179] = {.lex_state = 24}, - [180] = {.lex_state = 24}, - [181] = {.lex_state = 24}, - [182] = {.lex_state = 24}, - [183] = {.lex_state = 24}, - [184] = {.lex_state = 24}, - [185] = {.lex_state = 24}, - [186] = {.lex_state = 24}, - [187] = {.lex_state = 24}, - [188] = {.lex_state = 24}, - [189] = {.lex_state = 24}, - [190] = {.lex_state = 24}, - [191] = {.lex_state = 24}, - [192] = {.lex_state = 24}, - [193] = {.lex_state = 24}, - [194] = {.lex_state = 24}, - [195] = {.lex_state = 24}, - [196] = {.lex_state = 4}, - [197] = {.lex_state = 0}, - [198] = {.lex_state = 4}, - [199] = {.lex_state = 0}, - [200] = {.lex_state = 4}, - [201] = {.lex_state = 24}, - [202] = {.lex_state = 24}, - [203] = {.lex_state = 24}, - [204] = {.lex_state = 24}, - [205] = {.lex_state = 24}, - [206] = {.lex_state = 24}, - [207] = {.lex_state = 24}, - [208] = {.lex_state = 24}, - [209] = {.lex_state = 24}, - [210] = {.lex_state = 24}, - [211] = {.lex_state = 24}, - [212] = {.lex_state = 24}, - [213] = {.lex_state = 24}, - [214] = {.lex_state = 24}, - [215] = {.lex_state = 24}, - [216] = {.lex_state = 24}, - [217] = {.lex_state = 24}, - [218] = {.lex_state = 24}, - [219] = {.lex_state = 24}, - [220] = {.lex_state = 24}, - [221] = {.lex_state = 24}, - [222] = {.lex_state = 24}, - [223] = {.lex_state = 24}, - [224] = {.lex_state = 0}, - [225] = {.lex_state = 24}, - [226] = {.lex_state = 24}, - [227] = {.lex_state = 24}, - [228] = {.lex_state = 24}, - [229] = {.lex_state = 24}, - [230] = {.lex_state = 24}, - [231] = {.lex_state = 24}, - [232] = {.lex_state = 24}, - [233] = {.lex_state = 24}, - [234] = {.lex_state = 24}, - [235] = {.lex_state = 24}, - [236] = {.lex_state = 24}, - [237] = {.lex_state = 0}, - [238] = {.lex_state = 4}, - [239] = {.lex_state = 0}, - [240] = {.lex_state = 4}, - [241] = {.lex_state = 24}, - [242] = {.lex_state = 0}, - [243] = {.lex_state = 24}, - [244] = {.lex_state = 4}, - [245] = {.lex_state = 4}, - [246] = {.lex_state = 24}, - [247] = {.lex_state = 24}, - [248] = {.lex_state = 24}, - [249] = {.lex_state = 24}, - [250] = {.lex_state = 0}, - [251] = {.lex_state = 24}, - [252] = {.lex_state = 0}, - [253] = {.lex_state = 24}, - [254] = {.lex_state = 24}, - [255] = {.lex_state = 24}, - [256] = {.lex_state = 24}, - [257] = {.lex_state = 0}, - [258] = {.lex_state = 24}, - [259] = {.lex_state = 24}, - [260] = {.lex_state = 24}, - [261] = {.lex_state = 0}, - [262] = {.lex_state = 0}, - [263] = {.lex_state = 24}, - [264] = {.lex_state = 24}, - [265] = {.lex_state = 0}, + [18] = {.lex_state = 3}, + [19] = {.lex_state = 1}, + [20] = {.lex_state = 3}, + [21] = {.lex_state = 3}, + [22] = {.lex_state = 3}, + [23] = {.lex_state = 3}, + [24] = {.lex_state = 3}, + [25] = {.lex_state = 3}, + [26] = {.lex_state = 2}, + [27] = {.lex_state = 2}, + [28] = {.lex_state = 2}, + [29] = {.lex_state = 2}, + [30] = {.lex_state = 2}, + [31] = {.lex_state = 2}, + [32] = {.lex_state = 2}, + [33] = {.lex_state = 2}, + [34] = {.lex_state = 2}, + [35] = {.lex_state = 2}, + [36] = {.lex_state = 2}, + [37] = {.lex_state = 2}, + [38] = {.lex_state = 3}, + [39] = {.lex_state = 2}, + [40] = {.lex_state = 2}, + [41] = {.lex_state = 1}, + [42] = {.lex_state = 2}, + [43] = {.lex_state = 2}, + [44] = {.lex_state = 1}, + [45] = {.lex_state = 27}, + [46] = {.lex_state = 27}, + [47] = {.lex_state = 1}, + [48] = {.lex_state = 1}, + [49] = {.lex_state = 1}, + [50] = {.lex_state = 6}, + [51] = {.lex_state = 2}, + [52] = {.lex_state = 6}, + [53] = {.lex_state = 1}, + [54] = {.lex_state = 2}, + [55] = {.lex_state = 6}, + [56] = {.lex_state = 6}, + [57] = {.lex_state = 6}, + [58] = {.lex_state = 2}, + [59] = {.lex_state = 6}, + [60] = {.lex_state = 27}, + [61] = {.lex_state = 27}, + [62] = {.lex_state = 27}, + [63] = {.lex_state = 27}, + [64] = {.lex_state = 1}, + [65] = {.lex_state = 1}, + [66] = {.lex_state = 27}, + [67] = {.lex_state = 2}, + [68] = {.lex_state = 2}, + [69] = {.lex_state = 27}, + [70] = {.lex_state = 2}, + [71] = {.lex_state = 27}, + [72] = {.lex_state = 2}, + [73] = {.lex_state = 2}, + [74] = {.lex_state = 27}, + [75] = {.lex_state = 27}, + [76] = {.lex_state = 3}, + [77] = {.lex_state = 3}, + [78] = {.lex_state = 3}, + [79] = {.lex_state = 27}, + [80] = {.lex_state = 3}, + [81] = {.lex_state = 3}, + [82] = {.lex_state = 27}, + [83] = {.lex_state = 27}, + [84] = {.lex_state = 27}, + [85] = {.lex_state = 27}, + [86] = {.lex_state = 3}, + [87] = {.lex_state = 27}, + [88] = {.lex_state = 3}, + [89] = {.lex_state = 3}, + [90] = {.lex_state = 3}, + [91] = {.lex_state = 3}, + [92] = {.lex_state = 3}, + [93] = {.lex_state = 3}, + [94] = {.lex_state = 3}, + [95] = {.lex_state = 27}, + [96] = {.lex_state = 3}, + [97] = {.lex_state = 3}, + [98] = {.lex_state = 3}, + [99] = {.lex_state = 3}, + [100] = {.lex_state = 0}, + [101] = {.lex_state = 0}, + [102] = {.lex_state = 27}, + [103] = {.lex_state = 3}, + [104] = {.lex_state = 3}, + [105] = {.lex_state = 3}, + [106] = {.lex_state = 3}, + [107] = {.lex_state = 3}, + [108] = {.lex_state = 3}, + [109] = {.lex_state = 3}, + [110] = {.lex_state = 3}, + [111] = {.lex_state = 3}, + [112] = {.lex_state = 3}, + [113] = {.lex_state = 3}, + [114] = {.lex_state = 3}, + [115] = {.lex_state = 3}, + [116] = {.lex_state = 3}, + [117] = {.lex_state = 3}, + [118] = {.lex_state = 3}, + [119] = {.lex_state = 3}, + [120] = {.lex_state = 3}, + [121] = {.lex_state = 3}, + [122] = {.lex_state = 3}, + [123] = {.lex_state = 3}, + [124] = {.lex_state = 3}, + [125] = {.lex_state = 3}, + [126] = {.lex_state = 3}, + [127] = {.lex_state = 3}, + [128] = {.lex_state = 3}, + [129] = {.lex_state = 3}, + [130] = {.lex_state = 3}, + [131] = {.lex_state = 3}, + [132] = {.lex_state = 27}, + [133] = {.lex_state = 3}, + [134] = {.lex_state = 27}, + [135] = {.lex_state = 27}, + [136] = {.lex_state = 27}, + [137] = {.lex_state = 27}, + [138] = {.lex_state = 27}, + [139] = {.lex_state = 27}, + [140] = {.lex_state = 27}, + [141] = {.lex_state = 27}, + [142] = {.lex_state = 27}, + [143] = {.lex_state = 27}, + [144] = {.lex_state = 27}, + [145] = {.lex_state = 27}, + [146] = {.lex_state = 27}, + [147] = {.lex_state = 27}, + [148] = {.lex_state = 27}, + [149] = {.lex_state = 27}, + [150] = {.lex_state = 3}, + [151] = {.lex_state = 27}, + [152] = {.lex_state = 3}, + [153] = {.lex_state = 27}, + [154] = {.lex_state = 27}, + [155] = {.lex_state = 0}, + [156] = {.lex_state = 6}, + [157] = {.lex_state = 27}, + [158] = {.lex_state = 27}, + [159] = {.lex_state = 27}, + [160] = {.lex_state = 27}, + [161] = {.lex_state = 27}, + [162] = {.lex_state = 27}, + [163] = {.lex_state = 27}, + [164] = {.lex_state = 27}, + [165] = {.lex_state = 27}, + [166] = {.lex_state = 27}, + [167] = {.lex_state = 27}, + [168] = {.lex_state = 27}, + [169] = {.lex_state = 3}, + [170] = {.lex_state = 3}, + [171] = {.lex_state = 3}, + [172] = {.lex_state = 3}, + [173] = {.lex_state = 3}, + [174] = {.lex_state = 3}, + [175] = {.lex_state = 27}, + [176] = {.lex_state = 3}, + [177] = {.lex_state = 3}, + [178] = {.lex_state = 3}, + [179] = {.lex_state = 3}, + [180] = {.lex_state = 3}, + [181] = {.lex_state = 27}, + [182] = {.lex_state = 27}, + [183] = {.lex_state = 27}, + [184] = {.lex_state = 6}, + [185] = {.lex_state = 0}, + [186] = {.lex_state = 3}, + [187] = {.lex_state = 6}, + [188] = {.lex_state = 27}, + [189] = {.lex_state = 0}, + [190] = {.lex_state = 27}, + [191] = {.lex_state = 3}, + [192] = {.lex_state = 27}, + [193] = {.lex_state = 27}, + [194] = {.lex_state = 0}, + [195] = {.lex_state = 27}, + [196] = {.lex_state = 27}, + [197] = {.lex_state = 3}, + [198] = {.lex_state = 3}, + [199] = {.lex_state = 3}, + [200] = {.lex_state = 3}, + [201] = {.lex_state = 27}, + [202] = {.lex_state = 3}, + [203] = {.lex_state = 27}, + [204] = {.lex_state = 3}, + [205] = {.lex_state = 3}, + [206] = {.lex_state = 3}, + [207] = {.lex_state = 3}, + [208] = {.lex_state = 3}, + [209] = {.lex_state = 3}, + [210] = {.lex_state = 27}, + [211] = {.lex_state = 27}, + [212] = {.lex_state = 27}, + [213] = {.lex_state = 3}, + [214] = {.lex_state = 27}, + [215] = {.lex_state = 0}, + [216] = {.lex_state = 6}, + [217] = {.lex_state = 0}, + [218] = {.lex_state = 3}, + [219] = {.lex_state = 3}, + [220] = {.lex_state = 0}, + [221] = {.lex_state = 3}, + [222] = {.lex_state = 3}, + [223] = {.lex_state = 3}, + [224] = {.lex_state = 3}, + [225] = {.lex_state = 3}, + [226] = {.lex_state = 3}, + [227] = {.lex_state = 0}, + [228] = {.lex_state = 3}, + [229] = {.lex_state = 3}, + [230] = {.lex_state = 27}, + [231] = {.lex_state = 3}, + [232] = {.lex_state = 3}, + [233] = {.lex_state = 0}, + [234] = {.lex_state = 3}, + [235] = {.lex_state = 3}, + [236] = {.lex_state = 27}, + [237] = {.lex_state = 3}, + [238] = {.lex_state = 3}, + [239] = {.lex_state = 3}, + [240] = {.lex_state = 3}, + [241] = {.lex_state = 3}, + [242] = {.lex_state = 3}, + [243] = {.lex_state = 3}, + [244] = {.lex_state = 3}, + [245] = {.lex_state = 3}, + [246] = {.lex_state = 3}, + [247] = {.lex_state = 3}, + [248] = {.lex_state = 3}, + [249] = {.lex_state = 3}, + [250] = {.lex_state = 3}, + [251] = {.lex_state = 3}, + [252] = {.lex_state = 3}, + [253] = {.lex_state = 3}, + [254] = {.lex_state = 3}, + [255] = {.lex_state = 3}, + [256] = {.lex_state = 0}, + [257] = {.lex_state = 3}, + [258] = {.lex_state = 3}, + [259] = {.lex_state = 3}, + [260] = {.lex_state = 27}, + [261] = {.lex_state = 3}, + [262] = {.lex_state = 3}, + [263] = {.lex_state = 27}, + [264] = {.lex_state = 3}, + [265] = {.lex_state = 3}, [266] = {.lex_state = 0}, - [267] = {.lex_state = 0}, - [268] = {.lex_state = 4}, - [269] = {.lex_state = 24}, - [270] = {.lex_state = 24}, - [271] = {.lex_state = 24}, - [272] = {.lex_state = 15}, - [273] = {.lex_state = 4}, - [274] = {.lex_state = 0}, + [267] = {.lex_state = 27}, + [268] = {.lex_state = 3}, + [269] = {.lex_state = 27}, + [270] = {.lex_state = 0}, + [271] = {.lex_state = 0}, + [272] = {.lex_state = 27}, + [273] = {.lex_state = 27}, + [274] = {.lex_state = 27}, [275] = {.lex_state = 0}, - [276] = {.lex_state = 15}, + [276] = {.lex_state = 3}, [277] = {.lex_state = 0}, [278] = {.lex_state = 0}, - [279] = {.lex_state = 0}, - [280] = {.lex_state = 0}, + [279] = {.lex_state = 27}, + [280] = {.lex_state = 27}, [281] = {.lex_state = 0}, - [282] = {.lex_state = 0}, + [282] = {.lex_state = 27}, [283] = {.lex_state = 0}, - [284] = {.lex_state = 24}, - [285] = {.lex_state = 24}, - [286] = {.lex_state = 0}, - [287] = {.lex_state = 0}, + [284] = {.lex_state = 27}, + [285] = {.lex_state = 27}, + [286] = {.lex_state = 27}, + [287] = {.lex_state = 6}, [288] = {.lex_state = 0}, [289] = {.lex_state = 0}, - [290] = {.lex_state = 24}, - [291] = {.lex_state = 4}, - [292] = {.lex_state = 24}, - [293] = {.lex_state = 0}, - [294] = {.lex_state = 24}, + [290] = {.lex_state = 0}, + [291] = {.lex_state = 0}, + [292] = {.lex_state = 27}, + [293] = {.lex_state = 27}, + [294] = {.lex_state = 27}, [295] = {.lex_state = 0}, - [296] = {.lex_state = 24}, - [297] = {.lex_state = 15}, + [296] = {.lex_state = 0}, + [297] = {.lex_state = 27}, [298] = {.lex_state = 0}, - [299] = {.lex_state = 0}, - [300] = {.lex_state = 15}, - [301] = {.lex_state = 0}, - [302] = {.lex_state = 24}, - [303] = {.lex_state = 24}, + [299] = {.lex_state = 27}, + [300] = {.lex_state = 27}, + [301] = {.lex_state = 27}, + [302] = {.lex_state = 27}, + [303] = {.lex_state = 0}, [304] = {.lex_state = 0}, [305] = {.lex_state = 0}, - [306] = {.lex_state = 24}, + [306] = {.lex_state = 0}, [307] = {.lex_state = 0}, - [308] = {.lex_state = 24}, - [309] = {.lex_state = 24}, - [310] = {.lex_state = 24}, - [311] = {.lex_state = 24}, - [312] = {.lex_state = 0}, + [308] = {.lex_state = 27}, + [309] = {.lex_state = 0}, + [310] = {.lex_state = 0}, + [311] = {.lex_state = 0}, + [312] = {.lex_state = 3}, [313] = {.lex_state = 0}, - [314] = {.lex_state = 24}, - [315] = {.lex_state = 24}, - [316] = {.lex_state = 0}, - [317] = {.lex_state = 24}, + [314] = {.lex_state = 27}, + [315] = {.lex_state = 27}, + [316] = {.lex_state = 27}, + [317] = {.lex_state = 0}, [318] = {.lex_state = 0}, - [319] = {.lex_state = 24}, + [319] = {.lex_state = 27}, [320] = {.lex_state = 0}, - [321] = {.lex_state = 24}, + [321] = {.lex_state = 0}, [322] = {.lex_state = 0}, [323] = {.lex_state = 0}, - [324] = {.lex_state = 24}, + [324] = {.lex_state = 27}, [325] = {.lex_state = 0}, }; static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [STATE(0)] = { [ts_builtin_sym_end] = ACTIONS(1), - [sym_identity] = ACTIONS(1), + [sym_identifier] = ACTIONS(1), [sym_comment] = ACTIONS(3), [anon_sym_include] = ACTIONS(1), [anon_sym_category] = ACTIONS(1), @@ -3324,12 +3355,8 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_extends] = ACTIONS(1), [anon_sym_let] = ACTIONS(1), [anon_sym_EQ] = ACTIONS(1), - [anon_sym_PIPE] = ACTIONS(1), - [anon_sym_AMP] = ACTIONS(1), - [anon_sym_POUND] = ACTIONS(1), - [anon_sym_E] = ACTIONS(1), - [anon_sym_BANGE] = ACTIONS(1), [anon_sym_AT] = ACTIONS(1), + [sym_step_type] = ACTIONS(1), [anon_sym_COMMA] = ACTIONS(1), [anon_sym_BANG] = ACTIONS(1), [anon_sym_DOT] = ACTIONS(1), @@ -3347,6 +3374,7 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [anon_sym_CARET] = ACTIONS(1), [anon_sym_BSLASH_SLASH] = ACTIONS(1), [anon_sym_SLASH_BSLASH] = ACTIONS(1), + [anon_sym_POUND] = ACTIONS(1), [anon_sym_COLON] = ACTIONS(1), [anon_sym_associations] = ACTIONS(1), [anon_sym_LT_DASH_DASH] = ACTIONS(1), @@ -3358,13 +3386,13 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { [sym_cia] = ACTIONS(1), }, [STATE(1)] = { - [sym_source_file] = STATE(288), - [sym_declaration] = STATE(55), - [sym_include_declaration] = STATE(209), - [sym_category_declaration] = STATE(209), - [sym_define_declaration] = STATE(209), - [sym_associations_declaration] = STATE(209), - [aux_sym_source_file_repeat1] = STATE(55), + [sym_source_file] = STATE(307), + [sym_declaration] = STATE(46), + [sym_include_declaration] = STATE(143), + [sym_category_declaration] = STATE(143), + [sym_define_declaration] = STATE(143), + [sym_associations_declaration] = STATE(143), + [aux_sym_source_file_repeat1] = STATE(46), [ts_builtin_sym_end] = ACTIONS(5), [sym_comment] = ACTIONS(3), [anon_sym_include] = ACTIONS(7), @@ -3377,11 +3405,13 @@ static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { static const uint16_t ts_small_parse_table[] = { [0] = 17, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(19), 1, anon_sym_LBRACE, + ACTIONS(21), 1, + anon_sym_RBRACE, ACTIONS(25), 1, anon_sym_AT, ACTIONS(27), 1, @@ -3392,34 +3422,29 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LT_DASH, ACTIONS(35), 1, anon_sym_LBRACK, - STATE(11), 1, - sym_ttc, - STATE(20), 1, + STATE(3), 1, aux_sym_attack_step_repeat1, - STATE(44), 1, - sym_detector, - STATE(68), 1, - sym_preconditions, + STATE(7), 1, + sym_ttc, STATE(126), 1, + sym_preconditions, + STATE(239), 1, sym_reaching, ACTIONS(23), 2, anon_sym_let, - anon_sym_E, + sym_step_type, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - STATE(10), 2, + STATE(6), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(21), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [59] = 17, + STATE(29), 2, + sym_detector, + aux_sym_attack_step_repeat2, + [56] = 17, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(25), 1, @@ -3434,34 +3459,31 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LBRACK, ACTIONS(37), 1, anon_sym_LBRACE, - STATE(2), 1, - aux_sym_attack_step_repeat1, - STATE(6), 1, + ACTIONS(39), 1, + anon_sym_RBRACE, + STATE(9), 1, sym_ttc, - STATE(39), 1, - sym_detector, - STATE(69), 1, + STATE(19), 1, + aux_sym_attack_step_repeat1, + STATE(98), 1, sym_preconditions, - STATE(151), 1, + STATE(177), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, ACTIONS(41), 2, anon_sym_let, - anon_sym_E, - STATE(7), 2, + sym_step_type, + STATE(10), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(39), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [118] = 14, + STATE(28), 2, + sym_detector, + aux_sym_attack_step_repeat2, + [112] = 14, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3472,32 +3494,29 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LT_DASH, ACTIONS(35), 1, anon_sym_LBRACK, - STATE(16), 1, + ACTIONS(43), 1, + anon_sym_RBRACE, + STATE(14), 1, sym_ttc, - STATE(38), 1, - sym_detector, - STATE(71), 1, + STATE(133), 1, sym_preconditions, - STATE(138), 1, + STATE(186), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, ACTIONS(45), 2, anon_sym_let, - anon_sym_E, - STATE(17), 2, + sym_step_type, + STATE(15), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(43), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [168] = 14, + STATE(31), 2, + sym_detector, + aux_sym_attack_step_repeat2, + [159] = 14, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3508,32 +3527,29 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_LT_DASH, ACTIONS(35), 1, anon_sym_LBRACK, + ACTIONS(47), 1, + anon_sym_RBRACE, STATE(13), 1, sym_ttc, - STATE(47), 1, - sym_detector, - STATE(88), 1, + STATE(120), 1, sym_preconditions, - STATE(160), 1, + STATE(219), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, ACTIONS(49), 2, anon_sym_let, - anon_sym_E, - STATE(15), 2, + sym_step_type, + STATE(16), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(47), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [218] = 12, + STATE(39), 2, + sym_detector, + aux_sym_attack_step_repeat2, + [206] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3542,30 +3558,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(37), 1, - sym_detector, - STATE(93), 1, + ACTIONS(51), 1, + anon_sym_RBRACE, + STATE(97), 1, sym_preconditions, - STATE(161), 1, + STATE(264), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, ACTIONS(53), 2, anon_sym_let, - anon_sym_E, - STATE(8), 2, + sym_step_type, + STATE(30), 2, + sym_detector, + aux_sym_attack_step_repeat2, + STATE(48), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(51), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [262] = 12, + [247] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3574,30 +3587,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(40), 1, - sym_detector, - STATE(108), 1, + ACTIONS(55), 1, + anon_sym_RBRACE, + STATE(96), 1, sym_preconditions, - STATE(125), 1, + STATE(244), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, ACTIONS(57), 2, anon_sym_let, - anon_sym_E, - STATE(29), 2, + sym_step_type, + STATE(8), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(55), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [306] = 12, + STATE(27), 2, + sym_detector, + aux_sym_attack_step_repeat2, + [288] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3606,54 +3616,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(34), 1, - sym_detector, - STATE(97), 1, + ACTIONS(59), 1, + anon_sym_RBRACE, + STATE(103), 1, sym_preconditions, - STATE(131), 1, + STATE(170), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, ACTIONS(61), 2, anon_sym_let, - anon_sym_E, - STATE(29), 2, + sym_step_type, + STATE(33), 2, + sym_detector, + aux_sym_attack_step_repeat2, + STATE(48), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(59), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [350] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(65), 1, - anon_sym_LPAREN, - ACTIONS(67), 1, - anon_sym_DASH, - ACTIONS(63), 16, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - anon_sym_COMMA, - anon_sym_DOT, - anon_sym_RPAREN, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - anon_sym_LBRACK, - anon_sym_STAR, - anon_sym_BSLASH_SLASH, - anon_sym_SLASH_BSLASH, - [378] = 12, + [329] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3662,30 +3645,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(35), 1, - sym_detector, - STATE(109), 1, + ACTIONS(63), 1, + anon_sym_RBRACE, + STATE(106), 1, sym_preconditions, - STATE(137), 1, + STATE(176), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(71), 2, + ACTIONS(65), 2, anon_sym_let, - anon_sym_E, - STATE(29), 2, + sym_step_type, + STATE(11), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(69), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [422] = 12, + STATE(36), 2, + sym_detector, + aux_sym_attack_step_repeat2, + [370] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3694,30 +3674,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(36), 1, - sym_detector, - STATE(104), 1, + ACTIONS(67), 1, + anon_sym_RBRACE, + STATE(107), 1, sym_preconditions, - STATE(136), 1, + STATE(178), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(75), 2, + ACTIONS(69), 2, anon_sym_let, - anon_sym_E, - STATE(12), 2, + sym_step_type, + STATE(26), 2, + sym_detector, + aux_sym_attack_step_repeat2, + STATE(48), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(73), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [466] = 12, + [411] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3726,30 +3703,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(43), 1, - sym_detector, - STATE(79), 1, + ACTIONS(71), 1, + anon_sym_RBRACE, + STATE(114), 1, sym_preconditions, - STATE(150), 1, + STATE(202), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(79), 2, + ACTIONS(73), 2, anon_sym_let, - anon_sym_E, - STATE(29), 2, + sym_step_type, + STATE(32), 2, + sym_detector, + aux_sym_attack_step_repeat2, + STATE(48), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(77), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [510] = 12, + [452] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3758,30 +3732,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(49), 1, - sym_detector, - STATE(67), 1, + ACTIONS(75), 1, + anon_sym_RBRACE, + STATE(94), 1, sym_preconditions, - STATE(175), 1, + STATE(249), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(83), 2, + ACTIONS(77), 2, anon_sym_let, - anon_sym_E, - STATE(18), 2, + sym_step_type, + STATE(43), 2, + sym_detector, + aux_sym_attack_step_repeat2, + STATE(48), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(81), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [554] = 12, + [493] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3790,30 +3761,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(48), 1, - sym_detector, - STATE(94), 1, + ACTIONS(79), 1, + anon_sym_RBRACE, + STATE(125), 1, sym_preconditions, - STATE(169), 1, + STATE(235), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(87), 2, + ACTIONS(81), 2, anon_sym_let, - anon_sym_E, - STATE(29), 2, + sym_step_type, + STATE(12), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(85), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [598] = 12, + STATE(42), 2, + sym_detector, + aux_sym_attack_step_repeat2, + [534] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3822,30 +3790,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(51), 1, - sym_detector, - STATE(101), 1, + ACTIONS(83), 1, + anon_sym_RBRACE, + STATE(117), 1, sym_preconditions, - STATE(176), 1, + STATE(209), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(91), 2, + ACTIONS(85), 2, anon_sym_let, - anon_sym_E, - STATE(29), 2, + sym_step_type, + STATE(17), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(89), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [642] = 12, + STATE(34), 2, + sym_detector, + aux_sym_attack_step_repeat2, + [575] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3854,30 +3819,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(46), 1, - sym_detector, - STATE(83), 1, + ACTIONS(87), 1, + anon_sym_RBRACE, + STATE(118), 1, sym_preconditions, - STATE(156), 1, + STATE(265), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(95), 2, + ACTIONS(89), 2, anon_sym_let, - anon_sym_E, - STATE(14), 2, + sym_step_type, + STATE(35), 2, + sym_detector, + aux_sym_attack_step_repeat2, + STATE(48), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(93), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [686] = 12, + [616] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3886,30 +3848,27 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(45), 1, - sym_detector, - STATE(84), 1, + ACTIONS(91), 1, + anon_sym_RBRACE, + STATE(127), 1, sym_preconditions, - STATE(157), 1, + STATE(238), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(99), 2, + ACTIONS(93), 2, anon_sym_let, - anon_sym_E, - STATE(29), 2, + sym_step_type, + STATE(37), 2, + sym_detector, + aux_sym_attack_step_repeat2, + STATE(48), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(97), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [730] = 12, + [657] = 12, ACTIONS(15), 1, - sym_identity, + sym_identifier, ACTIONS(17), 1, sym_comment, ACTIONS(27), 1, @@ -3918,40 +3877,35 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(52), 1, - sym_detector, - STATE(105), 1, + ACTIONS(95), 1, + anon_sym_RBRACE, + STATE(122), 1, sym_preconditions, - STATE(185), 1, + STATE(226), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(103), 2, + ACTIONS(97), 2, anon_sym_let, - anon_sym_E, - STATE(29), 2, + sym_step_type, + STATE(40), 2, + sym_detector, + aux_sym_attack_step_repeat2, + STATE(48), 2, sym_meta, aux_sym_category_declaration_repeat1, - ACTIONS(101), 5, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - [774] = 3, + [698] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(107), 1, + ACTIONS(101), 1, + anon_sym_LPAREN, + ACTIONS(103), 1, anon_sym_DASH, - ACTIONS(105), 16, + ACTIONS(99), 12, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, anon_sym_COMMA, anon_sym_DOT, anon_sym_RPAREN, @@ -3961,31 +3915,45 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_STAR, anon_sym_BSLASH_SLASH, anon_sym_SLASH_BSLASH, - [799] = 5, + [722] = 5, ACTIONS(17), 1, sym_comment, - ACTIONS(113), 1, + ACTIONS(109), 1, anon_sym_AT, - STATE(20), 1, + STATE(19), 1, aux_sym_attack_step_repeat1, - ACTIONS(109), 4, + ACTIONS(105), 4, anon_sym_let, - anon_sym_E, + sym_step_type, anon_sym_BANG, - sym_identity, - ACTIONS(111), 11, + sym_identifier, + ACTIONS(107), 7, anon_sym_LBRACE, anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, anon_sym_SLASH_SLASH_BANG, anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, anon_sym_LBRACK, - [828] = 6, + [747] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(114), 1, + anon_sym_DASH, + ACTIONS(112), 12, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + anon_sym_COMMA, + anon_sym_DOT, + anon_sym_RPAREN, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + anon_sym_LBRACK, + anon_sym_STAR, + anon_sym_BSLASH_SLASH, + anon_sym_SLASH_BSLASH, + [768] = 6, ACTIONS(3), 1, sym_comment, ACTIONS(118), 1, @@ -3996,55 +3964,45 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_DASH, ACTIONS(124), 1, anon_sym_STAR, - ACTIONS(116), 13, + ACTIONS(116), 9, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, anon_sym_COMMA, anon_sym_RPAREN, anon_sym_PLUS_GT, anon_sym_DASH_GT, anon_sym_BSLASH_SLASH, anon_sym_SLASH_BSLASH, - [859] = 3, + [795] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(128), 1, + ACTIONS(120), 1, + anon_sym_LBRACK, + ACTIONS(122), 1, anon_sym_DASH, - ACTIONS(126), 16, + ACTIONS(124), 1, + anon_sym_STAR, + ACTIONS(116), 10, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, anon_sym_COMMA, anon_sym_DOT, anon_sym_RPAREN, anon_sym_PLUS_GT, anon_sym_DASH_GT, - anon_sym_LBRACK, - anon_sym_STAR, anon_sym_BSLASH_SLASH, anon_sym_SLASH_BSLASH, - [884] = 3, + [820] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(122), 1, + ACTIONS(128), 1, anon_sym_DASH, - ACTIONS(116), 16, + ACTIONS(126), 12, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, anon_sym_COMMA, anon_sym_DOT, anon_sym_RPAREN, @@ -4054,19 +4012,15 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_STAR, anon_sym_BSLASH_SLASH, anon_sym_SLASH_BSLASH, - [909] = 3, + [841] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(132), 1, anon_sym_DASH, - ACTIONS(130), 16, + ACTIONS(130), 12, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, anon_sym_COMMA, anon_sym_DOT, anon_sym_RPAREN, @@ -4076,45 +4030,15 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_STAR, anon_sym_BSLASH_SLASH, anon_sym_SLASH_BSLASH, - [934] = 7, + [862] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(118), 1, - anon_sym_DOT, - ACTIONS(120), 1, - anon_sym_LBRACK, - ACTIONS(124), 1, - anon_sym_STAR, - ACTIONS(134), 1, - anon_sym_DASH, ACTIONS(136), 1, - anon_sym_SLASH_BSLASH, - ACTIONS(116), 12, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - anon_sym_COMMA, - anon_sym_RPAREN, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - anon_sym_BSLASH_SLASH, - [967] = 3, - ACTIONS(3), 1, - sym_comment, - ACTIONS(140), 1, anon_sym_DASH, - ACTIONS(138), 16, + ACTIONS(134), 12, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, anon_sym_COMMA, anon_sym_DOT, anon_sym_RPAREN, @@ -4124,561 +4048,453 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_STAR, anon_sym_BSLASH_SLASH, anon_sym_SLASH_BSLASH, - [992] = 3, + [883] = 9, ACTIONS(17), 1, sym_comment, - ACTIONS(142), 4, - anon_sym_let, - anon_sym_E, + ACTIONS(27), 1, anon_sym_BANG, - sym_identity, - ACTIONS(144), 12, - anon_sym_LBRACE, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - anon_sym_AT, + ACTIONS(29), 1, anon_sym_SLASH_SLASH_BANG, + ACTIONS(31), 1, anon_sym_LT_DASH, + STATE(116), 1, + sym_preconditions, + STATE(206), 1, + sym_reaching, + ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - anon_sym_LBRACK, - [1016] = 8, - ACTIONS(3), 1, - sym_comment, - ACTIONS(118), 1, - anon_sym_DOT, - ACTIONS(120), 1, - anon_sym_LBRACK, - ACTIONS(124), 1, - anon_sym_STAR, - ACTIONS(134), 1, - anon_sym_DASH, - ACTIONS(136), 1, - anon_sym_SLASH_BSLASH, - ACTIONS(148), 1, - anon_sym_BSLASH_SLASH, - ACTIONS(146), 10, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(138), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - anon_sym_COMMA, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - [1050] = 5, + sym_step_type, + [915] = 9, ACTIONS(17), 1, sym_comment, - ACTIONS(150), 1, - sym_identity, - STATE(29), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - ACTIONS(155), 3, - anon_sym_let, - anon_sym_E, + ACTIONS(27), 1, anon_sym_BANG, - ACTIONS(153), 9, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, + ACTIONS(29), 1, anon_sym_SLASH_SLASH_BANG, + ACTIONS(31), 1, anon_sym_LT_DASH, + STATE(104), 1, + sym_preconditions, + STATE(171), 1, + sym_reaching, + ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [1077] = 3, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(140), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [947] = 9, ACTIONS(17), 1, sym_comment, - ACTIONS(157), 4, - anon_sym_let, - anon_sym_E, + ACTIONS(27), 1, anon_sym_BANG, - sym_identity, - ACTIONS(159), 9, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, + ACTIONS(29), 1, anon_sym_SLASH_SLASH_BANG, + ACTIONS(31), 1, anon_sym_LT_DASH, + STATE(109), 1, + sym_preconditions, + STATE(179), 1, + sym_reaching, + ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [1098] = 3, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(142), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [979] = 9, ACTIONS(17), 1, sym_comment, - ACTIONS(161), 4, - anon_sym_let, - anon_sym_E, + ACTIONS(27), 1, anon_sym_BANG, - sym_identity, - ACTIONS(163), 9, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, + ACTIONS(29), 1, anon_sym_SLASH_SLASH_BANG, + ACTIONS(31), 1, anon_sym_LT_DASH, + STATE(99), 1, + sym_preconditions, + STATE(191), 1, + sym_reaching, + ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [1119] = 6, - ACTIONS(3), 1, - sym_comment, - ACTIONS(165), 1, - sym_identity, - ACTIONS(171), 1, - anon_sym_LBRACK, - STATE(78), 1, - sym_ttc, - ACTIONS(169), 2, - anon_sym_let, - anon_sym_E, - ACTIONS(167), 8, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(144), 3, anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - anon_sym_LT_DASH, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - [1146] = 6, - ACTIONS(3), 1, - sym_comment, - ACTIONS(171), 1, - anon_sym_LBRACK, - ACTIONS(173), 1, - sym_identity, - STATE(72), 1, - sym_ttc, - ACTIONS(177), 2, anon_sym_let, - anon_sym_E, - ACTIONS(175), 8, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - anon_sym_LT_DASH, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - [1173] = 6, - ACTIONS(3), 1, + sym_step_type, + [1011] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(76), 1, + STATE(105), 1, sym_preconditions, - STATE(144), 1, + STATE(173), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(179), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(146), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1199] = 6, - ACTIONS(3), 1, - sym_comment, - ACTIONS(31), 1, - anon_sym_LT_DASH, - STATE(80), 1, - sym_preconditions, - STATE(152), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(181), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1225] = 6, - ACTIONS(3), 1, - sym_comment, - ACTIONS(31), 1, - anon_sym_LT_DASH, - STATE(77), 1, - sym_preconditions, - STATE(148), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(183), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1251] = 6, - ACTIONS(3), 1, + sym_step_type, + [1043] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(90), 1, + STATE(119), 1, sym_preconditions, - STATE(129), 1, + STATE(213), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(185), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(148), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1277] = 6, - ACTIONS(3), 1, + sym_step_type, + [1075] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(81), 1, + STATE(121), 1, sym_preconditions, - STATE(154), 1, + STATE(222), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(187), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(150), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1303] = 6, - ACTIONS(3), 1, + sym_step_type, + [1107] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(82), 1, + STATE(113), 1, sym_preconditions, - STATE(192), 1, + STATE(198), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(189), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(152), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1329] = 6, - ACTIONS(3), 1, + sym_step_type, + [1139] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(98), 1, + STATE(123), 1, sym_preconditions, - STATE(132), 1, + STATE(228), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(191), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1355] = 3, - ACTIONS(3), 1, - sym_comment, - ACTIONS(193), 3, - anon_sym_let, - anon_sym_E, - sym_identity, - ACTIONS(195), 9, - anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, - anon_sym_LT_DASH, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - anon_sym_LBRACK, - [1375] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(171), 1, - anon_sym_LBRACK, - STATE(86), 1, - sym_ttc, - ACTIONS(197), 10, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(154), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - anon_sym_LT_DASH, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - [1397] = 6, - ACTIONS(3), 1, + sym_step_type, + [1171] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(91), 1, + STATE(124), 1, sym_preconditions, - STATE(162), 1, + STATE(231), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(199), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(156), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1423] = 6, - ACTIONS(3), 1, + sym_step_type, + [1203] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(99), 1, + STATE(115), 1, sym_preconditions, - STATE(134), 1, + STATE(204), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(201), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(158), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1449] = 6, - ACTIONS(3), 1, + sym_step_type, + [1235] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(95), 1, + STATE(131), 1, sym_preconditions, - STATE(170), 1, + STATE(252), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(203), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(160), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1475] = 6, + sym_step_type, + [1267] = 7, ACTIONS(3), 1, sym_comment, - ACTIONS(31), 1, - anon_sym_LT_DASH, - STATE(92), 1, - sym_preconditions, - STATE(166), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(205), 7, + ACTIONS(118), 1, + anon_sym_DOT, + ACTIONS(120), 1, + anon_sym_LBRACK, + ACTIONS(124), 1, + anon_sym_STAR, + ACTIONS(164), 1, + anon_sym_DASH, + ACTIONS(166), 2, + anon_sym_BSLASH_SLASH, + anon_sym_SLASH_BSLASH, + ACTIONS(162), 6, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1501] = 6, - ACTIONS(3), 1, - sym_comment, - ACTIONS(31), 1, - anon_sym_LT_DASH, - STATE(96), 1, - sym_preconditions, - STATE(173), 1, - sym_reaching, - ACTIONS(33), 2, + sym_step_type, + anon_sym_COMMA, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(207), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1527] = 6, - ACTIONS(3), 1, + [1295] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(102), 1, + STATE(128), 1, sym_preconditions, - STATE(179), 1, + STATE(241), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(209), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(168), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1553] = 6, - ACTIONS(3), 1, + sym_step_type, + [1327] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(103), 1, + STATE(129), 1, sym_preconditions, - STATE(183), 1, + STATE(245), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(211), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(170), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1579] = 3, - ACTIONS(3), 1, + sym_step_type, + [1359] = 3, + ACTIONS(17), 1, sym_comment, - ACTIONS(213), 3, + ACTIONS(105), 4, anon_sym_let, - anon_sym_E, - sym_identity, - ACTIONS(215), 9, + sym_step_type, + anon_sym_BANG, + sym_identifier, + ACTIONS(107), 8, + anon_sym_LBRACE, anon_sym_RBRACE, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_BANGE, + anon_sym_AT, + anon_sym_SLASH_SLASH_BANG, anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, anon_sym_LBRACK, - [1599] = 6, - ACTIONS(3), 1, + [1379] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(106), 1, + STATE(130), 1, sym_preconditions, - STATE(186), 1, + STATE(250), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(217), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(172), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1625] = 6, - ACTIONS(3), 1, + sym_step_type, + [1411] = 9, + ACTIONS(17), 1, sym_comment, + ACTIONS(27), 1, + anon_sym_BANG, + ACTIONS(29), 1, + anon_sym_SLASH_SLASH_BANG, ACTIONS(31), 1, anon_sym_LT_DASH, - STATE(107), 1, + STATE(110), 1, sym_preconditions, - STATE(190), 1, + STATE(257), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(219), 7, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(174), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1651] = 4, - ACTIONS(3), 1, + sym_step_type, + [1443] = 6, + ACTIONS(17), 1, sym_comment, - ACTIONS(171), 1, + ACTIONS(176), 1, + sym_identifier, + ACTIONS(182), 1, anon_sym_LBRACK, - STATE(73), 1, + STATE(67), 1, sym_ttc, - ACTIONS(221), 10, - anon_sym_RBRACE, + ACTIONS(180), 3, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, + anon_sym_BANG, + ACTIONS(178), 5, + anon_sym_RBRACE, + anon_sym_SLASH_SLASH_BANG, anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [1673] = 4, + [1468] = 8, ACTIONS(3), 1, sym_comment, - ACTIONS(225), 1, - anon_sym_COMMA, - STATE(54), 1, - aux_sym_preconditions_repeat1, - ACTIONS(223), 9, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, + ACTIONS(184), 1, + ts_builtin_sym_end, + ACTIONS(186), 1, + anon_sym_include, + ACTIONS(189), 1, + anon_sym_category, + ACTIONS(192), 1, anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - [1694] = 8, + ACTIONS(195), 1, + anon_sym_associations, + STATE(45), 2, + sym_declaration, + aux_sym_source_file_repeat1, + STATE(143), 4, + sym_include_declaration, + sym_category_declaration, + sym_define_declaration, + sym_associations_declaration, + [1497] = 8, ACTIONS(3), 1, sym_comment, ACTIONS(7), 1, @@ -4689,3225 +4505,2909 @@ static const uint16_t ts_small_parse_table[] = { anon_sym_POUND, ACTIONS(13), 1, anon_sym_associations, - ACTIONS(228), 1, + ACTIONS(198), 1, ts_builtin_sym_end, - STATE(64), 2, + STATE(45), 2, sym_declaration, aux_sym_source_file_repeat1, - STATE(209), 4, + STATE(143), 4, sym_include_declaration, sym_category_declaration, sym_define_declaration, sym_associations_declaration, - [1723] = 6, - ACTIONS(3), 1, + [1526] = 6, + ACTIONS(17), 1, sym_comment, - ACTIONS(230), 1, - anon_sym_RBRACE, - ACTIONS(232), 1, + ACTIONS(182), 1, + anon_sym_LBRACK, + ACTIONS(200), 1, + sym_identifier, + STATE(70), 1, + sym_ttc, + ACTIONS(204), 3, anon_sym_let, - STATE(316), 1, - sym_asset_definition, - STATE(85), 3, - sym_asset_variable, - sym_attack_step, - aux_sym_asset_definition_repeat1, - ACTIONS(234), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1748] = 6, - ACTIONS(3), 1, + sym_step_type, + anon_sym_BANG, + ACTIONS(202), 5, + anon_sym_RBRACE, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + [1551] = 5, + ACTIONS(17), 1, sym_comment, - ACTIONS(232), 1, + ACTIONS(206), 1, + sym_identifier, + STATE(48), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + ACTIONS(211), 3, anon_sym_let, - ACTIONS(236), 1, + sym_step_type, + anon_sym_BANG, + ACTIONS(209), 5, anon_sym_RBRACE, - STATE(282), 1, - sym_asset_definition, - STATE(85), 3, - sym_asset_variable, - sym_attack_step, - aux_sym_asset_definition_repeat1, - ACTIONS(234), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1773] = 4, - ACTIONS(3), 1, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + [1574] = 3, + ACTIONS(17), 1, sym_comment, - ACTIONS(240), 1, - anon_sym_COMMA, - STATE(65), 1, - aux_sym_preconditions_repeat1, - ACTIONS(238), 9, - anon_sym_RBRACE, + ACTIONS(213), 4, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, + anon_sym_BANG, + sym_identifier, + ACTIONS(215), 6, + anon_sym_RBRACE, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [1794] = 6, + anon_sym_LBRACK, + [1592] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(232), 1, - anon_sym_let, - ACTIONS(242), 1, - anon_sym_RBRACE, - STATE(323), 1, - sym_asset_definition, - STATE(85), 3, - sym_asset_variable, - sym_attack_step, - aux_sym_asset_definition_repeat1, - ACTIONS(234), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1819] = 6, - ACTIONS(3), 1, + ACTIONS(217), 1, + sym_identifier, + ACTIONS(219), 1, + anon_sym_LPAREN, + ACTIONS(221), 2, + sym_integer, + sym_float, + STATE(102), 6, + sym__ttc_expr, + sym__ttc_parenthesized, + sym__ttc_primary, + sym_ttc_distribution, + sym_ttc_binop, + sym__number, + [1614] = 5, + ACTIONS(17), 1, sym_comment, - ACTIONS(232), 1, - anon_sym_let, - ACTIONS(244), 1, + ACTIONS(182), 1, + anon_sym_LBRACK, + ACTIONS(225), 1, + anon_sym_BANG, + STATE(72), 1, + sym_ttc, + ACTIONS(223), 7, anon_sym_RBRACE, - STATE(301), 1, - sym_asset_definition, - STATE(85), 3, - sym_asset_variable, - sym_attack_step, - aux_sym_asset_definition_repeat1, - ACTIONS(234), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1844] = 6, + anon_sym_let, + sym_step_type, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + [1636] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(232), 1, + ACTIONS(217), 1, + sym_identifier, + ACTIONS(219), 1, + anon_sym_LPAREN, + ACTIONS(227), 2, + sym_integer, + sym_float, + STATE(95), 6, + sym__ttc_expr, + sym__ttc_parenthesized, + sym__ttc_primary, + sym_ttc_distribution, + sym_ttc_binop, + sym__number, + [1658] = 3, + ACTIONS(17), 1, + sym_comment, + ACTIONS(229), 4, anon_sym_let, - ACTIONS(246), 1, + sym_step_type, + anon_sym_BANG, + sym_identifier, + ACTIONS(231), 6, anon_sym_RBRACE, - STATE(279), 1, - sym_asset_definition, - STATE(85), 3, - sym_asset_variable, - sym_attack_step, - aux_sym_asset_definition_repeat1, - ACTIONS(234), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1869] = 6, - ACTIONS(3), 1, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + anon_sym_LBRACK, + [1676] = 5, + ACTIONS(17), 1, sym_comment, - ACTIONS(232), 1, - anon_sym_let, - ACTIONS(248), 1, + ACTIONS(235), 1, + anon_sym_BANG, + ACTIONS(238), 1, + anon_sym_SLASH_SLASH_BANG, + STATE(54), 2, + sym_detector, + aux_sym_attack_step_repeat2, + ACTIONS(233), 6, anon_sym_RBRACE, - STATE(313), 1, - sym_asset_definition, - STATE(85), 3, - sym_asset_variable, - sym_attack_step, - aux_sym_asset_definition_repeat1, - ACTIONS(234), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1894] = 6, + anon_sym_let, + sym_step_type, + anon_sym_LT_DASH, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + [1698] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(232), 1, - anon_sym_let, - ACTIONS(250), 1, - anon_sym_RBRACE, - STATE(280), 1, - sym_asset_definition, - STATE(85), 3, - sym_asset_variable, - sym_attack_step, - aux_sym_asset_definition_repeat1, - ACTIONS(234), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1919] = 8, + ACTIONS(217), 1, + sym_identifier, + ACTIONS(219), 1, + anon_sym_LPAREN, + ACTIONS(241), 2, + sym_integer, + sym_float, + STATE(132), 6, + sym__ttc_expr, + sym__ttc_parenthesized, + sym__ttc_primary, + sym_ttc_distribution, + sym_ttc_binop, + sym__number, + [1720] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(252), 1, - ts_builtin_sym_end, - ACTIONS(254), 1, - anon_sym_include, - ACTIONS(257), 1, - anon_sym_category, - ACTIONS(260), 1, - anon_sym_POUND, - ACTIONS(263), 1, - anon_sym_associations, - STATE(64), 2, - sym_declaration, - aux_sym_source_file_repeat1, - STATE(209), 4, - sym_include_declaration, - sym_category_declaration, - sym_define_declaration, - sym_associations_declaration, - [1948] = 4, + ACTIONS(217), 1, + sym_identifier, + ACTIONS(219), 1, + anon_sym_LPAREN, + ACTIONS(243), 2, + sym_integer, + sym_float, + STATE(87), 6, + sym__ttc_expr, + sym__ttc_parenthesized, + sym__ttc_primary, + sym_ttc_distribution, + sym_ttc_binop, + sym__number, + [1742] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(240), 1, - anon_sym_COMMA, - STATE(54), 1, - aux_sym_preconditions_repeat1, - ACTIONS(266), 9, + ACTIONS(217), 1, + sym_identifier, + ACTIONS(219), 1, + anon_sym_LPAREN, + ACTIONS(245), 2, + sym_integer, + sym_float, + STATE(75), 6, + sym__ttc_expr, + sym__ttc_parenthesized, + sym__ttc_primary, + sym_ttc_distribution, + sym_ttc_binop, + sym__number, + [1764] = 5, + ACTIONS(17), 1, + sym_comment, + ACTIONS(182), 1, + anon_sym_LBRACK, + ACTIONS(249), 1, + anon_sym_BANG, + STATE(68), 1, + sym_ttc, + ACTIONS(247), 7, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [1969] = 6, + [1786] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(232), 1, - anon_sym_let, - ACTIONS(268), 1, - anon_sym_RBRACE, - STATE(298), 1, - sym_asset_definition, - STATE(85), 3, - sym_asset_variable, - sym_attack_step, - aux_sym_asset_definition_repeat1, - ACTIONS(234), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [1994] = 4, + ACTIONS(217), 1, + sym_identifier, + ACTIONS(219), 1, + anon_sym_LPAREN, + ACTIONS(251), 2, + sym_integer, + sym_float, + STATE(85), 6, + sym__ttc_expr, + sym__ttc_parenthesized, + sym__ttc_primary, + sym_ttc_distribution, + sym_ttc_binop, + sym__number, + [1808] = 5, ACTIONS(3), 1, sym_comment, - STATE(184), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(270), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2014] = 4, + ACTIONS(253), 1, + sym_identifier, + ACTIONS(255), 1, + anon_sym_LPAREN, + STATE(240), 1, + sym_asset_expr, + STATE(38), 6, + sym__inline_asset_expr, + sym__asset_expr_primary, + sym_asset_variable_substitution, + sym_asset_expr_type, + sym_asset_expr_binop, + sym_asset_expr_unop, + [1829] = 5, ACTIONS(3), 1, sym_comment, - STATE(135), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(272), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2034] = 4, + ACTIONS(253), 1, + sym_identifier, + ACTIONS(255), 1, + anon_sym_LPAREN, + STATE(152), 1, + sym_asset_expr, + STATE(38), 6, + sym__inline_asset_expr, + sym__asset_expr_primary, + sym_asset_variable_substitution, + sym_asset_expr_type, + sym_asset_expr_binop, + sym_asset_expr_unop, + [1850] = 5, ACTIONS(3), 1, sym_comment, - STATE(194), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(274), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2054] = 5, + ACTIONS(253), 1, + sym_identifier, + ACTIONS(255), 1, + anon_sym_LPAREN, + STATE(91), 1, + sym_asset_expr, + STATE(38), 6, + sym__inline_asset_expr, + sym__asset_expr_primary, + sym_asset_variable_substitution, + sym_asset_expr_type, + sym_asset_expr_binop, + sym_asset_expr_unop, + [1871] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(276), 1, - anon_sym_RBRACE, - ACTIONS(278), 1, - anon_sym_let, - STATE(70), 3, - sym_asset_variable, - sym_attack_step, - aux_sym_asset_definition_repeat1, - ACTIONS(281), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2076] = 4, - ACTIONS(3), 1, + ACTIONS(253), 1, + sym_identifier, + ACTIONS(255), 1, + anon_sym_LPAREN, + STATE(111), 1, + sym_asset_expr, + STATE(38), 6, + sym__inline_asset_expr, + sym__asset_expr_primary, + sym_asset_variable_substitution, + sym_asset_expr_type, + sym_asset_expr_binop, + sym_asset_expr_unop, + [1892] = 3, + ACTIONS(17), 1, sym_comment, - STATE(155), 1, - sym_reaching, - ACTIONS(33), 2, + ACTIONS(257), 4, + anon_sym_let, + sym_step_type, + anon_sym_BANG, + sym_identifier, + ACTIONS(259), 5, + anon_sym_RBRACE, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(284), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2096] = 2, - ACTIONS(3), 1, + [1909] = 3, + ACTIONS(17), 1, sym_comment, - ACTIONS(286), 10, - anon_sym_RBRACE, + ACTIONS(261), 4, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, + anon_sym_BANG, + sym_identifier, + ACTIONS(263), 5, + anon_sym_RBRACE, + anon_sym_SLASH_SLASH_BANG, anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [2112] = 2, + [1926] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(288), 10, + ACTIONS(265), 1, + anon_sym_LPAREN, + ACTIONS(269), 1, + anon_sym_SLASH, + ACTIONS(267), 6, + anon_sym_RPAREN, + anon_sym_RBRACK, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_CARET, + [1944] = 3, + ACTIONS(17), 1, + sym_comment, + ACTIONS(273), 1, + anon_sym_BANG, + ACTIONS(271), 7, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, + anon_sym_SLASH_SLASH_BANG, anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [2128] = 2, - ACTIONS(3), 1, + [1960] = 3, + ACTIONS(17), 1, sym_comment, - ACTIONS(223), 10, + ACTIONS(277), 1, + anon_sym_BANG, + ACTIONS(275), 7, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - anon_sym_COMMA, + sym_step_type, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [2144] = 5, + [1976] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(290), 1, - sym_identity, - ACTIONS(292), 1, + ACTIONS(253), 1, + sym_identifier, + ACTIONS(255), 1, anon_sym_LPAREN, - ACTIONS(294), 2, - sym_integer, - sym_float, - STATE(196), 6, - sym__ttc_expr, - sym__ttc_parenthesized, - sym__ttc_primary, - sym_ttc_distribution, - sym_ttc_binop, - sym__number, - [2166] = 4, - ACTIONS(3), 1, + STATE(22), 6, + sym__inline_asset_expr, + sym__asset_expr_primary, + sym_asset_variable_substitution, + sym_asset_expr_type, + sym_asset_expr_binop, + sym_asset_expr_unop, + [1994] = 3, + ACTIONS(17), 1, sym_comment, - STATE(159), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(296), 7, + ACTIONS(281), 1, + anon_sym_BANG, + ACTIONS(279), 7, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2186] = 4, - ACTIONS(3), 1, - sym_comment, - STATE(195), 1, - sym_reaching, - ACTIONS(33), 2, + sym_step_type, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(298), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2206] = 2, + [2010] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(300), 10, + ACTIONS(253), 1, + sym_identifier, + ACTIONS(255), 1, + anon_sym_LPAREN, + STATE(92), 6, + sym__inline_asset_expr, + sym__asset_expr_primary, + sym_asset_variable_substitution, + sym_asset_expr_type, + sym_asset_expr_binop, + sym_asset_expr_unop, + [2028] = 3, + ACTIONS(17), 1, + sym_comment, + ACTIONS(285), 1, + anon_sym_BANG, + ACTIONS(283), 7, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, + sym_step_type, + anon_sym_SLASH_SLASH_BANG, anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [2222] = 4, - ACTIONS(3), 1, + [2044] = 3, + ACTIONS(17), 1, sym_comment, - STATE(163), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(302), 7, + ACTIONS(257), 1, + anon_sym_BANG, + ACTIONS(259), 7, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2242] = 4, - ACTIONS(3), 1, - sym_comment, - STATE(164), 1, - sym_reaching, - ACTIONS(33), 2, + sym_step_type, + anon_sym_SLASH_SLASH_BANG, + anon_sym_LT_DASH, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(304), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2262] = 4, + [2060] = 4, ACTIONS(3), 1, sym_comment, - STATE(165), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(306), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2282] = 4, + ACTIONS(253), 1, + sym_identifier, + ACTIONS(255), 1, + anon_sym_LPAREN, + STATE(21), 6, + sym__inline_asset_expr, + sym__asset_expr_primary, + sym_asset_variable_substitution, + sym_asset_expr_type, + sym_asset_expr_binop, + sym_asset_expr_unop, + [2078] = 4, ACTIONS(3), 1, sym_comment, - STATE(128), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(308), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2302] = 4, + ACTIONS(289), 1, + anon_sym_SLASH, + ACTIONS(291), 1, + anon_sym_CARET, + ACTIONS(287), 5, + anon_sym_RPAREN, + anon_sym_RBRACK, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + [2095] = 6, ACTIONS(3), 1, sym_comment, - STATE(167), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(310), 7, + ACTIONS(293), 1, anon_sym_RBRACE, + ACTIONS(295), 1, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2322] = 4, + ACTIONS(297), 1, + sym_step_type, + STATE(318), 1, + sym_asset_definition, + STATE(108), 3, + sym_asset_variable, + sym_attack_step, + aux_sym_asset_definition_repeat1, + [2116] = 6, ACTIONS(3), 1, sym_comment, - STATE(171), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(312), 7, - anon_sym_RBRACE, + ACTIONS(295), 1, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2342] = 5, + ACTIONS(297), 1, + sym_step_type, + ACTIONS(299), 1, + anon_sym_RBRACE, + STATE(281), 1, + sym_asset_definition, + STATE(108), 3, + sym_asset_variable, + sym_attack_step, + aux_sym_asset_definition_repeat1, + [2137] = 6, ACTIONS(3), 1, sym_comment, - ACTIONS(232), 1, + ACTIONS(295), 1, anon_sym_let, - ACTIONS(314), 1, + ACTIONS(297), 1, + sym_step_type, + ACTIONS(301), 1, anon_sym_RBRACE, - STATE(70), 3, + STATE(306), 1, + sym_asset_definition, + STATE(108), 3, sym_asset_variable, sym_attack_step, aux_sym_asset_definition_repeat1, - ACTIONS(234), 5, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2364] = 2, + [2158] = 3, + ACTIONS(3), 1, + sym_comment, + ACTIONS(305), 1, + anon_sym_SLASH, + ACTIONS(303), 6, + anon_sym_RPAREN, + anon_sym_RBRACK, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_CARET, + [2173] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(316), 10, + ACTIONS(309), 1, + anon_sym_COMMA, + STATE(80), 1, + aux_sym_preconditions_repeat1, + ACTIONS(307), 5, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - anon_sym_LT_DASH, + sym_step_type, anon_sym_PLUS_GT, anon_sym_DASH_GT, - [2380] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(290), 1, - sym_identity, - ACTIONS(292), 1, - anon_sym_LPAREN, - ACTIONS(318), 2, - sym_integer, - sym_float, - STATE(141), 6, - sym__ttc_expr, - sym__ttc_parenthesized, - sym__ttc_primary, - sym_ttc_distribution, - sym_ttc_binop, - sym__number, - [2402] = 4, + [2190] = 6, ACTIONS(3), 1, sym_comment, - STATE(174), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(320), 7, - anon_sym_RBRACE, + ACTIONS(295), 1, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2422] = 5, + ACTIONS(297), 1, + sym_step_type, + ACTIONS(312), 1, + anon_sym_RBRACE, + STATE(323), 1, + sym_asset_definition, + STATE(108), 3, + sym_asset_variable, + sym_attack_step, + aux_sym_asset_definition_repeat1, + [2211] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(290), 1, - sym_identity, - ACTIONS(292), 1, - anon_sym_LPAREN, - ACTIONS(322), 2, - sym_integer, - sym_float, - STATE(142), 6, - sym__ttc_expr, - sym__ttc_parenthesized, - sym__ttc_primary, - sym_ttc_distribution, - sym_ttc_binop, - sym__number, - [2444] = 4, + ACTIONS(316), 1, + anon_sym_SLASH, + ACTIONS(314), 6, + anon_sym_RPAREN, + anon_sym_RBRACK, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_CARET, + [2226] = 3, ACTIONS(3), 1, sym_comment, - STATE(143), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(324), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2464] = 4, + ACTIONS(320), 1, + anon_sym_SLASH, + ACTIONS(318), 6, + anon_sym_RPAREN, + anon_sym_RBRACK, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_CARET, + [2241] = 3, ACTIONS(3), 1, sym_comment, - STATE(177), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(326), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2484] = 4, + ACTIONS(324), 1, + anon_sym_SLASH, + ACTIONS(322), 6, + anon_sym_RPAREN, + anon_sym_RBRACK, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + anon_sym_CARET, + [2256] = 5, ACTIONS(3), 1, sym_comment, - STATE(178), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(328), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2504] = 4, + ACTIONS(291), 1, + anon_sym_CARET, + ACTIONS(326), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_SLASH, + ACTIONS(287), 4, + anon_sym_RPAREN, + anon_sym_RBRACK, + anon_sym_PLUS, + anon_sym_DASH, + [2275] = 4, ACTIONS(3), 1, sym_comment, - STATE(130), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(330), 7, + ACTIONS(332), 1, + anon_sym_COMMA, + STATE(80), 1, + aux_sym_preconditions_repeat1, + ACTIONS(330), 5, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2524] = 4, - ACTIONS(3), 1, - sym_comment, - STATE(180), 1, - sym_reaching, - ACTIONS(33), 2, + sym_step_type, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(332), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2544] = 4, + [2292] = 4, ACTIONS(3), 1, sym_comment, - STATE(181), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(334), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2564] = 4, + ACTIONS(289), 1, + anon_sym_SLASH, + ACTIONS(291), 1, + anon_sym_CARET, + ACTIONS(287), 5, + anon_sym_RPAREN, + anon_sym_RBRACK, + anon_sym_PLUS, + anon_sym_DASH, + anon_sym_STAR, + [2309] = 6, ACTIONS(3), 1, sym_comment, - STATE(182), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(336), 7, - anon_sym_RBRACE, + ACTIONS(295), 1, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2584] = 4, + ACTIONS(297), 1, + sym_step_type, + ACTIONS(334), 1, + anon_sym_RBRACE, + STATE(321), 1, + sym_asset_definition, + STATE(108), 3, + sym_asset_variable, + sym_attack_step, + aux_sym_asset_definition_repeat1, + [2330] = 6, ACTIONS(3), 1, sym_comment, - STATE(145), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(338), 7, - anon_sym_RBRACE, + ACTIONS(295), 1, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2604] = 4, + ACTIONS(297), 1, + sym_step_type, + ACTIONS(336), 1, + anon_sym_RBRACE, + STATE(278), 1, + sym_asset_definition, + STATE(108), 3, + sym_asset_variable, + sym_attack_step, + aux_sym_asset_definition_repeat1, + [2351] = 6, ACTIONS(3), 1, sym_comment, - STATE(146), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(340), 7, - anon_sym_RBRACE, + ACTIONS(295), 1, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2624] = 4, + ACTIONS(297), 1, + sym_step_type, + ACTIONS(338), 1, + anon_sym_RBRACE, + STATE(313), 1, + sym_asset_definition, + STATE(108), 3, + sym_asset_variable, + sym_attack_step, + aux_sym_asset_definition_repeat1, + [2372] = 4, ACTIONS(3), 1, sym_comment, - STATE(147), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(342), 7, + ACTIONS(332), 1, + anon_sym_COMMA, + STATE(86), 1, + aux_sym_preconditions_repeat1, + ACTIONS(340), 5, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2644] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(290), 1, - sym_identity, - ACTIONS(292), 1, - anon_sym_LPAREN, - ACTIONS(344), 2, - sym_integer, - sym_float, - STATE(198), 6, - sym__ttc_expr, - sym__ttc_parenthesized, - sym__ttc_primary, - sym_ttc_distribution, - sym_ttc_binop, - sym__number, - [2666] = 4, - ACTIONS(3), 1, - sym_comment, - STATE(187), 1, - sym_reaching, - ACTIONS(33), 2, + sym_step_type, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(346), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2686] = 4, + [2389] = 6, ACTIONS(3), 1, sym_comment, - STATE(188), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(348), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2706] = 4, + ACTIONS(118), 1, + anon_sym_DOT, + ACTIONS(120), 1, + anon_sym_LBRACK, + ACTIONS(124), 1, + anon_sym_STAR, + ACTIONS(342), 1, + anon_sym_RPAREN, + ACTIONS(166), 3, + anon_sym_DASH, + anon_sym_BSLASH_SLASH, + anon_sym_SLASH_BSLASH, + [2410] = 6, ACTIONS(3), 1, sym_comment, - STATE(189), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(350), 7, - anon_sym_RBRACE, + ACTIONS(295), 1, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2726] = 4, + ACTIONS(297), 1, + sym_step_type, + ACTIONS(344), 1, + anon_sym_RBRACE, + STATE(283), 1, + sym_asset_definition, + STATE(108), 3, + sym_asset_variable, + sym_attack_step, + aux_sym_asset_definition_repeat1, + [2431] = 4, ACTIONS(3), 1, sym_comment, - STATE(149), 1, + STATE(255), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(352), 7, + ACTIONS(346), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2746] = 4, + sym_step_type, + [2447] = 6, ACTIONS(3), 1, sym_comment, - STATE(191), 1, - sym_reaching, - ACTIONS(33), 2, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - ACTIONS(354), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2766] = 4, + ACTIONS(291), 1, + anon_sym_CARET, + ACTIONS(326), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_SLASH, + ACTIONS(348), 1, + anon_sym_RBRACK, + ACTIONS(350), 2, + anon_sym_PLUS, + anon_sym_DASH, + [2467] = 4, ACTIONS(3), 1, sym_comment, - STATE(124), 1, + STATE(262), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(356), 7, + ACTIONS(352), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2786] = 4, + sym_step_type, + [2483] = 4, ACTIONS(3), 1, sym_comment, - STATE(193), 1, + STATE(172), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(358), 7, + ACTIONS(354), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2806] = 4, + sym_step_type, + [2499] = 4, ACTIONS(3), 1, sym_comment, - STATE(133), 1, + STATE(174), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(360), 7, + ACTIONS(356), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2826] = 4, + sym_step_type, + [2515] = 4, ACTIONS(3), 1, sym_comment, - STATE(153), 1, + STATE(180), 1, sym_reaching, ACTIONS(33), 2, anon_sym_PLUS_GT, anon_sym_DASH_GT, - ACTIONS(362), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2846] = 2, - ACTIONS(3), 1, - sym_comment, - ACTIONS(159), 10, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - anon_sym_LT_DASH, - anon_sym_PLUS_GT, - anon_sym_DASH_GT, - [2862] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(290), 1, - sym_identity, - ACTIONS(292), 1, - anon_sym_LPAREN, - ACTIONS(364), 2, - sym_integer, - sym_float, - STATE(200), 6, - sym__ttc_expr, - sym__ttc_parenthesized, - sym__ttc_primary, - sym_ttc_distribution, - sym_ttc_binop, - sym__number, - [2884] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(290), 1, - sym_identity, - ACTIONS(292), 1, - anon_sym_LPAREN, - ACTIONS(366), 2, - sym_integer, - sym_float, - STATE(140), 6, - sym__ttc_expr, - sym__ttc_parenthesized, - sym__ttc_primary, - sym_ttc_distribution, - sym_ttc_binop, - sym__number, - [2906] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(240), 1, - anon_sym_COMMA, - STATE(54), 1, - aux_sym_preconditions_repeat1, - ACTIONS(368), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2925] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(370), 1, - sym_identity, - ACTIONS(372), 1, - anon_sym_LPAREN, - STATE(115), 1, - sym_asset_expr, - STATE(28), 6, - sym__inline_asset_expr, - sym__asset_expr_primary, - sym_asset_variable_substitution, - sym_asset_expr_type, - sym_asset_expr_binop, - sym_asset_expr_unop, - [2946] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(240), 1, - anon_sym_COMMA, - STATE(113), 1, - aux_sym_preconditions_repeat1, - ACTIONS(374), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [2965] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(370), 1, - sym_identity, - ACTIONS(372), 1, - anon_sym_LPAREN, - STATE(58), 1, - sym_asset_expr, - STATE(28), 6, - sym__inline_asset_expr, - sym__asset_expr_primary, - sym_asset_variable_substitution, - sym_asset_expr_type, - sym_asset_expr_binop, - sym_asset_expr_unop, - [2986] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(370), 1, - sym_identity, - ACTIONS(372), 1, - anon_sym_LPAREN, - STATE(168), 1, - sym_asset_expr, - STATE(28), 6, - sym__inline_asset_expr, - sym__asset_expr_primary, - sym_asset_variable_substitution, - sym_asset_expr_type, - sym_asset_expr_binop, - sym_asset_expr_unop, - [3007] = 5, - ACTIONS(3), 1, - sym_comment, - ACTIONS(370), 1, - sym_identity, - ACTIONS(372), 1, - anon_sym_LPAREN, - STATE(74), 1, - sym_asset_expr, - STATE(28), 6, - sym__inline_asset_expr, - sym__asset_expr_primary, - sym_asset_variable_substitution, - sym_asset_expr_type, - sym_asset_expr_binop, - sym_asset_expr_unop, - [3028] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(370), 1, - sym_identity, - ACTIONS(372), 1, - anon_sym_LPAREN, - STATE(127), 6, - sym__inline_asset_expr, - sym__asset_expr_primary, - sym_asset_variable_substitution, - sym_asset_expr_type, - sym_asset_expr_binop, - sym_asset_expr_unop, - [3046] = 4, - ACTIONS(3), 1, - sym_comment, - ACTIONS(370), 1, - sym_identity, - ACTIONS(372), 1, - anon_sym_LPAREN, - STATE(21), 6, - sym__inline_asset_expr, - sym__asset_expr_primary, - sym_asset_variable_substitution, - sym_asset_expr_type, - sym_asset_expr_binop, - sym_asset_expr_unop, - [3064] = 4, + ACTIONS(358), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [2531] = 6, ACTIONS(3), 1, sym_comment, - ACTIONS(370), 1, - sym_identity, - ACTIONS(372), 1, - anon_sym_LPAREN, - STATE(23), 6, - sym__inline_asset_expr, - sym__asset_expr_primary, - sym_asset_variable_substitution, - sym_asset_expr_type, - sym_asset_expr_binop, - sym_asset_expr_unop, - [3082] = 4, + ACTIONS(360), 1, + anon_sym_STAR, + ACTIONS(362), 1, + sym_integer, + STATE(269), 1, + sym_multiplicity_range, + STATE(290), 1, + sym_multiplicity, + STATE(187), 2, + sym__multiplicity_atom, + sym_star, + [2551] = 6, ACTIONS(3), 1, sym_comment, - ACTIONS(370), 1, - sym_identity, - ACTIONS(372), 1, - anon_sym_LPAREN, - STATE(25), 6, - sym__inline_asset_expr, - sym__asset_expr_primary, - sym_asset_variable_substitution, - sym_asset_expr_type, - sym_asset_expr_binop, - sym_asset_expr_unop, - [3100] = 4, + ACTIONS(360), 1, + anon_sym_STAR, + ACTIONS(362), 1, + sym_integer, + STATE(269), 1, + sym_multiplicity_range, + STATE(316), 1, + sym_multiplicity, + STATE(187), 2, + sym__multiplicity_atom, + sym_star, + [2571] = 6, ACTIONS(3), 1, sym_comment, - ACTIONS(376), 1, - anon_sym_LPAREN, - ACTIONS(380), 1, + ACTIONS(291), 1, + anon_sym_CARET, + ACTIONS(326), 1, + anon_sym_STAR, + ACTIONS(328), 1, anon_sym_SLASH, - ACTIONS(378), 6, + ACTIONS(364), 1, anon_sym_RPAREN, - anon_sym_RBRACK, + ACTIONS(350), 2, anon_sym_PLUS, anon_sym_DASH, - anon_sym_STAR, - anon_sym_CARET, - [3118] = 2, + [2591] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(382), 7, + STATE(197), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(366), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3131] = 2, + sym_step_type, + [2607] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(384), 7, + STATE(199), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(368), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3144] = 2, + sym_step_type, + [2623] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(386), 7, + STATE(200), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(370), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3157] = 7, - ACTIONS(3), 1, - sym_comment, - ACTIONS(118), 1, - anon_sym_DOT, - ACTIONS(120), 1, - anon_sym_LBRACK, - ACTIONS(124), 1, - anon_sym_STAR, - ACTIONS(148), 1, - anon_sym_BSLASH_SLASH, - ACTIONS(388), 1, - anon_sym_RPAREN, - ACTIONS(136), 2, - anon_sym_DASH, - anon_sym_SLASH_BSLASH, - [3180] = 2, + sym_step_type, + [2639] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(390), 7, + STATE(169), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(372), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3193] = 2, + sym_step_type, + [2655] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(392), 7, + STATE(205), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(374), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3206] = 2, + sym_step_type, + [2671] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(394), 7, - anon_sym_RBRACE, + ACTIONS(295), 1, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3219] = 2, + ACTIONS(297), 1, + sym_step_type, + ACTIONS(376), 1, + anon_sym_RBRACE, + STATE(112), 3, + sym_asset_variable, + sym_attack_step, + aux_sym_asset_definition_repeat1, + [2689] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(396), 7, + STATE(207), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(378), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3232] = 2, + sym_step_type, + [2705] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(398), 7, + STATE(261), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(380), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3245] = 2, + sym_step_type, + [2721] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(400), 7, + ACTIONS(307), 6, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3258] = 2, + sym_step_type, + anon_sym_COMMA, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + [2733] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(402), 7, + ACTIONS(382), 1, anon_sym_RBRACE, + ACTIONS(384), 1, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3271] = 2, + ACTIONS(387), 1, + sym_step_type, + STATE(112), 3, + sym_asset_variable, + sym_attack_step, + aux_sym_asset_definition_repeat1, + [2751] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(404), 7, + STATE(218), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(390), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3284] = 2, + sym_step_type, + [2767] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(406), 7, + STATE(221), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(392), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3297] = 2, + sym_step_type, + [2783] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(408), 7, + STATE(223), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(394), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3310] = 2, + sym_step_type, + [2799] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(410), 7, + STATE(224), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(396), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3323] = 3, - ACTIONS(3), 1, - sym_comment, - ACTIONS(414), 1, - anon_sym_SLASH, - ACTIONS(412), 6, - anon_sym_RPAREN, - anon_sym_RBRACK, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_STAR, - anon_sym_CARET, - [3338] = 5, + sym_step_type, + [2815] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(418), 1, - anon_sym_STAR, - ACTIONS(420), 1, - anon_sym_SLASH, - ACTIONS(422), 1, - anon_sym_CARET, - ACTIONS(416), 4, - anon_sym_RPAREN, - anon_sym_RBRACK, - anon_sym_PLUS, - anon_sym_DASH, - [3357] = 4, + STATE(225), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(398), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [2831] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(422), 1, - anon_sym_CARET, - ACTIONS(424), 1, - anon_sym_SLASH, - ACTIONS(416), 5, - anon_sym_RPAREN, - anon_sym_RBRACK, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_STAR, - [3374] = 4, + STATE(229), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(400), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [2847] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(422), 1, - anon_sym_CARET, - ACTIONS(424), 1, - anon_sym_SLASH, - ACTIONS(416), 5, - anon_sym_RPAREN, - anon_sym_RBRACK, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_STAR, - [3391] = 2, + STATE(232), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(402), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [2863] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(426), 7, + STATE(234), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(404), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3404] = 2, + sym_step_type, + [2879] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(428), 7, + STATE(242), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(406), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3417] = 2, + sym_step_type, + [2895] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(430), 7, + STATE(243), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(408), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3430] = 2, + sym_step_type, + [2911] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(432), 7, + STATE(246), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(410), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3443] = 2, + sym_step_type, + [2927] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(434), 7, + STATE(247), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(412), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3456] = 2, + sym_step_type, + [2943] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(436), 7, + STATE(248), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(414), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3469] = 2, + sym_step_type, + [2959] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(438), 7, + STATE(237), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(416), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3482] = 2, + sym_step_type, + [2975] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(440), 7, + STATE(251), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(418), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3495] = 2, + sym_step_type, + [2991] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(442), 7, + STATE(253), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(420), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3508] = 2, + sym_step_type, + [3007] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(444), 7, + STATE(254), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(422), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3521] = 2, + sym_step_type, + [3023] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(446), 7, + STATE(258), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(424), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3534] = 2, + sym_step_type, + [3039] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(448), 7, + STATE(259), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(426), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3547] = 2, + sym_step_type, + [3055] = 6, + ACTIONS(3), 1, + sym_comment, + ACTIONS(291), 1, + anon_sym_CARET, + ACTIONS(326), 1, + anon_sym_STAR, + ACTIONS(328), 1, + anon_sym_SLASH, + ACTIONS(428), 1, + anon_sym_RBRACK, + ACTIONS(350), 2, + anon_sym_PLUS, + anon_sym_DASH, + [3075] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(450), 7, + STATE(208), 1, + sym_reaching, + ACTIONS(33), 2, + anon_sym_PLUS_GT, + anon_sym_DASH_GT, + ACTIONS(430), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3560] = 2, + sym_step_type, + [3091] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(452), 7, + ACTIONS(432), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, + ACTIONS(434), 1, + anon_sym_abstract, + ACTIONS(436), 1, + anon_sym_asset, + STATE(141), 2, + sym_asset_declaration, + aux_sym_category_declaration_repeat2, + [3108] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(438), 5, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_category, anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3573] = 2, + anon_sym_associations, + [3119] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(454), 7, + ACTIONS(440), 1, + sym_identifier, + ACTIONS(209), 2, + anon_sym_LBRACE, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3586] = 3, + STATE(136), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3134] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(458), 1, - anon_sym_SLASH, - ACTIONS(456), 6, - anon_sym_RPAREN, - anon_sym_RBRACK, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_STAR, - anon_sym_CARET, - [3601] = 2, + ACTIONS(443), 1, + sym_identifier, + ACTIONS(445), 1, + anon_sym_LBRACE, + ACTIONS(447), 1, + anon_sym_extends, + STATE(168), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3151] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(460), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, + ACTIONS(449), 5, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_category, anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3614] = 2, + anon_sym_associations, + [3162] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(462), 7, + ACTIONS(451), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3627] = 2, + ACTIONS(453), 1, + anon_sym_abstract, + ACTIONS(456), 1, + anon_sym_asset, + STATE(139), 2, + sym_asset_declaration, + aux_sym_category_declaration_repeat2, + [3179] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(464), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, + ACTIONS(459), 5, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_category, anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3640] = 2, + anon_sym_associations, + [3190] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(466), 7, + ACTIONS(434), 1, + anon_sym_abstract, + ACTIONS(436), 1, + anon_sym_asset, + ACTIONS(461), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3653] = 2, + STATE(139), 2, + sym_asset_declaration, + aux_sym_category_declaration_repeat2, + [3207] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(468), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, + ACTIONS(463), 5, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_category, anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3666] = 2, + anon_sym_associations, + [3218] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(470), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, + ACTIONS(465), 5, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_category, anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3679] = 2, + anon_sym_associations, + [3229] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(472), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, + ACTIONS(467), 5, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_category, anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3692] = 2, + anon_sym_associations, + [3240] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(474), 7, + ACTIONS(434), 1, + anon_sym_abstract, + ACTIONS(436), 1, + anon_sym_asset, + ACTIONS(469), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3705] = 2, + STATE(139), 2, + sym_asset_declaration, + aux_sym_category_declaration_repeat2, + [3257] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(476), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3718] = 2, + ACTIONS(443), 1, + sym_identifier, + ACTIONS(471), 1, + anon_sym_LBRACE, + ACTIONS(473), 1, + anon_sym_extends, + STATE(161), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3274] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(478), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, + ACTIONS(475), 5, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_category, anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3731] = 2, + anon_sym_associations, + [3285] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(480), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, + ACTIONS(477), 5, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_category, anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3744] = 2, + anon_sym_associations, + [3296] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(482), 7, + ACTIONS(434), 1, + anon_sym_abstract, + ACTIONS(436), 1, + anon_sym_asset, + ACTIONS(479), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3757] = 2, + STATE(145), 2, + sym_asset_declaration, + aux_sym_category_declaration_repeat2, + [3313] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(484), 7, + ACTIONS(332), 1, + anon_sym_COMMA, + STATE(80), 1, + aux_sym_preconditions_repeat1, + ACTIONS(481), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3770] = 3, + sym_step_type, + [3328] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(488), 1, - anon_sym_SLASH, - ACTIONS(486), 6, - anon_sym_RPAREN, - anon_sym_RBRACK, - anon_sym_PLUS, - anon_sym_DASH, - anon_sym_STAR, - anon_sym_CARET, - [3785] = 2, + ACTIONS(483), 5, + ts_builtin_sym_end, + anon_sym_include, + anon_sym_category, + anon_sym_POUND, + anon_sym_associations, + [3339] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(490), 7, + ACTIONS(332), 1, + anon_sym_COMMA, + STATE(150), 1, + aux_sym_preconditions_repeat1, + ACTIONS(485), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3798] = 2, + sym_step_type, + [3354] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(492), 7, + ACTIONS(487), 1, + sym_identifier, + ACTIONS(490), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3811] = 2, + STATE(167), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3368] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(494), 7, + ACTIONS(492), 1, + sym_identifier, + ACTIONS(494), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3824] = 2, + STATE(165), 2, + sym_association, + aux_sym_associations_declaration_repeat1, + [3382] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(496), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3837] = 2, + ACTIONS(360), 1, + anon_sym_STAR, + ACTIONS(496), 1, + sym_integer, + STATE(274), 2, + sym__multiplicity_atom, + sym_star, + [3396] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(498), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3850] = 2, + ACTIONS(498), 1, + anon_sym_RPAREN, + STATE(194), 1, + sym__number, + ACTIONS(500), 2, + sym_integer, + sym_float, + [3410] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(500), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3863] = 2, + ACTIONS(502), 1, + sym_identifier, + ACTIONS(504), 1, + anon_sym_LBRACE, + STATE(162), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3424] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(502), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3876] = 2, + ACTIONS(502), 1, + sym_identifier, + ACTIONS(506), 1, + anon_sym_LBRACE, + STATE(160), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3438] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(504), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3889] = 2, + ACTIONS(502), 1, + sym_identifier, + ACTIONS(508), 1, + anon_sym_LBRACE, + STATE(136), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3452] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(506), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3902] = 2, + ACTIONS(502), 1, + sym_identifier, + ACTIONS(510), 1, + anon_sym_LBRACE, + STATE(136), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3466] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(508), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3915] = 2, + ACTIONS(502), 1, + sym_identifier, + ACTIONS(512), 1, + anon_sym_LBRACE, + STATE(136), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3480] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(510), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3928] = 2, + ACTIONS(502), 1, + sym_identifier, + ACTIONS(514), 1, + anon_sym_LBRACE, + STATE(136), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3494] = 5, ACTIONS(3), 1, sym_comment, - ACTIONS(512), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3941] = 2, + ACTIONS(516), 1, + sym_identifier, + ACTIONS(518), 1, + anon_sym_LPAREN, + STATE(47), 1, + sym_detector_context, + STATE(266), 1, + sym_detector_name, + [3510] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(514), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3954] = 2, + ACTIONS(502), 1, + sym_identifier, + ACTIONS(520), 1, + anon_sym_LBRACE, + STATE(159), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3524] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(516), 7, + ACTIONS(522), 1, + sym_identifier, + ACTIONS(525), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3967] = 2, + STATE(165), 2, + sym_association, + aux_sym_associations_declaration_repeat1, + [3538] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(518), 7, + ACTIONS(492), 1, + sym_identifier, + ACTIONS(527), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3980] = 2, + STATE(154), 2, + sym_association, + aux_sym_associations_declaration_repeat1, + [3552] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(520), 7, + ACTIONS(529), 1, + sym_identifier, + ACTIONS(532), 1, anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [3993] = 2, + STATE(136), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3566] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(522), 7, - anon_sym_RBRACE, - anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [4006] = 2, + ACTIONS(502), 1, + sym_identifier, + ACTIONS(534), 1, + anon_sym_LBRACE, + STATE(136), 2, + sym_meta, + aux_sym_category_declaration_repeat1, + [3580] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(524), 7, + ACTIONS(536), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [4019] = 2, + sym_step_type, + [3589] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(526), 7, + ACTIONS(538), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [4032] = 2, + sym_step_type, + [3598] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(528), 7, + ACTIONS(540), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [4045] = 2, + sym_step_type, + [3607] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(530), 7, + ACTIONS(542), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [4058] = 2, + sym_step_type, + [3616] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(532), 7, + ACTIONS(544), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [4071] = 2, + sym_step_type, + [3625] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(534), 7, + ACTIONS(546), 3, anon_sym_RBRACE, anon_sym_let, - anon_sym_PIPE, - anon_sym_AMP, - anon_sym_POUND, - anon_sym_E, - anon_sym_BANGE, - [4084] = 6, - ACTIONS(3), 1, - sym_comment, - ACTIONS(418), 1, - anon_sym_STAR, - ACTIONS(420), 1, - anon_sym_SLASH, - ACTIONS(422), 1, - anon_sym_CARET, - ACTIONS(536), 1, - anon_sym_RPAREN, - ACTIONS(538), 2, - anon_sym_PLUS, - anon_sym_DASH, - [4104] = 6, - ACTIONS(3), 1, - sym_comment, - ACTIONS(540), 1, - anon_sym_STAR, - ACTIONS(542), 1, - sym_integer, - STATE(268), 1, - sym_multiplicity_range, - STATE(305), 1, - sym_multiplicity, - STATE(245), 2, - sym__multiplicity_atom, - sym_star, - [4124] = 6, + sym_step_type, + [3634] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(418), 1, - anon_sym_STAR, - ACTIONS(420), 1, - anon_sym_SLASH, - ACTIONS(422), 1, - anon_sym_CARET, - ACTIONS(544), 1, - anon_sym_RBRACK, - ACTIONS(538), 2, - anon_sym_PLUS, - anon_sym_DASH, - [4144] = 6, - ACTIONS(3), 1, - sym_comment, - ACTIONS(540), 1, - anon_sym_STAR, - ACTIONS(542), 1, - sym_integer, - STATE(268), 1, - sym_multiplicity_range, - STATE(291), 1, - sym_multiplicity, - STATE(245), 2, - sym__multiplicity_atom, - sym_star, - [4164] = 6, - ACTIONS(3), 1, - sym_comment, - ACTIONS(418), 1, - anon_sym_STAR, - ACTIONS(420), 1, - anon_sym_SLASH, - ACTIONS(422), 1, - anon_sym_CARET, - ACTIONS(546), 1, - anon_sym_RBRACK, - ACTIONS(538), 2, - anon_sym_PLUS, - anon_sym_DASH, - [4184] = 2, + ACTIONS(548), 3, + anon_sym_RBRACE, + anon_sym_abstract, + anon_sym_asset, + [3643] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(548), 5, - ts_builtin_sym_end, - anon_sym_include, - anon_sym_category, - anon_sym_POUND, - anon_sym_associations, - [4195] = 5, + ACTIONS(550), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3652] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(550), 1, + ACTIONS(552), 3, anon_sym_RBRACE, - ACTIONS(552), 1, - anon_sym_abstract, - ACTIONS(554), 1, - anon_sym_asset, - STATE(217), 2, - sym_asset_declaration, - aux_sym_category_declaration_repeat2, - [4212] = 5, + anon_sym_let, + sym_step_type, + [3661] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(552), 1, - anon_sym_abstract, - ACTIONS(554), 1, - anon_sym_asset, - ACTIONS(556), 1, + ACTIONS(554), 3, anon_sym_RBRACE, - STATE(210), 2, - sym_asset_declaration, - aux_sym_category_declaration_repeat2, - [4229] = 5, + anon_sym_let, + sym_step_type, + [3670] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(558), 1, - sym_identity, - ACTIONS(560), 1, - anon_sym_LBRACE, - ACTIONS(562), 1, - anon_sym_extends, - STATE(221), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4246] = 2, + ACTIONS(556), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3679] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(564), 5, - ts_builtin_sym_end, - anon_sym_include, - anon_sym_category, - anon_sym_POUND, - anon_sym_associations, - [4257] = 2, + ACTIONS(558), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3688] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(566), 5, - ts_builtin_sym_end, - anon_sym_include, - anon_sym_category, - anon_sym_POUND, - anon_sym_associations, - [4268] = 2, + ACTIONS(560), 3, + anon_sym_RBRACE, + anon_sym_abstract, + anon_sym_asset, + [3697] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(568), 5, - ts_builtin_sym_end, - anon_sym_include, - anon_sym_category, - anon_sym_POUND, - anon_sym_associations, - [4279] = 2, + ACTIONS(562), 3, + anon_sym_RBRACE, + anon_sym_abstract, + anon_sym_asset, + [3706] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(570), 5, - ts_builtin_sym_end, - anon_sym_include, - anon_sym_category, - anon_sym_POUND, - anon_sym_associations, - [4290] = 2, + ACTIONS(564), 1, + anon_sym_DOT, + ACTIONS(566), 1, + anon_sym_LPAREN, + STATE(230), 1, + aux_sym_detector_name_repeat1, + [3719] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(572), 5, - ts_builtin_sym_end, - anon_sym_include, - anon_sym_category, - anon_sym_POUND, - anon_sym_associations, - [4301] = 5, + ACTIONS(568), 3, + anon_sym_LBRACK, + anon_sym_LT_DASH_DASH, + anon_sym_DOT_DOT, + [3728] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(552), 1, - anon_sym_abstract, - ACTIONS(554), 1, - anon_sym_asset, - ACTIONS(574), 1, + ACTIONS(570), 1, anon_sym_RBRACE, - STATE(217), 2, - sym_asset_declaration, - aux_sym_category_declaration_repeat2, - [4318] = 5, + ACTIONS(572), 1, + anon_sym_COMMA, + STATE(185), 1, + aux_sym_cias_repeat1, + [3741] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(552), 1, - anon_sym_abstract, - ACTIONS(554), 1, - anon_sym_asset, - ACTIONS(576), 1, + ACTIONS(575), 3, anon_sym_RBRACE, - STATE(202), 2, - sym_asset_declaration, - aux_sym_category_declaration_repeat2, - [4335] = 2, + anon_sym_let, + sym_step_type, + [3750] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(578), 5, - ts_builtin_sym_end, - anon_sym_include, - anon_sym_category, - anon_sym_POUND, - anon_sym_associations, - [4346] = 4, + ACTIONS(579), 1, + anon_sym_DOT_DOT, + ACTIONS(577), 2, + anon_sym_LBRACK, + anon_sym_LT_DASH_DASH, + [3761] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(580), 1, - sym_identity, - ACTIONS(153), 2, - anon_sym_LBRACE, + ACTIONS(581), 3, anon_sym_RBRACE, - STATE(213), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4361] = 2, + anon_sym_abstract, + anon_sym_asset, + [3770] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(583), 5, - ts_builtin_sym_end, - anon_sym_include, - anon_sym_category, - anon_sym_POUND, - anon_sym_associations, - [4372] = 5, + ACTIONS(583), 1, + anon_sym_COMMA, + ACTIONS(585), 1, + anon_sym_RPAREN, + STATE(215), 1, + aux_sym_detector_context_repeat1, + [3783] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(558), 1, - sym_identity, - ACTIONS(585), 1, - anon_sym_LBRACE, ACTIONS(587), 1, - anon_sym_extends, - STATE(227), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4389] = 2, + anon_sym_DOT, + ACTIONS(590), 1, + anon_sym_LPAREN, + STATE(190), 1, + aux_sym_detector_name_repeat1, + [3796] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(589), 5, - ts_builtin_sym_end, - anon_sym_include, - anon_sym_category, - anon_sym_POUND, - anon_sym_associations, - [4400] = 5, + ACTIONS(592), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3805] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(591), 1, + ACTIONS(594), 3, anon_sym_RBRACE, - ACTIONS(593), 1, anon_sym_abstract, - ACTIONS(596), 1, anon_sym_asset, - STATE(217), 2, - sym_asset_declaration, - aux_sym_category_declaration_repeat2, - [4417] = 4, + [3814] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(599), 1, - sym_identity, - ACTIONS(601), 1, + ACTIONS(596), 3, anon_sym_RBRACE, - STATE(222), 2, - sym_association, - aux_sym_associations_declaration_repeat1, - [4431] = 4, + anon_sym_abstract, + anon_sym_asset, + [3823] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identity, - ACTIONS(605), 1, - anon_sym_LBRACE, - STATE(213), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4445] = 5, + ACTIONS(598), 1, + anon_sym_COMMA, + ACTIONS(600), 1, + anon_sym_RPAREN, + STATE(217), 1, + aux_sym_ttc_distribution_repeat1, + [3836] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(607), 1, - sym_identity, - ACTIONS(609), 1, - anon_sym_LPAREN, - STATE(32), 1, - sym_detector_context, - STATE(275), 1, - sym_detector_name, - [4461] = 4, + ACTIONS(602), 3, + anon_sym_RBRACE, + anon_sym_abstract, + anon_sym_asset, + [3845] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identity, - ACTIONS(611), 1, - anon_sym_LBRACE, - STATE(213), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4475] = 4, + ACTIONS(604), 3, + anon_sym_RBRACE, + anon_sym_abstract, + anon_sym_asset, + [3854] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(599), 1, - sym_identity, - ACTIONS(613), 1, + ACTIONS(606), 3, anon_sym_RBRACE, - STATE(228), 2, - sym_association, - aux_sym_associations_declaration_repeat1, - [4489] = 4, + anon_sym_let, + sym_step_type, + [3863] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identity, - ACTIONS(615), 1, - anon_sym_LBRACE, - STATE(213), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4503] = 4, + ACTIONS(608), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3872] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(540), 1, - anon_sym_STAR, - ACTIONS(617), 1, - sym_integer, - STATE(273), 2, - sym__multiplicity_atom, - sym_star, - [4517] = 4, + ACTIONS(610), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3881] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identity, - ACTIONS(619), 1, - anon_sym_LBRACE, - STATE(231), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4531] = 4, + ACTIONS(612), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3890] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identity, - ACTIONS(621), 1, - anon_sym_LBRACE, - STATE(219), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4545] = 4, + ACTIONS(614), 3, + anon_sym_RBRACE, + anon_sym_abstract, + anon_sym_asset, + [3899] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identity, - ACTIONS(623), 1, - anon_sym_LBRACE, - STATE(213), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4559] = 4, + ACTIONS(616), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3908] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(625), 1, - sym_identity, - ACTIONS(628), 1, + ACTIONS(618), 3, anon_sym_RBRACE, - STATE(228), 2, - sym_association, - aux_sym_associations_declaration_repeat1, - [4573] = 4, + anon_sym_abstract, + anon_sym_asset, + [3917] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(630), 1, - sym_identity, - ACTIONS(633), 1, + ACTIONS(620), 3, anon_sym_RBRACE, - STATE(232), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4587] = 4, + anon_sym_let, + sym_step_type, + [3926] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identity, - ACTIONS(635), 1, - anon_sym_LBRACE, - STATE(223), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4601] = 4, + ACTIONS(622), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3935] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(603), 1, - sym_identity, - ACTIONS(637), 1, - anon_sym_LBRACE, - STATE(213), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4615] = 4, + ACTIONS(624), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3944] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(639), 1, - sym_identity, - ACTIONS(642), 1, + ACTIONS(626), 3, anon_sym_RBRACE, - STATE(213), 2, - sym_meta, - aux_sym_category_declaration_repeat1, - [4629] = 2, + anon_sym_let, + sym_step_type, + [3953] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(628), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3962] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(630), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [3971] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(644), 3, + ACTIONS(632), 3, anon_sym_RBRACE, anon_sym_abstract, anon_sym_asset, - [4638] = 2, + [3980] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(646), 3, + ACTIONS(634), 3, anon_sym_RBRACE, anon_sym_abstract, anon_sym_asset, - [4647] = 2, + [3989] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(648), 3, + ACTIONS(636), 3, anon_sym_RBRACE, anon_sym_abstract, anon_sym_asset, - [4656] = 2, + [3998] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(650), 3, + ACTIONS(638), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4007] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(640), 3, anon_sym_RBRACE, anon_sym_abstract, anon_sym_asset, - [4665] = 4, + [4016] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(652), 1, + ACTIONS(642), 1, anon_sym_COMMA, - ACTIONS(655), 1, + ACTIONS(645), 1, anon_sym_RPAREN, - STATE(237), 1, + STATE(215), 1, aux_sym_detector_context_repeat1, - [4678] = 3, + [4029] = 3, ACTIONS(3), 1, sym_comment, - STATE(266), 1, + STATE(271), 1, sym__number, - ACTIONS(657), 2, + ACTIONS(647), 2, sym_integer, sym_float, - [4689] = 4, + [4040] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(659), 1, + ACTIONS(598), 1, anon_sym_COMMA, - ACTIONS(661), 1, + ACTIONS(649), 1, anon_sym_RPAREN, - STATE(250), 1, + STATE(233), 1, aux_sym_ttc_distribution_repeat1, - [4702] = 3, + [4053] = 2, ACTIONS(3), 1, sym_comment, - STATE(242), 1, - sym__number, - ACTIONS(663), 2, - sym_integer, - sym_float, - [4713] = 2, + ACTIONS(651), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4062] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(665), 3, + ACTIONS(653), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4722] = 4, + anon_sym_let, + sym_step_type, + [4071] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(659), 1, + ACTIONS(655), 1, + anon_sym_RBRACE, + ACTIONS(657), 1, anon_sym_COMMA, - ACTIONS(667), 1, - anon_sym_RPAREN, - STATE(239), 1, - aux_sym_ttc_distribution_repeat1, - [4735] = 2, + STATE(185), 1, + aux_sym_cias_repeat1, + [4084] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(163), 3, - anon_sym_LBRACE, + ACTIONS(659), 3, anon_sym_RBRACE, - sym_identity, - [4744] = 2, + anon_sym_let, + sym_step_type, + [4093] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(661), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4102] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(663), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4111] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(665), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4120] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(667), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4129] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(669), 3, - anon_sym_LBRACK, - anon_sym_LT_DASH_DASH, - anon_sym_DOT_DOT, - [4753] = 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4138] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(673), 1, - anon_sym_DOT_DOT, - ACTIONS(671), 2, - anon_sym_LBRACK, - anon_sym_LT_DASH_DASH, - [4764] = 2, + ACTIONS(583), 1, + anon_sym_COMMA, + ACTIONS(671), 1, + anon_sym_RPAREN, + STATE(189), 1, + aux_sym_detector_context_repeat1, + [4151] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(673), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4160] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(675), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4773] = 4, + anon_sym_let, + sym_step_type, + [4169] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(677), 1, + ACTIONS(564), 1, anon_sym_DOT, - ACTIONS(679), 1, + ACTIONS(677), 1, anon_sym_LPAREN, - STATE(263), 1, + STATE(190), 1, aux_sym_detector_name_repeat1, - [4786] = 2, + [4182] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(681), 3, + ACTIONS(679), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4795] = 2, + anon_sym_let, + sym_step_type, + [4191] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(683), 3, + ACTIONS(681), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4804] = 4, + anon_sym_let, + sym_step_type, + [4200] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(685), 1, + ACTIONS(683), 1, anon_sym_COMMA, - ACTIONS(688), 1, + ACTIONS(686), 1, anon_sym_RPAREN, - STATE(250), 1, + STATE(233), 1, aux_sym_ttc_distribution_repeat1, - [4817] = 2, + [4213] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(688), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4222] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(690), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4826] = 4, + anon_sym_let, + sym_step_type, + [4231] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(692), 1, - anon_sym_COMMA, - ACTIONS(694), 1, - anon_sym_RPAREN, - STATE(237), 1, - aux_sym_detector_context_repeat1, - [4839] = 4, + ACTIONS(263), 3, + anon_sym_LBRACE, + anon_sym_RBRACE, + sym_identifier, + [4240] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(677), 1, - anon_sym_DOT, - ACTIONS(696), 1, - anon_sym_LPAREN, - STATE(247), 1, - aux_sym_detector_name_repeat1, - [4852] = 2, + ACTIONS(692), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4249] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(694), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4258] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(696), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4267] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(698), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4861] = 2, + anon_sym_let, + sym_step_type, + [4276] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(700), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4870] = 2, + anon_sym_let, + sym_step_type, + [4285] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(702), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4879] = 4, + anon_sym_let, + sym_step_type, + [4294] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(704), 1, + ACTIONS(704), 3, anon_sym_RBRACE, - ACTIONS(706), 1, - anon_sym_COMMA, - STATE(262), 1, - aux_sym_cias_repeat1, - [4892] = 2, + anon_sym_let, + sym_step_type, + [4303] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(706), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4312] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(708), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4901] = 2, + anon_sym_let, + sym_step_type, + [4321] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(710), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4910] = 2, + anon_sym_let, + sym_step_type, + [4330] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(712), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4919] = 4, + anon_sym_let, + sym_step_type, + [4339] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(692), 1, - anon_sym_COMMA, - ACTIONS(714), 1, - anon_sym_RPAREN, - STATE(252), 1, - aux_sym_detector_context_repeat1, - [4932] = 4, + ACTIONS(714), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4348] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(716), 1, + ACTIONS(716), 3, anon_sym_RBRACE, - ACTIONS(718), 1, - anon_sym_COMMA, - STATE(262), 1, - aux_sym_cias_repeat1, - [4945] = 4, + anon_sym_let, + sym_step_type, + [4357] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(721), 1, - anon_sym_DOT, - ACTIONS(724), 1, - anon_sym_LPAREN, - STATE(263), 1, - aux_sym_detector_name_repeat1, - [4958] = 2, + ACTIONS(718), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4366] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(720), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4375] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(722), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4384] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(724), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4393] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(726), 3, anon_sym_RBRACE, - anon_sym_abstract, - anon_sym_asset, - [4967] = 4, + anon_sym_let, + sym_step_type, + [4402] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(728), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4411] = 4, ACTIONS(3), 1, sym_comment, - ACTIONS(706), 1, + ACTIONS(657), 1, anon_sym_COMMA, - ACTIONS(728), 1, + ACTIONS(730), 1, anon_sym_RBRACE, - STATE(257), 1, + STATE(220), 1, aux_sym_cias_repeat1, - [4980] = 2, + [4424] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(688), 2, - anon_sym_COMMA, - anon_sym_RPAREN, - [4988] = 2, + ACTIONS(732), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4433] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(730), 2, - anon_sym_COMMA, - anon_sym_RPAREN, - [4996] = 2, + ACTIONS(734), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4442] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(671), 2, - anon_sym_LBRACK, - anon_sym_LT_DASH_DASH, - [5004] = 3, + ACTIONS(736), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4451] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(732), 1, - sym_identity, - STATE(277), 1, - sym_detector_context_asset, - [5014] = 3, + ACTIONS(738), 3, + anon_sym_RBRACE, + anon_sym_abstract, + anon_sym_asset, + [4460] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(732), 1, - sym_identity, - STATE(261), 1, - sym_detector_context_asset, - [5024] = 2, + ACTIONS(740), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4469] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(724), 2, - anon_sym_DOT, - anon_sym_LPAREN, - [5032] = 3, + ACTIONS(742), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4478] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(734), 1, - sym_cia, - STATE(278), 1, - sym_cias, - [5042] = 2, + ACTIONS(744), 3, + anon_sym_RBRACE, + anon_sym_abstract, + anon_sym_asset, + [4487] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(736), 2, - anon_sym_LBRACK, - anon_sym_LT_DASH_DASH, - [5050] = 2, + ACTIONS(746), 3, + anon_sym_RBRACE, + anon_sym_let, + sym_step_type, + [4496] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(716), 2, + ACTIONS(748), 3, anon_sym_RBRACE, - anon_sym_COMMA, - [5058] = 3, + anon_sym_let, + sym_step_type, + [4505] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(609), 1, + ACTIONS(518), 1, anon_sym_LPAREN, - STATE(33), 1, + STATE(44), 1, sym_detector_context, - [5068] = 3, + [4515] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(734), 1, - sym_cia, - STATE(283), 1, - sym_cias, - [5078] = 2, + ACTIONS(750), 1, + sym_identifier, + STATE(227), 1, + sym_detector_context_asset, + [4525] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(655), 2, - anon_sym_COMMA, - anon_sym_RPAREN, - [5086] = 2, + ACTIONS(752), 1, + sym_cia, + STATE(304), 1, + sym_cias, + [4535] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(738), 1, - anon_sym_RBRACE, - [5093] = 2, + ACTIONS(577), 2, + anon_sym_LBRACK, + anon_sym_LT_DASH_DASH, + [4543] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(740), 1, - anon_sym_RBRACE, - [5100] = 2, + ACTIONS(754), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [4551] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(742), 1, - anon_sym_RBRACE, - [5107] = 2, + ACTIONS(686), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [4559] = 3, ACTIONS(3), 1, sym_comment, - ACTIONS(744), 1, - anon_sym_RBRACK, - [5114] = 2, + ACTIONS(750), 1, + sym_identifier, + STATE(275), 1, + sym_detector_context_asset, + [4569] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(746), 1, - anon_sym_RBRACE, - [5121] = 2, + ACTIONS(590), 2, + anon_sym_DOT, + anon_sym_LPAREN, + [4577] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(748), 1, - anon_sym_RBRACE, - [5128] = 2, + ACTIONS(756), 2, + anon_sym_LBRACK, + anon_sym_LT_DASH_DASH, + [4585] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(750), 1, - anon_sym_asset, - [5135] = 2, + ACTIONS(645), 2, + anon_sym_COMMA, + anon_sym_RPAREN, + [4593] = 3, ACTIONS(3), 1, sym_comment, ACTIONS(752), 1, - sym_identity, - [5142] = 2, - ACTIONS(3), 1, - sym_comment, - ACTIONS(754), 1, - anon_sym_RPAREN, - [5149] = 2, + sym_cia, + STATE(310), 1, + sym_cias, + [4603] = 2, ACTIONS(3), 1, sym_comment, - ACTIONS(756), 1, - anon_sym_LBRACK, - [5156] = 2, + ACTIONS(570), 2, + anon_sym_RBRACE, + anon_sym_COMMA, + [4611] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(758), 1, - ts_builtin_sym_end, - [5163] = 2, + anon_sym_RBRACE, + [4618] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(760), 1, - anon_sym_LBRACE, - [5170] = 2, + sym_identifier, + [4625] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(762), 1, - sym_identity, - [5177] = 2, + sym_identifier, + [4632] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(764), 1, - anon_sym_LT_DASH_DASH, - [5184] = 2, + anon_sym_RBRACE, + [4639] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(766), 1, - sym_identity, - [5191] = 2, + sym_identifier, + [4646] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(768), 1, - sym_string, - [5198] = 2, + anon_sym_RBRACE, + [4653] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(770), 1, - sym_identity, - [5205] = 2, + anon_sym_asset, + [4660] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(772), 1, - anon_sym_EQ, - [5212] = 2, + sym_identifier, + [4667] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(774), 1, - sym_identity, - [5219] = 2, + sym_identifier, + [4674] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(776), 1, - sym_cia, - [5226] = 2, + anon_sym_DASH_DASH_GT, + [4681] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(778), 1, - anon_sym_RBRACE, - [5233] = 2, + anon_sym_RBRACK, + [4688] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(780), 1, - sym_string, - [5240] = 2, + anon_sym_RPAREN, + [4695] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(782), 1, - anon_sym_DASH_DASH_GT, - [5247] = 2, + anon_sym_LBRACK, + [4702] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(784), 1, - anon_sym_RBRACE, - [5254] = 2, + anon_sym_COLON, + [4709] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(786), 1, - anon_sym_info, - [5261] = 2, + sym_identifier, + [4716] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(788), 1, - sym_identity, - [5268] = 2, + sym_identifier, + [4723] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(790), 1, - anon_sym_COLON, - [5275] = 2, + sym_identifier, + [4730] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(792), 1, - anon_sym_LBRACK, - [5282] = 2, + anon_sym_EQ, + [4737] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(794), 1, - sym_identity, - [5289] = 2, + anon_sym_RBRACK, + [4744] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(796), 1, - anon_sym_COLON, - [5296] = 2, + sym_identifier, + [4751] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(798), 1, - sym_identity, - [5303] = 2, + anon_sym_LBRACK, + [4758] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(800), 1, - sym_identity, - [5310] = 2, + anon_sym_info, + [4765] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(802), 1, - sym_identity, - [5317] = 2, + sym_identifier, + [4772] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(804), 1, - sym_identity, - [5324] = 2, + sym_identifier, + [4779] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(806), 1, - anon_sym_RBRACK, - [5331] = 2, + sym_identifier, + [4786] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(808), 1, - anon_sym_RBRACE, - [5338] = 2, + sym_string, + [4793] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(810), 1, - sym_identity, - [5345] = 2, + anon_sym_RBRACE, + [4800] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(812), 1, - sym_identity, - [5352] = 2, + anon_sym_LBRACE, + [4807] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(814), 1, anon_sym_RBRACE, - [5359] = 2, + [4814] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(816), 1, - sym_identity, - [5366] = 2, + ts_builtin_sym_end, + [4821] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(818), 1, - sym_string, - [5373] = 2, + sym_identifier, + [4828] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(820), 1, - sym_identity, - [5380] = 2, + anon_sym_COLON, + [4835] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(822), 1, - sym_string, - [5387] = 2, + anon_sym_RBRACE, + [4842] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(824), 1, - sym_identity, - [5394] = 2, + anon_sym_RBRACK, + [4849] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(826), 1, - anon_sym_COLON, - [5401] = 2, + sym_cia, + [4856] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(828), 1, anon_sym_RBRACE, - [5408] = 2, + [4863] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(830), 1, - anon_sym_info, - [5415] = 2, + sym_identifier, + [4870] = 2, ACTIONS(3), 1, sym_comment, ACTIONS(832), 1, - anon_sym_RBRACK, + sym_identifier, + [4877] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(834), 1, + anon_sym_LT_DASH_DASH, + [4884] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(836), 1, + sym_string, + [4891] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(838), 1, + anon_sym_RBRACE, + [4898] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(840), 1, + sym_identifier, + [4905] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(842), 1, + sym_string, + [4912] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(844), 1, + anon_sym_RBRACE, + [4919] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(846), 1, + anon_sym_COLON, + [4926] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(848), 1, + anon_sym_RBRACE, + [4933] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(850), 1, + anon_sym_info, + [4940] = 2, + ACTIONS(3), 1, + sym_comment, + ACTIONS(852), 1, + sym_string, }; static const uint32_t ts_small_parse_table_map[] = { [SMALL_STATE(2)] = 0, - [SMALL_STATE(3)] = 59, - [SMALL_STATE(4)] = 118, - [SMALL_STATE(5)] = 168, - [SMALL_STATE(6)] = 218, - [SMALL_STATE(7)] = 262, - [SMALL_STATE(8)] = 306, - [SMALL_STATE(9)] = 350, - [SMALL_STATE(10)] = 378, - [SMALL_STATE(11)] = 422, - [SMALL_STATE(12)] = 466, - [SMALL_STATE(13)] = 510, - [SMALL_STATE(14)] = 554, - [SMALL_STATE(15)] = 598, - [SMALL_STATE(16)] = 642, - [SMALL_STATE(17)] = 686, - [SMALL_STATE(18)] = 730, - [SMALL_STATE(19)] = 774, - [SMALL_STATE(20)] = 799, - [SMALL_STATE(21)] = 828, - [SMALL_STATE(22)] = 859, - [SMALL_STATE(23)] = 884, - [SMALL_STATE(24)] = 909, - [SMALL_STATE(25)] = 934, - [SMALL_STATE(26)] = 967, - [SMALL_STATE(27)] = 992, - [SMALL_STATE(28)] = 1016, - [SMALL_STATE(29)] = 1050, - [SMALL_STATE(30)] = 1077, - [SMALL_STATE(31)] = 1098, - [SMALL_STATE(32)] = 1119, - [SMALL_STATE(33)] = 1146, - [SMALL_STATE(34)] = 1173, - [SMALL_STATE(35)] = 1199, - [SMALL_STATE(36)] = 1225, - [SMALL_STATE(37)] = 1251, - [SMALL_STATE(38)] = 1277, - [SMALL_STATE(39)] = 1303, - [SMALL_STATE(40)] = 1329, - [SMALL_STATE(41)] = 1355, - [SMALL_STATE(42)] = 1375, - [SMALL_STATE(43)] = 1397, - [SMALL_STATE(44)] = 1423, - [SMALL_STATE(45)] = 1449, - [SMALL_STATE(46)] = 1475, - [SMALL_STATE(47)] = 1501, - [SMALL_STATE(48)] = 1527, - [SMALL_STATE(49)] = 1553, - [SMALL_STATE(50)] = 1579, - [SMALL_STATE(51)] = 1599, - [SMALL_STATE(52)] = 1625, - [SMALL_STATE(53)] = 1651, - [SMALL_STATE(54)] = 1673, - [SMALL_STATE(55)] = 1694, - [SMALL_STATE(56)] = 1723, - [SMALL_STATE(57)] = 1748, - [SMALL_STATE(58)] = 1773, - [SMALL_STATE(59)] = 1794, - [SMALL_STATE(60)] = 1819, - [SMALL_STATE(61)] = 1844, - [SMALL_STATE(62)] = 1869, - [SMALL_STATE(63)] = 1894, - [SMALL_STATE(64)] = 1919, - [SMALL_STATE(65)] = 1948, - [SMALL_STATE(66)] = 1969, - [SMALL_STATE(67)] = 1994, - [SMALL_STATE(68)] = 2014, - [SMALL_STATE(69)] = 2034, - [SMALL_STATE(70)] = 2054, - [SMALL_STATE(71)] = 2076, - [SMALL_STATE(72)] = 2096, - [SMALL_STATE(73)] = 2112, - [SMALL_STATE(74)] = 2128, - [SMALL_STATE(75)] = 2144, - [SMALL_STATE(76)] = 2166, - [SMALL_STATE(77)] = 2186, - [SMALL_STATE(78)] = 2206, - [SMALL_STATE(79)] = 2222, - [SMALL_STATE(80)] = 2242, - [SMALL_STATE(81)] = 2262, - [SMALL_STATE(82)] = 2282, - [SMALL_STATE(83)] = 2302, - [SMALL_STATE(84)] = 2322, - [SMALL_STATE(85)] = 2342, - [SMALL_STATE(86)] = 2364, - [SMALL_STATE(87)] = 2380, - [SMALL_STATE(88)] = 2402, - [SMALL_STATE(89)] = 2422, - [SMALL_STATE(90)] = 2444, - [SMALL_STATE(91)] = 2464, - [SMALL_STATE(92)] = 2484, - [SMALL_STATE(93)] = 2504, - [SMALL_STATE(94)] = 2524, - [SMALL_STATE(95)] = 2544, - [SMALL_STATE(96)] = 2564, - [SMALL_STATE(97)] = 2584, - [SMALL_STATE(98)] = 2604, - [SMALL_STATE(99)] = 2624, - [SMALL_STATE(100)] = 2644, - [SMALL_STATE(101)] = 2666, - [SMALL_STATE(102)] = 2686, - [SMALL_STATE(103)] = 2706, - [SMALL_STATE(104)] = 2726, - [SMALL_STATE(105)] = 2746, - [SMALL_STATE(106)] = 2766, - [SMALL_STATE(107)] = 2786, - [SMALL_STATE(108)] = 2806, - [SMALL_STATE(109)] = 2826, - [SMALL_STATE(110)] = 2846, - [SMALL_STATE(111)] = 2862, - [SMALL_STATE(112)] = 2884, - [SMALL_STATE(113)] = 2906, - [SMALL_STATE(114)] = 2925, - [SMALL_STATE(115)] = 2946, - [SMALL_STATE(116)] = 2965, - [SMALL_STATE(117)] = 2986, - [SMALL_STATE(118)] = 3007, - [SMALL_STATE(119)] = 3028, - [SMALL_STATE(120)] = 3046, - [SMALL_STATE(121)] = 3064, - [SMALL_STATE(122)] = 3082, - [SMALL_STATE(123)] = 3100, - [SMALL_STATE(124)] = 3118, - [SMALL_STATE(125)] = 3131, - [SMALL_STATE(126)] = 3144, - [SMALL_STATE(127)] = 3157, - [SMALL_STATE(128)] = 3180, - [SMALL_STATE(129)] = 3193, - [SMALL_STATE(130)] = 3206, - [SMALL_STATE(131)] = 3219, - [SMALL_STATE(132)] = 3232, - [SMALL_STATE(133)] = 3245, - [SMALL_STATE(134)] = 3258, - [SMALL_STATE(135)] = 3271, - [SMALL_STATE(136)] = 3284, - [SMALL_STATE(137)] = 3297, - [SMALL_STATE(138)] = 3310, - [SMALL_STATE(139)] = 3323, - [SMALL_STATE(140)] = 3338, - [SMALL_STATE(141)] = 3357, - [SMALL_STATE(142)] = 3374, - [SMALL_STATE(143)] = 3391, - [SMALL_STATE(144)] = 3404, - [SMALL_STATE(145)] = 3417, - [SMALL_STATE(146)] = 3430, - [SMALL_STATE(147)] = 3443, - [SMALL_STATE(148)] = 3456, - [SMALL_STATE(149)] = 3469, - [SMALL_STATE(150)] = 3482, - [SMALL_STATE(151)] = 3495, - [SMALL_STATE(152)] = 3508, - [SMALL_STATE(153)] = 3521, - [SMALL_STATE(154)] = 3534, - [SMALL_STATE(155)] = 3547, - [SMALL_STATE(156)] = 3560, - [SMALL_STATE(157)] = 3573, - [SMALL_STATE(158)] = 3586, - [SMALL_STATE(159)] = 3601, - [SMALL_STATE(160)] = 3614, - [SMALL_STATE(161)] = 3627, - [SMALL_STATE(162)] = 3640, - [SMALL_STATE(163)] = 3653, - [SMALL_STATE(164)] = 3666, - [SMALL_STATE(165)] = 3679, - [SMALL_STATE(166)] = 3692, - [SMALL_STATE(167)] = 3705, - [SMALL_STATE(168)] = 3718, - [SMALL_STATE(169)] = 3731, - [SMALL_STATE(170)] = 3744, - [SMALL_STATE(171)] = 3757, - [SMALL_STATE(172)] = 3770, - [SMALL_STATE(173)] = 3785, - [SMALL_STATE(174)] = 3798, - [SMALL_STATE(175)] = 3811, - [SMALL_STATE(176)] = 3824, - [SMALL_STATE(177)] = 3837, - [SMALL_STATE(178)] = 3850, - [SMALL_STATE(179)] = 3863, - [SMALL_STATE(180)] = 3876, - [SMALL_STATE(181)] = 3889, - [SMALL_STATE(182)] = 3902, - [SMALL_STATE(183)] = 3915, - [SMALL_STATE(184)] = 3928, - [SMALL_STATE(185)] = 3941, - [SMALL_STATE(186)] = 3954, - [SMALL_STATE(187)] = 3967, - [SMALL_STATE(188)] = 3980, - [SMALL_STATE(189)] = 3993, - [SMALL_STATE(190)] = 4006, - [SMALL_STATE(191)] = 4019, - [SMALL_STATE(192)] = 4032, - [SMALL_STATE(193)] = 4045, - [SMALL_STATE(194)] = 4058, - [SMALL_STATE(195)] = 4071, - [SMALL_STATE(196)] = 4084, - [SMALL_STATE(197)] = 4104, - [SMALL_STATE(198)] = 4124, - [SMALL_STATE(199)] = 4144, - [SMALL_STATE(200)] = 4164, - [SMALL_STATE(201)] = 4184, - [SMALL_STATE(202)] = 4195, - [SMALL_STATE(203)] = 4212, - [SMALL_STATE(204)] = 4229, - [SMALL_STATE(205)] = 4246, - [SMALL_STATE(206)] = 4257, - [SMALL_STATE(207)] = 4268, - [SMALL_STATE(208)] = 4279, - [SMALL_STATE(209)] = 4290, - [SMALL_STATE(210)] = 4301, - [SMALL_STATE(211)] = 4318, - [SMALL_STATE(212)] = 4335, - [SMALL_STATE(213)] = 4346, - [SMALL_STATE(214)] = 4361, - [SMALL_STATE(215)] = 4372, - [SMALL_STATE(216)] = 4389, - [SMALL_STATE(217)] = 4400, - [SMALL_STATE(218)] = 4417, - [SMALL_STATE(219)] = 4431, - [SMALL_STATE(220)] = 4445, - [SMALL_STATE(221)] = 4461, - [SMALL_STATE(222)] = 4475, - [SMALL_STATE(223)] = 4489, - [SMALL_STATE(224)] = 4503, - [SMALL_STATE(225)] = 4517, - [SMALL_STATE(226)] = 4531, - [SMALL_STATE(227)] = 4545, - [SMALL_STATE(228)] = 4559, - [SMALL_STATE(229)] = 4573, - [SMALL_STATE(230)] = 4587, - [SMALL_STATE(231)] = 4601, - [SMALL_STATE(232)] = 4615, - [SMALL_STATE(233)] = 4629, - [SMALL_STATE(234)] = 4638, - [SMALL_STATE(235)] = 4647, - [SMALL_STATE(236)] = 4656, - [SMALL_STATE(237)] = 4665, - [SMALL_STATE(238)] = 4678, - [SMALL_STATE(239)] = 4689, - [SMALL_STATE(240)] = 4702, - [SMALL_STATE(241)] = 4713, - [SMALL_STATE(242)] = 4722, - [SMALL_STATE(243)] = 4735, - [SMALL_STATE(244)] = 4744, - [SMALL_STATE(245)] = 4753, - [SMALL_STATE(246)] = 4764, - [SMALL_STATE(247)] = 4773, - [SMALL_STATE(248)] = 4786, - [SMALL_STATE(249)] = 4795, - [SMALL_STATE(250)] = 4804, - [SMALL_STATE(251)] = 4817, - [SMALL_STATE(252)] = 4826, - [SMALL_STATE(253)] = 4839, - [SMALL_STATE(254)] = 4852, - [SMALL_STATE(255)] = 4861, - [SMALL_STATE(256)] = 4870, - [SMALL_STATE(257)] = 4879, - [SMALL_STATE(258)] = 4892, - [SMALL_STATE(259)] = 4901, - [SMALL_STATE(260)] = 4910, - [SMALL_STATE(261)] = 4919, - [SMALL_STATE(262)] = 4932, - [SMALL_STATE(263)] = 4945, - [SMALL_STATE(264)] = 4958, - [SMALL_STATE(265)] = 4967, - [SMALL_STATE(266)] = 4980, - [SMALL_STATE(267)] = 4988, - [SMALL_STATE(268)] = 4996, - [SMALL_STATE(269)] = 5004, - [SMALL_STATE(270)] = 5014, - [SMALL_STATE(271)] = 5024, - [SMALL_STATE(272)] = 5032, - [SMALL_STATE(273)] = 5042, - [SMALL_STATE(274)] = 5050, - [SMALL_STATE(275)] = 5058, - [SMALL_STATE(276)] = 5068, - [SMALL_STATE(277)] = 5078, - [SMALL_STATE(278)] = 5086, - [SMALL_STATE(279)] = 5093, - [SMALL_STATE(280)] = 5100, - [SMALL_STATE(281)] = 5107, - [SMALL_STATE(282)] = 5114, - [SMALL_STATE(283)] = 5121, - [SMALL_STATE(284)] = 5128, - [SMALL_STATE(285)] = 5135, - [SMALL_STATE(286)] = 5142, - [SMALL_STATE(287)] = 5149, - [SMALL_STATE(288)] = 5156, - [SMALL_STATE(289)] = 5163, - [SMALL_STATE(290)] = 5170, - [SMALL_STATE(291)] = 5177, - [SMALL_STATE(292)] = 5184, - [SMALL_STATE(293)] = 5191, - [SMALL_STATE(294)] = 5198, - [SMALL_STATE(295)] = 5205, - [SMALL_STATE(296)] = 5212, - [SMALL_STATE(297)] = 5219, - [SMALL_STATE(298)] = 5226, - [SMALL_STATE(299)] = 5233, - [SMALL_STATE(300)] = 5240, - [SMALL_STATE(301)] = 5247, - [SMALL_STATE(302)] = 5254, - [SMALL_STATE(303)] = 5261, - [SMALL_STATE(304)] = 5268, - [SMALL_STATE(305)] = 5275, - [SMALL_STATE(306)] = 5282, - [SMALL_STATE(307)] = 5289, - [SMALL_STATE(308)] = 5296, - [SMALL_STATE(309)] = 5303, - [SMALL_STATE(310)] = 5310, - [SMALL_STATE(311)] = 5317, - [SMALL_STATE(312)] = 5324, - [SMALL_STATE(313)] = 5331, - [SMALL_STATE(314)] = 5338, - [SMALL_STATE(315)] = 5345, - [SMALL_STATE(316)] = 5352, - [SMALL_STATE(317)] = 5359, - [SMALL_STATE(318)] = 5366, - [SMALL_STATE(319)] = 5373, - [SMALL_STATE(320)] = 5380, - [SMALL_STATE(321)] = 5387, - [SMALL_STATE(322)] = 5394, - [SMALL_STATE(323)] = 5401, - [SMALL_STATE(324)] = 5408, - [SMALL_STATE(325)] = 5415, + [SMALL_STATE(3)] = 56, + [SMALL_STATE(4)] = 112, + [SMALL_STATE(5)] = 159, + [SMALL_STATE(6)] = 206, + [SMALL_STATE(7)] = 247, + [SMALL_STATE(8)] = 288, + [SMALL_STATE(9)] = 329, + [SMALL_STATE(10)] = 370, + [SMALL_STATE(11)] = 411, + [SMALL_STATE(12)] = 452, + [SMALL_STATE(13)] = 493, + [SMALL_STATE(14)] = 534, + [SMALL_STATE(15)] = 575, + [SMALL_STATE(16)] = 616, + [SMALL_STATE(17)] = 657, + [SMALL_STATE(18)] = 698, + [SMALL_STATE(19)] = 722, + [SMALL_STATE(20)] = 747, + [SMALL_STATE(21)] = 768, + [SMALL_STATE(22)] = 795, + [SMALL_STATE(23)] = 820, + [SMALL_STATE(24)] = 841, + [SMALL_STATE(25)] = 862, + [SMALL_STATE(26)] = 883, + [SMALL_STATE(27)] = 915, + [SMALL_STATE(28)] = 947, + [SMALL_STATE(29)] = 979, + [SMALL_STATE(30)] = 1011, + [SMALL_STATE(31)] = 1043, + [SMALL_STATE(32)] = 1075, + [SMALL_STATE(33)] = 1107, + [SMALL_STATE(34)] = 1139, + [SMALL_STATE(35)] = 1171, + [SMALL_STATE(36)] = 1203, + [SMALL_STATE(37)] = 1235, + [SMALL_STATE(38)] = 1267, + [SMALL_STATE(39)] = 1295, + [SMALL_STATE(40)] = 1327, + [SMALL_STATE(41)] = 1359, + [SMALL_STATE(42)] = 1379, + [SMALL_STATE(43)] = 1411, + [SMALL_STATE(44)] = 1443, + [SMALL_STATE(45)] = 1468, + [SMALL_STATE(46)] = 1497, + [SMALL_STATE(47)] = 1526, + [SMALL_STATE(48)] = 1551, + [SMALL_STATE(49)] = 1574, + [SMALL_STATE(50)] = 1592, + [SMALL_STATE(51)] = 1614, + [SMALL_STATE(52)] = 1636, + [SMALL_STATE(53)] = 1658, + [SMALL_STATE(54)] = 1676, + [SMALL_STATE(55)] = 1698, + [SMALL_STATE(56)] = 1720, + [SMALL_STATE(57)] = 1742, + [SMALL_STATE(58)] = 1764, + [SMALL_STATE(59)] = 1786, + [SMALL_STATE(60)] = 1808, + [SMALL_STATE(61)] = 1829, + [SMALL_STATE(62)] = 1850, + [SMALL_STATE(63)] = 1871, + [SMALL_STATE(64)] = 1892, + [SMALL_STATE(65)] = 1909, + [SMALL_STATE(66)] = 1926, + [SMALL_STATE(67)] = 1944, + [SMALL_STATE(68)] = 1960, + [SMALL_STATE(69)] = 1976, + [SMALL_STATE(70)] = 1994, + [SMALL_STATE(71)] = 2010, + [SMALL_STATE(72)] = 2028, + [SMALL_STATE(73)] = 2044, + [SMALL_STATE(74)] = 2060, + [SMALL_STATE(75)] = 2078, + [SMALL_STATE(76)] = 2095, + [SMALL_STATE(77)] = 2116, + [SMALL_STATE(78)] = 2137, + [SMALL_STATE(79)] = 2158, + [SMALL_STATE(80)] = 2173, + [SMALL_STATE(81)] = 2190, + [SMALL_STATE(82)] = 2211, + [SMALL_STATE(83)] = 2226, + [SMALL_STATE(84)] = 2241, + [SMALL_STATE(85)] = 2256, + [SMALL_STATE(86)] = 2275, + [SMALL_STATE(87)] = 2292, + [SMALL_STATE(88)] = 2309, + [SMALL_STATE(89)] = 2330, + [SMALL_STATE(90)] = 2351, + [SMALL_STATE(91)] = 2372, + [SMALL_STATE(92)] = 2389, + [SMALL_STATE(93)] = 2410, + [SMALL_STATE(94)] = 2431, + [SMALL_STATE(95)] = 2447, + [SMALL_STATE(96)] = 2467, + [SMALL_STATE(97)] = 2483, + [SMALL_STATE(98)] = 2499, + [SMALL_STATE(99)] = 2515, + [SMALL_STATE(100)] = 2531, + [SMALL_STATE(101)] = 2551, + [SMALL_STATE(102)] = 2571, + [SMALL_STATE(103)] = 2591, + [SMALL_STATE(104)] = 2607, + [SMALL_STATE(105)] = 2623, + [SMALL_STATE(106)] = 2639, + [SMALL_STATE(107)] = 2655, + [SMALL_STATE(108)] = 2671, + [SMALL_STATE(109)] = 2689, + [SMALL_STATE(110)] = 2705, + [SMALL_STATE(111)] = 2721, + [SMALL_STATE(112)] = 2733, + [SMALL_STATE(113)] = 2751, + [SMALL_STATE(114)] = 2767, + [SMALL_STATE(115)] = 2783, + [SMALL_STATE(116)] = 2799, + [SMALL_STATE(117)] = 2815, + [SMALL_STATE(118)] = 2831, + [SMALL_STATE(119)] = 2847, + [SMALL_STATE(120)] = 2863, + [SMALL_STATE(121)] = 2879, + [SMALL_STATE(122)] = 2895, + [SMALL_STATE(123)] = 2911, + [SMALL_STATE(124)] = 2927, + [SMALL_STATE(125)] = 2943, + [SMALL_STATE(126)] = 2959, + [SMALL_STATE(127)] = 2975, + [SMALL_STATE(128)] = 2991, + [SMALL_STATE(129)] = 3007, + [SMALL_STATE(130)] = 3023, + [SMALL_STATE(131)] = 3039, + [SMALL_STATE(132)] = 3055, + [SMALL_STATE(133)] = 3075, + [SMALL_STATE(134)] = 3091, + [SMALL_STATE(135)] = 3108, + [SMALL_STATE(136)] = 3119, + [SMALL_STATE(137)] = 3134, + [SMALL_STATE(138)] = 3151, + [SMALL_STATE(139)] = 3162, + [SMALL_STATE(140)] = 3179, + [SMALL_STATE(141)] = 3190, + [SMALL_STATE(142)] = 3207, + [SMALL_STATE(143)] = 3218, + [SMALL_STATE(144)] = 3229, + [SMALL_STATE(145)] = 3240, + [SMALL_STATE(146)] = 3257, + [SMALL_STATE(147)] = 3274, + [SMALL_STATE(148)] = 3285, + [SMALL_STATE(149)] = 3296, + [SMALL_STATE(150)] = 3313, + [SMALL_STATE(151)] = 3328, + [SMALL_STATE(152)] = 3339, + [SMALL_STATE(153)] = 3354, + [SMALL_STATE(154)] = 3368, + [SMALL_STATE(155)] = 3382, + [SMALL_STATE(156)] = 3396, + [SMALL_STATE(157)] = 3410, + [SMALL_STATE(158)] = 3424, + [SMALL_STATE(159)] = 3438, + [SMALL_STATE(160)] = 3452, + [SMALL_STATE(161)] = 3466, + [SMALL_STATE(162)] = 3480, + [SMALL_STATE(163)] = 3494, + [SMALL_STATE(164)] = 3510, + [SMALL_STATE(165)] = 3524, + [SMALL_STATE(166)] = 3538, + [SMALL_STATE(167)] = 3552, + [SMALL_STATE(168)] = 3566, + [SMALL_STATE(169)] = 3580, + [SMALL_STATE(170)] = 3589, + [SMALL_STATE(171)] = 3598, + [SMALL_STATE(172)] = 3607, + [SMALL_STATE(173)] = 3616, + [SMALL_STATE(174)] = 3625, + [SMALL_STATE(175)] = 3634, + [SMALL_STATE(176)] = 3643, + [SMALL_STATE(177)] = 3652, + [SMALL_STATE(178)] = 3661, + [SMALL_STATE(179)] = 3670, + [SMALL_STATE(180)] = 3679, + [SMALL_STATE(181)] = 3688, + [SMALL_STATE(182)] = 3697, + [SMALL_STATE(183)] = 3706, + [SMALL_STATE(184)] = 3719, + [SMALL_STATE(185)] = 3728, + [SMALL_STATE(186)] = 3741, + [SMALL_STATE(187)] = 3750, + [SMALL_STATE(188)] = 3761, + [SMALL_STATE(189)] = 3770, + [SMALL_STATE(190)] = 3783, + [SMALL_STATE(191)] = 3796, + [SMALL_STATE(192)] = 3805, + [SMALL_STATE(193)] = 3814, + [SMALL_STATE(194)] = 3823, + [SMALL_STATE(195)] = 3836, + [SMALL_STATE(196)] = 3845, + [SMALL_STATE(197)] = 3854, + [SMALL_STATE(198)] = 3863, + [SMALL_STATE(199)] = 3872, + [SMALL_STATE(200)] = 3881, + [SMALL_STATE(201)] = 3890, + [SMALL_STATE(202)] = 3899, + [SMALL_STATE(203)] = 3908, + [SMALL_STATE(204)] = 3917, + [SMALL_STATE(205)] = 3926, + [SMALL_STATE(206)] = 3935, + [SMALL_STATE(207)] = 3944, + [SMALL_STATE(208)] = 3953, + [SMALL_STATE(209)] = 3962, + [SMALL_STATE(210)] = 3971, + [SMALL_STATE(211)] = 3980, + [SMALL_STATE(212)] = 3989, + [SMALL_STATE(213)] = 3998, + [SMALL_STATE(214)] = 4007, + [SMALL_STATE(215)] = 4016, + [SMALL_STATE(216)] = 4029, + [SMALL_STATE(217)] = 4040, + [SMALL_STATE(218)] = 4053, + [SMALL_STATE(219)] = 4062, + [SMALL_STATE(220)] = 4071, + [SMALL_STATE(221)] = 4084, + [SMALL_STATE(222)] = 4093, + [SMALL_STATE(223)] = 4102, + [SMALL_STATE(224)] = 4111, + [SMALL_STATE(225)] = 4120, + [SMALL_STATE(226)] = 4129, + [SMALL_STATE(227)] = 4138, + [SMALL_STATE(228)] = 4151, + [SMALL_STATE(229)] = 4160, + [SMALL_STATE(230)] = 4169, + [SMALL_STATE(231)] = 4182, + [SMALL_STATE(232)] = 4191, + [SMALL_STATE(233)] = 4200, + [SMALL_STATE(234)] = 4213, + [SMALL_STATE(235)] = 4222, + [SMALL_STATE(236)] = 4231, + [SMALL_STATE(237)] = 4240, + [SMALL_STATE(238)] = 4249, + [SMALL_STATE(239)] = 4258, + [SMALL_STATE(240)] = 4267, + [SMALL_STATE(241)] = 4276, + [SMALL_STATE(242)] = 4285, + [SMALL_STATE(243)] = 4294, + [SMALL_STATE(244)] = 4303, + [SMALL_STATE(245)] = 4312, + [SMALL_STATE(246)] = 4321, + [SMALL_STATE(247)] = 4330, + [SMALL_STATE(248)] = 4339, + [SMALL_STATE(249)] = 4348, + [SMALL_STATE(250)] = 4357, + [SMALL_STATE(251)] = 4366, + [SMALL_STATE(252)] = 4375, + [SMALL_STATE(253)] = 4384, + [SMALL_STATE(254)] = 4393, + [SMALL_STATE(255)] = 4402, + [SMALL_STATE(256)] = 4411, + [SMALL_STATE(257)] = 4424, + [SMALL_STATE(258)] = 4433, + [SMALL_STATE(259)] = 4442, + [SMALL_STATE(260)] = 4451, + [SMALL_STATE(261)] = 4460, + [SMALL_STATE(262)] = 4469, + [SMALL_STATE(263)] = 4478, + [SMALL_STATE(264)] = 4487, + [SMALL_STATE(265)] = 4496, + [SMALL_STATE(266)] = 4505, + [SMALL_STATE(267)] = 4515, + [SMALL_STATE(268)] = 4525, + [SMALL_STATE(269)] = 4535, + [SMALL_STATE(270)] = 4543, + [SMALL_STATE(271)] = 4551, + [SMALL_STATE(272)] = 4559, + [SMALL_STATE(273)] = 4569, + [SMALL_STATE(274)] = 4577, + [SMALL_STATE(275)] = 4585, + [SMALL_STATE(276)] = 4593, + [SMALL_STATE(277)] = 4603, + [SMALL_STATE(278)] = 4611, + [SMALL_STATE(279)] = 4618, + [SMALL_STATE(280)] = 4625, + [SMALL_STATE(281)] = 4632, + [SMALL_STATE(282)] = 4639, + [SMALL_STATE(283)] = 4646, + [SMALL_STATE(284)] = 4653, + [SMALL_STATE(285)] = 4660, + [SMALL_STATE(286)] = 4667, + [SMALL_STATE(287)] = 4674, + [SMALL_STATE(288)] = 4681, + [SMALL_STATE(289)] = 4688, + [SMALL_STATE(290)] = 4695, + [SMALL_STATE(291)] = 4702, + [SMALL_STATE(292)] = 4709, + [SMALL_STATE(293)] = 4716, + [SMALL_STATE(294)] = 4723, + [SMALL_STATE(295)] = 4730, + [SMALL_STATE(296)] = 4737, + [SMALL_STATE(297)] = 4744, + [SMALL_STATE(298)] = 4751, + [SMALL_STATE(299)] = 4758, + [SMALL_STATE(300)] = 4765, + [SMALL_STATE(301)] = 4772, + [SMALL_STATE(302)] = 4779, + [SMALL_STATE(303)] = 4786, + [SMALL_STATE(304)] = 4793, + [SMALL_STATE(305)] = 4800, + [SMALL_STATE(306)] = 4807, + [SMALL_STATE(307)] = 4814, + [SMALL_STATE(308)] = 4821, + [SMALL_STATE(309)] = 4828, + [SMALL_STATE(310)] = 4835, + [SMALL_STATE(311)] = 4842, + [SMALL_STATE(312)] = 4849, + [SMALL_STATE(313)] = 4856, + [SMALL_STATE(314)] = 4863, + [SMALL_STATE(315)] = 4870, + [SMALL_STATE(316)] = 4877, + [SMALL_STATE(317)] = 4884, + [SMALL_STATE(318)] = 4891, + [SMALL_STATE(319)] = 4898, + [SMALL_STATE(320)] = 4905, + [SMALL_STATE(321)] = 4912, + [SMALL_STATE(322)] = 4919, + [SMALL_STATE(323)] = 4926, + [SMALL_STATE(324)] = 4933, + [SMALL_STATE(325)] = 4940, }; static const TSParseActionEntry ts_parse_actions[] = { @@ -7915,410 +7415,419 @@ static const TSParseActionEntry ts_parse_actions[] = { [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), [3] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(), [5] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 0, 0, 0), - [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(293), - [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(290), - [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(296), - [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(289), + [7] = {.entry = {.count = 1, .reusable = true}}, SHIFT(303), + [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT(279), + [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(319), + [13] = {.entry = {.count = 1, .reusable = true}}, SHIFT(305), [15] = {.entry = {.count = 1, .reusable = false}}, SHIFT(324), [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT_EXTRA(), [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(276), - [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 18), - [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 3, 0, 18), - [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(317), - [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(220), - [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(220), - [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(116), - [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(114), - [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), - [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(272), - [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 2, 0, 9), - [41] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 2, 0, 9), - [43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 49), - [45] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 5, 0, 49), - [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 93), - [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 6, 0, 93), + [21] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 2, 0, 9), + [23] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 2, 0, 9), + [25] = {.entry = {.count = 1, .reusable = true}}, SHIFT(315), + [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(163), + [29] = {.entry = {.count = 1, .reusable = true}}, SHIFT(163), + [31] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), + [33] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), + [35] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), + [37] = {.entry = {.count = 1, .reusable = true}}, SHIFT(268), + [39] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 17), + [41] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 3, 0, 17), + [43] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 47), + [45] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 5, 0, 47), + [47] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 91), + [49] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 6, 0, 91), [51] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 16), [53] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 3, 0, 16), - [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 17), - [57] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 3, 0, 17), - [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 34), - [61] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 4, 0, 34), - [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__asset_expr_primary, 1, 0, 0), - [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(286), - [67] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__asset_expr_primary, 1, 0, 0), - [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 42), - [71] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 4, 0, 42), - [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 41), - [75] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 4, 0, 41), - [77] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 71), - [79] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 5, 0, 71), - [81] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 121), - [83] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 7, 0, 121), - [85] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 111), - [87] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 7, 0, 111), - [89] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 122), - [91] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 7, 0, 122), - [93] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 82), - [95] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 6, 0, 82), - [97] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 83), - [99] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 6, 0, 83), - [101] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 145), - [103] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 8, 0, 145), - [105] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_expr_unop, 2, 0, 48), - [107] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_asset_expr_unop, 2, 0, 48), - [109] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_attack_step_repeat1, 2, 0, 43), - [111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attack_step_repeat1, 2, 0, 43), - [113] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attack_step_repeat1, 2, 0, 43), SHIFT_REPEAT(317), - [116] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_expr_binop, 3, 0, 78), - [118] = {.entry = {.count = 1, .reusable = true}}, SHIFT(121), - [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(309), - [122] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_asset_expr_binop, 3, 0, 78), - [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), - [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_expr_type, 4, 0, 104), - [128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_asset_expr_type, 4, 0, 104), - [130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_variable_substitution, 3, 0, 77), - [132] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_asset_variable_substitution, 3, 0, 77), - [134] = {.entry = {.count = 1, .reusable = false}}, SHIFT(120), - [136] = {.entry = {.count = 1, .reusable = true}}, SHIFT(120), - [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__inline_asset_expr, 3, 0, 0), - [140] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__inline_asset_expr, 3, 0, 0), - [142] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_attack_step_repeat1, 2, 0, 24), - [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attack_step_repeat1, 2, 0, 24), - [146] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_expr, 1, 0, 0), - [148] = {.entry = {.count = 1, .reusable = true}}, SHIFT(122), - [150] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_category_declaration_repeat1, 2, 0, 0), SHIFT_REPEAT(324), - [153] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat1, 2, 0, 0), - [155] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_category_declaration_repeat1, 2, 0, 0), - [157] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ttc, 3, 0, 0), - [159] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ttc, 3, 0, 0), - [161] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_meta, 4, 0, 6), - [163] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_meta, 4, 0, 6), - [165] = {.entry = {.count = 1, .reusable = false}}, SHIFT(53), - [167] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 2, 0, 25), - [169] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 2, 0, 25), - [171] = {.entry = {.count = 1, .reusable = true}}, SHIFT(111), - [173] = {.entry = {.count = 1, .reusable = false}}, SHIFT(42), - [175] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 3, 0, 50), - [177] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 3, 0, 50), - [179] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 59), - [181] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 72), - [183] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 68), - [185] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 31), - [187] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 79), - [189] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 13), - [191] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 35), - [193] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector_context, 3, 0, 0), - [195] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector_context, 3, 0, 0), - [197] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 4, 0, 85), - [199] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 98), - [201] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 38), - [203] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 112), - [205] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 108), - [207] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 118), - [209] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 132), - [211] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 142), + [55] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 15), + [57] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 3, 0, 15), + [59] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 30), + [61] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 4, 0, 30), + [63] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 37), + [65] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 4, 0, 37), + [67] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 38), + [69] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 4, 0, 38), + [71] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 65), + [73] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 5, 0, 65), + [75] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 140), + [77] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 8, 0, 140), + [79] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 118), + [81] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 7, 0, 118), + [83] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 79), + [85] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 6, 0, 79), + [87] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 80), + [89] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 6, 0, 80), + [91] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 119), + [93] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 7, 0, 119), + [95] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 106), + [97] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_attack_step, 7, 0, 106), + [99] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__asset_expr_primary, 1, 0, 0), + [101] = {.entry = {.count = 1, .reusable = true}}, SHIFT(289), + [103] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__asset_expr_primary, 1, 0, 0), + [105] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_attack_step_repeat1, 2, 0, 0), + [107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attack_step_repeat1, 2, 0, 0), + [109] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attack_step_repeat1, 2, 0, 0), SHIFT_REPEAT(315), + [112] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_expr_unop, 2, 0, 46), + [114] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_asset_expr_unop, 2, 0, 46), + [116] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_expr_binop, 3, 0, 76), + [118] = {.entry = {.count = 1, .reusable = true}}, SHIFT(69), + [120] = {.entry = {.count = 1, .reusable = true}}, SHIFT(294), + [122] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_asset_expr_binop, 3, 0, 76), + [124] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), + [126] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_variable_substitution, 3, 0, 75), + [128] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_asset_variable_substitution, 3, 0, 75), + [130] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_expr_type, 4, 0, 102), + [132] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_asset_expr_type, 4, 0, 102), + [134] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__inline_asset_expr, 3, 0, 0), + [136] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__inline_asset_expr, 3, 0, 0), + [138] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 69), + [140] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 31), + [142] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 39), + [144] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 18), + [146] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 34), + [148] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 81), + [150] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 95), + [152] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 56), + [154] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 107), + [156] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 110), + [158] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 66), + [160] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 144), + [162] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_expr, 1, 0, 0), + [164] = {.entry = {.count = 1, .reusable = false}}, SHIFT(74), + [166] = {.entry = {.count = 1, .reusable = true}}, SHIFT(74), + [168] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 120), + [170] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 129), + [172] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 141), + [174] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 156), + [176] = {.entry = {.count = 1, .reusable = false}}, SHIFT(51), + [178] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 3, 0, 48), + [180] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 3, 0, 48), + [182] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), + [184] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), + [186] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(303), + [189] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(279), + [192] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(319), + [195] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(305), + [198] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), + [200] = {.entry = {.count = 1, .reusable = false}}, SHIFT(58), + [202] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 2, 0, 24), + [204] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 2, 0, 24), + [206] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_category_declaration_repeat1, 2, 0, 0), SHIFT_REPEAT(324), + [209] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat1, 2, 0, 0), + [211] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym_category_declaration_repeat1, 2, 0, 0), [213] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector_context, 4, 0, 0), [215] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector_context, 4, 0, 0), - [217] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 146), - [219] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 159), - [221] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 3, 0, 51), - [223] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_preconditions_repeat1, 2, 0, 0), - [225] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_preconditions_repeat1, 2, 0, 0), SHIFT_REPEAT(118), - [228] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_source_file, 1, 0, 0), - [230] = {.entry = {.count = 1, .reusable = true}}, SHIFT(251), - [232] = {.entry = {.count = 1, .reusable = true}}, SHIFT(310), - [234] = {.entry = {.count = 1, .reusable = true}}, SHIFT(315), - [236] = {.entry = {.count = 1, .reusable = true}}, SHIFT(249), - [238] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_preconditions, 2, 0, 26), - [240] = {.entry = {.count = 1, .reusable = true}}, SHIFT(118), - [242] = {.entry = {.count = 1, .reusable = true}}, SHIFT(246), - [244] = {.entry = {.count = 1, .reusable = true}}, SHIFT(255), - [246] = {.entry = {.count = 1, .reusable = true}}, SHIFT(235), - [248] = {.entry = {.count = 1, .reusable = true}}, SHIFT(260), - [250] = {.entry = {.count = 1, .reusable = true}}, SHIFT(241), - [252] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), - [254] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(293), - [257] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(290), - [260] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(296), - [263] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_source_file_repeat1, 2, 0, 0), SHIFT_REPEAT(289), - [266] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_preconditions, 3, 0, 53), - [268] = {.entry = {.count = 1, .reusable = true}}, SHIFT(234), - [270] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 143), - [272] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 39), - [274] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 14), - [276] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_asset_definition_repeat1, 2, 0, 0), - [278] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_asset_definition_repeat1, 2, 0, 0), SHIFT_REPEAT(310), - [281] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_asset_definition_repeat1, 2, 0, 0), SHIFT_REPEAT(315), - [284] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 80), - [286] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 4, 0, 86), - [288] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 4, 0, 87), - [290] = {.entry = {.count = 1, .reusable = false}}, SHIFT(123), - [292] = {.entry = {.count = 1, .reusable = true}}, SHIFT(75), - [294] = {.entry = {.count = 1, .reusable = false}}, SHIFT(196), - [296] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 89), - [298] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 95), - [300] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 3, 0, 52), - [302] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 99), - [304] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 101), - [306] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 105), - [308] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 28), - [310] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 109), - [312] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 113), - [314] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_definition, 1, 0, 0), - [316] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 5, 0, 115), - [318] = {.entry = {.count = 1, .reusable = false}}, SHIFT(141), - [320] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 119), - [322] = {.entry = {.count = 1, .reusable = false}}, SHIFT(142), - [324] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 56), - [326] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 124), - [328] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 129), - [330] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 32), - [332] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 133), - [334] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 135), - [336] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 139), - [338] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 60), - [340] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 62), - [342] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 65), - [344] = {.entry = {.count = 1, .reusable = false}}, SHIFT(198), - [346] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 147), - [348] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 151), - [350] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 156), - [352] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 69), - [354] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 160), - [356] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 162), - [358] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 168), - [360] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 36), - [362] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 73), - [364] = {.entry = {.count = 1, .reusable = false}}, SHIFT(200), - [366] = {.entry = {.count = 1, .reusable = false}}, SHIFT(140), - [368] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_reaching, 3, 0, 54), - [370] = {.entry = {.count = 1, .reusable = true}}, SHIFT(9), - [372] = {.entry = {.count = 1, .reusable = true}}, SHIFT(119), - [374] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_reaching, 2, 0, 27), - [376] = {.entry = {.count = 1, .reusable = true}}, SHIFT(240), - [378] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__ttc_primary, 1, 0, 0), - [380] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__ttc_primary, 1, 0, 0), - [382] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 171), - [384] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 37), - [386] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 40), - [388] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), - [390] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 55), - [392] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 57), - [394] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 58), - [396] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 61), - [398] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 63), - [400] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 64), - [402] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 66), - [404] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 67), - [406] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 70), - [408] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 74), - [410] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 81), - [412] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__ttc_parenthesized, 3, 0, 0), - [414] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__ttc_parenthesized, 3, 0, 0), - [416] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ttc_binop, 3, 0, 78), - [418] = {.entry = {.count = 1, .reusable = true}}, SHIFT(87), - [420] = {.entry = {.count = 1, .reusable = false}}, SHIFT(87), - [422] = {.entry = {.count = 1, .reusable = true}}, SHIFT(89), - [424] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ttc_binop, 3, 0, 78), - [426] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 88), - [428] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 90), - [430] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 91), - [432] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 92), - [434] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 94), - [436] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 96), - [438] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 97), - [440] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 100), - [442] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 15), - [444] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 102), - [446] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 103), - [448] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 106), - [450] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 107), - [452] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 110), - [454] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 114), - [456] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ttc_distribution, 4, 0, 116), - [458] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ttc_distribution, 4, 0, 116), - [460] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 117), - [462] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 120), - [464] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 33), - [466] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 125), - [468] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 126), - [470] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 127), - [472] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 128), - [474] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 130), - [476] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 131), - [478] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_variable, 4, 0, 3), - [480] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 134), - [482] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 136), - [484] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 137), - [486] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ttc_distribution, 5, 0, 138), - [488] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ttc_distribution, 5, 0, 138), - [490] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 140), - [492] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 141), - [494] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 144), - [496] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 148), - [498] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 149), - [500] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 150), - [502] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 152), - [504] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 153), - [506] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 154), - [508] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 155), - [510] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 157), - [512] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 158), - [514] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 161), - [516] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 163), - [518] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 164), - [520] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 166), - [522] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 167), - [524] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 169), - [526] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 170), - [528] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 29), - [530] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 11, 0, 173), - [532] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 30), - [534] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 123), - [536] = {.entry = {.count = 1, .reusable = true}}, SHIFT(139), - [538] = {.entry = {.count = 1, .reusable = true}}, SHIFT(112), - [540] = {.entry = {.count = 1, .reusable = true}}, SHIFT(244), - [542] = {.entry = {.count = 1, .reusable = true}}, SHIFT(245), - [544] = {.entry = {.count = 1, .reusable = true}}, SHIFT(30), - [546] = {.entry = {.count = 1, .reusable = true}}, SHIFT(110), - [548] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_associations_declaration, 4, 0, 0), - [550] = {.entry = {.count = 1, .reusable = true}}, SHIFT(206), - [552] = {.entry = {.count = 1, .reusable = true}}, SHIFT(284), - [554] = {.entry = {.count = 1, .reusable = true}}, SHIFT(285), - [556] = {.entry = {.count = 1, .reusable = true}}, SHIFT(205), - [558] = {.entry = {.count = 1, .reusable = false}}, SHIFT(302), - [560] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), - [562] = {.entry = {.count = 1, .reusable = false}}, SHIFT(308), - [564] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_category_declaration, 4, 0, 2), - [566] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_category_declaration, 6, 0, 7), - [568] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_associations_declaration, 3, 0, 0), - [570] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_category_declaration, 5, 0, 5), - [572] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_declaration, 1, 0, 0), - [574] = {.entry = {.count = 1, .reusable = true}}, SHIFT(216), - [576] = {.entry = {.count = 1, .reusable = true}}, SHIFT(208), - [578] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_define_declaration, 4, 0, 3), - [580] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat1, 2, 0, 0), SHIFT_REPEAT(302), - [583] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_include_declaration, 2, 0, 1), - [585] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), - [587] = {.entry = {.count = 1, .reusable = false}}, SHIFT(306), - [589] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_category_declaration, 5, 0, 4), - [591] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat2, 2, 0, 0), - [593] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat2, 2, 0, 0), SHIFT_REPEAT(284), - [596] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat2, 2, 0, 0), SHIFT_REPEAT(285), - [599] = {.entry = {.count = 1, .reusable = true}}, SHIFT(287), - [601] = {.entry = {.count = 1, .reusable = true}}, SHIFT(207), - [603] = {.entry = {.count = 1, .reusable = true}}, SHIFT(302), - [605] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), - [607] = {.entry = {.count = 1, .reusable = true}}, SHIFT(253), - [609] = {.entry = {.count = 1, .reusable = true}}, SHIFT(270), - [611] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), - [613] = {.entry = {.count = 1, .reusable = true}}, SHIFT(201), - [615] = {.entry = {.count = 1, .reusable = true}}, SHIFT(211), - [617] = {.entry = {.count = 1, .reusable = true}}, SHIFT(273), - [619] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), - [621] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), - [623] = {.entry = {.count = 1, .reusable = true}}, SHIFT(62), - [625] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_associations_declaration_repeat1, 2, 0, 0), SHIFT_REPEAT(287), - [628] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_associations_declaration_repeat1, 2, 0, 0), - [630] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_association, 13, 0, 165), SHIFT(302), - [633] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_association, 13, 0, 165), - [635] = {.entry = {.count = 1, .reusable = true}}, SHIFT(203), - [637] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), - [639] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_association, 14, 0, 172), SHIFT(302), - [642] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_association, 14, 0, 172), - [644] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 7, 0, 23), - [646] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 4, 0, 2), - [648] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 6, 0, 19), - [650] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 6, 0, 20), - [652] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_detector_context_repeat1, 2, 0, 0), SHIFT_REPEAT(269), - [655] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_detector_context_repeat1, 2, 0, 0), - [657] = {.entry = {.count = 1, .reusable = false}}, SHIFT(266), - [659] = {.entry = {.count = 1, .reusable = true}}, SHIFT(238), - [661] = {.entry = {.count = 1, .reusable = true}}, SHIFT(172), - [663] = {.entry = {.count = 1, .reusable = false}}, SHIFT(242), - [665] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 7, 0, 22), - [667] = {.entry = {.count = 1, .reusable = true}}, SHIFT(158), - [669] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_star, 1, 0, 0), - [671] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_multiplicity, 1, 0, 0), - [673] = {.entry = {.count = 1, .reusable = true}}, SHIFT(224), - [675] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 5, 0, 8), - [677] = {.entry = {.count = 1, .reusable = true}}, SHIFT(321), - [679] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector_name, 2, 0, 0), - [681] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 7, 0, 44), - [683] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 7, 0, 45), - [685] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_ttc_distribution_repeat1, 2, 0, 0), SHIFT_REPEAT(238), - [688] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_ttc_distribution_repeat1, 2, 0, 0), - [690] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 6, 0, 12), - [692] = {.entry = {.count = 1, .reusable = true}}, SHIFT(269), - [694] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), - [696] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector_name, 1, 0, 0), - [698] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 8, 0, 46), - [700] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 8, 0, 47), - [702] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 5, 0, 10), - [704] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cias, 2, 0, 0), - [706] = {.entry = {.count = 1, .reusable = true}}, SHIFT(297), - [708] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 8, 0, 75), - [710] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 9, 0, 76), - [712] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 5, 0, 5), - [714] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), - [716] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_cias_repeat1, 2, 0, 0), - [718] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cias_repeat1, 2, 0, 0), SHIFT_REPEAT(297), - [721] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_detector_name_repeat1, 2, 0, 0), SHIFT_REPEAT(321), - [724] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_detector_name_repeat1, 2, 0, 0), - [726] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 6, 0, 11), - [728] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cias, 1, 0, 0), - [730] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector_context_asset, 2, 0, 84), - [732] = {.entry = {.count = 1, .reusable = true}}, SHIFT(311), - [734] = {.entry = {.count = 1, .reusable = true}}, SHIFT(265), - [736] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_multiplicity_range, 3, 0, 21), - [738] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), - [740] = {.entry = {.count = 1, .reusable = true}}, SHIFT(248), - [742] = {.entry = {.count = 1, .reusable = true}}, SHIFT(254), - [744] = {.entry = {.count = 1, .reusable = true}}, SHIFT(199), - [746] = {.entry = {.count = 1, .reusable = true}}, SHIFT(258), - [748] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), - [750] = {.entry = {.count = 1, .reusable = true}}, SHIFT(303), - [752] = {.entry = {.count = 1, .reusable = true}}, SHIFT(215), - [754] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), - [756] = {.entry = {.count = 1, .reusable = true}}, SHIFT(294), - [758] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), - [760] = {.entry = {.count = 1, .reusable = true}}, SHIFT(218), - [762] = {.entry = {.count = 1, .reusable = true}}, SHIFT(230), - [764] = {.entry = {.count = 1, .reusable = true}}, SHIFT(314), - [766] = {.entry = {.count = 1, .reusable = true}}, SHIFT(229), - [768] = {.entry = {.count = 1, .reusable = true}}, SHIFT(214), - [770] = {.entry = {.count = 1, .reusable = true}}, SHIFT(281), - [772] = {.entry = {.count = 1, .reusable = true}}, SHIFT(117), - [774] = {.entry = {.count = 1, .reusable = true}}, SHIFT(307), - [776] = {.entry = {.count = 1, .reusable = true}}, SHIFT(274), - [778] = {.entry = {.count = 1, .reusable = true}}, SHIFT(256), - [780] = {.entry = {.count = 1, .reusable = true}}, SHIFT(243), - [782] = {.entry = {.count = 1, .reusable = true}}, SHIFT(197), - [784] = {.entry = {.count = 1, .reusable = true}}, SHIFT(259), - [786] = {.entry = {.count = 1, .reusable = true}}, SHIFT(304), - [788] = {.entry = {.count = 1, .reusable = true}}, SHIFT(204), - [790] = {.entry = {.count = 1, .reusable = true}}, SHIFT(299), - [792] = {.entry = {.count = 1, .reusable = true}}, SHIFT(319), - [794] = {.entry = {.count = 1, .reusable = true}}, SHIFT(225), - [796] = {.entry = {.count = 1, .reusable = true}}, SHIFT(318), - [798] = {.entry = {.count = 1, .reusable = true}}, SHIFT(226), - [800] = {.entry = {.count = 1, .reusable = true}}, SHIFT(312), - [802] = {.entry = {.count = 1, .reusable = true}}, SHIFT(295), - [804] = {.entry = {.count = 1, .reusable = true}}, SHIFT(267), - [806] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), - [808] = {.entry = {.count = 1, .reusable = true}}, SHIFT(236), - [810] = {.entry = {.count = 1, .reusable = true}}, SHIFT(300), - [812] = {.entry = {.count = 1, .reusable = true}}, SHIFT(3), - [814] = {.entry = {.count = 1, .reusable = true}}, SHIFT(233), - [816] = {.entry = {.count = 1, .reusable = true}}, SHIFT(27), - [818] = {.entry = {.count = 1, .reusable = true}}, SHIFT(212), - [820] = {.entry = {.count = 1, .reusable = true}}, SHIFT(325), - [822] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), - [824] = {.entry = {.count = 1, .reusable = true}}, SHIFT(271), - [826] = {.entry = {.count = 1, .reusable = true}}, SHIFT(320), - [828] = {.entry = {.count = 1, .reusable = true}}, SHIFT(264), - [830] = {.entry = {.count = 1, .reusable = true}}, SHIFT(322), - [832] = {.entry = {.count = 1, .reusable = true}}, SHIFT(292), + [217] = {.entry = {.count = 1, .reusable = false}}, SHIFT(66), + [219] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), + [221] = {.entry = {.count = 1, .reusable = false}}, SHIFT(102), + [223] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 4, 0, 83), + [225] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 4, 0, 83), + [227] = {.entry = {.count = 1, .reusable = false}}, SHIFT(95), + [229] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector_context, 3, 0, 0), + [231] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector_context, 3, 0, 0), + [233] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attack_step_repeat2, 2, 0, 0), + [235] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_attack_step_repeat2, 2, 0, 0), SHIFT_REPEAT(163), + [238] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attack_step_repeat2, 2, 0, 0), SHIFT_REPEAT(163), + [241] = {.entry = {.count = 1, .reusable = false}}, SHIFT(132), + [243] = {.entry = {.count = 1, .reusable = false}}, SHIFT(87), + [245] = {.entry = {.count = 1, .reusable = false}}, SHIFT(75), + [247] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 3, 0, 49), + [249] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 3, 0, 49), + [251] = {.entry = {.count = 1, .reusable = false}}, SHIFT(85), + [253] = {.entry = {.count = 1, .reusable = true}}, SHIFT(18), + [255] = {.entry = {.count = 1, .reusable = true}}, SHIFT(71), + [257] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ttc, 3, 0, 0), + [259] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ttc, 3, 0, 0), + [261] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_meta, 4, 0, 6), + [263] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_meta, 4, 0, 6), + [265] = {.entry = {.count = 1, .reusable = true}}, SHIFT(156), + [267] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__ttc_primary, 1, 0, 0), + [269] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__ttc_primary, 1, 0, 0), + [271] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 4, 0, 84), + [273] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 4, 0, 84), + [275] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 4, 0, 85), + [277] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 4, 0, 85), + [279] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 3, 0, 50), + [281] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 3, 0, 50), + [283] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector, 5, 0, 113), + [285] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_detector, 5, 0, 113), + [287] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ttc_binop, 3, 0, 76), + [289] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ttc_binop, 3, 0, 76), + [291] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), + [293] = {.entry = {.count = 1, .reusable = true}}, SHIFT(196), + [295] = {.entry = {.count = 1, .reusable = true}}, SHIFT(314), + [297] = {.entry = {.count = 1, .reusable = true}}, SHIFT(285), + [299] = {.entry = {.count = 1, .reusable = true}}, SHIFT(203), + [301] = {.entry = {.count = 1, .reusable = true}}, SHIFT(214), + [303] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ttc_distribution, 4, 0, 114), + [305] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ttc_distribution, 4, 0, 114), + [307] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_preconditions_repeat1, 2, 0, 0), + [309] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_preconditions_repeat1, 2, 0, 0), SHIFT_REPEAT(63), + [312] = {.entry = {.count = 1, .reusable = true}}, SHIFT(263), + [314] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym__ttc_parenthesized, 3, 0, 0), + [316] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym__ttc_parenthesized, 3, 0, 0), + [318] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ttc_distribution, 3, 0, 75), + [320] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ttc_distribution, 3, 0, 75), + [322] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ttc_distribution, 5, 0, 136), + [324] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_ttc_distribution, 5, 0, 136), + [326] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), + [328] = {.entry = {.count = 1, .reusable = false}}, SHIFT(56), + [330] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_preconditions, 3, 0, 51), + [332] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), + [334] = {.entry = {.count = 1, .reusable = true}}, SHIFT(175), + [336] = {.entry = {.count = 1, .reusable = true}}, SHIFT(260), + [338] = {.entry = {.count = 1, .reusable = true}}, SHIFT(195), + [340] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_preconditions, 2, 0, 25), + [342] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), + [344] = {.entry = {.count = 1, .reusable = true}}, SHIFT(188), + [346] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 154), + [348] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), + [350] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), + [352] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 28), + [354] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 32), + [356] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 35), + [358] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 40), + [360] = {.entry = {.count = 1, .reusable = true}}, SHIFT(184), + [362] = {.entry = {.count = 1, .reusable = true}}, SHIFT(187), + [364] = {.entry = {.count = 1, .reusable = true}}, SHIFT(82), + [366] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 54), + [368] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 57), + [370] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 60), + [372] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 63), + [374] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 67), + [376] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_definition, 1, 0, 0), + [378] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 70), + [380] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 166), + [382] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_asset_definition_repeat1, 2, 0, 0), + [384] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_asset_definition_repeat1, 2, 0, 0), SHIFT_REPEAT(314), + [387] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_asset_definition_repeat1, 2, 0, 0), SHIFT_REPEAT(285), + [390] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 87), + [392] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 93), + [394] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 96), + [396] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 99), + [398] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 104), + [400] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 108), + [402] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 111), + [404] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 116), + [406] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 122), + [408] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 127), + [410] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 130), + [412] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 133), + [414] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 138), + [416] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 13), + [418] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 142), + [420] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 145), + [422] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 149), + [424] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 157), + [426] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 160), + [428] = {.entry = {.count = 1, .reusable = true}}, SHIFT(73), + [430] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 77), + [432] = {.entry = {.count = 1, .reusable = true}}, SHIFT(135), + [434] = {.entry = {.count = 1, .reusable = true}}, SHIFT(284), + [436] = {.entry = {.count = 1, .reusable = true}}, SHIFT(302), + [438] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_category_declaration, 4, 0, 2), + [440] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat1, 2, 0, 0), SHIFT_REPEAT(299), + [443] = {.entry = {.count = 1, .reusable = false}}, SHIFT(299), + [445] = {.entry = {.count = 1, .reusable = true}}, SHIFT(89), + [447] = {.entry = {.count = 1, .reusable = false}}, SHIFT(282), + [449] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_category_declaration, 5, 0, 4), + [451] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat2, 2, 0, 0), + [453] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat2, 2, 0, 0), SHIFT_REPEAT(284), + [456] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_category_declaration_repeat2, 2, 0, 0), SHIFT_REPEAT(302), + [459] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_define_declaration, 4, 0, 3), + [461] = {.entry = {.count = 1, .reusable = true}}, SHIFT(138), + [463] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_category_declaration, 5, 0, 5), + [465] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_declaration, 1, 0, 0), + [467] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_associations_declaration, 3, 0, 0), + [469] = {.entry = {.count = 1, .reusable = true}}, SHIFT(148), + [471] = {.entry = {.count = 1, .reusable = true}}, SHIFT(93), + [473] = {.entry = {.count = 1, .reusable = false}}, SHIFT(308), + [475] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_include_declaration, 2, 0, 1), + [477] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_category_declaration, 6, 0, 7), + [479] = {.entry = {.count = 1, .reusable = true}}, SHIFT(142), + [481] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_reaching, 3, 0, 52), + [483] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_associations_declaration, 4, 0, 0), + [485] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_reaching, 2, 0, 26), + [487] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_association, 13, 0, 163), SHIFT(299), + [490] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_association, 13, 0, 163), + [492] = {.entry = {.count = 1, .reusable = true}}, SHIFT(298), + [494] = {.entry = {.count = 1, .reusable = true}}, SHIFT(151), + [496] = {.entry = {.count = 1, .reusable = true}}, SHIFT(274), + [498] = {.entry = {.count = 1, .reusable = true}}, SHIFT(83), + [500] = {.entry = {.count = 1, .reusable = false}}, SHIFT(194), + [502] = {.entry = {.count = 1, .reusable = true}}, SHIFT(299), + [504] = {.entry = {.count = 1, .reusable = true}}, SHIFT(134), + [506] = {.entry = {.count = 1, .reusable = true}}, SHIFT(81), + [508] = {.entry = {.count = 1, .reusable = true}}, SHIFT(77), + [510] = {.entry = {.count = 1, .reusable = true}}, SHIFT(90), + [512] = {.entry = {.count = 1, .reusable = true}}, SHIFT(78), + [514] = {.entry = {.count = 1, .reusable = true}}, SHIFT(149), + [516] = {.entry = {.count = 1, .reusable = true}}, SHIFT(183), + [518] = {.entry = {.count = 1, .reusable = true}}, SHIFT(267), + [520] = {.entry = {.count = 1, .reusable = true}}, SHIFT(88), + [522] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_associations_declaration_repeat1, 2, 0, 0), SHIFT_REPEAT(298), + [525] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_associations_declaration_repeat1, 2, 0, 0), + [527] = {.entry = {.count = 1, .reusable = true}}, SHIFT(144), + [529] = {.entry = {.count = 2, .reusable = true}}, REDUCE(sym_association, 14, 0, 170), SHIFT(299), + [532] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_association, 14, 0, 170), + [534] = {.entry = {.count = 1, .reusable = true}}, SHIFT(76), + [536] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 92), + [538] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 55), + [540] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 58), + [542] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 59), + [544] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 61), + [546] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 62), + [548] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 7, 0, 22), + [550] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 64), + [552] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 36), + [554] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 68), + [556] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 71), + [558] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 72), + [560] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 8, 0, 73), + [562] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 9, 0, 74), + [564] = {.entry = {.count = 1, .reusable = true}}, SHIFT(280), + [566] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector_name, 1, 0, 0), + [568] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_star, 1, 0, 0), + [570] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_cias_repeat1, 2, 0, 0), + [572] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_cias_repeat1, 2, 0, 0), SHIFT_REPEAT(312), + [575] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 78), + [577] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_multiplicity, 1, 0, 0), + [579] = {.entry = {.count = 1, .reusable = true}}, SHIFT(155), + [581] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 5, 0, 8), + [583] = {.entry = {.count = 1, .reusable = true}}, SHIFT(272), + [585] = {.entry = {.count = 1, .reusable = true}}, SHIFT(49), + [587] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_detector_name_repeat1, 2, 0, 0), SHIFT_REPEAT(280), + [590] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_detector_name_repeat1, 2, 0, 0), + [592] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 41), + [594] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 5, 0, 10), + [596] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 7, 0, 42), + [598] = {.entry = {.count = 1, .reusable = true}}, SHIFT(216), + [600] = {.entry = {.count = 1, .reusable = true}}, SHIFT(79), + [602] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 7, 0, 43), + [604] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 5, 0, 5), + [606] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 86), + [608] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 88), + [610] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 89), + [612] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 90), + [614] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 8, 0, 44), + [616] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 94), + [618] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 8, 0, 45), + [620] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 97), + [622] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 98), + [624] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 100), + [626] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 6, 0, 101), + [628] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 103), + [630] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 105), + [632] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 6, 0, 11), + [634] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 7, 0, 23), + [636] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 6, 0, 20), + [638] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 112), + [640] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 6, 0, 12), + [642] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_detector_context_repeat1, 2, 0, 0), SHIFT_REPEAT(272), + [645] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_detector_context_repeat1, 2, 0, 0), + [647] = {.entry = {.count = 1, .reusable = false}}, SHIFT(271), + [649] = {.entry = {.count = 1, .reusable = true}}, SHIFT(84), + [651] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 115), + [653] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 117), + [655] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cias, 2, 0, 0), + [657] = {.entry = {.count = 1, .reusable = true}}, SHIFT(312), + [659] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 121), + [661] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 123), + [663] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 124), + [665] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 125), + [667] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 126), + [669] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 128), + [671] = {.entry = {.count = 1, .reusable = true}}, SHIFT(53), + [673] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 131), + [675] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 132), + [677] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector_name, 2, 0, 0), + [679] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 134), + [681] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 135), + [683] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_ttc_distribution_repeat1, 2, 0, 0), SHIFT_REPEAT(216), + [686] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_ttc_distribution_repeat1, 2, 0, 0), + [688] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 137), + [690] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 139), + [692] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 27), + [694] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 143), + [696] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 3, 0, 14), + [698] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_variable, 4, 0, 3), + [700] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 146), + [702] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 8, 0, 147), + [704] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 148), + [706] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 29), + [708] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 150), + [710] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 151), + [712] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 152), + [714] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 153), + [716] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 155), + [718] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 158), + [720] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 159), + [722] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 161), + [724] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 9, 0, 162), + [726] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 164), + [728] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 165), + [730] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cias, 1, 0, 0), + [732] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 167), + [734] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 168), + [736] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 10, 0, 169), + [738] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 4, 0, 2), + [740] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 11, 0, 171), + [742] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 5, 0, 53), + [744] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_asset_declaration, 6, 0, 19), + [746] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 4, 0, 33), + [748] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attack_step, 7, 0, 109), + [750] = {.entry = {.count = 1, .reusable = true}}, SHIFT(297), + [752] = {.entry = {.count = 1, .reusable = true}}, SHIFT(256), + [754] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_detector_context_asset, 2, 0, 82), + [756] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_multiplicity_range, 3, 0, 21), + [758] = {.entry = {.count = 1, .reusable = true}}, SHIFT(192), + [760] = {.entry = {.count = 1, .reusable = true}}, SHIFT(157), + [762] = {.entry = {.count = 1, .reusable = true}}, SHIFT(273), + [764] = {.entry = {.count = 1, .reusable = true}}, SHIFT(182), + [766] = {.entry = {.count = 1, .reusable = true}}, SHIFT(158), + [768] = {.entry = {.count = 1, .reusable = true}}, SHIFT(210), + [770] = {.entry = {.count = 1, .reusable = true}}, SHIFT(293), + [772] = {.entry = {.count = 1, .reusable = true}}, SHIFT(2), + [774] = {.entry = {.count = 1, .reusable = true}}, SHIFT(288), + [776] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), + [778] = {.entry = {.count = 1, .reusable = true}}, SHIFT(292), + [780] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), + [782] = {.entry = {.count = 1, .reusable = true}}, SHIFT(286), + [784] = {.entry = {.count = 1, .reusable = true}}, SHIFT(325), + [786] = {.entry = {.count = 1, .reusable = true}}, SHIFT(153), + [788] = {.entry = {.count = 1, .reusable = true}}, SHIFT(146), + [790] = {.entry = {.count = 1, .reusable = true}}, SHIFT(311), + [792] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), + [794] = {.entry = {.count = 1, .reusable = true}}, SHIFT(101), + [796] = {.entry = {.count = 1, .reusable = true}}, SHIFT(270), + [798] = {.entry = {.count = 1, .reusable = true}}, SHIFT(301), + [800] = {.entry = {.count = 1, .reusable = true}}, SHIFT(291), + [802] = {.entry = {.count = 1, .reusable = true}}, SHIFT(287), + [804] = {.entry = {.count = 1, .reusable = true}}, SHIFT(296), + [806] = {.entry = {.count = 1, .reusable = true}}, SHIFT(137), + [808] = {.entry = {.count = 1, .reusable = true}}, SHIFT(147), + [810] = {.entry = {.count = 1, .reusable = true}}, SHIFT(5), + [812] = {.entry = {.count = 1, .reusable = true}}, SHIFT(166), + [814] = {.entry = {.count = 1, .reusable = true}}, SHIFT(211), + [816] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), + [818] = {.entry = {.count = 1, .reusable = true}}, SHIFT(164), + [820] = {.entry = {.count = 1, .reusable = true}}, SHIFT(317), + [822] = {.entry = {.count = 1, .reusable = true}}, SHIFT(4), + [824] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), + [826] = {.entry = {.count = 1, .reusable = true}}, SHIFT(277), + [828] = {.entry = {.count = 1, .reusable = true}}, SHIFT(181), + [830] = {.entry = {.count = 1, .reusable = true}}, SHIFT(295), + [832] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), + [834] = {.entry = {.count = 1, .reusable = true}}, SHIFT(300), + [836] = {.entry = {.count = 1, .reusable = true}}, SHIFT(140), + [838] = {.entry = {.count = 1, .reusable = true}}, SHIFT(212), + [840] = {.entry = {.count = 1, .reusable = true}}, SHIFT(309), + [842] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65), + [844] = {.entry = {.count = 1, .reusable = true}}, SHIFT(201), + [846] = {.entry = {.count = 1, .reusable = true}}, SHIFT(320), + [848] = {.entry = {.count = 1, .reusable = true}}, SHIFT(193), + [850] = {.entry = {.count = 1, .reusable = true}}, SHIFT(322), + [852] = {.entry = {.count = 1, .reusable = true}}, SHIFT(236), }; #ifdef __cplusplus @@ -8360,13 +7869,13 @@ TS_PUBLIC const TSLanguage *tree_sitter_mal(void) { .lex_modes = (const void*)ts_lex_modes, .lex_fn = ts_lex, .keyword_lex_fn = ts_lex_keywords, - .keyword_capture_token = sym_identity, + .keyword_capture_token = sym_identifier, .primary_state_ids = ts_primary_state_ids, .name = "mal", .max_reserved_word_set_size = 0, .metadata = { .major_version = 0, - .minor_version = 1, + .minor_version = 2, .patch_version = 0, }, }; diff --git a/src/tree_sitter/parser.h b/src/tree_sitter/parser.h index cdbe64c..858107d 100644 --- a/src/tree_sitter/parser.h +++ b/src/tree_sitter/parser.h @@ -18,7 +18,6 @@ typedef uint16_t TSStateId; typedef uint16_t TSSymbol; typedef uint16_t TSFieldId; typedef struct TSLanguage TSLanguage; -typedef struct TSLanguageMetadata TSLanguageMetadata; typedef struct TSLanguageMetadata { uint8_t major_version; uint8_t minor_version; diff --git a/test/corpus/asset.ts-test b/test/corpus/asset.ts-test index deee2ec..b0e88ce 100644 --- a/test/corpus/asset.ts-test +++ b/test/corpus/asset.ts-test @@ -11,9 +11,9 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity))))) + id: (identifier))))) ================================ Empty Abstract Asset Declaration @@ -28,9 +28,9 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity))))) + id: (identifier))))) ================================= Empty Extending Asset Declaration @@ -45,10 +45,10 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) - extends: (identity))))) + id: (identifier) + extends: (identifier))))) ========================================== Empty Extending Abstract Asset Declaration @@ -64,10 +64,10 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) - extends: (identity))))) + id: (identifier) + extends: (identifier))))) ================ Two Empty Assets @@ -83,11 +83,11 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity)) + id: (identifier)) assets: (asset_declaration - id: (identity))))) + id: (identifier))))) ====================================== Empty Asset Declaration with Meta Info @@ -105,17 +105,17 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) meta: (meta - id: (identity) + id: (identifier) info: (meta_string)) meta: (meta - id: (identity) + id: (identifier) info: (meta_string))) assets: (asset_declaration - id: (identity) + id: (identifier) meta: (meta - id: (identity) + id: (identifier) info: (meta_string)))))) diff --git a/test/corpus/association.ts-test b/test/corpus/association.ts-test index 6056ad2..a694104 100644 --- a/test/corpus/association.ts-test +++ b/test/corpus/association.ts-test @@ -24,15 +24,15 @@ associations { (declaration (associations_declaration (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (integer)) - id: (identity) + id: (identifier) right_mult: (multiplicity (integer)) - right_field_id: (identity) - right_id: (identity))))) + right_field_id: (identifier) + right_id: (identifier))))) ========================== Association Multiplicities @@ -53,81 +53,81 @@ associations { (declaration (associations_declaration (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (integer)) - id: (identity) + id: (identifier) right_mult: (multiplicity (integer)) - right_field_id: (identity) - right_id: (identity)) + right_field_id: (identifier) + right_id: (identifier)) (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (star)) - id: (identity) + id: (identifier) right_mult: (multiplicity (star)) - right_field_id: (identity) - right_id: (identity)) + right_field_id: (identifier) + right_id: (identifier)) (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (multiplicity_range start: (integer) end: (integer))) - id: (identity) + id: (identifier) right_mult: (multiplicity (multiplicity_range start: (integer) end: (integer))) - right_field_id: (identity) - right_id: (identity)) + right_field_id: (identifier) + right_id: (identifier)) (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (multiplicity_range start: (integer) end: (star))) - id: (identity) + id: (identifier) right_mult: (multiplicity (multiplicity_range start: (integer) end: (star))) - right_field_id: (identity) - right_id: (identity)) + right_field_id: (identifier) + right_id: (identifier)) (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (multiplicity_range start: (star) end: (integer))) - id: (identity) + id: (identifier) right_mult: (multiplicity (multiplicity_range start: (star) end: (integer))) - right_field_id: (identity) - right_id: (identity)) + right_field_id: (identifier) + right_id: (identifier)) (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (multiplicity_range start: (star) end: (star))) - id: (identity) + id: (identifier) right_mult: (multiplicity (multiplicity_range start: (star) end: (star))) - right_field_id: (identity) - right_id: (identity))))) + right_field_id: (identifier) + right_id: (identifier))))) =============================== Association Declaration example @@ -143,15 +143,15 @@ associations { (declaration (associations_declaration (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (star)) - id: (identity) + id: (identifier) right_mult: (multiplicity (star)) - right_field_id: (identity) - right_id: (identity))))) + right_field_id: (identifier) + right_id: (identifier))))) ====================================== Association Declaration with Meta Info @@ -170,31 +170,31 @@ associations { (declaration (associations_declaration (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (integer)) - id: (identity) + id: (identifier) right_mult: (multiplicity (integer)) - right_field_id: (identity) - right_id: (identity) + right_field_id: (identifier) + right_id: (identifier) meta: (meta - id: (identity) + id: (identifier) info: (meta_string)) meta: (meta - id: (identity) + id: (identifier) info: (meta_string))) (association - left_id: (identity) - left_field_id: (identity) + left_id: (identifier) + left_field_id: (identifier) left_mult: (multiplicity (integer)) - id: (identity) + id: (identifier) right_mult: (multiplicity (integer)) - right_field_id: (identity) - right_id: (identity) + right_field_id: (identifier) + right_id: (identifier) meta: (meta - id: (identity) + id: (identifier) info: (meta_string)))))) diff --git a/test/corpus/attackstep.ts-test b/test/corpus/attackstep.ts-test index 75f6d16..23b5c80 100644 --- a/test/corpus/attackstep.ts-test +++ b/test/corpus/attackstep.ts-test @@ -17,20 +17,25 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity)) + step_type: (step_type) + id: (identifier)) (attack_step - id: (identity)) + step_type: (step_type) + id: (identifier)) (attack_step - id: (identity)) + step_type: (step_type) + id: (identifier)) (attack_step - id: (identity)) + step_type: (step_type) + id: (identifier)) (attack_step - id: (identity))))))) + step_type: (step_type) + id: (identifier))))))) ==================== Attack-step with Tag @@ -47,13 +52,14 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) - tag: (identity))))))) + step_type: (step_type) + id: (identifier) + tag: (identifier))))))) ============================== Attack-step with Multiple Tags @@ -70,14 +76,15 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) - tag: (identity) - tag: (identity))))))) + step_type: (step_type) + id: (identifier) + tag: (identifier) + tag: (identifier))))))) ===================== Attack-step with CIAs @@ -98,29 +105,34 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) cias: (cias (cia))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) cias: (cias (cia))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) cias: (cias (cia))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) cias: (cias (cia) (cia))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) cias: (cias (cia) (cia)))))))) @@ -151,46 +163,53 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (integer))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_binop left: (integer) right: (integer)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_binop left: (integer) right: (integer)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_binop left: (integer) right: (integer)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_binop left: (integer) right: (integer)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_binop left: (integer) right: (integer)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_binop left: (integer) @@ -198,7 +217,8 @@ category Test { left: (integer) right: (integer))))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_binop left: (integer) @@ -206,7 +226,8 @@ category Test { left: (integer) right: (integer))))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_binop left: (ttc_binop @@ -214,20 +235,23 @@ category Test { right: (integer)) right: (integer)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc - (identity))) + (identifier))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_distribution - id: (identity) + id: (identifier) values: (integer)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) ttc: (ttc (ttc_distribution - id: (identity) + id: (identifier) values: (integer) values: (integer))))))))) @@ -249,22 +273,24 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) meta: (meta - id: (identity) + id: (identifier) info: (meta_string)) meta: (meta - id: (identity) + id: (identifier) info: (meta_string))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) meta: (meta - id: (identity) + id: (identifier) info: (meta_string)))))))) ========================= @@ -289,31 +315,35 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) reaches: (reaching reaches: (asset_expr - (identity)))) + (identifier)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) reaches: (reaching reaches: (asset_expr - (identity)) + (identifier)) reaches: (asset_expr - (identity)))) + (identifier)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) reaches: (reaching reaches: (asset_expr - (identity)))) + (identifier)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) reaches: (reaching reaches: (asset_expr - (identity)) + (identifier)) reaches: (asset_expr - (identity))))))))) + (identifier))))))))) diff --git a/test/corpus/category.ts-test b/test/corpus/category.ts-test index f275954..fa62f82 100644 --- a/test/corpus/category.ts-test +++ b/test/corpus/category.ts-test @@ -9,7 +9,7 @@ category System {} (source_file (declaration (category_declaration - id: (identity)))) + id: (identifier)))) ========================================= Empty Category Declaration with Meta Info @@ -25,16 +25,16 @@ category System sameLine info: "Meta on same line" {} (source_file (declaration (category_declaration - id: (identity) + id: (identifier) meta: (meta - id: (identity) + id: (identifier) info: (meta_string)) meta: (meta - id: (identity) + id: (identifier) info: (meta_string)))) (declaration (category_declaration - id: (identity) + id: (identifier) meta: (meta - id: (identity) + id: (identifier) info: (meta_string))))) diff --git a/test/corpus/define.ts-test b/test/corpus/define.ts-test index 3fe9598..608eec2 100644 --- a/test/corpus/define.ts-test +++ b/test/corpus/define.ts-test @@ -9,7 +9,7 @@ Define Declaration (source_file (declaration (define_declaration - id: (identity) + id: (identifier) value: (string)))) =========================== @@ -25,15 +25,15 @@ Multiple Define Declaration (source_file (declaration (define_declaration - id: (identity) + id: (identifier) value: (string))) (declaration (define_declaration - id: (identity) + id: (identifier) value: (string))) (declaration (define_declaration - id: (identity) + id: (identifier) value: (string)))) ============================================= diff --git a/test/corpus/detector.ts-test b/test/corpus/detector.ts-test index 9b5bef1..50ca5e0 100644 --- a/test/corpus/detector.ts-test +++ b/test/corpus/detector.ts-test @@ -13,20 +13,21 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) detector: (detector context: (detector_context (detector_context_asset - type: (identity) - id: (identity)) + type: (identifier) + id: (identifier)) (detector_context_asset - type: (identity) - id: (identity)))))))))) + type: (identifier) + id: (identifier)))))))))) ========================== Commented Minimal Detector @@ -43,20 +44,21 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) detector: (detector context: (detector_context (detector_context_asset - type: (identity) - id: (identity)) + type: (identifier) + id: (identifier)) (detector_context_asset - type: (identity) - id: (identity)))))))))) + type: (identifier) + id: (identifier)))))))))) =========================== Detector with Detector Name @@ -73,21 +75,22 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) detector: (detector name: (detector_name - (identity) - (identity) - (identity)) + (identifier) + (identifier) + (identifier)) context: (detector_context (detector_context_asset - type: (identity) - id: (identity)))))))))) + type: (identifier) + id: (identifier)))))))))) =========================== Detector with Detector Type @@ -104,18 +107,19 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) detector: (detector context: (detector_context (detector_context_asset - type: (identity) - id: (identity))) - type: (identity)))))))) + type: (identifier) + id: (identifier))) + type: (identifier)))))))) ================= Detector with TTC @@ -132,16 +136,17 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) detector: (detector context: (detector_context (detector_context_asset - type: (identity) - id: (identity))) + type: (identifier) + id: (identifier))) ttc: (ttc (integer))))))))) diff --git a/test/corpus/precondition.ts-test b/test/corpus/precondition.ts-test index 7c241b7..d2db8e9 100644 --- a/test/corpus/precondition.ts-test +++ b/test/corpus/precondition.ts-test @@ -16,22 +16,24 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) preconditions: (preconditions condition: (asset_expr - (identity)))) + (identifier)))) (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) preconditions: (preconditions condition: (asset_expr - (identity)) + (identifier)) condition: (asset_expr - (identity))))))))) + (identifier))))))))) ============================================================ Attack-step with asset expression operators in Pre-condition @@ -58,54 +60,55 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (attack_step - id: (identity) + step_type: (step_type) + id: (identifier) preconditions: (preconditions condition: (asset_expr - (identity)) + (identifier)) condition: (asset_expr (asset_expr_binop - left: (identity) - right: (identity))) + left: (identifier) + right: (identifier))) condition: (asset_expr (asset_expr_binop - left: (identity) - right: (identity))) + left: (identifier) + right: (identifier))) condition: (asset_expr (asset_expr_binop - left: (identity) - right: (identity))) + left: (identifier) + right: (identifier))) condition: (asset_expr (asset_expr_binop - left: (identity) - right: (identity))) + left: (identifier) + right: (identifier))) condition: (asset_expr (asset_expr_binop left: (asset_expr_binop - left: (identity) - right: (identity)) - right: (identity))) + left: (identifier) + right: (identifier)) + right: (identifier))) condition: (asset_expr (asset_expr_binop left: (asset_variable_substitution - id: (identity)) - right: (identity))) + id: (identifier)) + right: (identifier))) condition: (asset_expr (asset_expr_binop left: (asset_expr_unop - expression: (identity)) - right: (identity))) + expression: (identifier)) + right: (identifier))) condition: (asset_expr (asset_expr_type - expression: (identity) - type_id: (identity))) + expression: (identifier) + type_id: (identifier))) condition: (asset_expr (asset_expr_type expression: (asset_expr_type - expression: (identity) - type_id: (identity)) - type_id: (identity)))))))))) + expression: (identifier) + type_id: (identifier)) + type_id: (identifier)))))))))) diff --git a/test/corpus/variable.ts-test b/test/corpus/variable.ts-test index 810f2da..575415b 100644 --- a/test/corpus/variable.ts-test +++ b/test/corpus/variable.ts-test @@ -13,11 +13,11 @@ category Test { (source_file (declaration (category_declaration - id: (identity) + id: (identifier) assets: (asset_declaration - id: (identity) + id: (identifier) body: (asset_definition (asset_variable - id: (identity) + id: (identifier) value: (asset_expr - (identity)))))))) + (identifier)))))))) diff --git a/tree-sitter.json b/tree-sitter.json index 3ed27be..bcccdb0 100644 --- a/tree-sitter.json +++ b/tree-sitter.json @@ -12,7 +12,7 @@ } ], "metadata": { - "version": "0.1.0", + "version": "0.2.0", "license": "MIT", "description": "IT systems are growing in complexity and the threat from cyberattacks is increasing. Threat modeling is a process that can be used to analyze potential attacks to IT systems in order to facilitate secure design. Meta Attack Language (MAL) is a threat modeling language framework for the creation of domain specific languages (DSL). MAL is developed at KTH Royal Institute of Technolog", "authors": [