0
what is a compiler if someone can explain??
4 Answers
+ 2
A compiler consists in general of 3 parts. The syntax analysis, context analysis and than the machine code generation.
Always when it finds an error the compiler tells you what went wrong( this are the compiler exceptions, runtime exceptions are thrown while execution)
Syntax analysis: wrong spelling of words or wrong construction of for example variable definitions. In this analysis an abstraction syntax tree (AST) is created only consisting on the importent information( no spaces or language specific syntax)
This ast ist used in context analysis and code generation.
Maschine code needs to be generated cause for example Java is a high level language and has a lot of abstraction which cant be directly used in hardware.
So the compiler is used to make an executable out of your code so you can run it after that.
+ 1
the short version is:
A compiler converts source code of compiled languages such as java, C++ and C sharp into binary executables. that is machine code ( 0s & 1s ).
0
Read on the difference between INTERPRETET & COMPILER
0
Thanks