Loading ...
Sorry, an error occurred while loading the content.

14607RE: [antlr-interest] treecc: AOP Approach to Writing Compilers

Expand Messages
  • Tiller, Michael (M.M.)
    Dec 16, 2004
      Alexey et. al.,

      I forwarded this discussion on to a colleague who is more familiar
      with using ML for compiler writing. He pointed out some stuff I wasn't
      aware of.

      What I would like to see is something with the pattern matching
      capabilities of ML (succinct action descriptions, exhaustive
      combinatorial analysis, etc.). Granted, tree parsers are one way to go.
      But my colleague also pointed out the following language:

      Scala - http://scala.epfl.ch/
      Nice - http://nice.sourceforge.net/

      To me the really neat part about these languages is that I can layer
      them over the Java virtual machine and work directly with Java objects.
      Perhaps it is more aesthetics than anything else, but it seems quite
      elegant to me.

      Alexey, I wonder if you could exploit the descriptions in treecc to
      generate code for these languages as well?

      I also found some discussions on these here:


      Note that I don't really have any concrete proposals. These ideas are
      still swirling around in my head at the moment. I just find that these
      various approaches have different aspects that I like and I just wonder
      if there is a way to combine them to get the best of all worlds.


      > -----Original Message-----
      > From: Alexey Demakov [mailto:demakov@...]
      > Sent: Thursday, November 25, 2004 11:40 AM
      > To: antlr-interest@yahoogroups.com
      > Subject: Re: [antlr-interest] treecc: AOP Approach to Writing
      > From: "Tiller, Michael (M.M.)" <mtiller@...>
      > > Thanks for posting this. This is quite interesting. Many of my
      > > friends gush about being able to do things like this in ML. I
      > > there is room to bring the sort of exhaustive pattern machine and
      > > high-level type descriptions of ML into a more mainstream
      > > like ANLTR.
      > Unfortunately, I'm not familiar with ML :(
      > > Have you given any thought to implementing these kinds of pattern
      > > matching features in TreeDL?! I'm already quite interested in
      > > but pattern matching capabilities would be a fascinating addition.
      > Generally, yes. But I think it is more 'operation over subtree' than
      > pattern matching. In my understanding, pattern matching proposes that
      > specify more than just a node - may be children types or attribute
      > -
      > and some engine searches tree and executes your actions in context
      > of matched pattern. I don't like such engine, because prefer
      > to control order of tree walking.
      > When processing a tree, we need some natural way to specify actions
      > tree as a whole or some subtree. Action, like usual method, have
      > signature.
      > Because of heterogenous tree description we don't need to repeat
      > full tree structure as in ANTLR tree grammars.
      > But action body should be defined for each inherited node type with
      > ability
      > to use super-implementation. Translation tool should check consistence
      > of action definition.
      > > I'm no compiler expert, but I can't help but see lots of related
      > > not quite cohesive ideas floating around on this subject. The
      > > thread on tree grammars (to use or not to use) plus the comments
      > > gotten from my ML friends along with my own experiences gives me the
      > > sense that perhaps there is a way to formulate these ideas in a more
      > > universal way. Personally, I like the pattern matching approach in
      > > because it seems like something that can be analyzed more (e.g. for
      > > holes) than a tree grammar. It also seems like it maps more to the
      > > compilation stages (type inference, constant folding, etc). But
      > > say it again "I'm no compiler expert".
      > Can you write some short review of ML features that can be useful for
      > processing? At least ideas. Or point me to existing document.
      > I'll try to read something about ML, but not sure can find time :(
      > > P.S. - I don't quite see the AOP part of Treecc. It really just
      > > like a high-level data model language that supports code generation
      > > the underlying data structures. Of course, I still don't get AOP so
      > > maybe that is why I can't see it.
      > Well, every answer on my message contains similar statement.
      > Let it be on conscience of author of "Treecc: An Aspect-Oriented
      > to Writing Compilers" :)
      > May be it is not AOP in usual sence, but I see some similarity.
      > Regards,
      > Alexey
      > -----
      > Alexey Demakov
      > TreeDL: Tree Description Language: http://treedl.sourceforge.net
      > RedVerst Group: http://www.unitesk.com
      > Yahoo! Groups Links
    • Show all 8 messages in this topic