From ee080b92ebaf6d2ef9e6de71a9c0d3631f2b30fe Mon Sep 17 00:00:00 2001 From: Ryan Culpepper Date: Fri, 26 Jan 2007 19:53:55 +0000 Subject: [PATCH] Macro stepper: cleaned up representation of big (localaction) contexts unitized hiding impl added (broken/experimental) navigation tools (jump, zoom) svn: r5468 original commit: ef1f77c33fc8082c80b6beea80f6f149ac7f8031 --- collects/macro-debugger/model/reductions-engine.ss | 10 ++++------ collects/macro-debugger/model/steps.ss | 12 ++++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/collects/macro-debugger/model/reductions-engine.ss b/collects/macro-debugger/model/reductions-engine.ss index 6335540..d5b2f2a 100644 --- a/collects/macro-debugger/model/reductions-engine.ss +++ b/collects/macro-debugger/model/reductions-engine.ss @@ -44,15 +44,13 @@ (syntax-rules () [(with-new-local-context e . body) (parameterize ([big-context - (cons (cons (current-derivation) - (cons (list e) - (context))) + (cons (make-bigframe (current-derivation) (context) (list e) e) (big-context))] [context null]) . body)])) - + ;; ----------------------------------- - + ;; CC ;; the context constructor (define-syntax (CC stx) @@ -66,7 +64,7 @@ (syntax-rules () [(R form pattern . clauses) (R** #f _ [#:set-syntax form] [#:pattern pattern] . clauses)])) - + (define-syntax (R** stx) (syntax-case stx (! @ List Block =>) [(R** form-var pattern) diff --git a/collects/macro-debugger/model/steps.ss b/collects/macro-debugger/model/steps.ss index 80906ad..18c3478 100644 --- a/collects/macro-debugger/model/steps.ss +++ b/collects/macro-debugger/model/steps.ss @@ -5,13 +5,14 @@ ;; A ReductionSequence is a (list-of Reduction) ;; A ProtoStep is (make-protostep Derivation BigContext StepType Context) - + ;; A Context is a list of Frames ;; A Frame is (syntax -> syntax) - ;; A BigContext is (list-of (cons Derivation (cons Syntaxes Syntax))) - ;; local expansion contexts: deriv, foci, term - + ;; A BigContext is (list-of BigFrame) + ;; A BigFrame is (make-bigframe Derivation Context Syntaxes Syntax) + (define-struct bigframe (deriv ctx foci e)) + ;; A Reduction is one of ;; - (make-step ... Syntaxes Syntaxes Syntax Syntax) ;; - (make-misstep ... Syntax Syntax Exception) @@ -36,6 +37,9 @@ (define (misstep-term1 s) (context-fill (protostep-ctx s) (misstep-e1 s))) + (define (bigframe-term bf) + (context-fill (bigframe-ctx bf) (bigframe-e bf))) + ;; A StepType is a simple in the following alist. (define step-type-meanings