driver.cc 641 B

12345678910111213141516171819202122232425262728
  1. #include <ruby_parser/driver.hh>
  2. #include <ruby_parser/lexer.hh>
  3. // Autogenerated code
  4. #include "third_party/parser/typedruby_bison.h"
  5. namespace ruby_parser {
  6. base_driver::base_driver(ruby_version version, const std::string& source, const struct builder& builder)
  7. : build(builder),
  8. lex(diagnostics, version, source),
  9. pending_error(false),
  10. def_level(0),
  11. ast(nullptr)
  12. {
  13. }
  14. typedruby25::typedruby25(const std::string& source, const struct builder& builder)
  15. : base_driver(ruby_version::RUBY_25, source, builder)
  16. {}
  17. ForeignPtr typedruby25::parse(SelfPtr self) {
  18. bison::typedruby25::parser p(*this, self);
  19. p.parse();
  20. return ast;
  21. }
  22. }