8

A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well

Embed Size (px)

Citation preview

Page 1: A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well
Page 2: A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well

A compiler is a computer program that translate written code (source code) into another computer language

Associated with high level languages A well formed list of compilers Compiles Java source code into Java

bytecode Translates all code at once Used with high level languages

Page 3: A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well

In Java, the interpreter is a component of the Java JDK that runs Java bytecode classes

Allows Java to be ran outside of a web browser

Translates code one line at a time and then executes the instruction immediately

Used with high level languages

Page 4: A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well

Used with low level languages Basically this translates the low level

language to machine code (then the program can be executed)

Page 5: A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well

1. You create a source document using an established protocol (in our case, the Java language).

2. Then your program is run through a source code compiler. The source code compiler checks for errors and won’t let you compile until it’s satisfied that everything will run correctly.

3. The compiler creates a new document, coded into Java bytecode. Any device capable of running Java will be able to interpret/translate this file into something it can run. The compiled bytecode is platform independent.

4. The Java Virtual Machine (JVM) translates the bytecode into something the underlying platform understands, and runs your program.

Page 6: A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well
Page 7: A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well

Usually have to be either interpreted, compiled, or translated (or some combination of all three)

Easier to use than low level languages Language is closer to spoken language

Portable Abstract Examples: Java, Visual Basic, ?, ? (lab

assignment)

Page 8: A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well

In a sense low level languages speak the same language as the hardware

Usually does not need a compiler or interpreter

1st Generation: Machine Code 2nd Generation: Assembly Language