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

Chapter 3 - Lexical and syntactic analysis: Lexical analysis. This chapter presents the following content: Example tokens, other sequences, regular expressions, clite lexical syntax, finite state automata, some conventions, lexer code, from design to code,. | 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 Lexical Analysis Purpose: transform program representation Input: printable Ascii characters Output: tokens Discard: whitespace, comments Defn: A token is a logically cohesive sequence of characters representing a single symbol. Example Tokens Identifiers Literals: 123, , 'x', true Keywords: bool char . Operators: + - * / . Punctuation: ; , ( ) { } Other Sequences Whitespace: space tab Comments // any-char* end-of-line End-of-line End-of-file Why a Separate Phase? Simpler, faster machine model than parser 75% of time spent in lexer for non-optimizing compiler Differences in character sets End of line convention differs Regular Expressions RegExpr Meaning x a character x \x an escaped character, ., \n { name } a reference to a name M

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.