I am working on a project to create a compiler in Ruby, even simple compilers will still have a lot of code. I plan on having classes like SymbolTable, Lexer,Parser etc....
All of these classes perform specific operations, but I would still like to group them under one namespace, is it possible to do this in separate files?
ex:
File#1 SymbolTable.rb
module PL0Compiler
class SymbolTable
#....
end
end
File#2 Lever.rb
module PL0Compiler
class Lexer
#....
end
end
Yes, it is. But it would have taken you less time to try it out than to ask, so it's a weird question. Maybe you don't know how to access it? Here is a rather elaborate example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With