งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

1 หลักการภาษาชุดคำสั่ง อ. บุรินทร์ รุจจนพันธุ์.. ปรับปรุง 9 มิถุนายน 2556 Transition & Parse Tree มหาวิทยาลัยเนชั่น.

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "1 หลักการภาษาชุดคำสั่ง อ. บุรินทร์ รุจจนพันธุ์.. ปรับปรุง 9 มิถุนายน 2556 Transition & Parse Tree มหาวิทยาลัยเนชั่น."— ใบสำเนางานนำเสนอ:

1 http://www.thaiall.com/programmingPage: 1 หลักการภาษาชุดคำสั่ง อ. บุรินทร์ รุจจนพันธุ์.. ปรับปรุง 9 มิถุนายน 2556 Transition & Parse Tree มหาวิทยาลัยเนชั่น http://www.nation.ac.th มหาวิทยาลัยเนชั่น http://www.nation.ac.th

2 http://www.thaiall.com/programmingPage: 2 เลกซิคัล อนาไลเซอร์ (Lexical Analyzer) ขั้นตอนแรก ทำหน้าที่ อ่าน Source Code แล้วแยกอักขระ ออกตามลักษณะ และหน้าที่ เช่น คำสั่ง ตัวแปร ค่าคงที่ เป็นต้น รวมถึงการขจัด ส่วนหมายเหตุ (Comment) ช่องว่างขาว (White space) เช่น blank, tab และ new line เป็นต้น ผลของขั้นตอน นี้จะแยกทุกสิ่งที่ควรแยกออกจาก กัน เพื่อนำไปตรวจสอบในขั้น ต่อไป ข้อมูลจาก ! http://www.cs.purdue.edu/homes/li/cs352/2Lexical.pdf

3 http://www.thaiall.com/programmingPage: 3 Transition Diagram A transition diagram is similar to a flowchart for (a part of) the lexer. We draw one for each possible token. It shows the decisions that must be made based on the input seen. The two main components are circles representing states (think of them as decision points of the lexer) and arrows representing edges (think of them as the decisions made). ข้อมูลจาก http://cs.nyu.edu/~gottlieb/courses/compilers/class-notes.html

4 http://www.thaiall.com/programmingPage: 4 ซินแทกซ์ อนาไลเซอร์ (Syntax Analyzer) ขั้นตอนที่สอง ทำ หน้าที่ ตรวจสอบ ความสัมพันธ์ การ จัดเรียง และความถูกต้อง ของแต่ละคำ แต่ละ ประโยค ซึ่งมีวิธี ตรวจสอบหลายวิธี เช่น ตรวจสอบ parse tree ว่า มีไวยากรณ์ถูกต้องตามที่ กำหนดไว้หรือไม่

5 http://www.thaiall.com/programmingPage: 5 Parse Tree (1/3) A parse tree is a tree that represents the syntactic structure of a string according to some formal grammar. A program that produces such trees is called a parser. Parse trees may be generated for sentences in natural languages (see natural language processing), as well as during processing of computer languages, such as programming languages. John hit the ball ข้อมูลจาก http://en.wikipedia.org/wiki/Parse_tree

6 http://www.thaiall.com/programmingPage: 6 Parse Tree (2/3) ข้อมูลจาก http://cs.nyu.edu/~gottlieb/courses/compilers/class-notes.html x3 = y + 3;

7 http://www.thaiall.com/programmingPage: 7 Parse Tree (3/3) if x1 then if x2 then s1 else s2


ดาวน์โหลด ppt 1 หลักการภาษาชุดคำสั่ง อ. บุรินทร์ รุจจนพันธุ์.. ปรับปรุง 9 มิถุนายน 2556 Transition & Parse Tree มหาวิทยาลัยเนชั่น.

งานนำเสนอที่คล้ายกัน


Ads by Google