ASTcentric logo

Study 1

In order to study some implications of a purely AST-centric IDE I wrote a prototype in Java (download it here).

It is an IDE for a tiny procedural language which I called 'Simple'. Here are the main features of Simple:

  • Scalar variables: Types are integer, floating point number, boolean, and string. Not type-safe.
  • Operators: '+', '-', '*', '/', '>', '>=', '<', '<=', '>', '>=', '=', '!='
  • Functions with scalar result and arbitrary but fixed number of arguments.
  • Assignment statement
  • If, elseif, and else statements
  • While statement
  • Return statement
  • Console output
  • Console input
The screen shot shows some of the advantages of an AST-centric IDE:
  • Graphical non-textual visualization of the tree.
  • Expanding/collapsing of tree nodes.
  • Visualization mixes text (in different fonts and colors) and icons.
  • Pretty line wrapping.
  • Dynamic line wrapping: Statements will be wrapped around if the width of the window shrinks.
The AST is stored in an ASCII file in a very compact format (not XML). Here is the example from the screen shot:
b
(
f:1.fibonacci:x
(
i:LT:v-1:L2
(
r:v-2
)
e
(
a:f1:f-3.1:1:SUB:v-3:L1
a:f2:f-4.1:1:SUB:v-4:L2
r:ADD:v-2:v-1
)
)
a:v:I0
w:GE:v-1:I0
(
t:-2:"Enter a number: "
p:ADD:"fibonacci(":ADD:v-3:ADD:")=":f-4.1:1:v-3
)
)