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