If you want your own parser, you have to write a grammar file. A grammar
file contains the name of your parser class, grammar for the parser, user
code, and anything else. When writing a grammar file, yacc’s knowledge is
helpful. If you have not used yacc before, Racc is
not too difficult.

It’s yyparse() of yacc, and Racc::Parser#next_token is
yylex(). This method must returns an array like [TOKENSYMBOL, ITS_VALUE].
EOF is [false, false]. (TOKENSYMBOL is a Ruby symbol (taken from
String#intern) by default. If you want to change this, see the grammar
reference.

“-v” creates verbose log file (.output). “-g” creates a “Verbose Parser”.
Verbose Parser prints the internal status
when parsing. But it’s not automatic. You must use -g option and
set +@yydebug+ to true in order to get output. -g option only
creates the verbose parser.