GScanner



hello,

I am attempting to write a lexical scanner using Glib's lexical scanner
utility, but it is a little confusing. I have numerous questions about
it:

1)  I am having some trouble deciding how to tell the scanner how to
identify comments.  The cpair_comment_single field is useful for
identifying single-line comments, but how do I tell it what characters
begin and end nested comments? In my case it is "(" and ")"

2) Also, when I call g_scanner_cur_value, what does the returned union
contain?  For example, if the TokenType is G_TOKEN_IDENTIFIER, does the
returned union contains NULLS for all fields except the v_identifier
field?  Or does it somehow fill in all of the fields?

3) could someone explain to me what the "scanner scope" is?

in case it matters, I am attempting to parse mbox's.  I trying to follow
the rules specified in RFC822.

thanks a lot!

-Ron Roth




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]