Jan18 - CSE262 Programming Languages Instructor Dr Liang...

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

View Full Document Right Arrow Icon
CSE262: Programming Languages Instructor: Dr. Liang Cheng Department of Computer Science and Engineering P.C. Rossin College of Engineering & Applied Science Lehigh University January 18, 2007
Background image of page 1

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

View Full DocumentRight Arrow Icon
Instructor: Dr. Liang Cheng CSE262: Programming Languages 01/18/07 Today’s Topics ± Introduction to language definition ± A formal method of describing syntax ± Complier/Compilation in a nutshell ± Summary and homework
Background image of page 2
Instructor: Dr. Liang Cheng CSE262: Programming Languages 01/18/07 Introduction to Language Definition ± Language definition or language specifications ± What does it looks like?
Background image of page 3

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

View Full DocumentRight Arrow Icon
Instructor: Dr. Liang Cheng CSE262: Programming Languages 01/18/07 Syntax and Semantics ± Syntax ± The form or structure of the expressions, statements, and program units ± while ( EXPRESSION ) { STATEMENTS; } ± Semantics ± The meaning of the expressions, statements, and program units
Background image of page 4
Instructor: Dr. Liang Cheng CSE262: Programming Languages 01/18/07 Terms for Describing Syntax ± A language is a set of sentences ± A sentence is a string of characters, composed of lexemes, over some alphabet ± A lexeme is the lowest level syntactic unit of a language described by a lexical specification ± A token is a category/abstraction of lexemes
Background image of page 5

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

View Full DocumentRight Arrow Icon
Instructor: Dr. Liang Cheng CSE262: Programming Languages 01/18/07 Examples of Lexemes & Tokens ± A lexeme is the lowest level syntactic unit of a language described by a lexical specification ± A token is a category/abstraction of lexemes ± x = y * 2 + 1; Lexemes Tokens x id =e q u a l _ s i g n y id *m u l t _ o p 2 int_literal +p l u s _ o p 1 int_literal ;s e m i c o l o n
Background image of page 6
Instructor: Dr. Liang Cheng CSE262: Programming Languages 01/18/07 Today’s Topics ± Introduction to language definition ± A formal method of describing syntax ± Compiler/Compilation in a nutshell ± Summary and homework
Background image of page 7

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

View Full DocumentRight Arrow Icon
Instructor: Dr. Liang Cheng CSE262: Programming Languages 01/18/07 A Formal Method of Describing Syntax ± Backus-Naur Form (1959) ± For Algol 58 (John Backus, the Peter Naur) ± BNF is equivalent to context-free grammars ± Context-free grammars were developed by Noam Chomsky in mid-1950s to define a class of languages called context-free languages ± A BNF grammar defines a language ± Recognizer vs. generators ± A BNF grammar or description is a production- rule collection
Background image of page 8
Instructor: Dr. Liang Cheng
Background image of page 9

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

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

This note was uploaded on 08/06/2008 for the course CSE 262 taught by Professor Cheng during the Spring '07 term at Lehigh University .

Page1 / 28

Jan18 - CSE262 Programming Languages Instructor Dr Liang...

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

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