C Convert Manual Text to HTML format?

I was arguing that lex and yacc are necessary and hence not superfluous.

Yes, try lex, it is very useful alone and can do a lot for your purpose, perhaps with a little programming. It is easier to learn than yacc, but you may need it also. They are in every unix installation, I have yacc trice in my computer: the one of (Free)BSD, the one of Plan9 (original) and (gnu)bison.

I should try likely,

Can Lex do filecopy and more file handling?
 
What do you mean with filecopy? You can embed your own C code and program in the lex input, and that can do anything. lex generates C code for a function int yylex() that when called reads until the next token, return the token number and can set external variables, for example yyval containing what it read or something related to what it read. When called it again, does the same with the next token, and so on. Then you can use this function in your own C functions. The return value (token) and the external variables (eg. yyval) are defined by you with the input to lex, and also what is a token: yylex() can also not return untill it read all the text, but do some output when reading it. Just read carefuly man lex().
 
For basic approach in C, it is just 20-30 lines about

I have no doubt that it is possible. I told you that I use among others Tcl for text processing, that it is by far my favourite scripting language. This is what Brian W. Kernighan writes about Tcl:

The split into two components was encouraged and ultimately forced by two issues. First, Tcl's notation for
arithmetic expressions is clumsy; it is easier to write most expressions in C. More important, however, Tcl is not very
good at data structures, since it provides only associative arrays and strings (upon which a veneer of linked lists can
be applied). Again, C or C++ is more expressive and the code is much easier to maintain. These operations also run
significantly faster in C/C++; this more than compensates for any extra file traffic.

(BTW: Tcl offers today more than associative arrays and strings)

If you believe him, C is better. Of course you can also use libraries in C for the build in features of Tcl you may miss in C. Most of the negative view of C for this purposes may come from laziness to programming in C, but not only.

To see how good tcl is, just see more quotes like the above one:

https://wiki.tcl-lang.org/page/Who+says+Tcl+sucks...

(... belongs is part of URL, but forums.freebsd.org do not accept them as such)
 
I have no doubt that it is possible. I told you that I use among others Tcl for text processing, that it is by far my favourite scripting language. This is what Brian W. Kernighan writes about Tcl:



(BTW: Tcl offers today more than associative arrays and strings)

If you believe him, C is better. Of course you can also use libraries in C for the build in features of Tcl you may miss in C. Most of the negative view of C for this purposes may come from laziness to programming in C, but not only.

To see how good tcl is, just see more quotes like the above one:

https://wiki.tcl-lang.org/page/Who+says+Tcl+sucks...

(... belongs is part of URL, but forums.freebsd.org do not accept them as such)

Likely, maybe, indeed it might come more from programmer laziness...
 
Back
Top