HPCC-8523 Change use of ENDMACRO to make macro processing more flexible

By moving the macro processing productions it is possible to remove the need
for the ENDMACRO token without hitting s/r errors in the grammar.  That in
turn makes mnore flexible what can be returned from a macro.

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>