News for hackers. Stuff that matters.
Re:Compiler Construction by Niklaus Wirth [pdf] by seanmcdirmid on Saturday February 01, 2020 @07:00PM (#22214151)
Parsing with type information is not the norm. It was only done in C because no one knew any better back then. Later language that adopt C-style casting (C#, Java) do not need to know if something is a type to deal with parens, they look for the follow on and evaluate the tree accordingly. That is why in C#:

  var x = (Foo) - foo;
Will be rejected with a type error (must enclose -foo in parentheses because Foo is a type) rather than a parse error.

There are no comments on this comment yet.