I'll try to explain quickly but completely. also I'll explain the LLVM output; i.e., what the mapping is and how LLVM works. Ter On Aug 6, 2009, at 12:15 PM, Martijn Reuvers wrote:
> Hey Ter, > > Looks fine to me. =) > Maybe you can explain a bit about why using backtrack here and there, > why it would be needed - maybe something about predicates (and the > limitations of them, e.g. things not always getting called). > > Martijn > > On Thu, Aug 6, 2009 at 1:34 AM, Terence Parr<pa...@cs.usfca.edu> > wrote: >> Posting the grammar(s) for you to take a look at. do think this >> covers it? >> It seems like it covers a good deal. I will post the full source >> code after >> I take another pass over it and so on. >> T >> >> >> On Aug 5, 2009, at 2:38 PM, Hugo Picado wrote: >> >>> Hi Terence, >>> >>> You don't actually need to put a big example, as long as it is a >>> good >>> example. Independently of the specific grammar, I think it should >>> address >>> common issues such as parsing, tree walk, input/output parameters >>> in rules, >>> lists, use of the most important predicates such as tokens, >>> header, member, >>> etc. >>> >>> Additionally, one think that I've seen that is commonly asked here >>> is how >>> to implement unary minus, or how to construct tree nodes with >>> different root >>> tokens, etc. >>> >>> You can use a small example to show all this, I think a "too much >>> big" >>> example will somewhere/sometime/somehow confuse the reader. >>> >>> Back to the question, perhaps your C subset is a nice choice :) >>> >>> Good luck with that. >>> >>> Regards, >>> Hugo. >>> >>> On Wed, Aug 5, 2009 at 8:25 PM, Terence Parr <pa...@cs.usfca.edu> >>> wrote: >>> Hi Guys, >>> >>> Ok, I'm rapidly running into my deadline for the book. by the end of >>> the day I hope to finish the translation and then the generation >>> chapters. you will see a beta of at least one of those chapters this >>> week. That leaves the sort of " wrapping up" chapter, which doesn't >>> really scream "Put a big LLVM example in". >>> >>> To satisfy you folks, would be sufficient if I put it up on the wiki >>> with some good but not perfect description as well as the full >>> source >>> code for my C subset to LLVM example? >>> >>> Ter >>> On Jun 24, 2009, at 10:30 AM, J. Stephen Riley Silber wrote: >>> >>>> >>>> I think Waverly's point wasn't the complexity of the grammar of the >>>> language. No one is arguing the simplicity of the Smalltalk >>>> grammar. His point was that compiling a simple imperative language >>>> to LLVM will demonstrate the basics of LLVM IL generation. >>>> "Everyone knows C", so it should make for a relatively simple >>>> tutorial. >>>> >>>> I know nothing about LLVM besides what's on its project homepage, >>>> but I am confident that a C subset example will allow me to ramp up >>>> quickly to the point where I could implement "advanced" features >>>> such as dynamic dispatch in short order. >>>> >>>> Ter, consider this a hearty seconding of Waverly's suggestion. >>>> It's >>>> a great idea. >>>> >>>> --- On Wed, 6/24/09, Damien Cassou <damien.cas...@gmail.com> wrote: >>>> >>>> From: Damien Cassou <damien.cas...@gmail.com> >>>> Subject: Re: [antlr-interest] ok, will build an LLVM example for >>>> book >>>> To: "Edwards, Waverly" <waverly.edwa...@genesys.com> >>>> Cc: "antlr-inter...@antlr.org ANTLR" <antlr-inter...@antlr.org> >>>> Date: Wednesday, June 24, 2009, 9:47 AM >>>> >>>> On Wed, Jun 24, 2009 at 6:40 PM, Edwards, >>>> Waverly<waverly.edwa...@genesys.com> wrote: >>>>> A Smalltalk or Java type language subset might be nice but overly >>>> complex, possibly >>>>> loosing your reader. >>>> >>>> The entire Smalltalk language represents no more than 17 AST >>>> nodes. I >>>> don't consider that overly complex. >>>> >>>> -- >>>> Damien Cassou >>>> http://damiencassou.seasidehosting.st >>>> >>>> "Lambdas are relegated to relative obscurity until Java makes them >>>> popular by not having them." James Iry >>>> >>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest >>>> Unsubscribe: >>>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address >>>> >>>> List: http://www.antlr.org/mailman/listinfo/antlr-interest >>>> Unsubscribe: >>>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address >>> >>> >>> List: http://www.antlr.org/mailman/listinfo/antlr-interest >>> Unsubscribe: >>> http://www.antlr.org/mailman/options/antlr-interest/your-email-address >>> >> >> >> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest >> Unsubscribe: >> http://www.antlr.org/mailman/options/antlr-interest/your-email- >> address >> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to il-antlr-interest@googlegroups.com To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---