From 436a5dac5a7738c90101bbef08691bcbc06f42fd Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Sun, 27 Apr 2014 15:38:07 +0300 Subject: [PATCH] created own directory for parser --- lib/crystal.rb | 4 ++-- lib/parser/README.markdown | 14 ++++++++++++++ lib/{vm => parser}/copied_parser.rb | 0 lib/{vm => parser}/parser.rb | 0 lib/{vm => parser}/transform.rb | 0 lib/vm/README.markdown | 15 --------------- 6 files changed, 16 insertions(+), 17 deletions(-) create mode 100644 lib/parser/README.markdown rename lib/{vm => parser}/copied_parser.rb (100%) rename lib/{vm => parser}/parser.rb (100%) rename lib/{vm => parser}/transform.rb (100%) 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 ===============