Add explanation of lexical rules and improve guide build tool