Ordering of application of rules

I am using ‘–apply’ option for running LT on an input file.

  1. What is the ordering of application of rules that is followed? I guess it is in the order in which they are written in the grammar.xml file.
  2. Also what happens if the application of one rule creates an environment for another rule? Does the second rule apply on the original sentence or the one changed by the first rule?