TAILIEUCHUNG - Lecture Programming languages (2/e): Chapter 3c - Tucker, Noonan

The purpose of the syntactic analyzer, or parser, is to construct a parse tree using as input the stream of tokens provided by the lexer. The output of the parser is usually an abstract syntax tree. The motivation for using an abstract syntax tree, rather than a parse tree. Chapter 3 - Lexical and syntactic analysis: Syntactic analysis. | Programming Languages 2nd edition Tucker and Noonan Chapter 3 Lexical and Syntactic Analysis Syntactic sugar causes cancer of the semicolon. A. Perlis Contents Chomsky Hierarchy Lexical Analysis Syntactic Analysis Syntactic Analysis Phase also known as: parser Purpose is to recognize source structure Input: tokens Output: parse tree or abstract syntax tree A recursive descent parser is one in which each nonterminal in the grammar is converted to a function which recognizes input derivable from the nonterminal. Program Structure consists of: Expressions: x + 2 * y Assignment Statement: z = x + 2 * y Loop Statements: while (i > } while (( ) > oldSize); Check Righthand Side { boolean allNull = true; for (Symbol t : ( )) if (! (t)) allNull = false; if (allNull) (( )); } Rewrite Grammar Augmented form Abbreviate symbols Replace meta constructs with nonterminals Transformed Grammar S → A $ A → i = E ; E → T E' E' →

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.