新建
上传
首页
助手
最?/div>
资料?/div>
工具

 

 

1 

编译原理及实?/p>

  

2.1   

设字母表

A={a}

,符号串

x=aaa

,写出下列符号串及其长度?/p>

x

0

,xx,x

5

以及

A

+

?/p>

A*

. 

x

0

=(aaa)

0

=

ε

                         | x

0

|=0     

xx=aaaaaa                           |xx|=6 

x

5

=aaaaaaaaaaaaaaa                   | x

5

|=15 

A

+

 =A

1

?/p>

A

2

?/p>

 

?/p>

. 

?/p>

A 

n

∪?/p>

={a,aa,aaa,aaaa,aaaaa

?/p>

}    

A* 

= 

A

0 

?/p>

A

1 

?/p>

 

A

2

 

?/p>

 

?/p>

. 

?/p>

 

A 

n

 

?/p>

?/p>

={

ε

,a,aa,aaa,aaaa,aaaaa

?/p>

}   

 

 

2.2   

令∑

={a

?/p>

b

?/p>

c}

,又?/p>

x=abc

?/p>

y=b

?/p>

z=aab

,写出如下符号串

及它们的长度?/p>

xy

?/p>

xyz

?/p>

?/p>

xy

?/p>

3

 

12

|=

 

(xy)3

 

|

      

cb

abcbabcbab

=

 

(abcb)3

=

(xy)3

7

|=

xyz

|

         

          

abcbaab

=

xyz

4

|=

xy

|

   

          

          

abcb

=

xy

 

 

2.3

 

设有文法

G[S]

?/p>

S

?/p>

=SS*|SS+|a

,写出符号串

aa+a*

规范推导?

并构造语法树?/p>

 

S => SS* => Sa* => SS+a* => Sa+a* => aa+a* 

 

Ͼλ
新建
上传
首页
助手
最?/div>
资料?/div>
工具

 

 

1 

编译原理及实?/p>

  

2.1   

设字母表

A={a}

,符号串

x=aaa

,写出下列符号串及其长度?/p>

x

0

,xx,x

5

以及

A

+

?/p>

A*

. 

x

0

=(aaa)

0

=

ε

                         | x

0

|=0     

xx=aaaaaa                           |xx|=6 

x

5

=aaaaaaaaaaaaaaa                   | x

5

|=15 

A

+

 =A

1

?/p>

A

2

?/p>

 

?/p>

. 

?/p>

A 

n

∪?/p>

={a,aa,aaa,aaaa,aaaaa

?/p>

}    

A* 

= 

A

0 

?/p>

A

1 

?/p>

 

A

2

 

?/p>

 

?/p>

. 

?/p>

 

A 

n

 

?/p>

?/p>

={

ε

,a,aa,aaa,aaaa,aaaaa

?/p>

}   

 

 

2.2   

令∑

={a

?/p>

b

?/p>

c}

,又?/p>

x=abc

?/p>

y=b

?/p>

z=aab

,写出如下符号串

及它们的长度?/p>

xy

?/p>

xyz

?/p>

?/p>

xy

?/p>

3

 

12

|=

 

(xy)3

 

|

      

cb

abcbabcbab

=

 

(abcb)3

=

(xy)3

7

|=

xyz

|

         

          

abcbaab

=

xyz

4

|=

xy

|

   

          

          

abcb

=

xy

 

 

2.3

 

设有文法

G[S]

?/p>

S

?/p>

=SS*|SS+|a

,写出符号串

aa+a*

规范推导?

并构造语法树?/p>

 

S => SS* => Sa* => SS+a* => Sa+a* => aa+a* 

 

">
新建
上传
首页
助手
最?/div>
资料?/div>
工具

 

 

1 

编译原理及实?/p>

  

2.1   

设字母表

A={a}

,符号串

x=aaa

,写出下列符号串及其长度?/p>

x

0

,xx,x

5

以及

A

+

?/p>

A*

. 

x

0

=(aaa)

0

=

ε

                         | x

0

|=0     

xx=aaaaaa                           |xx|=6 

x

5

=aaaaaaaaaaaaaaa                   | x

5

|=15 

A

+

 =A

1

?/p>

A

2

?/p>

 

?/p>

. 

?/p>

A 

n

∪?/p>

={a,aa,aaa,aaaa,aaaaa

?/p>

}    

A* 

= 

A

0 

?/p>

A

1 

?/p>

 

A

2

 

?/p>

 

?/p>

. 

?/p>

 

A 

n

 

?/p>

?/p>

={

ε

,a,aa,aaa,aaaa,aaaaa

?/p>

}   

 

 

2.2   

令∑

={a

?/p>

b

?/p>

c}

,又?/p>

x=abc

?/p>

y=b

?/p>

z=aab

,写出如下符号串

及它们的长度?/p>

xy

?/p>

xyz

?/p>

?/p>

xy

?/p>

3

 

12

|=

 

(xy)3

 

|

      

cb

abcbabcbab

=

 

(abcb)3

=

(xy)3

7

|=

xyz

|

         

          

abcbaab

=

xyz

4

|=

xy

|

   

          

          

abcb

=

xy

 

 

2.3

 

设有文法

G[S]

?/p>

S

?/p>

=SS*|SS+|a

,写出符号串

aa+a*

规范推导?

并构造语法树?/p>

 

S => SS* => Sa* => SS+a* => Sa+a* => aa+a* 

 

Ͼλ">
Ͼλ
Ŀ

1编译原理及实现课后题及答?- 百度文库
新建
上传
首页
助手
最?/div>
资料?/div>
工具

 

 

1 

编译原理及实?/p>

  

2.1   

设字母表

A={a}

,符号串

x=aaa

,写出下列符号串及其长度?/p>

x

0

,xx,x

5

以及

A

+

?/p>

A*

. 

x

0

=(aaa)

0

=

ε

                         | x

0

|=0     

xx=aaaaaa                           |xx|=6 

x

5

=aaaaaaaaaaaaaaa                   | x

5

|=15 

A

+

 =A

1

?/p>

A

2

?/p>

 

?/p>

. 

?/p>

A 

n

∪?/p>

={a,aa,aaa,aaaa,aaaaa

?/p>

}    

A* 

= 

A

0 

?/p>

A

1 

?/p>

 

A

2

 

?/p>

 

?/p>

. 

?/p>

 

A 

n

 

?/p>

?/p>

={

ε

,a,aa,aaa,aaaa,aaaaa

?/p>

}   

 

 

2.2   

令∑

={a

?/p>

b

?/p>

c}

,又?/p>

x=abc

?/p>

y=b

?/p>

z=aab

,写出如下符号串

及它们的长度?/p>

xy

?/p>

xyz

?/p>

?/p>

xy

?/p>

3

 

12

|=

 

(xy)3

 

|

      

cb

abcbabcbab

=

 

(abcb)3

=

(xy)3

7

|=

xyz

|

         

          

abcbaab

=

xyz

4

|=

xy

|

   

          

          

abcb

=

xy

 

 

2.3

 

设有文法

G[S]

?/p>

S

?/p>

=SS*|SS+|a

,写出符号串

aa+a*

规范推导?

并构造语法树?/p>

 

S => SS* => Sa* => SS+a* => Sa+a* => aa+a* 

 



ļ׺.doc޸Ϊ.docĶ

  • ⱨ - ͼ
  • 2019΢¯ҵ״չƷĿ¼
  • pppĿʵʩ-pppĿ
  • ƵƵ㼰BCCH , TCH
  • ̽¡
  • ʿν̰硷ѧ
  • 2016ϰ߼ҽۺϿ
  • 豸ƶ
  • 20XXX뵳˼㱨ѡ8ƪ.doc
  • C++γƱ

վ

԰ Ͼλ
ϵͷ779662525#qq.com(#滻Ϊ@)