cobol_parser is a COBOL parser written in pure ruby. It outputs s-expressions which like whitequark/parser's outputs. So you can translate COBOL to Ruby using unparser.
The following class of cobol_parser is ported from the open-cobol-1.1 source code.
- CobolParser::Config - cobc/config.def
- CobolParser::ErrorHelper - cobc/error.c
- CobolParser::Flag - cobc/flag.def
- CobolParser::Parser - cobc/parser.y
- CobolParser::PPLexer - cobc/pplex.l
- CobolParser::PPParser - cobc/ppparse.y
- CobolParser::Program - cobc/tree.c
- CobolParser::ReservedHelper - cobc/reserved.c
- CobolParser::Scanner - cobc/scanner.l
- CobolParser::Tree - cobc/tree.c
- CobolParser::TreeHelpler - cobc/tree.c
- CobolParser::Tree::* - cobc/tree.c, cobc/field.c
- CobolParser::TypeCheckHelper - cobc/typeck.c
- CobolParser::Warning - cobc/warning.def
All programs except those in lib/monkey_patches are distributed under the GNU General Public License. See COPYING for details.
lib/monkey_patches/001_lex_more_like_flex.rb is distributed under the MIT License. See piotrmurach/lex - LICENSE.txt for details.
Add this line to your application's Gemfile:
gem 'cobol_parser'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install cobol_parser
TODO: Write usage instructions here
After checking out the repo, run bin/setup
to install dependencies. Then, run rake test
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and the created tag, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/takaokouji/cobol_parser.