Mathematicians mostly depend on the semantics of an expression to disambiguate it. You could get something close by making use of a type system to filter all possible parses.
For example, sin cos x would parse as sin(cos(x)), (sin(cos))(x), (sin * cos)(x), ... and most of these would be discarded by the type checker. If you do it naively, the complexity will be exponential, but I think you could use dynamic programming to handle that. In my example, it would be more problematic that (sin * cos) might be interpreted as multiplication of functions, but this could be solved by having separate operators for numbers and other types, and only allowing some to be represented by juxtaposition.
Overall, I'm not convinced that such a highly ambiguous system would be beneficial in a general purpose programming language, but when you just want to type in a specific mathematical formula, disambiguate it once, and then work with the unambiguous representation (maybe using a pretty-printer), I think it would be useful.