Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion About default options ':ratchet' and ':sigspace' on rules
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Shu-chun Weng  
View profile  
 More options Jun 2 2006, 2:17 am
Newsgroups: perl.perl6.language
From: s...@csie.org (Shu-chun Weng)
Date: Fri, 2 Jun 2006 14:17:25 +0800
Local: Fri, Jun 2 2006 2:17 am
Subject: About default options ':ratchet' and ':sigspace' on rules
Hello,

 (used to post on google group but found it does not deliver)

I'm implementing "MiniPerl6" in pugs which is the first step of
writing perl 6 parser in perl 6.  In module Pugs::Grammar::MiniPerl6,
 http://svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6,
I use another perl 6 grammar to describe it.  It works well several
days before when the parsing engine written in perl 5 did not
implemented :ratchet and :sigspace flags.

The grammar file can be found here:
http//svn.openfoundry.org/pugs/misc/pX/Common/Pugs-Grammar-MiniPerl6/lib/Pu gs/Grammar/MiniPerl6.grammar

The "token" part is fine, but the "rule" part is extremely ugly.  I can
not add additional spaces to format it.

I'd like to suggest two changes to make it easier to write rules:

  1. Spaces at beginning and end of rule blocks should be ignored
     since space before and after current rule are most likely be
     defined in rules using current one.
  1a. I'm not sure if it's "clear" to define as this, but the spaces
      around the rule-level alternative could also be ignored.  For
      instance, look at the rule FunctionAppExpr defined in
      MiniPerl6 grammar file.

        rule FunctionAppExpr
{<Variable>|<Constants>|<ArrayRef>|<FunctionName>[<?ws>?<'('><?ws>?<Paramet ers><')'>]?}

      I could not even put a new line in it.  In the file, since there
      are production rules, I put the brases on strange positions
      to format it better.

  2. I am not sure the default rule of <ws>, I couldn't found it in
     S05.  Currently the engine use :P5/\s+/ but I would like it to
     be :P/\s*/ when it's before or after non-words and remains
     the same (\s+) otherwise.

I do not subscribe this group but subscribe daily digest, so it's OK to
reply on the list.  Suggestions welcome!

Cheers,
Shu-Chun Weng


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google