On Thu, Aug 6, 2009 at 6:02 PM, Robert Jacques<[email protected]> wrote:
>> int a = 5 / 2; // compiler knows to use integer division > > No, it doesn't. (i.e. Welcome to the limitations of a context-free grammar) > The right hand of the expression has to be evaluated before the left, or > otherwise function overloads, etc, don't work, so there's no way for the > compiler to know the type of the expected result when 5/2 is evaluated. Uh, no. This has literally nothing to do with the grammar. What happens in this line would be determined in the semantic phase, not parsing.
