refactoring and add methods to parser.rb

* separate file of racc definitiln and parser methods
* add methods `parse_string` to parser, and its test.