08/05/11 18:42:58
fslexってまだ日本語対応してないのな・・
URLリンク(www.strangelights.com)
{ open Microsoft.FSharp.Text.Printf;; }
rule strtest = parse
| _ { printf "%c" (Lexing.lexeme_char lexbuf 0); strtest lexbuf }
| eof { raise End_of_file }
{
//こっから実行コード
let test s = strtest (Lexing.from_string s);;
try test "aiueo" with _ -> printf "\n--end--\n";;
try test "あいうえお" with _ -> printf "\n--end--\n";;
printf "あいうえお";;
}
実行結果
aiueo
--end--
?????
--end--
あいうえお