syntax analysis

advertisement
CS 320 Programming Languages
Spring 2015
Credits: 3 units
Contact Hours: Tuesday/Thursday 1400-1515, 1600-1715
Instructor: John Carroll Office: GMCS 544Email: carroll@rohan.sdsu.edu
Office Hours Days: T/TH
Office Hours: 1130 – 1225, 1520-1555, 1720- (T/TH)
Course Materials
1. Required text: Concepts of Programming Languages, 9th Edition, by Robert Sebesta. Addison-Wesley Press. ISBN
9780136073475
2. Class notes: A collection of lecture notes, annotated programs, and diagrams presented in class. Available at KB
Books (5187 College Ave, 287-BOOK, kbbooks.com)
Course Information for CS 320
Description from the Official Course Catalog
Programming Language History, Syntax and Semantics, Lexical Analysis, Syntax Analysis, Names, Bindings, Scopes,
Data Types, Control Constructs, Function Invocation, Recursion, Functional Programming, and details of specific
programming languages.
Prerequisites: CS108 is a sufficient prerequisite; if you have already (or are concurrently) taking CS 237 (Assembly
Language), you will find that this will deepen your understanding.
Course Type: Upper division required course
Specific Goals for CS 320
Course-Level Student Learning Outcomes
The objectives of CS 320 (Programming Languages) are for students to:
Learn to recognize distinguishing programming language features.
1.
2.
Understand the importance of language design in program development.
Understand the process of breaking down source code into lexemes, tokens, and parse trees.
3.
4.
5.
Understand and use basic UNIX commands, compilers, and file structure.
Be able to apply scoping rules to variables, functions, modules, and namespaces.
Understand object-oriented methodologies by use of public, private, protected, and friend
constructs.
6.
Understand the concept of functional programming list processing through application of basic
methods.
7.
Be able to code a program in a previously unused programming language by studying examples
and researching language constructs as needed.
Relationship to CS Program Course Outcomes
CS 320 addresses the following CS Program course outcomes:
a) An ability to apply knowledge of computing and mathematics appropriate to the program’s student
outcomes and to the discipline
b) An ability to analyze a problem, and identify and define the computing requirements appropriate to its
solution
c) An ability to design, implement, and evaluate a computer-based system, process, component, or program to
meet desired needs
d) Recognition of the need for and an ability to engage in continuing professional development
e) An ability to use current techniques, skills, and tools necessary for computing practice.
8.
Topics Covered
The following topics are covered in CS 320:
1.
2.
3.
4.
5.
6.
7.
8.
Overview of programming language properties, categories, and history.
Introduction to UNIX, text editors, compiling, and running programs on the UNIX operating system.
Language syntax, semantics, syntactical analysis, and lexical analysis.
Naming, binding, and scope of variables.
Data types, arrays, and structures.
Function and module structure and invocation.
C programming language: input/output, static and dynamic allocation, pointers, arrays, structures;
debugging, compiling, and executing a program.
9. FORTRAN programming language: input/output, static and dynamic allocation, subprograms, syntax, control
structures, recursion; compiling, and executing a program.
10.
11.
12.
13.
Expressions and assignment statements.
Object-oriented objectives and properties: abstraction, encapsulation, polymorphism, and inheritance.
C++ programming language: input/output, classes, objects, structures, arrays of objects.
Functional languages composition and LISP programming language.
Special Assistance
Special Assistance: If you are a student with a disability and believe you will need accommodations for this class, it is your
responsibility to contact Student Disability Services at (619) 594-6473. To avoid any delay in the receipt of your
accommodations, you should contact Student Disability Services as soon as possible. Please note that accommodations
are not retroactive, and that accommodations based upon disability cannot be provided until you have presented your
instructor with an accommodation letter from Student Disability Services. Your cooperation is appreciated.
Course Structure and Conduct
Style of the Course: lecture, individual homework, and individual programming assignments
Technology Utilized in the Course: Various IDEs, SDSU server rohan class accounts and development environment, SSH
connection utilities
Programming Assignments and Exams
Programming assignments: There will be 4-5 programming assignments and 3-4 homework assignments throughout the
semester. Programming work is to be done on an individual basis. All programming assignments will be submitted online
and (in the case of APL) a matching hard copy submitted in class. You are required to follow certain coding guidelines
which will be outlined in class and on assignments. No late assignments accepted; however, many assignments can be
turned in early to receive extra credit.
Exams: There will be one midterm exam and a final exam. Make-up exams are not given. Unless a compelling reason
exists (to be determined by me), failure to appear for an exam at the indicated date and time will result in a zero score. If
you know in advance that you will miss an exam, see me about it in advance. Refer to
http://arweb.sdsu.edu/es/registrar/finalexams/14_fall.html and note now that the date of our final exam is Tuesday, May
12, 2015, from 1pm-3pm (2pm class) or 3:30pm-5:30pm (4pm class); don't make plans that conflict with the final. Note in
particular that the university policy prohibits taking the final early.
Course Assessment and Grading
Assignments will comprise 35% of your grade, the midterm will be 25% of your grade, and the final will be worth 40%
of your grade.
Excused Absence Make-up Policies: Unless a compelling reason exists (“compelling” will be determined by me),
failure to appear for an exam at the indicated date and time will result in a zero score.
Other Course Policies
1.
2.
Adding/Dropping Procedures: Students that do not show up the first week of class will be dropped at the end of
the first week. Students will be allowed to add the course based on space available, provided they have attended
all lectures from the first week of class. Last day for students to add or drop class: 9/8/2014.
Cheating/Plagiarism: You are free to discuss ideas and strategies for approaching problems with others, but each
student must complete his/her own work. Cheating and plagiarism WILL NOT BE TOLERATED. If a student is
found cheating or plagiarizing material written by someone else (including information posted on websites), that
student will fail this course and should expect to face disciplinary proceedings.
3.
Extra Credit Policy: If you are having problems with the assignments or tests, contact the instructor as soon as
possible. It will NOT be possible to earn extra credit to improve a poor grade at the end of the semester. There
may be opportunities for extra credit during the semester that are related to additional/early programming
assignments.
4.
Classroom Focus: If you MUST bring a cell phone or pager to class, set it to the vibrate mode and step out of the
room to take any necessary calls. PLEASE limit this to emergency/critical situations only.
Fictional Course Calendar
Regard these dates as wild approximations. The actual time line will be updated, adjusted, and published as the semester
progresses.
Week
Date
Topic
Reading
Assignment
1
2
3
4
5
6
7
8
Jan
Course Introduction
Chapter 0 notes
Jan
compilers / C / Unix
Chapter 0,1 notes
Jan
Introduction / C / Unix
Chapter 1 Sebesta
Feb
History / C / Unix
Chapter 2 Sebesta
Feb
Syntax / APL / Grammars
Chapter 3 Sebesta
Feb
Lexical & Syntax analysis / APL
Chapter 3 Sebesta
As2
Feb
Lexical & Syntax analysis / APL
Chapter 3 Sebesta
P1
Feb
Lexical & Syntax analysis / APL
Chapter 4 Sebesta
Feb
LR Parsing
Chapter 4 Sebesta
Feb
LR Parsing
Chapter 4 Sebesta
Feb
Lexical & Syntax analysis / APL
Chapter 4 Sebesta
Mar
Names, binding, scope
Chapter 5 Sebesta
Mar
Names, binding, scope
Chapter 5 Sebesta
Mar
review
Chapter 5 Sebesta
Mar
Midterm exam
Chapter 6 Sebesta
As1
As3
P2
9
10
11
12
13
14
15
16
Mar
Data Types
Chapter 6 Sebesta
Mar
Data Types
Chapter 6 Sebesta
Mar
Expressions and Assignments
Chapter 7 Sebesta
Mar
Expressions and Assignments
Chapter 7 Sebesta
Apr
Functional Programming
Chapter 15 Sebesta
Apr
Scheme
Chapter 15 Sebesta
Apr
Scheme
Chapter 15 Sebesta
Apr
Subprograms
Chapter 9 Sebesta
Apr
Subprograms
Chapter 9 Sebesta
Apr
Subprograms
Chapter 9 Sebesta
Apr
Implementing Subprograms
Chapter 10 Sebesta
Apr
Stack building
Chapter 10 Sebesta
May
Logic programming languages
Chapter 16 Sebesta
May
Prolog
Chapter 16 Sebesta
May
Final Exam
Lab 6 due
Download