How are computers programmed so that they understand different programming languages?

793 views

How are computers programmed so that they understand different programming languages?

In: 9

11 Answers

Anonymous 0 Comments

Typically with lex and yacc. Or Flex and Bison, which are the open-source equivalents with a few extra features. These break down languages into their components (lexicon) and then use a parse tree to figure out what to do with syntax.

And that’s very specifically just for compilers. Most computers and most programs don’t understand any programming languages other than their own machine code.