4 ms·
t1 and t2 should be (user defined?) types so I would imagine LR(1) should be able to disambiguate between a generic function and the less than operator. Not sa
by UncleEntity 6y ago
t1 and t2 should be (user defined?) types so I would imagine LR(1) should be able to disambiguate between a generic function and the less than operator.
Not saying the grammar would be context-free though.
- dllthomas 6y agoYou could help the grammar by having some lexical distinction between types and other identifiers. Relying on that is going to prevent you from including numbers as things you can be generic over (without some additional syntax for that case). That may or may not be something you care about.