Flexyどうこうの前にまずは準備
「Flexyの構文解析はyaccとかで作ってる? - maru.cc@はてな」の続きです。
プラグインで拡張できない範囲の拡張に構文解析部分の修正が必要で、こちらのサイトを参考に試してみてます。
「HTML_Template_Flexy - 機能の拡張 - ループ構造の追加」
phpLexはこちらから落としてきました。
http://sourceforge.net/projects/php-sharp/
http://php-sharp.cvs.sourceforge.net/php-sharp/phpLex/
Tokenizer.lexはこちらから。
http://cvs.php.net/viewvc.cgi/pear/HTML_Template_Flexy/Flexy/Tokenizer.lex
phpLex.exeはそのままでは動かなかったので、コンパイルしようと思い、CVSから落としてきました。
$ cvs -d:pserver:anonymous@php-sharp.cvs.sourceforge.net:/cvsroot/php-sharp login Logging in to :pserver:anonymous@php-sharp.cvs.sourceforge.net:2401/cvsroot/php-sharp CVS password: $ cvs -z3 -d:pserver:anonymous@php-sharp.cvs.sourceforge.net:/cvsroot/php-sharp co -P phpLex cvs checkout: Updating phpLex U phpLex/Accept.cs U phpLex/Alloc.cs U phpLex/Anchor.cs U phpLex/BitSet.cs U phpLex/Bunch.cs U phpLex/CREDITS U phpLex/CharSet.cs U phpLex/DTrans.cs U phpLex/Dfa.cs U phpLex/Emit.cs U phpLex/Error.cs U phpLex/Gen.cs U phpLex/Gen_broken.cs U phpLex/Input.cs U phpLex/LICENCE U phpLex/Lex.cs U phpLex/MakeNfa.cs U phpLex/Minimize.cs U phpLex/Nfa.cs U phpLex/Nfa2Dfa.cs U phpLex/NfaPair.cs U phpLex/SimplifyNFA.cs U phpLex/Spec.cs U phpLex/Utility.cs U phpLex/build U phpLex/makefile U phpLex/phpLex.exe cvs checkout: Updating phpLex/examples U phpLex/examples/build.sh U phpLex/examples/simple.lex U phpLex/examples/simple.php U phpLex/examples/test.txt
パスワードは設定されていないので、そのままEnterで落ちてきました。
.csファイルはC#なので、.NETの環境でコンパイルしてみます。