Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #42334] PGE compiler faults out "set_integer_keyed() not implemented in class 'Undef'"

2 views
Skip to first unread message

Jim McKim

unread,
Apr 7, 2007, 2:20:19 PM4/7/07
to bugs-bi...@rt.perl.org
# New Ticket Created by "Jim McKim"
# Please include the string: [perl #42334]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42334 >


---
osname= linux
osvers= 2.6.15-gentoo-alt2
arch= x86_64-linux
cc= x86_64-pc-linux-gnu-gcc
---
Flags:
category=utilities
severity=low
ack=no
---
I see this fault when compiling the first grammar example below:

/home/mckim/src.local/parrot-0.4.10/parrot -O 0 /home/mckim/src/parrot-
0.4.10/compilers/pge/pgc.pir --encoding=utf8 --output=test.pir test.pg
set_integer_keyed() not implemented in class 'Undef'
current instr.: 'parrot;PGE::Exp::Quant;reduce' pc 4627
(compilers/pge/PGE/Exp.pir:444)
called from Sub 'parrot;PGE::Exp::Concat;reduce' pc 4392
(compilers/pge/PGE/Exp.pir:364)
called from Sub 'parrot;PGE::Exp::Group;reduce' pc 4918
(compilers/pge/PGE/Exp.pir:619)
called from Sub 'parrot;PGE::Exp::Quant;reduce' pc 4652
(compilers/pge/PGE/Exp.pir:450)
called from Sub 'parrot;PGE::Exp::Concat;reduce' pc 4392
(compilers/pge/PGE/Exp.pir:364)
called from Sub 'parrot;PGE::Exp;root_pir' pc 3903
(compilers/pge/PGE/Exp.pir:117)
called from Sub 'parrot;PGE::Exp;compile' pc 3825
(compilers/pge/PGE/Exp.pir:74)
called from Sub 'parrot;PGE::P6Grammar::Compiler;regex_stmt' pc 503
(runtime/parrot/library/PGE/P6Grammar.pir:275)
called from Sub 'parrot;PGE::P6Grammar::Compiler;compile' pc 207
(runtime/parrot/library/PGE/P6Grammar.pir:155)
called from Sub 'parrot;HLLCompiler;eval' pc 500
(runtime/parrot/library/Parrot/HLLCompiler.pir:338)
called from Sub 'parrot;HLLCompiler;evalfiles' pc 800
(runtime/parrot/library/Parrot/HLLCompiler.pir:472)
called from Sub 'parrot;HLLCompiler;command_line' pc 960
(runtime/parrot/library/Parrot/HLLCompiler.pir:538)
called from Sub 'parrot;PGE::P6Grammar::Compiler;main' pc 16
(runtime/parrot/library/PGE/P6Grammar.pir:65)


The problematic grammar:

grammar x_grammar;

#token h_digits { <:i[0-9a-f]>+ }
#token h_digits { <[0-9a-f]> }

token TOK_CONSTANT {
#<h_digits> ( : <h_digits> )**{1..15}
<h_digits> : <h_digits>
}


This example is extracted from a larger grammar to demonstrate the
problem. When I simplify it further by removing the commented-out
lines, e.g.:


grammar x_grammar;

token TOK_CONSTANT {
<h_digits> : <h_digits>
}


PGE compiles it successfully!

--
Jim McKim

---
Summary of my parrot 0.4.10 (r0) configuration:
configdate='Wed Apr 4 19:44:29 2007'
Platform:
osname=linux, archname=x86_64-linux
jitcapable=0, jitarchname=nojit,
jitosname=linux, jitcpuarch=x86_64
execcapable=0
perl=/usr/bin/perl5.8.8
Compiler:
cc='x86_64-pc-linux-gnu-gcc', ccflags=' -pipe
-Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_GNU_SOURCE -fPIC -I /usr/include',
Linker and Libraries:
ld='x86_64-pc-linux-gnu-gcc', ldflags=' -L/usr/local/lib64',
cc_ldflags='',
libs='-lpthread -lnsl -ldl -lm -lcrypt -lutil -lrt -lgmp -lreadline
-lncurses'
Dynamic Linking:
share_ext='.so', ld_share_flags='-shared -L/usr/local/lib64 -fPIC',
load_ext='.so', ld_load_flags='-shared -L/usr/local/lib64 -fPIC'
Types:
iv=long, intvalsize=8, intsize=4, opcode_t=long, opcode_t_size=8,
ptrsize=8, ptr_alignment=1 byteorder=12345678,
nv=double, numvalsize=8, doublesize=8

---
Environment:
HOME =/home/mckim
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH
=/usr/kde/3.5/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/3.4.5:/opt/blackdown-
jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin:/usr/bin:/u
sr/kde/3.5/bin:/usr/qt/3/bin:/usr/kde/3.4/bin:/usr/games/bin:/opt/vmware/workstation/bin
SHELL =/bin/bash

Patrick R. Michaud

unread,
Apr 9, 2007, 4:32:18 PM4/9/07
to perl6-i...@perl.org
On Sat, Apr 07, 2007 at 11:20:19AM -0700, Jim McKim wrote:
> The problematic grammar:
>
> grammar x_grammar;
>
> #token h_digits { <:i[0-9a-f]>+ }
> #token h_digits { <[0-9a-f]> }
>
> token TOK_CONSTANT {
> #<h_digits> ( : <h_digits> )**{1..15}
> <h_digits> : <h_digits>
> }


The error (that PGE is having difficulty catching) is
that the cut operator (':') isn't being applied to any
particular term in:

#<h_digits> ( : <h_digits> )**{1..15}

So, when PGE sees the ':' cut operator, it attempts to
apply it to the previous pattern and there's not anything
there to apply it to, at which point PGE chokes. PGE should
report a more useful exception here.

Note that the leading # does not comment out the entire line
in this case -- since # is followed by an opening '<' bracket
character, the comment terminates with the closing '>' bracket [1]
and not at the end of the line.

So, I'll take this ticket as being that PGE needs to
better recognize when a 'cut' token is being applied to
a null term and report the error accordingly.

Thanks!

Pm

[1] http://dev.perl.org/perl6/doc/design/syn/S05.html#New_metacharacters

0 new messages