• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Decoupling a Parser Tree from the Object that needs its information

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Started this discussion in another thread.

João Bispo wrote:Duv Vo: Thank you for the tip. I've read about object serialization, but I'm not sure this is what I'm looking for, the life-time of the objects is limited to the program.

I'll give you an example of what I'm doing. I have a parser for a simple language, and originally, the objects would access directly the nodes of the parser tree to obtain the needed information. This had two downsides:

- The objects had to know the structure of the parser tree. If I changed the language, there might be changes in the "working" objects, which shouldn't;
- If I want to use those "working" objects (in this case, they are objects that generate code) in another context, I need an object which is a node of the parser tree, with the expected structure;



Old Thread: link

This question is more about program design, so I'm not sure this is the right section. Curretly, I've already decoupled the parser tree from the other objects (see my post in Old Thread for the method), but I'm not sure of it. I've already searched the internet but haven't been lucky.
 
yeah, but ... what would PIE do? Especially concerning this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic