flex/lex/bison/yacc parser for C ?

flex/lex/bison/yacc parser for C ?

Post by Yosseff Levanon » Wed, 26 Aug 1998 04:00:00



Greetings !

Does anybody know where can I get (preferably for free) a lex scanner
specification
along with a compatible do-nothing yacc grammar for ANSI C ?

I need this in order to analyze C source modules, in particular, keep
track
of scopes and variable declarations.

Thanks,

--Yossi Levanoni

 
 
 

flex/lex/bison/yacc parser for C ?

Post by David Malo » Wed, 26 Aug 1998 04:00:00



>Greetings !
>Does anybody know where can I get (preferably for free) a lex scanner
>specification
>along with a compatible do-nothing yacc grammar for ANSI C ?

Check the C FAQ - 18.15 contains pointers on what you want.

        http://www.eskimo.com/~scs/C-faq/top.html

David.

 
 
 

flex/lex/bison/yacc parser for C ?

Post by Yosseff Levanon » Thu, 27 Aug 1998 04:00:00




> >Greetings !

> >Does anybody know where can I get (preferably for free) a lex scanner

> >specification
> >along with a compatible do-nothing yacc grammar for ANSI C ?

> Check the C FAQ - 18.15 contains pointers on what you want.

>         http://www.eskimo.com/~scs/C-faq/top.html

> David.

Thanks David for the useful link.  I've found a parser and lexer at:

ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z

The directory contains other interesting stuff as well (e.g. C++ lexer)

--Yossi

 
 
 

flex/lex/bison/yacc parser for C ?

Post by Jens Schweikhard » Thu, 27 Aug 1998 04:00:00


[Posted and mailed]


#>
#> >Greetings !
#>
#> >Does anybody know where can I get (preferably for free) a lex scanner
#>
#> >specification
#> >along with a compatible do-nothing yacc grammar for ANSI C ?
#>
#> Check the C FAQ - 18.15 contains pointers on what you want.
#>
#>         http://www.eskimo.com/~scs/C-faq/top.html
#>
#> David.

# Thanks David for the useful link.  I've found a parser and lexer at:

# ftp://ftp.uu.net/usenet/net.sources/ansi.c.grammar.Z

Yosseff,

note that the companion lexer from the same place is not complete
(in the sense that it won't parse most nontrivial C code). This is
due to the check_type() function, which is hairy to implement.
As is, if the lexer finds an identifier, say in

...
struct foo { foo foo; } foo;

it needs to return TYPE_NAME for the 2nd foo, and IDENTIFIER
for the others. This is not implemented -- it'll always return
IDENTIFIER which leads to syntax errors for most inputs.

Does anybody else know of other lexer/parser combinations
that handle this correctly? I've looked at the gcc sources
and found them to be way too inaccessible to be modified for
that purpose.

Regards,

        Jens
--
Jens Schweikhardt  http://www.shuttle.de/schweikh/
SIGSIG -- signature too long (core dumped)

 
 
 

1. lexer/parser generators other than lex/yacc/flex/bison

These tools are adequate for simple programs, but whenever
I've tried to use them in reentrant projects, I've had to do
all sorts of grotesque things to get them to work.  I've had
zero luck getting them to work in a multithreaded environment.
(I understand that the C++ bison/flex may be somewhat better
about this, but this isn't an option.)

What else is out there?

-Roger

Roger Gonzalez                    Datapult Communications

phone 781-646-0028                Arlington, MA 02174-1009

2. sync() question

3. Object-oriented lex(flex) and yacc(bison) for c++?

4. linux problem

5. lookinf for Flex.Lex and Bison/Yacc ...

6. Deleting files in /var/tmp

7. Yacc/Lex vs Bison/Flex

8. IPMasquerading and MTU setting

9. lex/flex and yacc/bison

10. Lex (Flex) and Yacc (or Bison) questions.

11. flex/bison(lex/yacc) help needed.

12. flex,lex,yacc & bison doc???

13. Lex/Yacc Substitute (not bison/flex)