Which Parser can parse poker-log files, which one is the easiest and best? (Need alternative for Spirit. Gold Parser, ANTLR or ...) [closed]
I have to parse some pokerhandhistory-files, log files.
The content is like this:
Theplayername bets $100
All i need is the name, the action(as token) and the amount.
The problem is that the name can also contain an action and spac开发者_运维百科es.
Example: theplayer bets bets $100
I tried to get it working with GoldParser and ANTLR. Can't get it...
With Boost::spirit there's no problem, it works. The only bad thing is that the compilation time for my whole poker-grammar is awesome, takes 20 minutes.
I saw that ANTLR (C-Api) and GoldParser are a bit better in compilation times.
Would be nice if someone could post a tip on how to grab the information with Goldparser.
Thank you very much!!!!
They can both be used (ANTLR or Goldparser). But if the format is so simple (USERNAME
ACTION
...
AMOUNT
), then I see no need for a full-blown parser: mind as well process the file line by line and split on white spaces.
You could go like this:
- Find the last $ sign
- Look for the beginning of the "bets " substring that should be before that
- The player name is the substring before that position.
No need to get into some complicated parser, do it by hand if the format is just that.
精彩评论