From: Clifford Heath Date: 2008-02-05T08:20:02+09:00 Subject: Re: Treetop problem Marco Guiseppe wrote: > It seems to appear when the first character of the string parsed is a > valid match for both rules, and Treetop is unable to resolve the > ambiguity. Packrat parsers are greedy. When a rule succeeds, or when a repeated element (*, +) repeats too many times, or when an optional rule is taken, that decision will never be reversed - it's been memoized. You must prevent it happening (perhaps by using lookahead) in the first place. In this case, you can do that by writing: rule string [A-z] [A-z0-9]* end BTW, did you realize that there are non-alphabetic characters in the range A-z? Did you mean to say [A-Za-z]? Clifford Heath.