15.1 COMPILERS

A compiler is a translator that converts a computer program written in one programming language (the source program) into another language (the target program). There are many types of compilers, but the typical compiler translates a program in a high-level language (e.g., C++, Java, Python) into a low-level language (e.g., machine code). High-level languages are easier for humans to write programs in then low-level languages. Low-level languages such as machine code are what a computer understands, but they are tedious for humans to write programs in.

As an example, consider a C++ program in a file named simple.cpp. A C++ compiler would convert the program into a file of machine code matching the type of computer the user is ...

Get An Introduction to Formal Languages and Automata, 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.