Access over 35 million academic & study documents

Book 10044

Content type
User Generated
Showing Page:
1/28

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/28

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/28

Sign up to view the full document!

lock_open Sign Up
Showing Page:
4/28

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 28 pages?
Access Now
Unformatted Attachment Preview
An Overview of a Compiler - Part 1 Y.N. Srikant Department of Computer Science Indian Institute of Science Bangalore 560 012 NPTEL Course on Compiler Design Y.N. Srikant Compiler Overview Outline of the Lecture 1 Compiler overview with block diagram 2 Lexical analysis with LEX 3 Parsing with YACC 4 Semantic analysis with attribute grammars 5 Intermediate code generation with syntax-directed translation 6 Code optimization examples Topics 5 and 6 will be covered in Part II of the lecture Y.N. Srikant Compiler Overview Language Processing System Y.N. Srikant Compiler Overview Compiler Overview Y.N. Srikant Compiler Overview Translation Overview - Lexical Analysis Y.N. Srikant Compiler Overview Lexical Analysis LA can be generated automatically from regular expression specifications LEX and Flex are two such tools Tokens of the LA are the terminal symbols of the parser LA is usually called to deliver a token when the parser needs it Why is LA separate from parsing? Simplification of design - software engineering reason I/O issues are limited LA alone LA based on finite automata are more efficient to implement than pushdown automata used for parsing (due to stack) Y.N. Srikant Compiler Overview LEX Example %% [A-Z]+ %% yywrap(){} main(){yylex();} Y.N. Srikant Compiler Overview Form of a LEX File LEX has a language for describing regular expressions It generates a pattern matcher for the REs described General structure of a LEX program ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4