Code generation using yacc
Suppose the grammar is given, how to design the code generation process?
start(res) ::= template. { **how to write stuff here?? Is it true there will 开发者_JS百科only be
one correct way to write this? And Let's suppose the programming language is also given** }
This is a pretty broad question, with many books an articles written on it. The general heading you're looking for is Syntax directed translation, and the classic reference is the Dragon Book
精彩评论