Permalink
Browse files

Merge branch 'master' of github.com:lawrancej/CompilerDesign into exp…

…eriment
  • Loading branch information...
2 parents 58310d3 + d26023e commit 03b359b90af06adaa3b4a41995502036a8cb3233 @lawrancej committed May 23, 2012
Showing with 102 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +27 −0 collaborators.sh
  3. +13 −5 git.md
  4. +61 −2 index.md
View
@@ -0,0 +1 @@
+*.html
View
@@ -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
View
18 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
View
@@ -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?

0 comments on commit 03b359b

Please sign in to comment.