これを JS に移植しました。 http://svn.webkit.org/repository/webkit/trunk/WebCore/css/tokenizer.flex ポイント それなりに汎用的な Flex みたいなものを作ったので、その部分は CSS 以外にも使えると思います。 あと、定義を文字列で書かずに正規表現オブジェクトで書くのでバックスラッシュをエスケープせずに書けます。ですので、ほとんどの箇所は WebKit の tokenizer の定義をコピーするだけで済みました。 その辺のアイデアは JavaScript で構文解析: Days on the Moon を参考にしました あと http://svn.coderepos.org/share/lang/actionscript/ascss/src/css/CSSLexer.as id:gyuque さんの ASCSS
ParseTree is a C extension (using RubyInline) that extracts the parse tree for an entire class or a specific method and returns it as a s-expression (aka sexp) using ruby‘s arrays, strings, symbols, and integers. ruby_parser (RP) is a ruby parser written in pure ruby (utilizing racc—which does by default use a C extension). RP's output is the same as ParseTree's output: s-expressions using ruby's
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く