SEN2001 · Programlama Dilleri

Programming Languages

Syntax and semantics, binding and scope, data types, subprograms, functional and logic programming.

Textbook: Robert W. Sebesta, Concepts of Programming Languages, 8e, Pearson Education, Addison Wesley, 2008, ISBN 978-0-321-50968-0

  1. Week 1
    Introduction
  2. Week 2
    Describing Syntax and Semantics I
    • Syntax: BNF, derivation, parse tree and ambiguityWriting language rules with BNF and EBNF, producing leftmost derivations, drawing parse trees, proving ambiguity and reading precedence/associativity from a grammar. The part of the midterm that brings the most points.
  3. Week 3
    Describing Syntax and Semantics II
  4. Week 4
    Names, Bindings, Type Checking and Scopes
  5. Week 5
    Data Types
  6. Week 6
    Expressions and Assignment Statements
  7. Week 7
    Control Structures
  8. Week 8
    Subprograms I
    • Subprograms I: parameter passing methodsFormal/actual parameters, the in/out/inout models and five implementations: pass-by-value, result, value-result, reference, name. Tracing what the same program prints under each method; also Java's rule, closures and default parameters.
  9. Week 9
    Subprograms II
    • Subprograms II: activation records, static and dynamic chainsWhat happens at call and return, the structure of an activation record, the run-time stack, recursion, nonlocal access through the static chain in nested subprograms (chain_offset, local_offset), blocks and the deep/shallow access implementation of dynamic scope.
  10. Week 10
    Abstract Data Types
    • Abstract data types (ADT) and encapsulationThe concept of abstraction, the two conditions of an ADT, information hiding, Ada packages, C++ and Java classes, parameterized ADTs (generics) and encapsulation constructs for large programs (namespace, package).
  11. Week 11
    Object-oriented Programming
  12. Week 12
    Exception Handling and Event Handling
    • Exception handling and event handlingThe concept of exceptions and design questions, binding to a handler and propagation, the try/catch/finally flow in Java, checked/unchecked exceptions, a C++ and Ada comparison; event-driven programming, the listener model and the JavaScript event loop.
  13. Week 13
    Functional Programming
    • Functional programming: Scheme, lambda, map and recursionThe idea of a mathematical function, LISP data structures (atom, list, cons cell), car/cdr/cons in Scheme, define and lambda, if/cond/let, recursive list functions, higher-order functions (map, filter, compose) and tail recursion.
  14. Week 14
    Logic Programming
    • Logic programming: Prolog, unification and resolutionFrom propositional logic to Prolog: fact, rule and query, unification and instantiation, depth-first search with resolution and backtracking, lists, arithmetic (is), cut and the closed-world assumption. Finding the answers to queries and their order.