Contains most of the text parsing logic using ANTLR4