Luke Palmer wrote:
This list is for people interested in building the Perl 6 compiler. Now
you have your first real task!
We have to make a formal grammar for Perl 6. Perl 6 is a huge language,
so the task seems better done incrementally by the community...
Send patches to this list.
OK, I'll
Luke Blanshard wrote:
# Next comes any number of single characters or nested =begin/
# =end blocks -- but the smallest number that will match...
[ . | «pod_begin_end_block» ]*?
Actually I think that alternation needs to be in the other order,
doesn't it? (This is within rule
Luke Blanshard writes:
Luke Palmer wrote:
This list is for people interested in building the Perl 6 compiler. Now
you have your first real task!
We have to make a formal grammar for Perl 6. Perl 6 is a huge language,
so the task seems better done incrementally by the community...
Luke Palmer wrote:
[By the way, shouldn't this grammar be called Perl rather than
Perl6::Grammar?...
Grammars and classes share a namespace, so I think Perl::Grammar is
correct...
I got the name Perl for the grammar from S05, which also gives this example:
given $source_code {
Luke Palmer writes:
Also, don't use rule parameters, conditionals, or code blocks. Those
things require us to know Perl 6 before we're done defining Perl 6.
Keep it essentially BNF with Perl 6 syntax (it's okay to use groups and
quantifiers though, since those can always be converted to
Patrick R. Michaud writes:
rule identifier() { alpha \w* }
Does Perl 6 allow leading underscores in identifiers? If so,
shouldn't this be
rule identifier() { +alpha+[_] \w* }
?
Yeah, it should. There was an error anyway:
rule identifier() { +alpha \w* }
Fixed.
rule
A few initial questions/comments on some small things -- I'll get
to the bigger constructs a bit later. I'm an outside-in designer,
so I tend to work on the macro and micro levels until I meet in the
middle.
rule identifier() { alpha \w* }
Does Perl 6 allow leading underscores in identifiers?