Computer Science 340
Programming Languages
Fall 2023, Siena College
Lecture 4: Syntax and Semantics
Date: Thursday, September 14, 2023
Agenda
- Announcements
- Lab 1: Python Basics for Java Programmers [HTML] [PDF] is nearing the end of the late clock.
- Lab 2: More Python for Java Programmers [HTML] [PDF] is due Sunday night.
- Unrelated to class, a week from today: definitely make time to
go to the inauguration!
- Programming Language of the Day: Pascal
- Problem Set 1: [PDF] out
- Syntax and Semantics
- describing syntax
- language recognizers and generators
- grammars
- parse trees
- Assignment due in Canvas at the start of our next class: Read
Sebesta Chapter 3, Section 3, and indicate that you have done
so by entering your name as your response in the Canvas assignment.
This assignment is worth 10 points in the "Assignments" category.
We will be covering the contents of this section in detail in class,
so don't worry if all the details aren't very clear on your first
reading.
Terminology
- syntax
- semantics
- language definition
- sentence
- language
- lexeme
- token
- language recognizer
- accepted, rejected strings
- syntax analysis
- language generator
- grammar
- context-free grammar
- regular grammar
- Backus-Naur Form (BNF)
- production
- abstraction
- definition
- nonterminal symbols
- terminal symbols
- left-hand side (LHS) and right-hand side (RHS) of a rule
- derivation
- start symbol
- sentential form
- leftmost (or rightmost) derivation
- parse tree
- ambiguous/unambiguous grammars
- associativity