Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [perl #53018] AutoReply: grammar not behaving as class
On Thu, Apr 17, 2008 at 10:20 PM, Jonathan Worthington via RT
<perl6-bugs-followup@perl.org> wrote:
>
> St=E9phane Payrard wrote: 
>  As far as I'm aware, the grammar keyword isn't properly implemented yet
>  (it'll parse, but that's probably about it).
>
>  Jonathan
>
>
>

There is not much missing.

The following patch already gets .WHAT to work.
The code for grammar methods  is apparently correctly generated except
for the namespace.

grammar A { token aa { baba }  };    say A.WHAT;

Index: languages/perl6/src/parser/actions.pm
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
3D=3D=3D=3D
--- languages/perl6/src/parser/actions.pm=09(revision 27021)
+++ languages/perl6/src/parser/actions.pm=09(working copy)
@@ -796,11 +796,11 @@
if $key eq 'open' {
# Start of the block; if it's a class or role, need to make $?CLAS=
S or
# $?ROLE available for storing current definition in.
-        if $<sym> eq 'class' || $<sym> eq 'role' {
+        if $<sym> eq 'class' || $<sym> eq 'role' || $<sym> eq 'grammar' {
my $decl_past :=3D PAST::Stmts.new();

# If it's a class...
-            if $<sym> eq 'class' {
+            if $<sym> eq 'class' || $<sym> eq 'grammar' {
# Call method to create the class.
$decl_past.push(PAST::Op.new(
:pasttype('bind'),
@@ -914,7 +914,7 @@
$past.blocktype('declaration');
$past.pirflags(':init :load');

-        if $<sym> eq 'class' {
+        if $<sym> eq 'class' || $<sym> eq 'grammar' {
# Make proto-object.
$?CLASS.push(PAST::Op.new(
:pasttype('call'),

--=20
cognominal stef


Report this thread to moderator Post Follow-up to this message
Old Post
Stéphane Payrard
04-18-08 10:25 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Perl 6 Compiler archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 10:04 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.