formal_part1 - CSC C24: Principles of Programming Languages...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSC C24: Principles of Programming Languages Formal Specifications c circlecopyrt Suzanne Stevenson 2002, with revisions by Cathy Jansen. 1 Translation Process Summary 1. Lexical Analysis: Converts source code into sequence of tokens 2. Syntactic Analysis: Structures tokens into initial parse tree 3. Semantic Analysis: Annotates parse tree with semantic actions 4. Code Generation: Produces final machine code 2 Syntax and Semantics of Programming Languages Syntax : Describes what a legal program may look like—its form . • What are the components of the language? ( words ) • How may they be combined with each other? ( grammar ) 3 Syntax and Semantics of Programming Languages Semantics : Defines the meaning of a legal program. • Defines meaning of each program construct • Normal and abnormal termination; nontermination Inherently harder than syntax. State-of-the-art is to use English descriptions (though see Sebesta 3.5 for formal approaches under investigation). 4 Syntax and Semantics of Programming Languages Example semantic description from Common Lisp: The Reference : USAGE (equal x y) DESCRIPTION Returns true if arguments x and y are isomorphic....
View Full Document

This note was uploaded on 02/05/2011 for the course CS 24 taught by Professor Cathy during the Summer '10 term at University of Toronto- Toronto.

Page1 / 22

formal_part1 - CSC C24: Principles of Programming Languages...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online