Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Seed me, Seymour" -- a random number generator meets the big green mother from outer space


devel / comp.compilers / Retrieving data from multiple lists from a single pattern

SubjectAuthor
* Retrieving data from multiple lists from a single patternArchana Deshmukh
`- Re: Retrieving data from multiple lists from a single patternArchana Deshmukh

1
Retrieving data from multiple lists from a single pattern

<23-07-014@comp.compilers>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=842&group=comp.compilers#842

  copy link   Newsgroups: comp.compilers
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From: desharchana19@gmail.com (Archana Deshmukh)
Newsgroups: comp.compilers
Subject: Retrieving data from multiple lists from a single pattern
Date: Fri, 21 Jul 2023 04:25:44 -0700
Organization: Compilers Central
Sender: johnl%iecc.com
Approved: comp.compilers@iecc.com
Message-ID: <23-07-014@comp.compilers>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="51758"; mail-complaints-to="abuse@iecc.com"
Keywords: parse, design
Posted-Date: 24 Jul 2023 12:51:48 EDT
X-submission-address: compilers@iecc.com
X-moderator-address: compilers-request@iecc.com
X-FAQ-and-archives: http://compilers.iecc.com
 by: Archana Deshmukh - Fri, 21 Jul 2023 11:25 UTC

Hello,

I have a pattern I which contains two list items. I am able to parse list.
However, as there are two lists in one pattern, data related to only 2nd list is stores.

pattern: (padding=[1,2,3,4],data = 1, size=[1,2]);

The data related to first list gets overwritten.

Can I use some context like if token is padding store data to one array and if token is size save data to another array.

However, any suggestion is welcome.

Best Regards,
Archana Deshmukh
[There are lots of ways to do this. You could set a flag when you see the padding or size
token to say where to store the list. Or you could allocate space dynamically;
put each list in a fixed static place as you parse it, then make a copy when you see
the ] and return it. -John]

Re: Retrieving data from multiple lists from a single pattern

<23-07-016@comp.compilers>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=844&group=comp.compilers#844

  copy link   Newsgroups: comp.compilers
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From: desharchana19@gmail.com (Archana Deshmukh)
Newsgroups: comp.compilers
Subject: Re: Retrieving data from multiple lists from a single pattern
Date: Tue, 25 Jul 2023 20:58:42 -0700
Organization: Compilers Central
Sender: johnl%iecc.com
Approved: comp.compilers@iecc.com
Message-ID: <23-07-016@comp.compilers>
References: <23-07-014@comp.compilers>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970";
logging-data="62072"; mail-complaints-to="abuse@iecc.com"
Keywords: parse, design
Posted-Date: 26 Jul 2023 00:20:45 EDT
X-submission-address: compilers@iecc.com
X-moderator-address: compilers-request@iecc.com
X-FAQ-and-archives: http://compilers.iecc.com
In-Reply-To: <23-07-014@comp.compilers>
 by: Archana Deshmukh - Wed, 26 Jul 2023 03:58 UTC

On Monday, July 24, 2023 at 10:23:20 PM UTC+5:30, Archana Deshmukh wrote:
> Hello,
>
> I have a pattern I which contains two list items. I am able to parse list.
> However, as there are two lists in one pattern, data related to only 2nd list is stores.
>
> pattern: (padding=[1,2,3,4],data = 1, size=[1,2]);
>...
> Best Regards,
> Archana Deshmukh
> [There are lots of ways to do this. You could set a flag when you see the padding or size
> token to say where to store the list. Or you could allocate space dynamically;
> put each list in a fixed static place as you parse it, then make a copy when you see
> the ] and return it. -John]

Thanks John.

At present, I am using flag to store the data to lists. However, I was trying to figure out is there better way to do this.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor