diff --git a/lib/crystal.rb b/lib/crystal.rb index 9911681c..d643114c 100644 --- a/lib/crystal.rb +++ b/lib/crystal.rb @@ -2,7 +2,7 @@ require 'parslet' require "asm/program" require "elf/object_writer" -require 'vm/parser' +require 'parser/parser' +require 'parser/transform' require 'vm/nodes' -require 'vm/transform' diff --git a/lib/parser/README.markdown b/lib/parser/README.markdown new file mode 100644 index 00000000..bb2b9f16 --- /dev/null +++ b/lib/parser/README.markdown @@ -0,0 +1,14 @@ +Parser +================ + +This includes the parser and generated ast. + +Parslet is really great in that it: +- does not generate code but instean gives a clean dsl to define a grammar +- uses ruby modules so one can split the grammars up +- has a seperate tranform stage to generate an ast layer + +Especially the last point is great. Since it is seperate it does not clutter up the actual grammar. +And it can generate a layer that has no links to the actual parser anymore, thus saving/automating +a complete tranformation process. + diff --git a/lib/vm/copied_parser.rb b/lib/parser/copied_parser.rb similarity index 100% rename from lib/vm/copied_parser.rb rename to lib/parser/copied_parser.rb diff --git a/lib/vm/parser.rb b/lib/parser/parser.rb similarity index 100% rename from lib/vm/parser.rb rename to lib/parser/parser.rb diff --git a/lib/vm/transform.rb b/lib/parser/transform.rb similarity index 100% rename from lib/vm/transform.rb rename to lib/parser/transform.rb diff --git a/lib/vm/README.markdown b/lib/vm/README.markdown index 73c7965a..eabe386d 100644 --- a/lib/vm/README.markdown +++ b/lib/vm/README.markdown @@ -1,18 +1,3 @@ -Parser -================ - -This includes the parser and generated ast. - -Parslet is really great in that it: -- does not generate code but instean gives a clean dsl to define a grammar -- uses ruby modules so one can split the grammars up -- has a seperate tranform stage to generate an ast layer - -Especially the last point is great. Since it is seperate it does not clutter up the actual grammar. -And it can generate a layer that has no links to the actual parser anymore, thus saving/automating -a complete tranformation process. - - Virtual Machine ===============