[llvm] [Dexter] Add basic structured script parsing (PR #193710)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Thu May 7 08:24:49 PDT 2026
================
@@ -0,0 +1,202 @@
+# DExTer : Debugging Experience Tester
+# ~~~~~~ ~ ~~ ~ ~~
+#
+# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+"""This file defines all of the Nodes used to create Dexter scripts. All Nodes must be registered with the yaml
+constructor/representer in `setup_yaml_parser` before loading or printing any script.
+"""
+
+import abc
+from dataclasses import dataclass
+from typing import Any, Dict, Optional, Union
+import yaml
+from dex.dextIR.ValueIR import ValueIR
+from dex.utils.Exceptions import Error
+
+
+def setup_yaml_parser(loader):
+ reg_classes = [
+ Where,
+ Value,
+ DexRange,
+ ]
+ for c in reg_classes:
+ c.register_yaml(loader)
+
+
+class DexterNodeError(Error):
+ """Class representing errors with Dexter node parsing."""
+
+ def __init__(self, node, msg):
+ super(DexterNodeError, self).__init__(msg)
+ self.msg = msg
+ self.node = node
+
+ def __str__(self):
+ return f"Error with node: {self.node}: {self.msg}"
+
+
+###################
+## Structural Nodes: These are used as keys in the Script, and collectively define Dexter's actions when running a test:
+## how it steps and navigates through the debuggee program, and what information it collects from the
+## debugger.
+
+
+class Where:
+ """ "One or more instances of this class define a range of steps in a debugging session. Any expects in the script
----------------
OCHyams wrote:
nit, extra "?
https://github.com/llvm/llvm-project/pull/193710
More information about the llvm-commits
mailing list