TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: DARIN MCBRIDE
from: AUKE REITSMA
date: 1998-02-14 08:41:00
subject: Comment parsing

Hi Darin,
On 12 Feb 98, 22:03, you wrote to Auke Reitsma
 MS>>> Comment extraction is not as easy as one might first think.
...
 DM> If one can get all the states of a C-parser into one's head,
 ... you won't have place for anything else ;-)
 DM> eliminate 3/4 of them due to being irrelevant, and put them down
 DM> into a state-graph, it quickly becomes simple.  Tedious, but
 DM> simple.
Yes. State-graphs are the way to go. Then use an FSM implementation.
See Snippets ...
Advantage: direct translation of the state table into code. Your sample 
pseudo-code just might have a nearly invisible bug. ;-) Been there, done 
hat.
Disadvantage: a bit slowish. And if you make a mistake in the code it might 
produce garbage. Or lock up. (States without exit conditions.)
Greetings from
 _____
 /_|__|  Auke Reitsma, Delft, The Netherlands.
/  | \  --------------------------------------
--- GEcho 1.00
---------------
* Origin: Home by the C (Auke.Reitsma@net.hcc.nl) (2:281/400.20)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.