Before studying the structure of mdoc manuals, let's review the language we've seen so far. Foremost, we've noticed that mdoc documents consist only of printable ASCII characters. We noted that a period at the beginning of a line indicates a mdoc macro:
It's safe to say, in this case, that mdoc is line-oriented in that programme flow is in part governed by position on a line. In the case of Qq, we saw how the macro extends to the end of the line. This is also the first notion of scope, specifically scoping to the end of line. We then saw examples where scope covers multiple lines and accommodates for nested macros as well as text.
We were briefly introduced to the concept of macros accepting flags and flag arguments.
Finally, we noted that double-quotes have special semantic significance, which led to the topic of escaped terms such as \(dq for a double-quote character. We also saw how punctuation is treated in special ways when lying at line boundaries.
In this chapter, we'll formalise these concepts. I'll draw my terminology from the literature of formal languages and grammar, but it's not necessary to be familiar with the terms beforehand.
Contents | Next | Home | History |
Last edited by $Author: kristaps $ on $Date: 2011/11/04 01:06:28 $. Copyright © 2011, Kristaps Dzonsons. CC BY-SA.