Hey!
I'm trying to help a friend in a college assignment, but i kind of forgot a lot of C an Lex.
The thing is, we are trying to parse a HTML and a correspondent CSS file and add to a tag it's style.
Eg:
HTML
<body>
</body>
CSS
body{color:black;}
modified HTML
<body style="color:black;">
</body>
All the regex are done and the Macros too.
Problem: The input HTML and modified HTML gotta be the same file. We tried redirect both yyin and yyout to the same file... and then use the fputs(text, yyout); where text is a char * with all the style information (and style=""). It doesn't work.
So... Can you guys help him?
its important not to lose the notion of location in the file (so the style="" goes to the right tag).
Thanks