[NewCompiler] Parser error alternateKeyword symbole?

Marcus Denker denker at iam.unibe.ch
Tue Sep 26 09:53:24 UTC 2006


On 18.09.2006, at 19:46, Mathieu Suen wrote:

> Hi,
>
> I want to generate a alternateKeyword symbole but I can find a way  
> to do it.
> In fact I dfon't know what is an alternateKeyword symbole.
>
> I pick it up from the grammar:
> ...
> |	"#" <alternateKeyword>	{#litSymbol:}
> ...
>
> And I want to build a test like:
>
> rbNode := (self defaultParser parseMethod: 'test #:indexOf:') body  
> statements first.
> 	self assert: (rbNode firstToken value = '#').
> 	self assert: (rbNode lastToken value = ':indexOf:')
>
> but (self defaultParser parseMethod: 'test #:indexOf:') raise an error
>
> Have an idea?
>

The old (handwritten) parser indeed accepts stuff like

1)
  #:hallo:hallo:

and

2)
  #hallo:hallo

Both of which are not parsable with the Smacc based parser.

I guess that the alternatKeyWord token was supposed to fix problem
1), but it does not work.

So this is a bug that needs to be fixed... or we need to decide to
only support well-formed symbols (#sdfsdf:sdfsdf:), as for the
others people can write #':hello:hello' with no problem.
I tend to the second solution, as we re-compile the image and
use lots of code with the new compiler, and this problem never
came up.

Does anyone have an example of those strange symbols in praktice?

      Marcus


More information about the Newcompiler mailing list