[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [computer-go] SGF parsers
>Since I didn't feel like writing an SGF parser myself, I had a quick look at
>what Java implementations are available at SourceForge. There are a few...
>but looking at one (forgot which one) I soon realised that these probably
>all create their own internal data-structures. Since I already have a good
>tree data structure (based on the the Swing TreeModel with minimal extra
>work) I don't feel like switching to someone elses just for the sake of SGF
>parsing.
>
>
>
I've written a SGF grammar for the ANTLR parser generator
(http://www.antlr.org). It can generate C++, Java (and C# code with
minor modifications). I plan to put it on my web page today, so anyone
can test it. Perhaps you can play with the ANTLR toolkit and think about
a way to translate the internal AST to XML. I am also interested in this
conversion. At the moment it parses correctly the test file in
http://www.red-bean.com/sgf/examples/ff4_ex.sgf but the correctness of
the grammar hasn't been through fully tested.
Don't know if this is useful to you.
Toni Cebrián.
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/