in reply to Re: PRD parser problem: How to skip C comments when parsing
in thread PRD parser problem: How to skip C comments when parsing

Thanks ikegami! But your change seems not fix my script. I cannot get the right result when I change my script with your kind suggestion.
the error log: error 1! error 0!

Replies are listed 'Best First'.
Re^3: PRD parser problem: How to skip C comments when parsing
by ikegami (Patriarch) on Jun 10, 2008 at 08:01 UTC

    Did you forget to remove <skip: /\/\/.*\n/> from Prize?

    You'll still get an error, though, because your data is invalid based on your definition of Prize. You've previously indicated or implied that the Prize is the rest of the line. You have changed you definition of Prize without adjusting your grammar to compensate. You probably want something like:

    Prize: /(?:(?!\n|\/\*|\/\/).)*/
      Hi, ikegami, Thanks for you answer! I replied this post serveral times but it's not showed out along this post. I don't know why ...
      can your fix deal with mutiple lines comments, like the 3rd line of my example?
        Yes. "." matches newlines when the "s" modifier is used.