Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #3510 > unrolled thread
| Started by | Archana Deshmukh <desharchana19@gmail.com> |
|---|---|
| First post | 2023-07-21 04:25 -0700 |
| Last post | 2023-07-25 20:58 -0700 |
| Articles | 2 — 1 participant |
Back to article view | Back to comp.compilers
Retrieving data from multiple lists from a single pattern Archana Deshmukh <desharchana19@gmail.com> - 2023-07-21 04:25 -0700
Re: Retrieving data from multiple lists from a single pattern Archana Deshmukh <desharchana19@gmail.com> - 2023-07-25 20:58 -0700
| From | Archana Deshmukh <desharchana19@gmail.com> |
|---|---|
| Date | 2023-07-21 04:25 -0700 |
| Subject | Retrieving data from multiple lists from a single pattern |
| Message-ID | <23-07-014@comp.compilers> |
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]
[toc] | [next] | [standalone]
| From | Archana Deshmukh <desharchana19@gmail.com> |
|---|---|
| Date | 2023-07-25 20:58 -0700 |
| Message-ID | <23-07-016@comp.compilers> |
| In reply to | #3510 |
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.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.compilers
csiph-web