6 ms·
> Generating the tree is trivial. If by "generating the tree" you mean generating definitions for the AST data structures, this is nontrivial enough that yacc
by jzimmerman64 4y ago
> Generating the tree is trivial.
If by "generating the tree" you mean generating definitions for the AST data structures, this is nontrivial enough that yacc does not do it.
> The lexer is part of the parser.
Again, yacc (a parser generator) does not include a lexer generator; that requires a second package such as lex.
> A pretty printer is not part of a compiler.
A pretty-printer for the IR or target language is an important part of a compiler, as one needs to render the output in a form that some other tool (e.g., an assembler) can accept. A pretty-printer for the source language also comes in handy.
> The rest you have to do by hand.
What you have to do by hand is to write a function from the source AST to the target AST (i.e., a compiler backend). langcc generates the whole frontend, not just the parser.