pkmnfrk | 3 Jun 2009 16:03
Picon
Gravatar

Re: fb2cpp

Oh? Why would the plusses annoy me? They're not special characters or anything.

--
Mike Caron

-----Original Message-----
From: Ralph Versteegen <teeemcee <at> gmail.com>

Date: Thu, 4 Jun 2009 01:39:58 
To: <ohrrpgce <at> lists.motherhamster.org>
Subject: Re: [Ohrrpgce] fb2cpp

2009/6/3 James Paige <Bob <at> hamsterrepublic.com>:
> On Tue, Jun 02, 2009 at 11:46:58PM +1200, Ralph Versteegen wrote:
>> 2009/6/2 James Paige <Bob <at> hamsterrepublic.com>:
>> > On Tue, Jun 02, 2009 at 09:39:46AM +1200, Ralph Versteegen wrote:
>> >> 2009/6/2 James Paige <Bob <at> hamsterrepublic.com>:
>> >> > I have been trying out fb2cpp from subversion, and I'm having a little
>> >> > difficulty getting it compiled.
>> >> >
>> >> > One minor problem is that I think the Makefile should have:
>> >> >
>> >> > -LEG = leg.exe
>> >> > +LEG = leg$(EXE)
>> >> >
>> >> > Then, I always get a warning that says:
>> >> >
>> >> > make: Circular fb.leg <- fb.leg.c dependency dropped.
>> >> >
>> >> > And finally, I get this error:
>> >> >
>> >> > gcc -g -Wall -Wno-unused-label  -o fb fb.leg.c
>> >> > /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crt1.o: In function
>> >> > `_start':
>> >> > /build/buildd/glibc-2.9/csu/../sysdeps/i386/elf/start.S:115: undefined
>> >> > reference to `main'
>> >> > collect2: ld returned 1 exit status
>> >> > make: *** [fb2cpp] Error 1
>> >> >
>> >> > ---
>> >> > James
>> >>
>> >> I have no idea why I'm getting the circular dependency warning. Make
>> >> must be interpreting the makefile differently from me. I really hate
>> >> Make now. The makefile for peg/leg is a terrible mess. Someone
>> >> recommended SCons.
>> >>
>> >> That's a strange error. Doesn't fb.leg.c contain the main function? It
>> >> should be at the very bottom.
>> >>
>> >> And, apologies for the messiness of the code. Too many sins involving
>> >> pointers :P
>> >
>> > I got past that error by doing "make clean && make" directly in the peg
>> > directory, but now when I try to compile fb2cpp I get:
>> >
>> > james <at> doomtrain:~/src/fb2cpp$ make
>> > make: Circular fb.leg <- fb.leg.c dependency dropped.
>> > cp ../peg/leg .
>> > leg -o fb.leg.c fb.leg primitives.leg expressions.leg
>> > primitives.leg:20: syntax error before text "%{"
>> > make: *** [fb.leg.c] Error 1
>> >
>> > ---
>> > James
>>
>> I checked out a fresh copy, and fixed the makefile. It compiled fine
>> for me. Funny, I thought I'd compiled it under linux just recently. I
>> changed LEG to ./leg${EXE}. Maybe you have . in your PATH, or maybe
>> you've previously compiled peg and installed it and so are using the
>> wrong version?
>
> Aha! That was exactly it. I did
>
>  which leg
>
> which revealed to me that it was using /usr/local/bin/leg which I had
> installed and forgotten about a month ago while experimenting with
> creating a debian/ubuntu package of peg/leg
>
> I can compile it now
>
>> I'm about to check in the new complete type system (types, not UDTs),
>> after which I'll finally have all the pieces to start on the serious
>> fun.
>
> Groovy.
>
> So what should I be looking at to try it out? Which files are the
> converter, and which are test files? what toes the generated fb
> executable do?
>
> ---
> James

testfb.bas is the only test file. fb.leg, primitives.leg,
expressions.leg are the core of the parser/converter, base.leg
contains the mysterious macros used everywhere, operators.h and
fb.gpref are tables of symbol data, types.c, symtab.c and stb_hash.h
are utility functions, and there's a other few files laying around
that aren't part of anything.
fb_c++.h contains the C++ wrappers around strings and arrays. It's
meant to be terrifying, but in fact it's so full of cruft that the
effect is rather diluted :(

Anyway, to test out fb2c++, as I've just renamed the executable, since
IM mentioned that the pluses would annoy Mike, just pass testfb.bas,
or standard input. There's not much else to see besides what's
showcased there. Currently two areas of conversion are pretty much
complete: lexical tokens, and expressions, minus the function call and
indexing operators. Variable/function/type declarations are in
progress, flow control/block constructs will be next, and the builtin
functions and the preprocessor are the other two major components I
envision.
_______________________________________________
Ohrrpgce mailing list
ohrrpgce <at> lists.motherhamster.org
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Gmane