From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- third_party/python/json_e/jsone/AST.py | 52 ++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 third_party/python/json_e/jsone/AST.py (limited to 'third_party/python/json_e/jsone/AST.py') diff --git a/third_party/python/json_e/jsone/AST.py b/third_party/python/json_e/jsone/AST.py new file mode 100644 index 0000000000..3503f79dfc --- /dev/null +++ b/third_party/python/json_e/jsone/AST.py @@ -0,0 +1,52 @@ +class ASTNode(object): + def __init__(self, token): + self.token = token + + +Primitive = ASTNode + + +class BinOp(ASTNode): + def __init__(self, token, left, right): + ASTNode.__init__(self, token) + self.left = left + self.right = right + + +class UnaryOp(ASTNode): + def __init__(self, token, expr): + ASTNode.__init__(self, token) + self.expr = expr + + +class FunctionCall(ASTNode): + def __init__(self, token, name, args): + ASTNode.__init__(self, token) + self.name = name + self.args = args + + +class ContextValue(ASTNode): + def __init__(self, token): + ASTNode.__init__(self, token) + + +class List(ASTNode): + def __init__(self, token, list): + ASTNode.__init__(self, token) + self.list = list + + +class ValueAccess(ASTNode): + def __init__(self, token, arr, isInterval, left, right): + ASTNode.__init__(self, token) + self.arr = arr + self.isInterval = isInterval + self.left = left + self.right = right + + +class Object(ASTNode): + def __init__(self, token, obj): + ASTNode.__init__(self, token) + self.obj = obj -- cgit v1.2.3