answersLogoWhite

0


Best Answer

It depends on the compiler and operating system. A lot of compilers generate C(++) objects or code instead of assembly language. It seems to be easier for compiler developers to develop and support a C(++) platform instead of assembler.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

First, it is important to note that a compiler might, but does not need to, generate output in a low level language. Many traditional compilers generate assembly language output and meet the question's assumption, but more modern designs often skip this intermediate step.

The general process of compiling a high level language into the desired output is a multi-step process. The essence of this process is outlined in the following.

In one step, the compiler reads and pre-conditions the source code. For example, extraneous spaces or source code comments might be removed at this stage.

In another step, the compiler scans the remaining source code and constructs tokens from groups of input characters, and categorizes each token. For example, the letters a, b, and c might combine to a token of value "abc" and type variable reference, and characters 1, 2 and 3 might combine to a token of value 123 and type integer constant.

In the next step, the steam of tokens is subject to syntactic analysis. For example, three tokens "abc," "=" and "123" can form an expression when used in this order, but placing the constant number on the left hand side does not result in a valid expression. Syntactic analysis is generally driven by rules defined in the grammar, and implemented with a parser. The parser generally results in a tree of semantic nodes. For example, the expression in the previous example might be folded into a semantic node of type assignment, consisting of a variable reference and an arithmetic expression.

In the next step, semantic analysis is performed. The purpose is to determine whether each construct makes sense in its context. For example, one language may not allow assigning a variable of type "string" to a variable of type "int."

Now follows a series of optimizing steps, aimed at reducing the runtime-complexity of the semantic tree.

Finally, the semantic tree is translated into the destination code. Code generation is typically implemented using multiple steps, and can be closely interwoven with optimization.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How does a compiler convert high to low level language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are the purpose of compilers?

When writing a program, you write it in a certain language (java, C++, VB.NET etc.). For the computer to understand that, you need to convert it to computer language. That is what the compiler does.


What do you need to a translate a programmer written in a high level language in to machinery language?

A compiler.


Which program translates an assembly language program into a high-level language?

A High level language is a language like C, Pascal, Fortran. To convert, the easiest way is to use a compiler. A compiler will take the instructions written in a high level language and convert them into machine code which is the specific instruction set for that type of computer. Assembly language is just a human readable form of a machine code which is how the designers of the computer instruction set made it work. A disassembler will show the assembly language from machine code. But the compiler usually includes a lot of optimisations from a the high level language and will not often generate very simple assembly.


How do you convert higher level language into lower level language?

Not only can we but we have to! Machine code is the only language understood by the computer, thus all languages, both low and high level, must be converted to machine code in order to execute. Most compiled languages can produce low-level symbolic code (assembly language), but not all, especially those that compile to byte code rather than machine code. However, all code has to be compiled or interpreted to machine code at some point and machine code can be disassembled to produce low-level symbolic code.


What do you mean by compiler?

Which converts high level language into machine understandable codes!

Related questions

What is compiler is working?

compiler used to convert high level language coad into machine level language


What is required to convert a high level language into machine language so as to execute it later?

we need compiler to convert high level language in to machine language


What is compilers and interpreters the purpose?

compiler and interpreter used to convert high level language to machine level language .....compiler does dis job in atonce while interpreter does in step by step


What is ddl compiler?

DDL compiler is the compiler whose job is to convert high level commands to low level commands..


High level to Machine level language is converted using?

high level language is converted to machine level language using a compiler or an interpreter


What are the purpose of compilers?

When writing a program, you write it in a certain language (java, C++, VB.NET etc.). For the computer to understand that, you need to convert it to computer language. That is what the compiler does.


What level of language is cobol?

COBOL is a high level language (high order language in military terminology). It is compiled using a compiler.


Which software translates high level language programme into machine language?

A compiler.


How to convert low level language into high level language?

lang are convert into low level language by


Similarities between compiler interpreter assembler?

Both are use to convert high level languages into machine language


What do you need to a translate a programmer written in a high level language in to machinery language?

A compiler.


What program that converts a high level programming language into machine language?

compiler or assembler