Parsing with Perl 6

By Moritz Lenz (‎moritz‎) from Erlangen.pm
Date: Saturday, 6 March 2010 10:00
Duration: 40 minutes
Language: English
Tags: 6 grammars parsiing perl regexes


"You can't parse XML with regexes" they say. While that's certainly
true for traditional regular expressions, Perl 6 takes parsing one step
further. With named regular expressions, recursion and grammars, the
full power of context-free languages stands at your disposal - fully
integrated in the language and with clean syntax.

In this talk I will introduce Perl 6 regexes and grammars by showing a
grammar for the JSON data exchange format. I will then talk about
these topics:

* retrieving data from the parse tree; integration into the surrounding
language
* whitespaces and comments: the "problems" usually solved by a lexer
* improving error messages
* extending grammars through inheritance
* adding alternatives through inheritance
* resolving ambiguities with the "longest token" rule
* performance considerations