1. Trang chủ
  2. » Luận Văn - Báo Cáo

Bài tập lớn Chương trình dịch – Đề số 13

55 324 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 55
Dung lượng 2,59 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

1.Nguyễn Thị Hồng Trang2.Nguyễn Thị Thanh Hải 3.Dương Thị Thanh Thúy  Thực hiện chuyển đổi kiểu từ nguyên sang thực khi cần thiết..  Quá trình phân tích cú pháp được thực hiện theo ph

Trang 1

1.Nguyễn Thị Hồng Trang

2.Nguyễn Thị Thanh Hải

3.Dương Thị Thanh Thúy

 Thực hiện chuyển đổi kiểu từ nguyên sang thực khi cần thiết

Yêu cầu:

 Viết chương trình bằng tay

 Quá trình phân tích cú pháp được thực hiện theo phương pháp từ dưới lên

 Giai đoạn xử lý ngữ nghĩa sinh viên phải thực hiện bằng cách đặt các hành

vi ngữ nghĩa vào bản đặc tả cú pháp

Trang 2

A Những nội dung liên quan tới yêu cầu của đề bài

Trang 3

Printf(“Bạn đạt loại Giỏi”);

II Các phát biểu kết thúc bằng dấu ;

Đa số các câu lệnh kết thúc bằng dấu ;, dùng để ngăn cách các câu lệnh Ví

dụ như: Phát biểu gán (a=0, gán 0 cho biến a), khai báo biến, hằng (float a, khai báo biến a có kiểu số thực)…

Trang 4

4 Toán tử chọn theo điều kiện

(Điều kiện) ? biểu thức 1 : biểu thức 2

- Điều kiện đúng thì biểu thức nhận giá trị biểu thức 1, các trường hợp còn lại bằngbiểu thức 2

Kiểu tên_mảng [kích_thước_chiều1][kích_thước_chiều2]…[kích_thước_chiều_n]

6 Độ ưu tiên của phép toán

- Có 15 mức ưu tiên, thường thì các toán tử 1 ngôi có độ ưu tiên cao hơn 2 ngôi Thứ tự ưu tiên được chỉ rõ hơn trong dấu ()

7 Chuyển đổi kiểu nguyên sang kiểu số thực

int i;

Trang 5

- Chuyển kiểu: (float) i;

B Phân tích từ vựng

I Bảng token

hoặc dấu gạch chân theo sau là số hoặcchữ, dấu gạch chân và không trùng vớikhóa

Trang 7

type → int | float

h Các token khác

=

7 6

1 0

Trang 8

* num

* real

Chú ý: Một số trạng thái có thêm một dấu * để chỉ ra đồ thị chuyển đã xử lý quá

một ký tự của phần khác Ký hiệu này được lưu và trả lại khi đoán nhận phần khác

5 6

4 3

2 +

] ) (

/

* -

other 6

Trang 9

C Phân tích cú pháp

I Định nghĩa văn phạm tổng quát

S → void main leftpar rightpar block

block → begin assign_list end

assign_list → assign assign_list |

assign → dec_var | begin assign_list end | pbif

dec_var → type id id1 semicolon dec_var

id1 → coma id1 | open num close id1 |

pbif → if expr pbif | if expr pbif else pbif | begin assign_list end |

id asg expr semicolonexpr → exp aws expr colon expr

exp → exp or exp1 | exp1

exp1 → exp1 and term | term

term → term relop1 term1 | term1

term1 → term1 relop2 term2 | term2

!

1 8

19

2 0

15

13 14 12

17

21

11 }

Trang 10

term2 → term2 op1 term3| term3

term3 → term3 op2 factor | factor

factor → not factor1

factor1 → leftpar exp rightpar| id | num | real

* Văn phạm tăng cường

S’ → S(1) S → dec_var void main leftpar rightpar block(2) dec_var → type id id1 semicolon dec_var(4) id1 → coma id id1

(5) id1 → open num close id1

(6) id1 →

(7) block → begin assign_list end

(8) assign_list → assign assign_list

(9) assign_list →

(10) assign → dec_var

(11) assign → if expr assign

(12) assign → if expr assign else assign

(13) assign → begin assign_list end

(14) assign → id asg expr semicolon

(15) expr → exp aws expr colon expr

Trang 11

(26) term2 → term3

(27) term3 → term3 op2 factor

(28) term3 → factor

(29) factor → not factor1

(30) factor1 → leftpar expr rightpar(31) factor1 → id

(32) factor1 → num

(33) factor1 → real

(34) factor1 → leftpar type rightpar id

II Các ký hiệu kết thúc và chưa kết thúc

Trang 12

S → dec_var void main leftpar rightpar block, $

dec_var → type id id1 semicolon dec_var, void

dec_var → , void

Trang 13

-goto(I0, S)

I 1: S’→S., $

goto(I0, dec_var)

-I 2: S → dec_var void main leftpar rightpar block, $

goto(I0, type)

-I 3: dec_var → type id id1 semicolon dec_var, void

goto(I2, void)

-I 4: S → dec_var void main leftpar rightpar block, $

goto(I3, id)

-I 5: dec_var → type id id1 semicolon dec_var, void

id1 → coma id id1, semicolon

id1 → open num close id1, semicolon

id1 → , semicolon

goto(I4, main)

-I 6: S → dec_var void main leftpar rightpar block, $

goto(I5, id1)

-I 7: dec_var → type id id1 semicolon dec_var, void

goto(I5, coma)

-I 8: id1 → coma id id1, semicolon

goto(I5, open)

-I 9: id1 → open num close id1, semicolon

goto(I6, leftpar)

Trang 14

-I 10: S → dec_var void main leftpar rightpar block, $

goto(I7, semicolon)

-I 11: dec_var → type id id1 semicolon dec_var, void

dec_var → type id id1 semicolon dec_var, void

goto(I8, id)

-I 12: id1 → coma id id1, semicolon

id1 → coma id id1, semicolon

id1 → open num close id1, semicolon

id1 → , semicolon

goto(I9, num)

-I 13: id1 → open num close id1, semicolon

goto(I10, rightpar)

-I 14: S → dec_var void main leftpar rightpar block, $

block → begin assign_list end, $

goto(I11, dec_var)

-I 15: dec_var → type id id1 semicolon dec_var., void

goto(I11, type) ≡ I3

goto(I12, id1)

-I 16: id1 → coma id id1., semicolon

goto(I12, coma) ≡ I8, goto(I12, open) ≡ I9

goto(I13, close)

-I 17: id1 → open num close id1, semicolon

id1 → coma id id1, semicolon

id1 → open num close id1, semicolon

id1 → , semicolon

Trang 15

I 19: block → begin assign_list end, $

assign_list → assign assign_list, end

assign_list → , end

assign → dec_var, type | begin | id | if |

dec_var → type id id1 semicolon dec_var, type | begin | id | if |

assign → if expr assign, type | begin | id | if |

assign → if expr assign else assign, type | begin | id | if |

assign → begin assign_list end, type | begin | id | if |

assign → id asg expr semicolon, type | begin | id | if |

-goto(I17, id)

I 20: id1 → open num close id1., semicolon

goto(I17, coma) ≡ I8, goto(I17, open) ≡ I9

I 22: assign_list → assign assign_list, end

assign_list → assign assign_list, end

assign_list → , end

assign → dec_var, type | begin | id | if |

dec_var → type id id1 semicolon dec_var, type | begin | id | if |

assign → if expr assign, type | begin | id | if |

assign → if expr assign else assign, type | begin | id | if |

assign → begin assign_list end, type | begin | id | if |

Trang 16

assign → id asg expr semicolon, type | begin | id | if |

I 25: assign → if expr assign, type | begin | id | if |

assign → if expr assign else assign, type | begin | id | if |

expr → exp aws expr colon expr, type | begin | id | if |

expr → exp, type | begin | id | if |

exp → exp or exp1, type | begin | id | if | aws | or |

exp → exp1, type | begin | id | if | aws | or |

exp1 → exp1 and term, type | begin | id | if | aws | or | and |

exp1 → term, type | begin | id | if | aws | or | and |

term → term relop1 term1, type | begin | id | if | aws | or | and | relop1 |

term → term1, type | begin | id | if | aws | or | and | relop1 |

term1 → term1 relop2 term2, type| begin| id| if| aws| or| and| relop1|relop2|

term1 → term2, type| begin| id| if| aws| or| and| relop1|relop2|

term2 →.term2 op1 term3, type|begin|id|if|aws|or|and|relop1|relop2|op1|

term2 → term3, type|begin|id|if|aws|or|and|relop1|relop2|op1|

term3→.term3 op2 factor,type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

term3 → factor, type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

factor → not factor1, type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

goto(I19, begin)

-I 26: assign → begin assign_list end, type | begin | id | if |

Trang 17

assign_list → assign assign_list, end

assign_list → , end

assign → dec_var, type | begin | id | if |

dec_var → type id id1 semicolon dec_var, type | begin | id | if |

assign → if expr assign, type | begin | id | if |

assign → if expr assign else assign, type | begin | id | if |

assign → begin assign_list end, type | begin | id | if |

assign → id asg expr semicolon, type | begin | id | if |

goto(I19, id)

-I 27: assign → id asg expr semicolon, type | begin | id | if |

I 29: assign_list → assign assign_list., end

goto(I22, assign) ≡ I22, goto(I22, dec_var) ≡ I23, goto(I22, type) ≡ I24

goto(I22, if) ≡ I25, goto(I22, begin) ≡ I26, goto(I22, id) ≡ I27

goto(I24, id)

I 30: dec_var → type id id1 semicolon dec_var, type | begin | id | if |

id1 → coma id id1, semicolon

id1 → open num close id1, semicolon

id1 → , semicolon

-goto(I25, expr)

I 31: assign → if expr assign, type | begin | id | if |

assign → if expr assign else assign, type | begin | id | if |

assign → dec_var, type | begin | id | if | | else

dec_var → type id id1 semicolon dec_var, type | begin | id | if | | elseassign → if expr assign, type | begin | id | if | | else

Trang 18

assign → if expr assign else assign, type | begin | id | if | | else

assign → begin assign_list end, type | begin | id | if | | esle

assign → id asg expr semicolon, type | begin | id | if | | else

-goto(I25, exp)

I 32: expr → exp aws expr colon expr, type | begin | id | if |

expr → exp., type | begin | id | if |

exp → exp or exp1, type | begin | id | if | aws | or |

-goto(I25, exp1)

I 33: exp → exp1., type | begin | id | if | aws | or |

exp1 → exp1 and term, type | begin | id | if | aws | or | and |

-goto(I25, term)

I 34: exp1 → term., type | begin | id | if | aws | or | and |

term → term relop1 term1, type | begin | id | if | aws | or | and | relop1 |

-goto(I25, term1)

I 35: term → term1., type | begin | id | if | aws | or | and | relop1 |

term1 → term1 relop2 term2, type| begin| id| if| aws| or| and| relop1|relop2|

-goto(I25, term2)

I 36: term1 → term2., type| begin| id| if| aws| or| and| relop1|relop2|

term2 →term2 op1 term3, type|begin|id|if|aws|or|and|relop1|relop2|op1|

-goto(I25, term3)

I 37: term2 → term3., type|begin|id|if|aws|or|and|relop1|relop2|op1|

term3→term3 op2 factor,type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

Trang 19

I 39: factor → not factor1, type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

factor1 → leftpar expr rightpar,type|begin|id|if|aws|or|and|

relop1|relop2|op1|op2|

factor1 → id, type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

factor1 → num, type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

factor1 → real, type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

factor1 → leftpar type rightpar id, type|begin|id|if|aws|or|and|

relop1|relop2|op1|op2|

-goto(I26, assign_list)

I 40: assign → begin assign_list end, type | begin | id | if |

goto(I26, assign) ≡ I22, goto(I26, dec_var) ≡ I23, goto(I26, type) ≡ I24

goto(I26, if) ≡ I25, goto(I26, begin) ≡ I26, goto(I26, id) ≡ I27

-goto(I27, asg)

I 41: assign → id asg expr semicolon, type | begin | id | if |

expr → exp aws expr colon expr, semicolon

expr → exp, semicolon

exp → exp or exp1, semicolon | aws | or

exp → exp1, semicolon | aws | or

exp1 → exp1 and term, semicolon | aws | or | and

exp1 → term, semicolon | aws | or | and

term → term relop1 term1, semicolon | aws | or | and | relop1

term → term1, semicolon | aws | or | and | relop1

term1 → term1 relop2 term2, semicolon | aws | or | and | relop1| relop2

Trang 20

term1 → term2, semicolon | aws | or | and | relop1| relop2

term2 →.term2 op1 term3, semicolon | aws | or | and | relop1| relop2 | op1term2 → term3, semicolon | aws | or | and | relop1| relop2 | op1

term3→.term3 op2 factor, semicolon | aws | or | and | relop1| relop2 |op1|op2term3 → factor, semicolon | aws | or | and | relop1| relop2 |op1|op2

factor → not factor1, semicolon | aws | or | and | relop1| relop2 |op1|op2 -

goto(I30, id1)

I 42: dec_var → type id id1 semicolon dec_var, type | begin | id | if |

Goto(I30, coma) ≡ I8, goto(I30, open) ≡ I9

Goto(I31, assign)

I 43: assign → if expr assign., type | begin | id | if |

assign → if expr assign else assign, type | begin | id | if |

I 46: assign → if expr assign, type | begin | id | if | | else

assign → if expr assign else assign, type | begin | id | if | | else

expr → exp aws expr colon expr, type | begin | id | if |

expr → exp, type | begin | id | if |

exp → exp or exp1, type | begin | id | if | aws | or |

exp → exp1, type | begin | id | if | aws | or |

exp1 → exp1 and term, type | begin | id | if | aws | or | and |

exp1 → term, type | begin | id | if | aws | or | and |

term → term relop1 term1, type | begin | id | if | aws | or | and | relop1 |

term → term1, type | begin | id | if | aws | or | and | relop1 |

term1 → term1 relop2 term2, type| begin| id| if| aws| or| and|

relop1|relop2|

Trang 21

term1 → term2, type| begin| id| if| aws| or| and| relop1|relop2|

term2 →.term2 op1 term3, type|begin|id|if|aws|or|and|

relop1|relop2|op1|

term2 → term3, type|begin|id|if|aws|or|and|relop1|relop2|op1|

term3→.term3 op2 factor,type|begin|id|if|aws|or|and|

relop1|relop2|op1|op2|

term3 → factor, type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

factor → not factor1,type|begin|id|if|aws|or|and|relop1|relop2|op1|op2|

goto(I31, begin)

I 47: assign → begin assign_list end, type | begin | id | if | | else

assign_list → assign assign_list, end

assign_list → , end

assign → dec_var, type | begin | id | if |

dec_var → type id id1 semicolon dec_var, type | begin | id | if |

assign → if expr assign, type | begin | id | if |

assign → if expr assign else assign, type | begin | id | if |

assign → begin assign_list end, type | begin | id | if |

assign → id asg expr semicolon, type | begin | id | if |

I 49: expr → exp aws expr colon expr, type | begin | id | if |

expr → exp aws expr colon expr, colon

expr → exp, colon

exp → exp or exp1, colon | aws | or

exp → exp1, colon | aws | or

exp1 → exp1 and term, colon | aws | and | or

exp1 → term, colon | aws | and | or

term → term relop1 term1, colon | aws | and | relop1 | or

Trang 22

term → term1, colon | aws | and | relop1 | or

term1 → term1 relop2 term2, colon | aws | and | relop1 | relop2 | or

term1 → term2, colon | aws | and | relop1 | relop2 | or

term2 →.term2 op1 term3, colon|aws|or|and|relop1|relop2|op1

term2 → term3, colon |aws|or|and|relop1|relop2|op1

term3→.term3 op2 factor,colon|aws|or|and|relop1|relop2|op1|op2

term3 → factor, colon|aws|or|and|relop1|relop2|op1|op2

factor → not factor1, colon|aws|or|and|relop1|relop2|op1|op2

Goto(I32, or)

I 50: exp → exp or exp1, type | begin | id | if | aws | or |

exp1 → exp1 and term, type | begin | id | if | aws | or | | and

exp1 → term, type | begin | id | if | aws | or | | and

term → term relop1 term1, type | begin | id | if | aws | or | | and | relop1term → term1, type | begin | id | if | aws | or | | and | relop1

term1 →.term1 relop2 term2, type| begin| id| if| aws| or| | and| relop1|relop2

term1 → term2, type| begin| id| if| aws| or| | and| relop1| relop2

term2 →.term2 op1 term3, type|begin|id|if| aws| or| | and| relop1| relop2|op1

term2 → term3, type| begin| id| if| aws| or| | and| relop1| relop2| op1

term3 → term3 op2 factor, type|begin|id|if|aws|or| |and|

relop1|relop2|op1|op2term3 → factor, type| begin| id| if| aws| or| | and| relop1| relop2|op1|op2factor →.not factor1, type|begin| id| if| aws| or| | and| relop1| relop2|op1|op2 -

Goto(I33, and)

I 51: exp1 → exp1 and term, type | begin | id | if | aws | or | and |

term → term relop1 term1, type | begin | id | if | aws | or | | and | relop1term → term1, type | begin | id | if | aws | or | | and | relop1

Trang 23

term1 →.term1 relop2 term2, type| begin| id| if| aws| or| | and| relop1|relop2

term1 → term2, type| begin| id| if| aws| or| | and| relop1| relop2

term2 →.term2 op1 term3, type|begin|id|if| aws| or| | and| relop1| relop2|op1

term2 → term3, type| begin| id| if| aws| or| | and| relop1| relop2| op1

term3 → term3 op2 factor, type|begin|id|if|aws|or| |and|

relop1|relop2|op1|op2term3 → factor, type| begin| id| if| aws| or| | and| relop1| relop2|op1|op2factor →.not factor1, type|begin| id| if| aws| or| | and| relop1| relop2|op1|op2 -

Goto(I34, relop1)

I 52: term → term relop1 term1, type | begin | id | if | aws | or | and | relop1 |

term1 →.term1 relop2 term2, type| begin| id| if| aws| or| | and| relop1|relop2

term1 → term2, type| begin| id| if| aws| or| | and| relop1| relop2

term2 →.term2 op1 term3, type|begin|id|if| aws| or| | and| relop1| relop2|op1

term2 → term3, type| begin| id| if| aws| or| | and| relop1| relop2| op1

term3 → term3 op2 factor, type|begin|id|if|aws|or| |and|

relop1|relop2|op1|op2term3 → factor, type| begin| id| if| aws| or| | and| relop1| relop2|op1|op2factor →.not factor1, type|begin| id| if| aws| or| | and| relop1| relop2|op1|op2 -Goto(I35, relop2)

I 53: term1 → term1 relop2 term2, type| begin| id| if| aws| or| and| relop1|relop2|

term2 →.term2 op1 term3, type|begin|id|if| aws| or| | and| relop1| relop2|op1

term2 → term3, type| begin| id| if| aws| or| | and| relop1| relop2| op1

term3 → term3 op2 factor, type|begin|id|if|aws|or| |and|

Trang 24

relop1|relop2|op1|op2term3 → factor, type| begin| id| if| aws| or| | and| relop1| relop2|op1|op2factor →.not factor1, type|begin| id| if| aws| or| | and| relop1| relop2|op1|op2 -

Goto(I36, op1)

I 54: term2 →term2 op1 term3, type|begin|id|if|aws|or|and|relop1|relop2|op1|

term3 → term3 op2 factor, type|begin|id|if|aws|or| |and|

relop1|relop2|op1|op2term3 → factor, type| begin| id| if| aws| or| | and| relop1| relop2|op1|op2factor →.not factor1, type|begin| id| if| aws| or| | and| relop1| relop2|op1|op2 -

I 57: factor1 → leftpar expr rightpar, type | begin | id | if | aws | or | and |

relop1| relop2 |op1 |op2 |

expr → exp aws expr colon expr, rightpar

expr → exp, rightpar

exp → exp or exp1, rightpar | aws | or

exp → exp1, rightpar | aws | or

exp1 → exp1 and term, rightpar | aws | or | and

exp1 → term, rightpar | aws | or | and

term → term relop1 term1, rightpar | aws | or | and | relop1

term → term1, rightpar | aws | or | and | relop1

term1 → term1 relop2 term2, rightpar | aws | or | and | relop1 | relop2

term1 → term2, rightpar | aws | or | and | relop1 | relop2

Trang 25

term2 →.term2 op1 term3, rightpar | aws | or | and | relop1 | relop2 | op1term2 → term3, rightpar | aws | or | and | relop1 | relop2 | op1

term3→.term3 op2 factor, rightpar | aws | or | and | relop1 | relop2 | op1| op2term3 → factor, rightpar | aws | or | and | relop1 | relop2 | op1| op2

factor → not factor1, rightpar | aws | or | and | relop1 | relop2 | op1| op2factor1 → leftpar type rightpar id, type|begin|id|if|aws|or|and|

I 63: expr → exp aws expr colon expr, semicolon

expr → exp., semicolon

exp → exp or exp1, semicolon | aws | or

-Goto(I41, exp1)

I 64: exp → exp1., semicolon | aws | or

exp1 → exp1 and term, semicolon | aws | or | and

-Goto(I41, term)

I 65: exp1 → term., semicolon | aws | or | and

Trang 26

term → term relop1 term1, semicolon | aws | or | and | relop1

-Goto(I41, term1)

I 66: term → term1., semicolon | aws | or | and | relop1

term1 → term1 relop2 term2, semicolon | aws | or | and | relop1| relop2 -

Goto(I41, term2)

I 67: term1 → term2., semicolon | aws | or | and | relop1| relop2

term2 →term2 op1 term3, semicolon | aws | or | and | relop1| relop2 | op1 -

Goto(I41, term3)

I 68: term2 → term3., semicolon | aws | or | and | relop1| relop2 | op1

term3→term3 op2 factor, semicolon | aws | or | and | relop1| relop2 |op1|op2 -

Goto(I41, factor)

I 69: term3 → factor., semicolon | aws | or | and | relop1| relop2 |op1|op2

-Goto(I41, not)

I 70: factor → not factor1, semicolon | aws | or | and | relop1| relop2 |op1|op2

factor1 → leftpar expr rightpar, semicolon| aws| or| and| relop1| relop2|op1|

op2factor1 → id, semicolon | aws | or | and | relop1| relop2 |op1|op2

factor1 → num, semicolon | aws | or | and | relop1| relop2 |op1|op2

factor1 → real, semicolon | aws | or | and | relop1| relop2 |op1|op2

factor1 → leftpar type rightpar id, semicolon | aws | or | and | relop1| relop2

|op1|op2 -

Goto(I42, semicolon)

I 71: dec_var → type id id1 semicolon dec_var, type | begin | id | if |

dec_var → type id id1 semicolon dec_var, type | begin | id | if |

dec_var → , type | begin | id | if |

-Goto(I43, else)

I 72: assign → if expr assign else assign, type | begin | id | if |

assign → dec_var, type | begin | id | if |

Trang 27

dec_var → type id id1 semicolon dec_var, type | begin | id | if |

assign → if expr assign, type | begin | id | if |

assign → if expr assign else assign, type | begin | id | if |

assign → begin assign_list end, type | begin | id | if |

assign → id asg expr semicolon, type | begin | id | if |

-Goto(I45, id)

I 73: dec_var → type id id1 semicolon dec_var, type | begin | id | if | | else

id1 → coma id id1, semicolon

id1 → open num close id1, semicolon

id1 → , semicolon

-goto(I46, expr)

I 74: assign → if expr assign, type | begin | id | if | | else

assign → if expr assign else assign, type | begin | id | if | | else

assign → dec_var, type | begin | id | if | | else

dec_var → type id id1 semicolon dec_var, type | begin | id | if | | else

assign → if expr assign, type | begin | id | if | | else

assign → if expr assign else assign, type | begin | id | if | | else

assign → begin assign_list end, type | begin | id | if | | esle

assign → id asg expr semicolon, type | begin | id | if | | else

goto(I46, exp) ≡ I32, goto(I46, exp1) ≡ I33, goto(I46, term) ≡ I34, goto(I46, term1) ≡ I35,goto(I46, term2) ≡ I36, goto(I46, term3) ≡ I37, goto(I46, factor) ≡ I38,

goto(I46, not) ≡ I39

-Goto(I47, assign_list)

I 75: assign → begin assign_list end, type | begin | id | if | | else

goto(I26, assign) ≡ I22, goto(I26, dec_var) ≡ I23, goto(I26, type) ≡ I24

goto(I26, if) ≡ I25, goto(I26, begin) ≡ I26, goto(I26, id) ≡ I27

-Goto(I48, asg)

I 76: assign → id asg expr semicolon, type | begin | id | if | | else

Ngày đăng: 14/04/2015, 08:58

HÌNH ẢNH LIÊN QUAN

2. Sơ đồ dịch - Bài tập lớn Chương trình dịch – Đề số 13
2. Sơ đồ dịch (Trang 7)

TỪ KHÓA LIÊN QUAN

w