Doge log

Abby CTO 雑賀 力王のオフィシャルサイトです

2008-03-14から1日間の記事一覧

PyPy

id:nishiohirokazuも書いてるけど。 # 3.3 Trying out the translator * 3.3.1 Trying out the type annotator * 3.3.2 Translating the flow graph to C code * 3.3.3 Translating the flow graph to LLVM code * 3.3.4 Translating the flow graph to Java…

便所の落書き

これぐらいバカでもできるよ。 grammer.txt IGNORE: " "; NAME: "[a-zA-Z_]*"; NUMBER: "0|[1-9][0-9]*"; arith_expr: term ("+" term)+ | # was (("+"|"-") term)* term ("-" term)+ | <term>; term: factor ("*" term)+ | # was (("*"|"/"|"%"|"//") factor)* fa</term>…

plyでMiniLispを実装

原点に戻る。plyでminilispを実装します。 紹介の意味も込めて某所にあったのをほぼそのまま載せます。 plyのシンプルさ(Lispのシンプルさ?)がわかってもらえるかと思います。 minilisp_lex.py import ply.lex as lex tokens = ('QUOTE', 'SIMB', 'NUM', …