Nico Rehwaldt
2022
A tool (or human) that understands the meaning behind (written) text.
if (!fs.existsSync(inputFile)) {
console.log('Created %s', inputFile);
fs.copyFileSync(__dirname + '/template.md', inputFile);
}
Produce (terminal) symbols from the input.
Match symbols against grammar to produce a syntax tree.
There exists many strategies to do this: Top-down (Earley) or bottom up (LR parsing, PEG).
a + b
# can be arithmetic operation (a) + (b)
# or name (a,+,b)
# depending on <grammar>
Chomsky hierarchy defines different classes of languages.
Most sane (programing-) languages are context free.
Context sensitive languages on the other end require full context for parsing.
a + b
# can be arithmetic operation (a) + (b)
# or name (a,+,b)
# depending on <grammar> + <context>
Let's take OR as an example.
XOR
Live or death?
Öhm...
OR
What do you want for dinner? Noodles, potatoes, soup or just buns?
Yes.
{
foo: true,
bar: "NOPE",
if foo then bar: 100,
x: if foo then bar
}
lezer-feel