m4 tool


Author: yifei / Created: May 30, 2017, 8:57 p.m. / Modified: May 30, 2017, 8:58 p.m. / Edit

m4 macro language http://mbreen.com/m4.html

comman line invoking

m4 -D

builtins

define(, ) undefine() ifdef(, , ) ifelse(, , , ) eval() len() include() syscmd() `'are quotes

for comments

M4 rules it reads in the macro's arguments (if any) it determines the expansion of the macro and inserts this expansion at the beginning of its input m4 continues scanning the input, starting with the expansion

example: define(definenum',define(num',99')') num # -> num definenum num # -> define(num',99') num -> 99

Unless a nested macro is quoted, it is expanded immediately:

define(definenum', define(num', `99')) num # -> 99 definenum # ->


有任何问题可以发邮件到 kongyifei (at) gmail.com 讨论