diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0b84df0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.html \ No newline at end of file diff --git a/collaborators.sh b/collaborators.sh new file mode 100644 index 0000000..9b3a275 --- /dev/null +++ b/collaborators.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +collaborators=( "lawrancej" "UnZinkable" "mrpenguin7" "CyDrive" "jcamps" "powersa2" "AllTheAction" "lapatink" "tannerd01" "kirip" "tomleo" "garciaa1" "KBVuong1" "RoboCafaz" "LynxStar" "theCompanyDream" "aghon" "SoxMax" "nhogan11" "finna" "CyaSteve" "sthdips09" "torosianj" "vafaeed" "cantrellk" "dalswaimil" ) + +if [ $# = 0 ]; then + echo "Do git commands for all collaborators." + echo "" + echo "Usage: $0 COMMAND" + echo "" + echo "Where COMMAND is one the following:" + echo "setup Do git remote add for all collaborators" + echo "fetch Do git fetch for all collaborators" + echo "clean Do git remote rm for all collaborators" + echo "" + echo "Example: $0 setup" +elif [ $1 = "fetch" ]; then + git fetch --all +else + for collaborator in "${collaborators[@]}" + do + if [ $1 = "setup" ]; then + git remote add $collaborator https://github.com/$collaborator/CompilerDesign.git + elif [ $1 = "clean" ]; then + git remote rm $collaborator + fi + done +fi diff --git a/git.md b/git.md index c8e06e8..d5bb0fe 100644 --- a/git.md +++ b/git.md @@ -52,15 +52,23 @@ Using git --------- Typically your use of git will involve (assuming you're on your master branch): -Make a change to `some_file` +### How do I know what I changed? - git add some_file + git diff # This will show changes that you've made. -Make a change to `another_file` +### How do I create a new branch? - git add another_file + git checkout -b some_new_branch -What did I do? +### How do I add a new file to git? + + git add new_file + +### How do I add all changes I've made to the current commit? + + git commit -a -m "Message goes here" + +### What did I do? git status # Show the status of the index, staging area, and untracked files gitk --all & # Show a graphical timeline of commits diff --git a/index.md b/index.md index e6b72f4..536a0e9 100644 --- a/index.md +++ b/index.md @@ -14,6 +14,11 @@ Examples: - GCC, Clang, Visual C++ translate C into machine code - LaTeX, Pandoc translate document markup into PDF, HTML, etc. +Follow-up: + +- [How do compilers work](#what-are-the-phases-of-a-compiler)? +- [Who developed the first compiler](#who-is-grace-hopper)? + ### What is a language? A [set](background.md#what-is-a-set) of [strings](background.md#what-is-a-string). @@ -26,14 +31,50 @@ Examples and counterexamples: ### What is Chomsky's hierarchy? ### What is an interpreter? +An interpreter is a type of compiler that simply executes the code directly without translating it to a lower level. + +Examples: + +- Debuggers +- Scripting languages + +Follow-up: + +- [How do interpreters work](#how-do-interpreters-work)? ### The C compiler is written in C. How can that be? ### What are the phases of a compiler? -List the phases here. Briefly describe what each phase does. Give examples. +Compilers operate around these phases: + +Front end (process source language): + +- [Scanner (Lexical analyzer)](#what-is-a-scanner). Split source code (a [string](background.md#what-is-a-string)) into a token sequence. +- [Parser (Syntactic analyzer)](#what-is-a-parser). Check if token sequence conforms to language grammar and construct the [parse tree](#what-is-a-parse-tree) or [abstract syntax tree](#what-is-an-abstract-syntax-tree). +- [Type checker (Semantic analyzer)](#what-is-a-type-checker). Check if the program is [semantically valid](#what-is-semantics). + +Middle end (an intermediate representation): +- [Translator](#what-is-a-translator). Convert an abstract syntax tree into an [intermediate representation](#what-are-intermediate-representations). +- [Optimizer](#what-is-optimization). Improves IR code by eliminating redundancy and [dead code](#what-is-dead-code). + +Back end (generate target language): +- [Code generator](#what-is-code-generation). Produces machine code. -### Who is Grace Hopper? +### How do interpreters work? +Interpreters consist of the exact [same phases of a compiler](#what-are-the-phases-of-a-compiler), but execute programs instead of [generating machine code](#what-is-code-generation). +### Who is [Grace Hopper](http://www.smbc-comics.com/?id=2516)? + +#### Military Career + +#### Contributions to Computer Science + - Developed the first compiler for a computer programming language. + - Conceptualized machine-independent programming languages. + - Popularized the term "debugging." + +#### Honors + - "Computer Sciences Man of the Year" award from the Data Processing Management Association in 1969 + Regular languages ----------------- @@ -108,6 +149,22 @@ Abstract Syntax Trees ### What is the visitor design pattern? +Semantics +--------- +### What is semantics? + +### What is static semantics? + +### What is runtime semantics? + +### What is type-checking? + +Intermediate representations +---------------------------- +### What are intermediate representations? + +### What is a translator? + Optimization ------------ ### What is optimization? @@ -122,6 +179,8 @@ Optimization ### What is method inlining? +### What is dead code? + Code generation --------------- ### What is code generation?