PPT Slide
import java_cup.runtime.*;
LineTerminator = \r|\n|\r\n
XML_Declaration = "<?xml version="[\"']"1.0"[\"'][^\r\n]*"?>"{LineTerminator}
DOCTYPE_Declaration = "<!DOCTYPE "[^\r\n<>]+">"{LineTerminator}
PCDATA = [a-zA-Z0-9;& ,._\n\r\t-]+
{XML_Declaration} { return new Symbol(sym.XML_DECLARATION, yytext()); }
{DOCTYPE_Declaration} { return new Symbol(sym.DOCTYPE_DECLARATION, yytext()); }
{StartTag} { return new Symbol(sym.START_TAG, yytext()); }
{EndTag} { return new Symbol(sym.END_TAG, yytext()); }
{Whitespace} { ; } /* Drop whitespace */
{PCDATA} { return new Symbol(sym.PCDATA, yytext()); }
<<EOF>> { return new Symbol(sym.EOF); }