Error Message & Error Recovery

 
 
ตัวอย่าง Error Message และ Error Recovery
 
  ตัวอย่าง Input Sequence ที่ reject คือ II+( --|
V<E>
II+( --|
 
#1- REPLACE(<E-list><T>) , RETAIN
V<E-list><T>
II+( --|
 
#4 - REPLACE(<T-LIST><P>) , RETAIN
V<E-list><T-list><P>
II+( --|
 
#8 - POP , ADVANCE
V<E-list><T-list>
I+( --|
 
Reject 16 - POP , ADVANCE
V<E-list>
+( --|
 
#2 - REPLACE(<E-list><T>) , ADVANCE
V<E-list><T>
( --|
 
#4 - REPLACE(<T-LIST><P>) , RETAIN
V<E-list><T-list><P>
( --|
 
#7 - REPLACE( ) <E>) , ADVANCE
V<E-list><T-list> )<E>
--|
 
Reject 4 - EXIT
 
  ตัวอย่าง Input Sequence ที่ reject คือ +I++I --|  
V<E>
+I++I --|
  Reject 1 - REPLACE(<E-list><T-list>),RETAIN
V<E-list> <T-list>
+I++I --|
  #6 - POP , RETAIN
V<E-list>
+I++I --|
  #2 - REPLACE(<E-list><T>) , ADVANCE
V<E-list><T>
I++I --|
  #4 - REPLACE(<T-LIST><P>) , RETAIN
V<E-list><T-list><P>
I++I --|
  #8 - POP , ADVANCE
V<E-list><T-list>
++I --|
  #6 - POP , RETAIN
V<E-list>
++I --|
  #2 - REPLACE(<E-list><T>) , ADVANCE
V<E-list><T>
+I --|
  Reject 5 - ADVANCE
V<E-list><T>
I --|
  #4 - REPLACE(<T-LIST><P>) , RETAIN
V<E-list> <T-list><P>
I --|
  #8 - POP , ADVANCE
V<E-list> <T-list>
--|
  #6 - POP , RETAIN
V<E-list>
--|
  #3 - POP , RETAIN
V
--|
  Accept
 
  ตัวอย่าง Input Sequence ที่ reject คือ (*I*) --|  
V<E>
(*I*) --|
  #1 - REPLACE(<E-list><T>) , RETAIN
V<E-list><T>
(*I*) --|
  #4 - REPLACE(<T-LIST><P>) , RETAIN
V<E-list><T-list><P>
(*I*) --|
  #7 - REPLACE( ) <E>) , ADVANCE
V<E-list><T-list> ) <E>
*I*) --|
  Reject 2 - REPLACE(<E-list><T-list>),RETAIN
V<E-list><T-list> ) <E-list> <T-list>
*I*) --|
  #5 - REPLACE(<T-LIST><P>) , ADVANCE
V<E-list><T-list> ) <E-list> <T-list><P>
I*) --|
  #8 - POP , ADVANCE
V<E-list><T-list> ) <E-list> <T-list>
*) --|
  #5 - REPLACE(<T-LIST><P>) , ADVANCE
V<E-list><T-list> ) <E-list> <T-list> <P>
) --|
  Reject 11 - POP , RETAIN
V<E-list><T-list> ) <E-list> <T-list>
) --|
  #6 - POP , RETAIN
V<E-list><T-list> ) <E-list>
) --|
  #3 - POP , RETAIN
V<E-list><T-list> )
) --|
  POP ADVANCE
V<E-list><T-list>
--|
  #6 - POP , RETAIN
V<E-list>
--|
  #3 - POP , RETAIN
V
--|
  Accept
 
  ตัวอย่าง Input Sequence ที่ reject คือ I+)* --|  
V<E>
I+)* --|
  #1 - REPLACE(<E-list><T>) , RETAIN
V<E-list><T>
I+)* --|
  #4 - REPLACE(<T-LIST><P>) , RETAIN
V<E-list><T-list><P>
I+)* --|
  #8 - POP , ADVANCE
V<E-list><T-list>
+)* --|
  #6 - POP , RETAIN
V<E-list>
+)* --|
  #2 - REPLACE(<E-list><T>) , ADVANCE
V<E-list><T>
)* --|
  Reject 7 - POP , RETAIN
V<E-list>
)* --|
  #3 - POP , RETAIN
V
)* --|
  Reject 27 - ADVANCE
V
* --|
  Reject 25 - PUSH(<T-list>) ,RETAIN
V<T-list>
* --|
  #5 - REPLACE(<T-LIST><P>) , ADVANCE
V<T-list><P>
* --|
  Reject 12 - EXIT
 
  ตัวอย่าง Input Sequence ที่ reject คือ I( )I* --|  
V<E>
I( )I* --|
  #1 - REPLACE(<E-list><T>) , RETAIN
V<E-list><T>
I( )I* --|
  #4 - REPLACE(<T-LIST><P>) , RETAIN
V<E-list><T-list><P>
I( )I* --|
  #8 - POP , ADVANCE
V<E-list><T-list>
( )I* --|
  Reject 17 - REPLACE(<T>),RETAIN
V<E-list><T>
( )I* --|
  #4 - REPLACE(<T-LIST><P>) , RETAIN
V<E-list><T-list><P>
( )I* --|
  #7 - REPLACE( ) <E>) , ADVANCE
V<E-list><T-list> ) <E>
)I* --|
  Reject 3 - POP , ADVANCE
V<E-list><T-list> )
I* --|
  Reject 18 - POP , ADVANCE
V<E-list><T-list>
* --|
  #6 - POP , RETAIN
V<E-list>
* --|
  #2 - REPLACE(<E-list><T>) , ADVANCE
V<E-list><T>
* --|
  Reject 6 - ADVANCE
V<E-list><T>
--|
  Reject 8 - EXIT
 
 



204442 Compiler

 

- ออกแบบ Top-Down Pushdown Processor

 

- ตัวอย่าง Error Message & Error Recovery

 

 

จัดทำโดย

นางสาว กอบศิริ ลาัวัลกุล

รหัส 4805654 ลำดับที่ 7

Design By Kobsiri Lawankun 4805654