Created: 2011-07-12 17:10
Updated: 2015-11-05 04:35
License: other


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


Melbourne generates abstract syntax trees (ASTs) from Ruby source code:

require 'melbourne'

'class Test; end'.to_ast # => <AST::Class:0x1017800f8
                                @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.


The original code of Melbourne is part of the Rubinius project and was written by and is © Evan Phoenix.

Melbourne was extracted from Rubinius into this gem by Marco Otte-Witte.

Bugs/ Feature Requests

the +melbourne+ gem is not maintained by the Rubinius team! If you encounter bugs or have feature requests, refer to the Github repository.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more