What's the difference between using regular expressions based parsers and dedicated parsers?

Regular expressions based parser provide common way to perform syntax highlighting for the text based on parsing rules. Parsing is performed using a finite-state automaton driven by regular expressions matching the parsed text. This approach allows defining syntax highlighting rules for virtually unlimited set of programming languages.
Dedicated parsers such as CsParser, JsParser, and VbParser are designed to perform syntax highlighting for specific languages, they use hard-coded algorithm for parsing the text performing it much faster comparing to regular-expressions based parsers. These parsers actually do much more than just syntax highlighting, allowing having features that can be found in Visual Studio Editor - code outlining, intellisense, code formatting and underlying erroneous syntax tokens.


No Very

Captcha Image

Back to FAQs