btl_syntax.py: classes to
represent BTL programs
btl_interpreter.py:
evaluating BTL programs
test_btl_interpreter.py
fact.py: Python implementation of
factorial
readinput.py: read (multiple
lines of standard input into a string and break the string into words at
spaces
myDrop.hs: a recursive
re-implementation of Haskell's drop
function. patternDrop.hs
computes the same result but using patterns in the argument lists. These
are discussed in the week 3 notes.
card.hs: a short example
illustrating defining a data type and writing a function processing that type.
nats.hs: Natural numbers
simple-expr-recognizer.cpp:
a recursive-descent parser implementing an expression recognizer. This
serves as an introduction to recursive descent parsing.
simple-expr.cpp: expression
parser with evaluation.
g++ -o expr expr.cpp
./expr 3 + 4 - 5
The dot at the start (./) is necessary because there's a more full-fledged
version of expr that comes standard on Unix systems.
./expr 18 \* \( 3 - 12 / 2 \)
fact.cpp: C++ implementation of
factorial for discussion on semantics