资 源 简 介
The need for parsers
There is a bunch of parser-generators out there, but only view generate recursive descent parsers for your LL(1) grammar. Anyway, usually you do not only need to check some input against your grammar; the common case is that you must perform custom logic on the parsed input.
When building compilers, this logic is generally embedded in the nodes of your abstract syntax tree (AST), which is what a parser should output. Each node in the AST stands for an applied production of the grammar the parser recognizes. If you could define these nodes, then you could use your very own logic to process the input however you want.
A compiler would do semantic checking and object code generation, a calculator would evaluate a formula, an BNF parser would determine whether a grammar is LL(1), LL(2), ...
Deduce g