Topic: Flex... time to have sex (urgent help needed) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28012" title="Pages that link to Topic: Flex... time to have sex (urgent help needed) (Page 1 of 1)" rel="nofollow" >Topic: Flex... time to have sex (urgent help needed) <span class="small">(Page 1 of 1)</span>\

 
_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

posted posted 05-30-2006 10:34

Well, not quite. Exams first.

Does anybody use Bison or Yacc with Lex or Flex on Windows?
These are compiler generation tools.
Can run both of them fine, but am having a hard time at compiling the c output, linker errors on elements from the flex library for example.

In unix, the gcc -ll flag seems to resolve this, but I could not get it to work for Windows so far.

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 05-30-2006 13:00

I've used it in the past - but it much depends on wether you're using cgywin or mingw.
So which is up?

_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

posted posted 05-30-2006 13:28

Mingw32. With the awful dev cpp on top (it's not that bad and it's free).

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 05-30-2006 15:44

hm... no idea.
What does the -ll flag do - what is it's equivalent under mingw?

_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

posted posted 05-30-2006 16:24

Afaik, it translates to "load library" and in a 'nix environment, resolves the flex lib at compile time.
Go figure how this works in a Windows environment

Anyway, thank you for trying: with the project specification, I am able to do this "blindly", without compiling the actual analyser and parser, and given the time remaining for me for this thing, it's either a quick mingw setup miracle, or I triple check my lexicon and grammar, make the lex and yacc files, a report, and deliver that instead.

But it's ok, last time I did that, the teacher got mad at decrypting the regexp I had put together
off the top of my head, only to find out that against all the good practices and uses...

It worked.

And got me a 5/6 Off to make more teachers crazy..

hyperbole
Paranoid (IV) Inmate

From: Madison, Indiana
Insane since: Aug 2000

posted posted 05-30-2006 17:22
quote:

Tyberius Prime said:

What does the -ll flag do -




Under *nix, the -l flag specifies a library to look in for external symbol references. the "name" of the library is the argument to the -l flag. in this case the library name is "l". You could find the file this library lives in by searching for a file named libl.a (a statically loaded library) or libl.so (a dynamically loaded library). As another example, if you had the flag -lpdf on the linker command line this refers to a library named libpdf.a or libpdf.so.

You can use the -L command to specify additional paths to search for libraries. Most *nix systems will search /lib, /usr/lib, and /usr/local/lib by default. You can specify that for this run you want the linker to also search your own library directory by adding -L/home/myname/my-libs to the command line when you invoke the linker. This flag needs to appear somewhere on the line before the -l flag that specifies your personal library.

.



-- not necessarily stoned... just beautiful.

_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

posted posted 05-30-2006 19:30

righto hyperbole, found out in the meantime. I had used both .a and .so in the past, .a to compile my own dev cpp libs (glpng for instance), .so to make quick ports of dyn libs for java cross-platform apps.
In this case, go figure, I was looking for libl.a and libfl.a.

For OOOld versions of flex and yacc. (like 6 years old).

Instead, I got myself Bison and Flex for Windows, as parts of the GnuWin32 toolset.
A set of cool unix apps ported to Windows.
Cygwin would work as well.

Would be an heresy if compilers were not platform independent.

Anway, the goodies are here:
http://gnuwin32.sourceforge.net/packages/flex.htm
http://gnuwin32.sourceforge.net/packages/bison.htm

And these tools act together as a "compiler compiler".
In flex definition files, I put regular expressions that will help tokenize a source file (defines a finite rational language - the words of my programming language)

In yacc files, I put syntax definitions (defines a grammar) that will bind the grammar to programmatic actions.

In other wors, the chain of things I am building up above are two exes that will parse a file to a set of programmatic instructions.
Aka basic compiler.

And you know what makes it a true pain in the behind?
The language I have to parse within the next two hours is...



French. "le cheval mange la lune." has to make sense to my computer. eeek.

Thank you hyperbole, TP, helped a lot.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu