Modified addAllMacroIntoTree() to handle redefined macro