[lug] parsing tool for linux

Daniel Webb webb at robust.colorado.edu
Tue Apr 9 17:48:34 MDT 2002


  I'm not totally sure what you want, but if you're looking for a C
grammar / lexer the grammar by Jim Roskind is the best I have found.  My
internet connection is not working well right now, but I can email the
grammar to you if you want.  You should be able to find it if you use the
search terms "Jim Roskind" and "grammar".


> Hi folks!  I am looking for a tool that already knows C syntax, and can
> output the results of a parsed C source file, one token per line.  I know
> about some of the tools (like Bison) which can generate C files from a
> grammar, but what I need to do is take something like the following in a
> source file:
>
> if(x==(testp(foobar))&&(func(y))){
>
> and get back:
>
> if
> (
> x
> ==
> (
> testp(
> foobar
> )
> )
> &&
> (
> func(
> y
> )
> )
> )
> }
>
> I need to build a language model so that I can start figuring out how to
> make ViaVoice useful for programming; I planned on just using all of the
> source code that ships with Linux and gcc.
>
> Separated by spaces is fine, too, so long as the function names are
> preserved as functions ( so that func(x) comes out func(, or func (x)
> comes out func( )
>
> For those of you who know what a language model is, it just models the
> frequency of two words (tokens) occuring next to each other.  It is
> a primary component in speech recognition.
>
> I don't have the resources to write a C parser, and I have looked for
> something that could output the parse tree, but couldn't find one (maybe I
> don't know the right search string).
>
> Any ideas?
>
>
> --Keith
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>




More information about the LUG mailing list