gnupic: Yikes, I crashed GPAL
Subject:
Re: Yikes, I crashed GPAL
From:
Craig Franklin ####@####.####
Date:
25 Oct 2004 09:37:02 +0100
Message-Id: <417C1E57.7010301@users.sourceforge.net>
David McNab wrote:
> Craig Franklin wrote:
>
>> Update your cvs and try again.
>
> ...
>
>>> scan.l:614: error: invalid lvalue in assignment
>>
> ...
>
>> Check your version of flex. gputils supports 2.5.4(a).
>
>
> I was using flex 2.5.31. Downgrading to 2.5.4a and re-flexing scan.l
> got me a clean compile.
>
> But the current flex doco explicitly states that YY_CURRENT_BUFFER
> should /NOT/ be used as an lvalue, so I'm sorry to say that scan.l is
> broken. However, thanks for the tip - it's a relief to be able to
> build from cvs.
>
It depends which documents you look at. With my 2.5.4 it says this:
`YY_CURRENT_BUFFER' macro returns a `YY_BUFFER_STATE' handle to the
current buffer.
With 2.5.31 it says this:
`YY_CURRENT_BUFFER' macro returns a `YY_BUFFER_STATE' handle to the
current buffer. It should not be used as an lvalue.
From what I understand, YY_CURRENT_BUFFER was changed in 2.5.31. That
is why the documents were changed and why the new flex generates errors.
From everything I have read, 2.5.31 is unstable. Those that are using
flex with C++ might not have a choice, but I do. I won't switch to an
unstable version of flex. You probably had this version of flex because
you are using Debian unstable, right?
http://packages.debian.org/cgi-bin/search_packages.pl?keywords=flex&searchon=names&subword=1&version=all&release=all
This subject has come up several times recently. I am going to add a
flex version check to the configure script. Hopefully, this will catch
problems early.
> There's another small thing - the line:
> DATA_ADDRESS : constant uint8 = 0x5;
> in p16f873a causes compilations to fail, complaining about duplicate
> definitions. Commenting out this def fixes the problem.
>
I have this one fixed. I will commit my stuff to cvs tonight.
> Anyway, onward to learning/mastering GPAL. I look forward to the
> evolution of this interesting language.
>
> Cheers
> David
>
>>
>>>
>>> Craig Franklin wrote:
>>>
>>>> David McNab wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> How do I import another module into a GPAL module?
>>>>>
>>>>> For instance, the following 'hello world' program:
>>>>>
>>>>> module helloleds is
>>>>>
>>>>> pragma processor = "16f873a";
>>>>>
>>>> with p16f873a;
>>>>
>>>>> procedure main is
>>>>> begin
>>>>> p16f873a.TRISB = 0x00;
>>>>> p16f873a.PORTB = 0xa5;
>>>>> end procedure;
>>>>>
>>>>> end module;
>>>>>
>>>>> I've spent a couple of frustrating hours trying to figure out how
>>>>> to get this thing to compile.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> gpal p16f873a.pub helloleds.pal
>>>>
>>>>> No mention in the docs of how to import needed modules and access
>>>>> their namespaces.
>>>>>
>>>> From the manual:
>>>>
>>>> 2.6.11 With
>>>>
>>>> with <name>;
>>>>
>>>> The with statement tells the compiler to add the data
>>>> from the public <name> to its symbol tables. This will
>>>> allow access to that module's subprograms and data.
>>>>
>>>>
>>>> I am committing big changes to gpal now. If you have any
>>>> recommendations I am listening.
>>>>
>>>>> Please help
>>>>>
>>>>
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ####@####.####
>> For additional commands, e-mail: ####@####.####
>>
>>
>>
>