Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lawrancej/CompilerDesign into exp…
Browse files Browse the repository at this point in the history
…eriment
  • Loading branch information
Joey Lawrance committed May 23, 2012
2 parents 58310d3 + d26023e commit 03b359b
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
*.html
27 changes: 27 additions & 0 deletions 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
18 changes: 13 additions & 5 deletions git.md
Expand Up @@ -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
Expand Down
63 changes: 61 additions & 2 deletions index.md
Expand Up @@ -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).

Expand All @@ -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
-----------------

Expand Down Expand Up @@ -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?
Expand All @@ -122,6 +179,8 @@ Optimization

### What is method inlining?

### What is dead code?

Code generation
---------------
### What is code generation?
Expand Down

0 comments on commit 03b359b

Please sign in to comment.