[lug] parsing tool for linux

Bill Wimsatt bwimsatt at coraccess.com
Sun Apr 7 16:03:11 MDT 2002


Have you looked at the ANTLR project? http://www.antlr.org/

Great language parsing tool!

Regards,
Bill Wimsatt
VP, Engineering
CorAccess Systems
1600 Jackson Street
Suite 150
Golden, Colorado 80401
303 477 7757 (o)
720 480 2985 (c)
 
http://www.coraccess.com
 

-----Original Message-----
From: lug-admin at lug.boulder.co.us [mailto:lug-admin at lug.boulder.co.us]
On Behalf Of HEROLD
Sent: Sunday, April 07, 2002 3:46 PM
To: lug at lug.boulder.co.us
Subject: [lug] parsing tool for linux

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