CS 330 Lecture 29 – Modeling a Program
Agenda what ?s model this a model for Logo Model This Code Block.java Command.java CommandListener.java CommandMove.java CommandRotate.java Environment.java Expression.java ExpressionLiteral.java LogoVirtualMachine.java Haiku
CS 330 Lecture 28 – Interpreting
Agenda what ?s a REPL walking a parse tree with ANTLR’s callbacks TODO Start Bifur. Code makefile Note to copy and pasters: makefile rules need to be indented with real tabs, not spaces. Basecalc.g InterpreterBasecalc.java Haiku
CS 330 Homework 4 – due before April 24
See the PDF.
CS 330 Lecture 27 – Goodbye, Generics and a Base Calculator
Agenda what ?s two kinds of polymorphism Java’s approach to generics our first grammar/interpreter TODO Walk through https://theantlrguy.atlassian.net/wiki/display/ANTLR4/Getting+Started+with+ANTLR+v4. Read chapter 2 through section 2.1 in the book. Also read section 2.3. 1/4 sheet. Code Basecalc.g
CS 330 Lecture 26 – Reference Counting and Templates
Agenda what ?s reference-counted garbage collection a smart pointer subtype polymorphism vs. parametric polymorphism the difference between generics and templates Think About This Code SharedPointer.h test_shared.cpp Haiku
CS 330 Lecture 25 – A Compiler That’s For You
Agenda what ?s what’s wrong with this? think about this a reference-counted pointer What’s Wrong With This? What Does This Do? Think About This Code SVector.cpp foo.cpp Haiku
CS 330 Lecture 24 – Templates
Agenda what ?s program this a templated vector class overloading builtin operators TODO Read section 7.7.3 in your book. Wondering about Java’s garbage collection? Read http://www.ibm.com/developerworks/library/j-jtp10283/. Why do we need both delete and delete[]? Check out http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=287. 1/4 sheet. Program This Code QVector.h vector_test.cpp Haiku
CS 330 Lecture 23 – Inheritance vs. Composition, Iflessness
Agenda what ?s inheritance vs. composition a raffle Game of Life without conditionals Code raffle.cpp life_sans_if.cpp Haiku
CS 330 Lecture 22 – Vtables and Other C++isms
Agenda what ?s O(1) dynamic dispatch Game of Life with conditionals overloading builtin operators copy constructor formatted output with stringstream references TODO Optional participation point: write Game of Life without conditionals. Code Sizeof.cpp life.cpp Haiku
CS 330 Lecture 21 – Object-oriented Programming
Agenda what ?s homework 3 – due before April 4 textbook definition of OOP theorize this what does this do? Game of Life with Conditionals TODO Read http://www.insomniacgames.com/tech/articles/0308/three_big_lies.php. (This page rendered improperly for me; I had to highlight the text to read it.) Read http://hacksoflife.blogspot.com/2008/04/what-is-oop-good-for.html. What do you think? 1/4 sheet. Theorize This What Does This Do? […]