CSCC24 Principles of Programming Languages
Functional Programming - Scheme
Defining Functions From last class:
Parameter: integer n 0. Result: sum of integers from 0 to n. (define (sum-n n) (cond ) ) What could/should we change if _? How would you define
CSC 324: Principles of Programming Languages
Functional Programming c Suzanne Stevenson 2001,2002 with revisions by Cathy Jansen
Part III: Functional Programming Pure Functional Languages
Fundamental concept: application of (mathematical) functions to v
CSC 24C: Principles of Programming Languages Logic Programming c Suzanne Stevenson 2001, with revisions by Cathy Jansen
Part V: Logic Programming and Prolog Logic programming languages are not procedural or functional. Specify relations between objects
CSC 324: Principles of Programming Languages Procedural Language Design Issues READING: Sebesta 4.3,4.4,4.84.10; 8.18.5,8.11; 9.19.5 c Suzanne Stevenson 2001
Part VI: Procedural Language Design Issues Procedures: A Control Abstraction A block of code th
Part VI: Procedural Language Design Issues CSC 324: Principles of Programming Languages Procedural Language Design Issues READING: Sebesta 4.3,4.4,4.84.10; 8.18.5,8.11; 9.19.5 A horn clause logic programming) c Suzanne Stevenson 2001 Procedures modularize
c Diane Horton 2000; with revisions by Suzanne Stevenson, Alan Rosselet, and Cathy Jansen.
You must read the course info sheet. It will also be posted on the course web site, available through the intranet.
Abstract versus Concrete Syntax
Concrete Syntax: representation of a construct in a particular language, including placement of keywords and delimiters
Abstract Syntax: structure of meaningful components of each language construct
Same abstract syntax,
Parsing in a Grammar (L) Can we recognize X2 := 0 as being in L?
Parse Trees (in L) A parse tree of X2 := 0 in L:
Each internal node is a nonterminal; its children are the RHS of a production for that NT. The parse tree demonstrates that the grammar gen
CSC C24: Principles of Programming Languages Formal Specications c Suzanne Stevenson 2002, with revisions by Cathy Jansen.
Translation Process Summary
1. Lexical Analysis: Converts source code into sequence of tokens
2. Syntactic Analysis: Structures to