[plt-scheme] Looking for a standardized way to have syntax-debugger recognize a custum language.

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Tue May 29 16:16:26 EDT 2007

On May 29, 2007, at 3:09 PM, Kyle Smith wrote:

> Hi,
>
> I'm sure that I'm not the only person that has written a custum
> language for their private use, so I'm wondering if their might
> be a better way than the method I describe below to get the
> syntax-debugger to show up whenever I'm in my custom
> language.  Syntax-debugger already supports module based
> languages, but mine resides in it's own directory in collects so
> that I can have it available to me by simply selecting it from
> the languages drop-down in the lower left of DrScheme.
>
> Currently, I make the following changes in two source files
> whenever I download a new version:
>
> macro-debugger/tools.ss:
>
> (define (macro-stepper-works-for? lang)
>   (let ([main-group (car lang)]
>         [second (and (pair? (cdr lang))
>                      (cadr lang))]
>         [third (and (pair? (cdr lang))
>                     (pair? (cddr lang))
>                     (caddr lang))])
>     (and
>      (equal?
>       main-group
>       (string-constant professional-languages))
>      (or
>       (member
>        second
>        (list
>          (string-constant r5rs-lang-name)
>          ;;; internal SchemeKeys language
>          (string-constant schemekeys-language)
>          "(module ...)"
>          "Swindle"))
>       (member
>        third
>        (list
>          (string-constant mzscheme-w/debug)
>          (string-constant mred-w/debug)
>          (string-constant pretty-big-scheme)))))))
>
> string-constants/english-string-constants.ss
>
>  ;;; languages
> ...
>  (r5rs-one-line-summary "R5RS, with no frills")
> ;;; internal SchemeKeys languagae
>   (schemekeys-language "SchemeKeys")
>  (expander "Expander")
> ...
>
> and my info.ss file looks like this:
>
> (module info (lib "infotab.ss" "setup")
>   (require
>           (lib "string-constant.ss" "string-constants"))
>   (define name "SchemeKeys")
>   (define drscheme-language-modules
>     (list "schemekeys.ss"))
>   (define drscheme-language-numbers
>     '((-1000 0)))
>   (define drscheme-language-positions
>     (list (list (string-constant professional-languages)
>   (string-constant schemekeys-language)))))
>
> At first I tried simply changing my info.ss to the above,
> hoping that it would then be recognized by syntax-debugger
> as belonging to the group of professional-languages that it
> appears it supports as a group.  But, that wasn't sufficient,
> so I added the reference to schemekeys in tool.ss itself,
> and that worked.
>
> Is there an easier way through my info.ss file to achieve the
> same effect?

If you created your languages through a DrScheme tool, you could 
override the 'enable-macro-stepper?' method added to the 
'drscheme:language:language<%>' instance the tool creates. See the 
section "Notes for DrScheme language implementors" at the end of 
"macro-debugger/doc.txt".

I don't know of a way of doing that with just the "info.ss" file. If 
someone could point out a way of getting from an arbitrary language to 
a (maybe) "info.ss" path for that language, then I could add a new 
"info.ss" field for the macro stepper to check. I'm open to other 
ideas, too.

Ryan

>
> Thanks,
>
> --kyle
> airfoil at bellsouth dot net
> schemekeys.blogspot.com
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.