Zomis / Brainduck

Brainfuck Interpreter in Java/Groovy, with a Groovy DSL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Abstract Syntax Tree

Zomis opened this issue · comments

If @retailcoder can do it then so can I. And in fact, it would be useful to have it.

At the moment I need to run the code in order to analyze it, with an AST, the code could be analyzed and simplified, and hints/warnings/errors shown without the code being executed.

This could also have major impact on the core code, as data structures can be changed and code could run faster.

An important question is: Should each token know its span to be shown in the IDE?

We'll start with each token knowing its span, I believe that it should not cause any problems.

The goal with the AST is to implement static code analysis and to possibly improve the runspeed of code (although compile time will increase)

As a start, the code will only be lexed and parsed at specific occasions, a future goal would be to lex and parse the code as the IDE is edited, see http://chat.stackexchange.com/transcript/8595?m=33308498#33308498