Unlike natural language, a formal language has a strict grammar (lexis = a set of words and syntax = a set of rules by which words can be arranged in text). A programmer must know this grammar and write code strictly according to it. And the one who creates a new programming language must not only invent a grammar but also develop a Compiler that can understand any text written in that language and convert it into machine code. To do this, the Compiler contains all possible templates for commands and sentences. When recognizing program text, it sequentially searches for each pattern in the text and creates objects in its data structure. It also ensures that no segment that doesn't match any pattern remains.
To search patterns in the text Compiler uses Finite Automata. These are algorithms reminding the Turing Machine. They read letter by letter and, depending on each new letter, transition to a new state. A Finite Automaton is usually drawn as a graph consisting of state-circles connected to each other by transitions, each with a letter written above them. An Automaton is called Finite because it contains a finite number of these state-circles. Finite Automata perform the same function as Regular Expressions, that you may know if you are interested in programming. In fact, Finite Automata almost always works under the hood of Regular Expression function.
Here are some PDF books about Formal Languages and Finite Automata:
An Introduction to Formal Languages and Automata
2012 by Peter Linz

Download PDF
Introduction To The Theory Of Formal Languages
2024 by Dan A Simovici

Download PDF
The Magic of Formal Languages
2025 by Pasquale De Marco

Download PDF
See also: Top 10 eBook Organizers
How to download PDF:
1. Install Gooreader
2. Enter Book ID to the search box and press Enter
3. Click "Download Book" icon and select PDF*
* - note that for yellow books only preview pages are downloaded


