PPT Slide
import java_cup.runtime.*;
action code {: int titleno = 1; :}
terminal String XML_DECLARATION, DOCTYPE_DECLARATION, PCDATA;
terminal String BookCatalogue_ST, Book_ST, Title_ST, Author_ST, Date_ST, ISBN_ST, Publisher_ST;
terminal String BookCatalogue_ET, Book_ET, Title_ET, Author_ET, Date_ET, ISBN_ET, Publisher_ET;
non terminal xml, bookCatalogue, books, book, title, author, date, isbn, publisher;
xml ::= XML_DECLARATION DOCTYPE_DECLARATION bookCatalogue
bookCatalogue ::= BookCatalogue_ST books BookCatalogue_ET
book ::= Book_ST title author date isbn publisher Book_ET
title ::= Title_ST PCDATA:title Title_ET {: System.out.println(titleno++ + ". " + title); :}
author ::= Author_ST PCDATA Author_ET
date ::= Date_ST PCDATA Date_ET
isbn ::= ISBN_ST PCDATA ISBN_ET
publisher ::= Publisher_ST PCDATA Publisher_ET