afscrome / IronVelocity

A wrapper around NVelocity (a port of Apache Velocity) using the DLR to provide higher performance template execution.
MIT License
6 stars 1 forks source link

Parser Refactoring #40

Closed afscrome closed 9 years ago

afscrome commented 9 years ago

Simplified the parser by rewriting binary expression precedence handling to make use of Antlr4's left recursion handling (See https://theantlrguy.atlassian.net/wiki/display/ANTLR4/Left-recursive+rules).

Also did some further refactoring to combine expression & primary expression rules into a single rule. This makes the parser grammar simpler & easier to understand. Some crude testing also shows 5-10% performance gains in parsing.