Parsing in Embedded Systems

Mar 02, 2010 3 Replies

Hai Folks What is Parsing... i heard from one of the folks about Parsing in Embedded Systems and he told he uses Perl Scripts for Parsing....


vijay wibbled on Tuesday 02 March 2010 06:02

formatting link

Tim Watts Managers, politicians and environmentalists: Nature's carbon buffer.

:-)

It's an old children's party game, "Parse the parcel", AKA, "Chinese Whispers".

Each person hears a whisper, tries to understand it, and then passes it along as a whisper. At the end of the line, the arrived message is compared with the original.

:-)

Parsers can be many things, but they can be very simple. Here's a list parser, which will use the characters in Sep to return a list of tokens ... the Lst_t library is left as exercise for student (so as not to do

*ALL* your homework).

Lst_t *tokens ;

tokens = s_parse( "This is my string", " \t\r" ) ; lst_dump( tokens ) ;

produces ... This is my string

Lst_t *s_parse( Str_t Str, Str_t Sep ){ Str_t p, q ; Lst_t *x ;

if( !Str ) return( (Lst_t *) NULL ) ;

x = lst_create( 10 ) ; p = Str ; while( (q = (Str_t) strsep( (Str_t *) &p, Sep )) ){ if( s_length( q ) ) lst_add( x, q ) ; } return x ; }

HTH, Rob Sciuk

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required