V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
unity0703

一个非常小的编译器学习例子

  •  
  •   unity0703 · Mar 31, 2016 · 2828 views
    This topic created in 3679 days ago, the information mentioned may be changed or developed.

    https://github.com/thejameskyle/the-super-tiny-compiler/blob/master/super-tiny-compiler.js

    200 多行代码+ 500 多行注释,从 TOKENIZER 到 PARSER 之类的基本概念都覆盖到了,这个例子非常适合编译器入门学习

    当然功能也很简单,就是把(add 2 (subtract 4 2))之类的 lisp 风格代码编译成对应的 C 语言代码: add(2, subtract(4, 2))

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5650 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 06:51 · PVG 14:51 · LAX 23:51 · JFK 02:51
    ♥ Do have faith in what you're doing.