⚙️Parser
Also known as Parsing, Code Parser
A program that reads text and finds how its parts fit.
Think of it like
Think of it like a teacher reading a sentence. They check each word fits the rules of grammar.
Example
Why it matters
All code and all data files go through a parser first. Nothing else can happen before that.
Definition
Example code
console
$ node -e 'console.log(JSON.parse("{\"name\":\"Emma\",\"age\":9}").age)'
9Common mistake
Key takeaways
- 1Text in. Plain characters, one after another.
- 2Structure out. Often a tree.
- 3Grammar check. Bad input stops here.