Macro Processing - Programming On Unix

Users browsing this thread: 1 Guest(s)
venam
Administrators
Hello fellow nixers,
Let's discuss macro processing and weird places where you can use and abuse them.

You certainly know about the C one.

You can stop the gcc compiler after macro processing by using the -E flag
Code:
echo "#include <stdbool.h>" | gcc -E - | grep stdbool
This can be useful to know where a library is loaded from, like in the previous example.

m4 is the popular macro processing tool on Unix systems.
It can be used for almost anything that requires transformation.

There are a lot of other sort of macro or text generator on Unix, as mostly everything is text.

To just name a few:
* groff/troff
* yacc/bison
* lex
* sed/awk?

Here are some fun links to read:
https://en.wikipedia.org/wiki/General-pu..._processor
http://iotek.github.io/m4/
http://www.tldp.org/LDP/LG/issue22/using...4%3C/EM%3E

Let's just start an abstract discussion about those and see where it goes.


Messages In This Thread
Macro Processing - by venam - 05-06-2017, 01:46 PM
RE: Macro Processing - by jkl - 06-06-2017, 12:43 PM
RE: Macro Processing - by venam - 06-06-2017, 01:24 PM
RE: Macro Processing - by yossarian - 06-06-2017, 01:57 PM