How do C / C ++ parsers work?

I spent a lot of time learning the work of the PHP parser:

it translates the PHP code finally into code.

But how is c-code translated into executable files?

By the way, how can one judge whether language A can be converted to language B in some way from the mathematical aspect?

+3
source share
4 answers

This is a really big and very deep question, which draws on many parts of computer science.

, . " ", , . , " " " ". , . , , , , , , - .

- , , " " . , , "add", "sub" "" . , , . , .

, C ++, , , , , . , , - , , , , .., . , , , , , , ( ) ( ).

. , " , ?" " ?" , ; .

, , . , , , . , , , , , , .

, !

+10

PHP C; PHP PHP , PHP - , , PHP . C . , , PHP PHP, .

PHP- C, ++ Assembly Pascal Erlang bash Java - , . ( , Perl, .)

C , , . C "": lexing , parsing , . , , , , object file , architecture. linker ( C), , , Pragprog " " .

+6

, , , . , . :

alt text

. , , . , . , . , . . , - .

+5

, B - ?

Turing , .

PHP C, " ", HipHop, . .

C, .

, , . , , , Qaru , .

+2

Source: https://habr.com/ru/post/1786822/


All Articles