How Compilers Work

Start
-parse
-get next token
-semantic analysis
-look up variable name
-do semantic checks -> generate code(passed) or semantic error(failed)
-put in symbol table

Front End: Analysis
1. Lexical Analysis
2. Syntax Analysis
3. Semantic Analysis

Back End: Systhesis
4. Code Generation
5. Optimization

Lexical rules of language dictate how legal word is formed by concatenating alphabet.

If x==1 then if y==2 print 1 else print 2
stmt -> if expr then stmt else stmt

why compilers?

High-level Language

C/Java Compiler

temp = v[k];
v[k] = v[k+1];
v[k+1] = temp;

Fortran Compiler

TEMP = V(K)
V(K) = V(K+1)
V(K+1) = TEMP

Assembly Language

lw $to, 0($2)
lw $t1, 4($2)
sw $t1, 0($2)
sw $to, 4($2)
#include

int main()
{
	char A = '2';
	int sum = A + 10;
	std::cout<<"sum ="<
		Posted on Categories Compiler			

Overview of Methodology Data First

Overview of Methodology: Data First

Information flow diagram – tasks, ER Diagram – Abstract code/SQL, Relational schema – PHP code, MySQL relational platform

Property values are
– lexical, visible, audible
– they are things that name other things

Relational Model
– Data Structures
– Constraints
– Operations
algebra
calculus

Performance

Performance
– Latency (Start -> Done)
– Throughput (# / Second)
Throughput = 1 / Latency

Benchmarks
– Programs and input data agreed upon for performance measurements

Benchmark suite
– Multiple programs
– Each representative of some type of app

Computer Architecture

Computer Architecture
Design a computer is well-suited for its purpose

Why do we need?
1.improve performance
2.improve ability

Fablication Technology, Circuit design

Active Power
P = 1/2 C * V^2 * f * α
capacitance, power supply, frequency, active factor

ACME

System simple_cs = {
	Component client = { Port send-request; Port err-trap; }
	Component server = { Port receive-request; Port alert; }
	Connector rpc = { Role caller; Role callee; }
	Connector err = { Role source; Role sink; }
	Attachment server.receive-request to rpc.callee;
	Attachment client-request to rpc.caller;
	Attachment client.err-trap to err.sink
	Attachment server.alert to err.source
}

Software Architecture

The set of significant decisions about the organization of a software system, the selection of the structural elements and their interfaces by which the system is composed, together with their behavior as specified in the collaborations among those elements, the composition of these structural and behavioral element into progressively larger subsystems and the architectural style that guides organization: these elements and their interfaces, their collaborations, and their composition.

-Verhoff
The software architecture of a deployed software is determined by those aspects that are the hardest to change.

LinesVisible Association

context LinesVisible inv:
	ViewPort : viewContents->size() =
	ViewPort : height.min(FileManager : document->size())

Displays Diagram

context LinesVisible inv:
	let topLineNumber = ScrollBar : handlePosition *
		FileManager : document->size()
	in ViewPort : viewContents = FileManager : document->
		subsequence(topLineNumber, topLineNumber + ViewPort: viewContents->size() - 1)

GUI

GUI toolkit(library) for textBrowser
-window
-scrollbar

File Manager
-some way to access the file’s contents
-provide a module that can retrieve a limited length, consecutive subsequence of the file’s lines.

ViewPort
-need to be able to display the textual content graphically

ScrollBar
-need to give the user some way to access different parts of the file

Use Cases
-three candidate structural elements
-behavior of the TextBrowser
-how the user will use the intended solution

Basic Concept: Why this application exist?
-> Re-text
– move handle
– change window(ViewPort) size

Analysis Model
– UML class-model diagram
– rectangle for classes
– Each rectangle is divided vertically
– Lines between the components denote relationships

Operation
– comprise those actions that the user can undertake to interact with the TextBrowser