Basic help for uni paper

Hi,

I am a German student and I just need some basic help for a “term
paper”. I have to write a compiler for ruby with EBNF and save the
results in a sqlite database. The problem that i have, is that I cant
find any propper ruby examples online. I need a basic ruby programm,
that has 3-7 .rb files. Online I can only find ruby code that is all in
one rb file. But the compiler that I am working on, has to deal with
“required” ruby files, and look in those files for class definitions
etc. So, does anyone have an example for me, or at least a page where I
could find some good examples?
thanks in advance
greets from germany

Joao S. wrote:

I have to write a compiler for ruby with EBNF and save the
results in a sqlite database. The problem that i have, is that I cant
find any propper ruby examples online. I need a basic ruby programm,
that has 3-7 .rb files. Online I can only find ruby code that is all in
one rb file. But the compiler that I am working on, has to deal with
“required” ruby files, and look in those files for class definitions
etc. So, does anyone have an example for me, or at least a page where I
could find some good examples?

Well, if you’re going to write a ruby compiler, then you’re going to
have to learn the language pretty thoroughly, and so you’ll easily be
able to write a test program which spans 3 sources files :slight_smile:

There are loads of projects you can look at starting from
raa.ruby-lang.org and rubyforge.org

www.ruby-doc.org is also a good starting point, especially the book
“Programming Ruby”. Click on the chapter entitled “Modules”, which
further down gives a description of require/load.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs