PPT Slide
// Parse slash-delimited book data.
LineTerminator = \r|\n|\r\n
StringBuffer line = new StringBuffer();
private void add_to_buffer(String s) {
private void display_line() {
System.out.println(line.toString());
line = new StringBuffer(); /* Clear buffer */
{Field} { add_to_buffer(yytext()); }
{Slash} { add_to_buffer("/"); }
{LineTerminator} { display_line(); }
invoke the add_to_buffer()