rubyx/lib/ruby
Torsten Rüger 7c91a08d5b Fix vool assignments after call rework
also small fix for if and return, as they need to execute sneds and yields (not just sends), so testing for Call not SendStatement
2019-08-16 20:39:08 +03:00
..
array_statement.rb start a new ruby layer to do the to_vool conversion 2018-07-19 14:46:51 +03:00
assignment.rb rename callable to CallStatement 2018-07-30 14:44:14 +03:00
basic_values.rb Fix ruby receiver to vool 2019-08-16 16:05:45 +03:00
block_statement.rb first run at ruby block to_vool 2018-07-20 20:07:15 +03:00
call_statement.rb Fix ruby receiver to vool 2019-08-16 16:05:45 +03:00
class_method_statement.rb class Methods down to vool #24 2019-02-14 19:24:12 +02:00
class_statement.rb still doing attr_reader, but closing #25 2019-03-07 11:00:18 +02:00
hash_statement.rb start a new ruby layer to do the to_vool conversion 2018-07-19 14:46:51 +03:00
if_statement.rb Fix if statements hoisting, now that send is working 2019-08-16 18:42:57 +03:00
logical_statement.rb remove unused code 2018-09-01 15:14:07 +03:00
method_statement.rb fix method to_vool 2018-07-19 21:36:28 +03:00
normalizer.rb Fix ruby normalising to_vool 2019-08-16 14:20:06 +03:00
README.md Some docs 2019-08-06 17:42:15 +03:00
return_statement.rb Fix vool assignments after call rework 2019-08-16 20:39:08 +03:00
ruby_compiler.rb Fix if logic error 2019-03-05 20:30:24 +02:00
send_statement.rb Fix ruby normalising to_vool 2019-08-16 14:20:06 +03:00
statement.rb Some docs and to_s testing 2018-09-01 15:54:25 +03:00
statements.rb Fixing ruby send with arguments 2019-08-15 21:30:36 +03:00
variables.rb Fix ruby normalising to_vool 2019-08-16 14:20:06 +03:00
while_statement.rb Fix ruby normalising to_vool 2019-08-16 14:20:06 +03:00
yield_statement.rb Some docs and to_s testing 2018-09-01 15:54:25 +03:00

Ruby

A representation of the ruby code.

Concrete Syntax tree

Ruby is parsed by the parser gem (big thanks to whitequark). Own attempts at this task have failed utterly, because ruby is a huge language (and not well defined at that)

Alas, the parser gem creates an abstract syntax tree, meaning one class is used to represent all node types.

Imho object oriented languages have a class system to do just that, ie represent what we may loosely call type here, ie the kind of statement.

The ruby layer is really all about defining classes for every kind of statement, thus "typing" the syntax tree, and making it concrete.

to Vool

In our nice layers, we are ont the way down to Vool, a simplified version of oo.

It has proven handy to have this layer, so the code for transforming each object is in the class representing that object. (As one does in oo, again imho).

Parfait objects

The compilation process ends up creating (parfait) objects to represent things like classes, types and constants. This is not done here yet, but in the vool layer.