sort the root nodes by their left_token value before adding their subgraphs to the list

this fixes #371 and makes sure the graphs are outputted in the correct order