难舍难分是什么意思| 心经讲的是什么| 特应性皮炎是什么意思| 玄冥是什么意思| 吃什么增加孕酮| 头发油腻是什么原因| 心绞痛挂什么科| 嘴巴麻是什么原因| 封闭针是什么| 蛇属于什么类动物| 冠心吃什么药好| 房颤用什么药| 女性尿路感染有什么症状| 产后抑郁一般发生在产后什么时间| 流是什么意思| 美好的近义词是什么| 什么还珠成语| 为什么手上会起小水泡| 马标志的车是什么牌子| 秋高气爽是什么意思| 肠痈是什么病| n0是什么意思| 吃什么药能让月经马上来| 流眼泪是什么原因| 裸官是什么意思| 类风湿不能吃什么食物| 珍惜当下是什么意思| 回奶吃什么快最有效的| 经常喝柠檬水有什么好处和坏处| 破屋什么意思| 福利姬什么意思| 蘑菇炒什么好吃| 黄体中期是什么意思| 女性下面长什么样| 吃韭菜有什么好处和坏处| 囗苦是什么原因| 晚年是什么意思| 我能做什么| 灌肠是什么意思| 别扭是什么意思| 尿血什么原因| 11月14号什么星座| 气管小憩室是什么意思| 什么的天空飘着什么的白云| 鸡和什么属相相冲| 天运子什么修为| 什么人什么己| 鼻子上长痘痘是什么原因| 赵本山什么学历| 运动裤配什么上衣好看| 什么是周岁| 脚后跟疼吃什么药| 贫血的人来姨妈会有什么症状| 袋鼠属于什么类动物| 什么的荷花| 乙肝表面抗体是什么意思| 打点是什么意思| 心电轴右偏是什么意思| 咳嗽雾化用什么药| 衣服五行属什么| 痛风什么东西不可以吃| 不在服务区是什么意思| 姓叶的男孩取什么名字好| 女人吃藕有什么好处| 7月29日是什么星座| 什么样的情况下会怀孕| 美如天仙是什么生肖| 桌游是什么| 深棕色是什么颜色| 感冒嗓子疼吃什么消炎药| 东北和山东有什么区别| 柏拉图爱情是什么意思| 什么是新陈代谢| 肾属于什么科| 结缔组织病是什么病| 涉三什么意思| 养心吃什么| 早起胃疼是什么原因导致的| 贫血有什么症状表现| 康健是什么意思| 致五行属什么| 老公生日送什么礼物| 吃完饭就想睡觉是什么原因| 什能组什么词| 纤维条索灶是什么意思| 阴道炎挂什么科| 滑石粉是什么东西| 心脑血管挂什么科| soda是什么意思| 鸡男配什么属相最好| 淋巴结在什么位置| 原本是什么意思| 什么情况下要做肠镜检查| syp是什么意思| 无花果有什么作用| 安赛蜜是什么东西| 吃什么伤口愈合的快| 什么药退烧快| 舌头不舒服是什么原因引起的| 火为什么没有影子| 最近我和你都有一样的心情什么歌| 好事多磨什么意思| 产妇吃什么下奶快又多| 90岁属什么生肖| fq交友是什么意思| 特别提款权是什么意思| vd是什么意思| 狒狒是什么意思| 左金丸治什么病最好| 长脸型适合什么样的发型| 跑步肚子疼是什么原因| 什么是电解水| kissme什么意思| 吃什么补钙最好| 尿道感染要吃什么药| 县公安局局长什么级别| 睡觉时头晕是什么原因| 安赛蜜是什么| 龙涎香什么味道| rads是什么意思| 辣椒是什么时候传入中国的| 肠绞痛吃什么药| 亩产是什么意思| 下雨天适合穿什么衣服| 寻麻疹是什么原因引起的| 来月经吃什么对身体好| 独美是什么意思| 牙龈起包是什么原因| 躯体化障碍是什么病| 灰指甲是什么样的图片| dx是什么| 419是什么意思| 公历年份是什么意思| 孕早期头疼是什么原因| 喝三七粉有什么好处| 喝中药不能吃什么| 夏天出汗多是什么原因| 郫县豆瓣酱能做什么菜| 什么情况下需要切除子宫| 腿毛旺盛是什么原因| ra是什么| 白带异味是什么原因| 做梦孩子死了什么预兆| 咳嗽吃什么水果最好| 小孩嘴臭是什么原因| 怀孕吃核桃对宝宝有什么好处| 心肌酶谱是查什么的| 沅字五行属什么| 晚上为什么不能剪指甲| 锁骨是什么骨| 扒拉是什么意思| 荔枝肉是什么菜系| 梦见剃光头是什么预兆| ct腹部平扫能检查什么| 为什么不| 公丁香和母丁香有什么区别| 尿频尿多吃什么药好| 小孩热感冒吃什么药好| 火把节是什么节日| 什么是情劫| 锴字五行属什么| o型血和b型血的孩子是什么血型| 脂肪瘤吃什么药可以消除| 眼睛淤青用什么方法能快点消除| 高傲什么意思| 脑供血不足吃什么药效果最好| 什么地| 讲义气是什么意思| 为什么眼皮会跳| 嘴苦是什么原因造成的| 中唐筛查是检查什么| 吃什么能治脂肪肝| 看痘痘挂什么科| 什么头什么颈| 京东自营店是什么意思| 太原为什么叫龙城| 什么水果不含糖| 同人是什么意思| 吃烧烤后吃什么水果可以帮助排毒| 下肢静脉血栓挂什么科| 为什么会骨盆前倾| 985和211有什么区别| 夜半是什么时辰| 阴阳失调是什么意思| 挚爱的意思是什么| 灰指甲挂什么科| 南昌有什么好玩的| 偷袭是什么意思| 什么少年| 小孩便秘吃什么药| 为什么会低血压| 五行水多代表什么| 白热化阶段是什么意思| 什么还珠| 颈部淋巴结肿大是什么原因| 男人吃什么对性功能好| 拉肚子应该挂什么科| hpvhr阳性什么意思| 艾滋病潜伏期有什么症状| 情志是什么意思| 什么是羊蝎子| 吃高血压药有什么副作用| 克霉唑为什么4天一次| 鼻窦炎挂什么科| 丁香泡水喝有什么功效和作用| adem是什么病| 宝宝拉肚子吃什么| 胳膊上的花是打了什么疫苗| 夜光杯是什么材质| 男人吃什么更持久| 小鸟站在高压线上为什么不会触电| 火加同念什么| 仓鼠咬笼子是什么原因| 月经推后是什么原因| 乔迁之喜送什么花| 乌纱帽是什么意思| 点状钙化灶是什么意思| 脾虚是什么症状| 1973年属什么生肖| 孕妇吃葡萄对胎儿有什么好处| 什么情况下不能献血| 宝宝睡眠不好是什么原因| 吃黑米有什么好处和坏处| 坐支是什么意思| 移车打什么电话| 什么是证件照| 北加田加共是什么字| 吃什么提神| 盆腔积液有什么症状有哪些| 葵水是什么| 促什么谈什么| 芝士是什么材料做的| 云翳是什么意思| 产后42天复查挂什么科| 劳动法什么时候实施的| 左手小指和无名指发麻是什么原因| 消融手术是什么意思| 什么是心脏早搏| 补阳气吃什么| 子宁不嗣音什么意思| 花团锦簇是什么意思| 打呼噜是什么原因造成的| 胃反酸吃什么药最好| 油价什么时候上涨| 金骏眉属于什么茶| 勾心斗角是什么生肖| 纸片人什么意思| 肝s5是什么意思| 阴道内壁是什么样的| 什么是普世价值| 羊蝎子是什么肉| 造影手术是什么意思| 蓟是什么意思| smile是什么意思| 808是什么意思| 吃惊的近义词是什么| 网络cp是什么意思| 杭州的市花是什么花| 人什么什么什么| 血管瘤挂什么科比较好| a血型和o血型生出宝宝是什么血型| 熊猫为什么吃竹子| 护士要什么学历| 啰嗦是什么意思| 百度

新股中签率一览:友讯达网上发行中签率0.0237%

百度 桑切斯已经成为了全英超收入最高的球星,冬窗的时候曼联击败了曼城签下了智利球星,并为其开出了一份60万镑周薪的合约。

m4 is a general-purpose macro processor included in most Unix-like operating systems, and is a component of the POSIX standard.

m4
Paradigmmacro
Designed byBrian Kernighan, Dennis Ritchie
First appeared1977; 48 years ago (1977)
Major implementations
GNU m4

The language was designed by Brian Kernighan and Dennis Ritchie for the original versions of UNIX. It is an extension of an earlier macro processor, m3, written by Ritchie for an unknown AP-3 minicomputer.[1]

The macro preprocessor operates as a text-replacement tool. It is employed to re-use text templates, typically in computer programming applications, but also in text editing and text-processing applications. Most users require m4 as a dependency of GNU autoconf and GNU Bison.

History

edit

Macro processors became popular when programmers commonly used assembly language. In those early days of programming, programmers noted that much of their programs consisted of repeated text, and they invented simple means for reusing this text. Programmers soon discovered the advantages not only of reusing entire blocks of text, but also of substituting different values for similar parameters. This defined the usage range of macro processors at the time.[2]

In the 1960s, an early general-purpose macro processor, M6, was in use at AT&T Bell Laboratories, which was developed by Douglas McIlroy, Robert Morris and Andrew Hall.[3]

Kernighan and Ritchie developed m4 in 1977, basing it on the ideas of Christopher Strachey. The distinguishing features of this style of macro preprocessing included:

  • free-form syntax (not line-based like a typical macro preprocessor designed for assembly-language processing)
  • the high degree of re-expansion (a macro's arguments get expanded twice: once during scanning and once at interpretation time)

The implementation of Rational Fortran used m4 as its macro engine from the beginning, and most Unix variants ship with it.

As of 2024 many applications continue to use m4 as part of the GNU Project's autoconf. It also appears in the configuration process of sendmail (a widespread[citation needed] mail transfer agent) and for generating footprints in the gEDA toolsuite. The SELinux Reference Policy relies heavily on the m4 macro processor.

m4 has many uses in code generation, but (as with any macro processor) problems can be hard to debug.[4]

Features

edit

m4 offers these facilities:

  • a free-form syntax, rather than line-based syntax
  • a high degree of macro expansion (arguments get expanded during scan and again during interpretation)
  • text replacement
  • parameter substitution
  • file inclusion
  • string manipulation
  • conditional evaluation
  • arithmetic expressions
  • system interface
  • programmer diagnostics
  • programming language independent
  • human language independent
  • provides programming language capabilities

Unlike most earlier macro processors, m4 does not target any particular computer or human language; historically, however, its development originated for supporting the Ratfor dialect of Fortran. Unlike some other macro processors, m4 is Turing-complete as well as a practical programming language.

Unquoted identifiers which match defined macros are replaced with their definitions. Placing identifiers in quotes suppresses expansion until possibly later, such as when a quoted string is expanded as part of macro replacement. Unlike most languages, strings in m4 are quoted using the backtick (`) as the starting delimiter, and apostrophe (') as the ending delimiter. Separate starting and ending delimiters allows the arbitrary nesting of quotation marks in strings to be used, allowing a fine degree of control of how and when macro expansion takes place in different parts of a string.

Example

edit

The following fragment gives a simple example that could form part of a library for generating HTML code. It defines a commented macro to number sections automatically:

divert(-1)

m4 has multiple output queues that can be manipulated with the
`divert' macro. Valid queues range from 0 to 10, inclusive, with
the default queue being 0. As an extension, GNU m4 supports more
diversions, limited only by integer type size.

Calling the `divert' macro with an invalid queue causes text to be
discarded until another call.  Note that even while output is being
discarded, quotes around `divert' and other macros are needed to
prevent expansion.

# Macros aren't expanded within comments, meaning that keywords such
# as divert and other built-ins may be used without consequence.

# HTML utility macro:

define(`H2_COUNT', 0)

# The H2_COUNT macro is redefined every time the H2 macro is used:

define(`H2',
	`define(`H2_COUNT', incr(H2_COUNT))<h2>H2_COUNT. $1</h2>')

divert(1)dnl
dnl
dnl The dnl macro causes m4 to discard the rest of the line, thus
dnl preventing unwanted blank lines from appearing in the output.
dnl
H2(First Section)
H2(Second Section)
H2(Conclusion)
dnl
divert(0)dnl
dnl
<HTML>
undivert(1)dnl One of the queues is being pushed to output.
</HTML>

Processing this code with m4 generates the following text:

<HTML>
<h2>1. First Section</h2>
<h2>2. Second Section</h2>
<h2>3. Conclusion</h2>
</HTML>

Implementations

edit

FreeBSD, NetBSD, and OpenBSD provide independent implementations of the m4 language. Furthermore, the Heirloom Project Development Tools includes a free version of the m4 language, derived from OpenSolaris.

M4 has been included in the Inferno operating system. This implementation is more closely related to the original m4 developed by Kernighan and Ritchie in Version 7 Unix than its more sophisticated relatives in UNIX System V and POSIX.[5]

GNU m4 is an implementation of m4 for the GNU Project.[6][7] It is designed to avoid many kinds of arbitrary limits found in traditional m4 implementations, such as maximum line lengths, maximum size of a macro and number of macros. Removing such arbitrary limits is one of the stated goals of the GNU Project.[8]

The GNU Autoconf package makes extensive use of the features of GNU m4.

GNU m4 is currently maintained by Gary V. Vaughan and Eric Blake.[6] GNU m4 is free software, released under the terms of the GNU General Public License.

See also

edit

References

edit
  1. ^ Brian W. Kernighan and Dennis M. Ritchie. The m4 macro processor. Technical report, Bell Laboratories, Murray Hill, New Jersey, USA, 1977. pdf
  2. ^ History of GNU m4
  3. ^ Hall, Andrew D. (1972). The M6 Macro Processor. Computing Science Technical Report #2 (PDF) (Report). Bell Labs.
  4. ^ Kenneth J. Turner. Exploiting the m4 macro language. Technical Report CSM-126, Department of Computing Science and Mathematics, University of Stirling, Scotland, September 1994. pdf
  5. ^ m4(1) – Inferno General commands Manual
  6. ^ a b GNU m4 web site "GNU M4", accessed January 25, 2020.
  7. ^ GNU m4 manual, online and for download in HTML, PDF, and other forms. "GNU M4 — GNU macro processor", accessed January 25, 2020.
  8. ^ "GNU Coding Standards: Writing Robust Programs". quote: "Avoid arbitrary limits on the length or number of any data structure".
edit

肿瘤是什么病严重吗 野蒜有什么功效和作用 ro是什么意思 锁阳是什么东西 结核感染是什么意思
螳螂吃什么食物 卵巢保养最好的方法是什么 閪什么意思 法令纹上的痣代表什么 大小便失禁是什么原因造成的
跳蛋是什么意思 血肌酐高吃什么食物 七情六欲是什么意思 可是什么意思 胃胀痛吃什么药
胎停了有什么症状 吃什么容易流产 胎动什么感觉 月经为什么推迟不来 刘玄德属什么生肖
睡觉掉床下是什么预兆hcv8jop8ns2r.cn 肚子不饿是什么原因ff14chat.com 川芎有什么功效hcv8jop2ns3r.cn dyj什么意思hcv7jop5ns1r.cn 椎体楔形变是什么意思hcv9jop6ns5r.cn
大便干燥吃什么药naasee.com 桥本甲状腺炎是什么意思hcv8jop5ns5r.cn 什么是心脑血管疾病hcv7jop4ns7r.cn 把碗打碎了有什么征兆hcv8jop8ns2r.cn 脸色发黑发暗是什么原因inbungee.com
花苞裤不适合什么人穿chuanglingweilai.com vb610是什么药hcv8jop3ns4r.cn hsg是什么检查项目hcv7jop5ns1r.cn 干咳吃什么药好hcv8jop6ns4r.cn 脑血栓前兆是什么症状表现hcv9jop4ns0r.cn
肚脐眼红是什么原因hcv7jop5ns0r.cn 壬水命是什么意思hcv7jop7ns3r.cn 切尔斯什么意思sscsqa.com 满天星是什么意思clwhiglsz.com 兰桂齐芳是什么意思weuuu.com
百度