简体   繁体   中英

Can Coco/R turn a parsed file into bytecode?

I want to write a simple compiler for educational purposes in Delphi. I have read about Coco/R and found this implementation for Delphi: http://code.google.com/p/dcocor/ . From what I have read, this is a parser for the Delphi 2009 syntax.

What would I have to do to turn the parsed file into a bytecode? Can Coco/R do this?

I know about scripting languages like FastScript or DWS, but I'd like to try and write my own for my own purposes.

Please give me some advice or clarify things a little.

What would I have to do to turn the parsed file into a bytecode?

First, decide what kind of bytecode would you like to have: JVM? LLVM? MSIL? Inventing your own?

Can Coco/R do this?

Coco/R is a parser generator framework, it only generates lexer-parser for a language you define and feed to the generator. Steps after that is your responsibility. Though there might be projects out there that can help generating ast/target code (but I haven't found any for Coco/R ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM