Skip to content

Ruby's lexer and parser, ast builder originally written by Miquel Sabate( https://cgit.kde.org/kdev-ruby.git/) and extended here for some new functionality (e.g. json visitor and something more).

Notifications You must be signed in to change notification settings

seovchinnikov/ruby2json

Repository files navigation

Ruby's lexer and parser, ast builder originally written by Miquel Sabate( https://cgit.kde.org/kdev-ruby.git/) and extended here for some new functionality (e.g. json visitor and something more).

#How to run:

bison -d parser.y -o parser.c  
gcc -c   node.c parser.c  
g++ -c rubyastvisitor.cpp main.cpp  
g++ -o  myapp main.o node.o parser.o rubyastvisitor.o  
./myapp ruby.rb where.out  

where ruby.rb is input file that contains correct ruby program's text and where.out is output json file.
JSON is not formated here, so smth like http://json.parser.online.fr can be used.
Lexer is located at parser_yylex function, that's called inside yylex.

Some of the json's output directives are described here http://www.math.spbu.ru/user/dlebedin/concepts.pdf

Note. Console is clogged with debug informaion.

About

Ruby's lexer and parser, ast builder originally written by Miquel Sabate( https://cgit.kde.org/kdev-ruby.git/) and extended here for some new functionality (e.g. json visitor and something more).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published