开发者

Which Parser can parse poker-log files, which one is the easiest and best? (Need alternative for Spirit. Gold Parser, ANTLR or ...) [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

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:

  1. Find the last $ sign
  2. Look for the beginning of the "bets " substring that should be before that
  3. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜