renamed (again)

This commit is contained in:
Torsten Ruger 2014-07-17 02:24:24 +03:00
parent 300b266366
commit 5e313f7744
5 changed files with 13 additions and 13 deletions

View File

@ -1,17 +1,17 @@
## Sapphire Reader*
## Kide Reader*
The parser part of sapphire is now a standalone gem. It parses ruby using Parslet and no other dependencies.
The parser part of kide is now a standalone gem. It parses ruby using Parslet and no other dependencies.
This is interesing if you want to generate executable code, like sapphire, but also for other things, like code analysis.
This is interesing if you want to generate executable code, like kide, but also for other things, like code analysis.
Also it is very educational, as it is very readable code, and not too much of it.
*
It looks into it's sapphire ball and all it sees is red. A red sapphire . . . ruby, yes.
It looks into it's kide ball and all it sees is red. A red kide . . . ruby, yes.
### Parser
The main parser per se is in parser/sapphire , but it just pulls in all the parts.
The main parser per se is in parser/kide , but it just pulls in all the parts.
All the other files are ruby modules representing aspects of the parser. Most names are quite self explanitory, but here is a list:
@ -32,7 +32,7 @@ All the other files are ruby modules representing aspects of the parser. Most n
The Abtract Syntax Tree (ast) layer puts the parsed code into objects, so they are nice and easy to work with.
The Classes don't really define any functionality, that is done in Sapphire, or can be done in any code using this. Sapphire just adds a compile function to each class, but a visitor pattern would do just as well.
The Classes don't really define any functionality, that is done in Kide, or can be done in any code using this. Kide just adds a compile function to each class, but a visitor pattern would do just as well.
The functionality that is in there is mainly to do with testing. Equality is defined, but also **inspect** in such a way that it's output (which you get from a failing test) can be pasted straight into the test case as the expected result.

View File

@ -14,11 +14,11 @@ require 'rake'
require 'jeweler'
Jeweler::Tasks.new do |gem|
# gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
gem.name = "sapphire-reader"
gem.homepage = "http://github.com/sapphire-vm/sapphire-reader"
gem.name = "kide-reader"
gem.homepage = "http://github.com/kide-vm/kide-reader"
gem.license = "GPL3"
gem.summary = %Q{Parse ruby in ruby using parslet.}
gem.description = %Q{Sapphire reader is part of the sapphire vm. The reader reads (parses) ruby and
gem.description = %Q{Kide reader is part of the kide vm. The reader reads (parses) ruby and
creates an ast from it. There are no other dependencies than parslet, which itself has hardly any.
The gem may be useful for code analysis tools or for education.
Two ways to use it include adding functions to each of the AST classes, or using a visitor patter.}
@ -48,7 +48,7 @@ Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""
rdoc.rdoc_dir = 'rdoc'
rdoc.title = "sapphire-reader #{version}"
rdoc.title = "kide-reader #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end

View File

@ -1,3 +1,3 @@
require 'parslet'
require 'parser/sapphire'
require 'parser/kide'
require 'parser/transform'

View File

@ -19,7 +19,7 @@ module Parser
# a maybe removes the 0 a sequence (array) to a single (hash). Thus 2 transformations are needed
# More work than the prettiness is worth, so only use .maybe on something that does not need capturing
class Sapphire < Parslet::Parser
class Kide < Parslet::Parser
include BasicTypes
include CompoundTypes
include Tokens

View File

@ -17,7 +17,7 @@ module ParserHelper
module InstanceMethods
def setup
@parser = Parser::Sapphire.new
@parser = Parser::Kide.new
@transform = Parser::Transform.new
end