乔姆斯基在研究语言的过程中,从产生语言的角度发现了一种模型用来描述语言,它就是文法。

文本格式化

normal, italic, bold, mono.

``double quoted'', `single quoted'.

normal, super, sub.

Command: ls -al

mono *bold*

passthru bold

Path: '/some/filez.txt', '.b'

red text on yellow large all bold

colors

aqua aqua-background black black-background blue blue-background fuchsia fuchsia-background gray gray-background green green-background lime lime-background maroon maroon-background navy navy-background olive olive-background purple purple-background red red-background silver silver-background teal teal-background white white-background yellow yellow-background

Chars: nibmr

Escaped: _italic_, _italic_, t__e__st, t__e__st, bold, <b>normal</b> &#182; `not single quoted' \`\`not double quoted''


段落

在研究语言的过程中,我们往往需要判断一个字符串是否属于某个语言。 如果这个的语言是一个有穷集合那还好说,我们只需要遍历语言中的所有字符串就能判断出我们要找的字符串是不是属于该语言。 但当语言是一个无穷集合时,事情就会变得比较棘手。 幸运的是,一般来说语言都有一个自己的结构,称为语法。 通过一个适当的模型,我们就能表打出语言的结构特征,而这个模型就是文法。

有了文法之后,我们就可以用一个有穷描述来描述语言,文法解决了语言的定义问题(从另一种角度定义无穷字符串集合)。

用文法不仅能描述出语言的结构特征,还能生成该语言的所有句子。 用文法生成的集合就是它所描述的语言。 但是,文法也有自己的能力上限,不是所有的语言都可以用文法来描述。 正则文法那一部分我们就能监视到。

多级标题

三级 1

四级1

三级2

四级2

样例块

示例 1. Optional Title

This is an example single-paragraph note. very very very very very very very very very very very very very very very very very very very very very very very long.

This is the second paragraph.

示例 2. Optional Title
This is an example single-paragraph note.

结束测试。

补充块

Optional Title

Sidebar Block

Use: sidebar notes :)

警告块

Note.
Tip.
Important.
Caution.
Warning.

这是一个 1 倍大小的 爱心。 这是一个 2 倍大小的 爱心。

Feeding the Werewolves

While werewolves are hardy community members, keep in mind the following dietary concerns:

  1. They are allergic to cinnamon.

a note.

  1. More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.

  2. Celery makes them sad.

代码块

html 标题
<style>

pre.rouge .hll {
  background-color: #ffc;
}
pre.rouge .hll * {
  background-color: initial;
}
</style>

代码块间距测试。

require 'sinatra' (1)

get '/hi' do (2) (3)
  "Hello World! very very very very very very very very very very very very very very very very very very very very very very very long."
end
1Library import
2URL mapping
3Response block

这是一个块内代码 GetUrl(http://test.com) 测试。

gist 测试。

直译块

Optional Title
*Literal* Block

Use: workaround when literal
paragraph (indented) like
1. First.
2. Second.
incorrectly processed as list.

引用块

Optional Title

Quote Block

Use: cite somebody

— cite author
cite source

Quote Block

Use: cite somebody "Hello World! very very very very very very very very very very very very very very very very very very very very very very very long."

— cite author
cite source

折叠块

链路层和网络层信息收集

折叠块测试。

示例 3. 有线网络监听

概要:监听能捕获的网络段和 IP,同时记录下各个 IP 开启的服务(如 ICMP、HTTP)。

工具:

参考文献:

示例 4. 无线网络监听

概要:监听周围设备的信道、加密方式、SSID、BSSID、ESSID。

工具:

参考文献:

测试结束。

图片

Diagram
asciidoc ghpages github token

接下来看一个标题测试:

Diagram
图表 1. Bytefield

测试完毕。 可以发现撒旦恢复本年度送我在那些佛埃及访问。额外惊人之举欧文二日而我却将

列表

Bulleted
  • bullet

  • bullet

    • bullet

    • bullet

  • bullet

    • bullet

    • bullet

      • bullet

      • bullet

        • bullet

        • bullet

          • bullet

          • bullet

        • bullet

      • bullet

    • bullet

  • bullet

列表继续的测试:

  1. test

    this is a test

  2. test

    this is a test

    this is a test

  3. test

    1. test

Bulleted 2
  • bullet

    • bullet

段落后接列表测试:

Ordered
  1. number

  2. number

    1. letter

    2. letter

  3. number

    1. loweralpha

    2. loweralpha

      1. lowerroman

      2. lowerroman

        1. upperalpha

        2. upperalpha

          1. upperroman

          2. upperroman

        3. upperalpha

      3. lowerroman

    3. loweralpha

  4. number

Ordered 2
  1. letter

  2. letter

    1. letter2

    2. letter2

      1. number

      2. number

        1. number2

        2. number2

        3. number2

        4. number2

      3. number

    3. letter2

  3. letter

Checklist
  • checked

  • also checked

  • not checked

  • normal list item

Checklist interactive
  • checked

  • also checked

  • not checked

  • normal list item

Labeled
Term 1

Definition 1

Term 2

Definition 2

Term 2.1

Definition 2.1

Term 2.2

Definition 2.2

Term 3

Definition 3

Term 4

Definition 4

Term 4.1

Definition 4.1

Term 4.2

Definition 4.2

Term 4.2.1

Definition 4.2.1

Term 4.2.2

Definition 4.2.2

Term 4.3

Definition 4.3

Term 5

Definition 5

Labeled 2
Term 1

Definition 1

Term 1.1

Definition 1.1

Labeled horizontal
Term 1

Definition 1

Term 2

Definition 2

Term 2.1

Definition 2.1

Term 2.2

Definition 2.2

Term 3

Definition 3

Term 4

Definition 4

Term 4.1

Definition 4.1

Term 4.2

Definition 4.2

Term 4.2.1

Definition 4.2.1

Term 4.2.2

Definition 4.2.2

Term 4.3

Definition 4.3

Term 5

Definition 5

Q&A
  1. Question 1

    Answer 1

  2. Question 2

    Answer 2

Indent is optional
  • bullet

    • another bullet

      1. number

        1. again number

          1. letter

            1. again letter

            2. letter

        2. number

    • bullet

  • bullet

Break two lists
  1. number

  2. number

Independent paragraph break list.

  1. number

Header break list too
  1. number

  1. List block define list boundary too

  2. number

  3. number

  1. number

  2. number

Continuation
  • bullet continuation

    1. number continuation

      • bullet

        literal continuation
        1. letter

          Non-literal continuation.

          any block can be
          
          included in list

          Last continuation.

List block allow sublist inclusion
  • bullet

    • bullet

      • bullet

        • bullet

    • bullet

  • bullet

    1. number

      1. letter

        1. number

          1. letter

      2. letter

    2. number

表格

表格 1. An example table
Col 1Col 2Col 3

1

Item 1

a

2

Item 2

b

3

Item 3

c

6

Three items

d

表格 2. CSV data, 15% each column

1

2

3

4

a

b

c

d

A

B

C

D

IDFNameLNameAddressPhone

1

Vasya

Pupkin

London

+123

2

X

Y

A,B

45678

表格 3. Multiline cells, row/col span
DateDurationAvg HRNotes

22-Aug-08

10:24

157

Worked out MSHR (max sustainable heart rate) by going hard for this interval.

22-Aug-08

152

Back-to-back with previous interval.

24-Aug-08

none

数学公式

构造产生语言 \${a^nb^nc^n| n>=1}\$ 的文法。

解:这个语言实际上是一个上下文有关语言 CSL,它不能用上下文无关文法表示。 如果将 \$a^nb^n\$ 和 \$c^n\$ 分开表示,即构造文法如下:

\$G->AB\$
\$A->aAb|ab\$
\$B->cB|c\$

则它只能表示语言 \${a^nb^nc^m|n>=1,m>=1}\$,因为不在同一产生式的递归推导终结符,无法保证终结符的个数相同。 只有递归表示位于同一产生式中,才能保证该产生式中的符号是同个数的。 因此可以考虑将语言分成三部分:

\$G->aABC | aBC\$

这样 a、B、C 出现的个数相同,可惜此字符串是以 \$aa cdots a BCBC cdots BC\$ 形式出现的,因此我们需要添加产生式,调整非终结符的顺序:

\$CB->BC\$

这样既不改变 B 和 C 的数量,同时也把 C 都移到了最右边。

最后,只有处于正确位置的 B、C 才能推导为终结符:

\$aB->ab\$
\$bB->b b\$
\$bC->bc\$
\$cC->c c\$

这保证了 aBCBC 在不换位直接推导的时候会碰到 cB,进而无法推导下去。