gnupic: some problem in source code--scan.l


Previous by date: 10 Jul 2012 02:48:25 -0000 some problem in source code--scan.l, feqin fan
Next by date: 10 Jul 2012 02:48:25 -0000 Re:some problem in source code--scan.l, Joe Pfeiffer
Previous in thread: 10 Jul 2012 02:48:25 -0000 some problem in source code--scan.l, feqin fan
Next in thread: 10 Jul 2012 02:48:25 -0000 Re: some problem in source code--scan.l, feqin fan

Subject: Re: some problem in source code--scan.l
From: Byron Jeff ####@####.####
Date: 10 Jul 2012 02:48:25 -0000
Message-Id: <20120710024814.GA8392@mail.clayton.edu>

On Tue, Jul 10, 2012 at 09:50:13AM +0800, feqin fan wrote:
> Hello, everyone..
> 
> I have some problem need your help, THX..
> 
> at the beginning of scan.l LINE 97
> 
> #define YY_INPUT(buf,result,max_size) \
>   { \
>     GP_INPUT(buf,result,max_size); \
>     if (result) \
>       { \
>         state.src->last_char_is_nl = (buf[result - 1] == '\n'); \
>       } \
>     else if (!state.src->last_char_is_nl) \
>       { \
>         *buf = '\n'; \
>         result = 1; \
>         state.src->last_char_is_nl = true; \
>       } \
>   }
> 
> BUT,state.src->last_char_is_nl = true, WHERE is the number
> *last_char_is_nl* in struct state.src ?
> 
> --------------------------------------------
> 
> Another problem, the pattern   ^{IDENT}#v\(   match what?
> someone Please give me a example..

Can't answer the first one. But can on the second. The #v notation is
described in the MPASM manual on page 67. Here's a link:

http://courses.washington.edu/phys335/datasheets/mpasm-usersguide.pdf

Primary usage is to create unique labels in macros. The document gives the
example:

define_table 	macro
		local a = 0

		while a < 3
entry#v(a) 	dw 0
		a += 1
		endw

		endm

each entry#v(a) would generate a unique label with the string entry and the
current value of the a variable when the macro is invoked..

entry0 dw0
entry1 dw0
entry2 dw0
entry3 dw0

Hope this helps.

BAJ

> 
> Thank you, guys..
> 
> :-)
> 
> 
> 
> ------------------------------------
> 
> live long and prosper..

-- 
Byron A. Jeff
Department Chair: IT/CS/CNET
College of Information and Mathematical Sciences
Clayton State University
http://cims.clayton.edu/bjeff

Previous by date: 10 Jul 2012 02:48:25 -0000 some problem in source code--scan.l, feqin fan
Next by date: 10 Jul 2012 02:48:25 -0000 Re:some problem in source code--scan.l, Joe Pfeiffer
Previous in thread: 10 Jul 2012 02:48:25 -0000 some problem in source code--scan.l, feqin fan
Next in thread: 10 Jul 2012 02:48:25 -0000 Re: some problem in source code--scan.l, feqin fan


Powered by ezmlm-browse 0.20.