| # | Date | Due | Assignment |
|---|---|---|---|
| Aug 20 | Aug 24 |
Submit proof of prerequisites to Canvas: Assignments/Miscellaneous/Course prerequisites |
|
| Aug 20 | Aug 26 |
Submit project team info (one submission per team) to Canvas: Assignments/Miscellaneous/Project team info |
|
| 1 | Aug 27 | Sept 3 |
Simple Scanner and Parser
Simple: Simple.zip Test input files: TestWhile1.txt TestWhile2.txt TestIf1.txt TestIf2.txt TestIf13txt TestIf4.txt TestFor1.txt TestFor2.txt TestFor3.txt TestCase1.txt TestCase2.txt Sample solution: Asgn1Solution.zip |
| 2 | Sep 3 | Sep 10 |
Simple Interpreter
Test input files: TestWhile.txt TestIf.txt TestFor.txt TestCase.txt Expected output: TestWhile.out.txt TestIf.out.txt TestFor.out.txt TestCase.out.txt Sample solution: Asgn2Solution.zip |
| 3 | Sep 10 | Sep 17 |
Simple Interpreter using ANTLR 4
Test input files: TestWhile.txt TestIf.txt TestFor.txt TestCase.txt Expected output: TestWhile.out.txt TestIf.out.txt TestFor.out.txt TestCase.out.txt |
| Week | Date | Content |
|---|---|---|
| 1 | Aug 22 |
Slides:
Goals; course learning outcomes; project teams; grading;
postmortem assessment report; types of programming languages;
it's all about translation; language classes during translation;
Pascal; example translations: conversion, execution, debugging, compilation
Example Pascal program: SquareRootTable.pas Example language conversion (Pascal to Java): SquareRootTable.java Example object code (Jasmin): SquareRootTable.j |
| 2 | Aug 25 |
Slides:
A software architecture; parser; tokens; scanner; parse tree; symbol table; backend components; translator control flow; translator data flow; Pascal tokens; syntax diagrams;
how to scan for tokens; basic scanning algorithm;
test the scanner; current character vs. next character;
consume characters and tokens
Simple scanner, parser, and interpreter: Simple.zip |
| Aug 27 | Slides: Statement and expression syntax diagrams; operator precedence; Pascal control statements; parse tree conceptual design; parse tree operations; building a parse tree; classes: Scanner, Token, Node, SymtabEntry, Symtab; symbol table hack #1; syntax error handling; Parser methods; statements: WHILE, IF, FOR, CASE; dangling ELSE | |
| 3 | Sept 1 | Slides: Symbol table: concept, design, operation, hacks; parse program, assignment statement, variable; listing; cross-reference table; Simple interpreter; visiting tree nodes; runtime uses of parse tree and symbol table; visit tree nodes: program, compound statement, assignment statement, REPEAT statement, IF statement, expressions |
| Sept 3 |
Slides:
Top-down recursive descent parsing; Chomsky language hierarchy; DFA scanner; syntax and semantics; grammars and languages; derivations and productions; ANTLR 4; translation workflow; multiple passes
Example code: SimpleDFAScanner.zip |
|
| 4 | Sept 8 |
Slides:
ANTLR 4 grammar file; metasymbols; token definitions; production rules; generated parser; testing tool; context classes; visit methods; base visit method implementations; create the symbol table; overriding base methods; syntax and semantic error handlers; order in the grammar file
Example ANTLR 4 grammar file: SimpleA1.g4 Example ANTLR 4 code: SimpleA1.zip |
| Sept 10 |
Slides:
ANTLR 4 generated Context classes and visit methods; custom tree node fields; new semantic visit method overrides; pass 3 tree walk; executor visit method overrides; labeled rule alternatives
Example ANTLR 4 code: SimpleA2.g4 SimpleA2.zip SimpleA3.g4 SimpleA3.zip |
This course will concentrate on practical aspects of compiler construction, programming language design, and engineering a large, complex software application.
This is a challenging course that will demand much of your time and effort throughout the semester.
Department policy is to enforce
all course prerequisites strictly
|
CS 47 Introduction to Computer Systems or CMPE 102 Assembly Language Programming |
grade C- or better |
| CS 146 Data Structures and Algorithms | grade C- or better |
| CS 154 Formal Languages and Computability | grade C- or better |
|
The Definitive ANTLR 4 Reference, 2nd edition Terence Parr Pragmatic Bookshelf, 2012 ISBN: 978-1934356999 http://www.antlr.org/ |
| Pascal Tutorial looks very good. It has an online Pascal compiler. |
| Learn Pascal also looks good, although it doesn't appear to cover set types. |
| http://rextester.com/l/pascal_online_compiler |
| https://www.tutorialspoint.com/compile_pascal_online.php |
| https://www.jdoodle.com/execute-pascal-online |
| Install the ANTLR 4 plug-in for Eclipse, etc. |
| The Java Virtual Machine Instruction Set |
This is a challenging course that will demand much of your time and effort throughout the semester.