Recently maintainability and usability of ruby's parser have been discussed. There are several approaches for these problems, however I believe LR parser is the best solution for supporting Ruby's elegant syntax.
When using parser generators, we write a grammar description file like "parse.y". In a grammar file, many DSL, e.g. %parse-param, %initial-action, %left, %right ..., are used to control the behavior of generated parser. Even so Push Down Automaton has potential to solve these problems, parser generator's DSL is not enough to represent it. Such impedance mismatches between DSL and PDA requires us to use hacks like lex state.
This talk will cover redesigning the responsibility of lexer and parser, how to expand DSL for grammar files and introduction to Lrama parser generator.