Compiling with C# and Java
معرفی کتاب «Compiling with C# and Java» نوشتهٔ Patrick D Terry در سال 2004. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Compiling with C# and Java» در دستهٔ بدون دستهبندی قرار دارد.
Compilers are essential to computer programming. They translate statements madein a particular programming language into low-level machine code which the computer can understand.Compiling with C# and Javais a practical introduction to how this is achieved for stack machines such as the Java Virtual Machine (JVM) and .NET Common Language Runtime (CLR), and is ideal for students needing an introductory text on compilers or anyone with a general interest in the topic. Features:* Highly practical approach, with many diagrams, examples and exercises to give the reader a genuine working knowledge of the concepts involved.* Case studies in C# and Java target the Java Virtual Machine (JVM) and .NET Common Language Runtime (CLR), two of the most contemporary and popular technologies.* Step-by-step progression, beginning with compiling a simple language subset and adding extra language features as the reader advances.* Uses Coco/R extensively – a versatile tool used in the construction of a wide range of syntax-directed applications.* Complete source code for all case studies is available on a(http://www.booksites.net/terry) support website .Pat Terry is a Professor in the Department of Computer Science at Rhodes University, South Africa, where he was recognized for the Vice-Chancellor’s award for distinguished teaching. Cover Compiling with C# and Java Contents Preface Acknowledgements Translators and Languages Objectives Systems programs and translators The benefits of using high-level languages The curse of complexity Successful language design The benefits of formal description Translator Classification and Structure T-diagrams Classes of translator Linkers and loaders Phases in translation Multi-stage translators Interpreters, interpretive compilers and emulators The P-system and the JVM JIT compilers and the .NET Framework Compiler Development and Bootstrapping Using a high-level translator Using a high-level host language Bootstrapping Self-compiling compilers The half bootstrap Bootstrapping from a portable interpretive compiler A P-code assembler The use of compiler generating tools Stack Machines Simple machine architecture Assembler languages Addressing modes The PVM – a simple stack machine Programming the PVM An emulator for the PVM A minimal assembler for PVM code Enhancing the efficiency of the emulator Error handling in the PVM Enhancing the instruction set of the PVM Another stack machine – the JVM The CLR – a conceptual stack machine Language Specification Syntax, semantics and pragmatics Languages, symbols, alphabets and strings Regular expressions Grammars and productions Classic BNF notation for productions Simple examples Phrase structure and lexical structure e-productions Extensions to BNF Syntax diagrams Formal treatment of semantics Development and Classification of Grammars Equivalent grammars Case study – equivalent grammars for describing expressions Some simple restrictions on grammars Ambiguous grammars The Chomsky hierarchy Deterministic Top-down Parsing Deterministic top-down parsing Restrictions on grammars so as to allow LL(1) parsing The effect of the LL(1) conditions on language design Case study – Parva Parser and Scanner Construction Construction of simple recursivev descent parsers Case study – a parser for assignment sequences Other aspects of recursive descent parsing Syntax error detection and recovery Construction of simple scanners Case study – a scanner for Boolean assignments Keywords and literals Comment handling LR parsing Automated construction of scanners and parsers Syntax-directed Translation Embedding semantic actions into syntax rules Attribute grammars Synthesized and inherited attributes Classes of attribute grammars Case study – a small database for a group of students Using Coco/R: Overview Coco/R – a brief history Installing and running Coco/R Case study – a simple adding machine Overall form of a Cocol description Scanner specification Parser specification The driver program Using Coco/R: Case Studies Case study – understanding C declarations Case study – generating simple two-address code from expressions Case study – generating two-address code from an AST Case study – manipulating EBNF productions Case study – a simple assembler for the PVM Further projects A Parva Compiler: the Front End Overall compiler structure File handling Error reporting Scanning and parsing Syntax error recovery Constraint analysis Further projects A Parva Compiler: the Back End Extending the symbol table entries The code generation interface Using the code generation interface Code generation for the PVM Towards greater efficiency Other aspects of code generation Further projects A Parva Compiler: Functions and Parameters Source language extensions Constraint analysis Run-time storage management Putting it all together Mutually recursive functions Nested functions Heap management Further projects A C#Minor Compiler: the Front End The source language – C#Minor The target language The symbol table Abstract syntax design Abstract syntax tree construction Parsing declarations Further projects A C#Minor Compiler:the Back End Single-pass compiler strategy Generating code for statements from an abstract syntax tree Generating code for expressionsf rom an abstract syntax tree Low-level code generation – the CodeGen class The OpCode class Tracking the depth of stack Generating the directives Further projects Appendix A: Assembler programmer’s guide to the PVM, JVM and CLR virtual machines Fundamental types Instruction sets Assembler directives Appendix B: Library routines Appendix C: Context-free grammars and I/O facilities for Parva and C#Minor Appendix D: Software resources for this book The Resource Kit Coco/R distributions Other compiler tools, free compilers and similar resources Disclaimer Bibliography Index A compiler is a special program that processes statements in a particular programming language and turns them into machine code that the computer can understand. Compiling with C# and Java is an introduction to compiler construction using the Java Virtual Machine (JVM) and .NET Common Language Routine (CLR), both of which provide the interface between compiler, C# or Java code, and hardware. Loaded with exercises, examples and case studies, the text balances theory and practice to provide the reader with a solid working knowledge of the subject.
دانلود کتاب Compiling with C# and Java