|
|
|
|
|
by pests
4843 days ago
|
|
According to the linked presentation, slide 13: "The C specification says that when there is such an ambiguity, munch as much as possible. (The "greedy lexer rule".)" So j+++++k turns into: j++ ++ + k Which is clarified on the next slide. |
|
I would have guessed that j++ ++ was not legal syntax.
So, I was wrong: There are two ways to parse that mess. So, there is ambiguity. And the way they resolve the ambiguity is their 'greedy' rule! Wow!
Net, that tricky stuff is too tricky for me.
There was a famous investor in Boston who said that he only invests in companies only an idiot could run well because the chances were too high that too soon some idiot would be running the company.
Well, I want code, or at least language syntax, that any idiot can understand, for now, me, and later some of the people that might be working for me!
You are way ahead of me on C, and you leave me more afraid of it than I was. But then I was always afraid of it and, in particular, never wrote ++.