-
Notifications
You must be signed in to change notification settings - Fork 4
/
part2-1.xml
79 lines (78 loc) · 2.64 KB
/
part2-1.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xml; charset=utf-8"/>
<title>Syntax</title>
<link rel="stylesheet" href="css/book.css" type="text/css"/>
</head>
<body>
<h2>
Syntax
</h2>
<p>
Before studying the structure of <span class="lang">mdoc</span> manuals, let's review the language we've seen so far.
Foremost, we've noticed that <span class="lang">mdoc</span> documents consist only of printable <a class="term"
href="glossary.xml#ascii">ASCII</a> characters. We noted that a period at the beginning of a line indicates a
<span class="lang">mdoc</span> macro:
</p>
<div class="mdocin">
.Qq hello, world
</div>
<p>
It's safe to say, in this case, that <span class="lang">mdoc</span> is line-oriented in that programme flow is in part
governed by position on a line. In the case of <a href="macros.xml#macro_qq" class="macro">Qq</a>, 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.
</p>
<div class="mdocin">
.Sh DESCRIPTION
<br />
The
<br />
.Nm
<br />
utility...
</div>
<p>
We were briefly introduced to the concept of macros accepting flags and flag arguments.
</p>
<div class="mdocin">
.Bl -tag -width Ds
<br />
.It List key.
<br />
List value.
<br />
.El
</div>
<p>
Finally, we noted that double-quotes have special semantic significance, which led to the topic of escaped terms such as
<span class="screen">\(dq</span> for a double-quote character. We also saw how punctuation is treated in special ways
when lying at line boundaries.
</p>
<div class="mdocin">
End of sentence, end of line.
<br />
Same goes with
<br />
.Em macros .
</div>
<p>
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.
</p>
<table class="nav">
<tbody>
<tr>
<td class="nav-contents"><a href="toc.xml">Contents</a></td>
<td class="nav-next"><a href="part2-1-1.xml">Next</a></td>
<td class="nav-home"><a href="http://manpages.bsd.lv/index.html">Home</a></td>
<td class="nav-history"><a href="http://manpages.bsd.lv/cgi-bin/cvsweb/part2-1.xml?cvsroot=manpages">History</a></td>
</tr>
</tbody>
</table>
<p class="edits">
Last edited by $Author$ on $Date$. Copyright © 2011, Kristaps Dzonsons. CC BY-SA.
</p>
</body>
</html>