You didn't show the error you received, but I suspect at least one problem is the, by adding dot to the pattern for name you've taken away the ability to recognizer your functions (which will always be followed by dots. Remember, that ANTLR will always try to find the longest matching token, so now FUNCTION.toString will match the NAME Lexer rule and consumes more of the input stream than the FUNCTION or DOT lexer rules, so it'll be a NAME token. There's a way to have ANTLR dump out the token stream when it tries to parse the input. You should probably look into that and get the all the tokenization right and then move on to the parse rules.
BTW... generally, names that allow for dots, don't allow them to begin with dots. If that's you intention, you'd need to rework the NAME rule to be something more like:
NAME: [A-Za-z0-9][A-Za-z0-9\.]+
(also, as I cut and pasted your rule, it doesn't look as though either were adding the dot to the rule. The first has an unescaped dot which matched any character, and the second looks like you attempted to escape the dot, but by using \\, you escaped the slash and left the dot unescaped.)
Definitely look at the token stream and get your tokenization right first.