Melbourne is Rubinius' parser component. The +melbourne+ gem extracts this parser component for stand-alone use under MRI and other environments.
For Melbourne's full RDoc, see rdoc.info.
Melbourne generates abstract syntax trees (ASTs) from Ruby source code:
require 'melbourne' 'class Test; end'.to_ast # => <AST::Class:0x1017800f8 @line=1, @body=#<AST::EmptyBody:0x101780058 @line=1>, @name=#<AST::ClassName:0x101780080 @line=1, @superclass=#<AST::Nil:0x1017800a8 @line=1>, @name=:Test>, @superclass=#<AST::Nil:0x1017800a8 @line=1>>
Abstract Syntax Trees
Abstract syntax trees allow for deep introspection of Ruby source code and are far easier to handle than e.g. S-expressions as provided by ParseTree and other gems.
For more information on abstract syntax trees, see Wikipedia.
Melbourne was extracted from Rubinius into this gem by Marco Otte-Witte.