First version of the ASTDebugger on master

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

First version of the ASTDebugger on master

Nicolas Petton
Hi guys,

If you clone the master repo, you can see the new ASTInterpreter and
ASTDebugger classes.

The ASTInterpreter is able to interpret Amber code without compiling it
into JS. The debugger, a subclass of the interpreter, has stepping
capabilities.

While it's not 100% working yet (the tests show that the interpret
supports most of the language already), you can give it a try with the
SUnit tests, or by running something like the following:

    | ast debugger |
    ast := Smalltalk current parse: 'foo 1 + 2 + 4'.
    (SemanticAnalyzer on: Object) visit: ast.

    debugger := ASTDebugger new
        context: (AIContext new receiver: Object new; yourself);
        interpret: ast nodes first;
        yourself.
       
    debugger step; step.
    debugger step; step.
    debugger result."Answers 1"
    debugger step.
    debugger result. "Answers 3"
    debugger step.
    debugger result. "Answers 7"
   

Cheers!
Nico

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


Reply | Threaded
Open this post in threaded view
|

Re: First version of the ASTDebugger on master

Guido Stepken

Wow! Seems, Amber becomes a quite usable system. A suggestion to implement:

http://www.kickstarter.com/projects/ibdknox/light-table

Should enormously raise acceptance for beginners and in education.

Price of worth - see kickstarter! ;-)

Have fun!

Am 15.02.2013 16:24 schrieb "Nicolas Petton" <[hidden email]>:
Hi guys,

If you clone the master repo, you can see the new ASTInterpreter and
ASTDebugger classes.

The ASTInterpreter is able to interpret Amber code without compiling it
into JS. The debugger, a subclass of the interpreter, has stepping
capabilities.

While it's not 100% working yet (the tests show that the interpret
supports most of the language already), you can give it a try with the
SUnit tests, or by running something like the following:

    | ast debugger |
    ast := Smalltalk current parse: 'foo 1 + 2 + 4'.
    (SemanticAnalyzer on: Object) visit: ast.

    debugger := ASTDebugger new
        context: (AIContext new receiver: Object new; yourself);
        interpret: ast nodes first;
        yourself.

    debugger step; step.
    debugger step; step.
    debugger result."Answers 1"
    debugger step.
    debugger result. "Answers 3"
    debugger step.
    debugger result. "Answers 7"


Cheers!
Nico

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.