#lang scheme/base
(provide (all-defined-out))
(define-struct Term (location) #:transparent)
(define-struct (Declaration Term) () #:transparent)
(define-struct (Statement Term) () #:transparent)
(define-struct (Expression Term) () #:transparent)
(define-struct (FunctionDeclaration Declaration) (name args body) #:transparent)
(define-struct (VariableDeclaration Declaration) (bindings) #:transparent)
(define-struct (VariableInitializer Term) (id init) #:transparent)
(define-struct (LetDeclaration Declaration) (bindings) #:transparent)
(define-struct (StringLiteral Expression) (value) #:transparent)
(define-struct (NumericLiteral Expression) (value) #:transparent)
(define-struct (BooleanLiteral Expression) (value) #:transparent)
(define-struct (NullLiteral Expression) () #:transparent)
(define-struct (RegexpLiteral Expression) (pattern global? case-insensitive?) #:transparent)
(define-struct (ArrayLiteral Expression) (elements) #:transparent)
(define-struct (ObjectLiteral Expression) (properties) #:transparent)
(define-struct (ThisReference Expression) () #:transparent)
(define-struct (VarReference Expression) (id) #:transparent)
(define-struct (BracketReference Expression) (container key) #:transparent)
(define-struct (DotReference Expression) (container id) #:transparent)
(define-struct (NewExpression Expression) (constructor arguments) #:transparent)
(define-struct (PostfixExpression Expression) (expression operator) #:transparent)
(define-struct (PrefixExpression Expression) (operator expression) #:transparent)
(define-struct (InfixExpression Expression) (left operator right) #:transparent)
(define-struct (ConditionalExpression Expression) (test consequent alternate) #:transparent)
(define-struct (AssignmentExpression Expression) (lhs operator rhs) #:transparent)
(define-struct (FunctionExpression Expression) (name args body) #:transparent)
(define-struct (LetExpression Expression) (bindings body) #:transparent)
(define-struct (CallExpression Expression) (method args) #:transparent)
(define-struct (ParenExpression Expression) (expression) #:transparent)
(define-struct (ListExpression Expression) (expressions) #:transparent)
(define-struct (BlockStatement Statement) (statements) #:transparent)
(define-struct (EmptyStatement Statement) () #:transparent)
(define-struct (ExpressionStatement Statement) (expression) #:transparent)
(define-struct (IfStatement Statement) (test consequent alternate) #:transparent)
(define-struct (DoWhileStatement Statement) (body test) #:transparent)
(define-struct (WhileStatement Statement) (test body) #:transparent)
(define-struct (ForStatement Statement) (init test incr body) #:transparent)
(define-struct (ForInStatement Statement) (lhs container body) #:transparent)
(define-struct (ContinueStatement Statement) (label) #:transparent)
(define-struct (BreakStatement Statement) (label) #:transparent)
(define-struct (ReturnStatement Statement) (value) #:transparent)
(define-struct (LetStatement Statement) (bindings body) #:transparent)
(define-struct (WithStatement Statement) (context body) #:transparent)
(define-struct (SwitchStatement Statement) (expression cases) #:transparent)
(define-struct (LabelledStatement Statement) (label statement) #:transparent)
(define-struct (ThrowStatement Statement) (value) #:transparent)
(define-struct (TryStatement Statement) (body catch finally) #:transparent)
(define-struct (Identifier Term) (name) #:transparent)
(define-struct (CaseClause Term) (question answer) #:transparent)
(define-struct (CatchClause Term) (id body) #:transparent)