#include #include "lexer.h" #include "list.h" using namespace std; void ctiSeznam (Lexer & f, List & v); void ctiPrvek (Lexer & f, List & v) { string name = f.readIdent (); Item * p = new Item (name); v.linkLast (p); if (f.kind == text) { p->info = f.token; f.nextToken(); } if (f.isSeparator('{')) ctiSeznam (f, p->inner); } void ctiSeznam (Lexer & f, List & v) { f.checkSeparator('{'); if (! f.isSeparator('}')) { ctiPrvek (f, v); while (f.isSeparator (',')) { f.nextToken (); // skip ',' ctiPrvek (f, v); } } f.checkSeparator('}'); } int main() { List a; Lexer f ("../lexer05/abc.txt"); ctiSeznam (f, a); a.print(); a.html (cout); ofstream g ("../lexer05/output.html"); a.html (g); return 0; }