Re: handling basic Makefile as domain specific language
Jeremy Tregunna <[email protected]> Wed, 18 Apr 2012 12:32:29 -0600
| Newsgroups | gmane.comp.lang.io |
|---|---|
| Message-ID | <[email protected]> |
Hi Oliver, When I wrote the phone book example for Bruce, : was not treated as part of the identifier. Had I known it was going to become part of the identifier, I would have wrote it differently to avoid confusion for the user. Your only real option is to force a whitespace between the identifier and the : to get around Io's use of it (solely for the purposes of the objc bridge I might add). Alternatively, you can write an actual parser and skip the DSL route. Regards, Jeremy Tregunna On Sunday, 15 April, 2012 at 4:08 PM, Oliver Kiddle wrote: > > After reading Bruce A. Tate's 7 languages book, I wondered whether it > would be possible to configure IO to support the basic dependency syntax > of Unix make. I'm not concerned with full Makefiles, just the type of > output that you get from gcc with the -M (or -MM) options and similar > tools. At worst, this might be something like: > > # comment > file.o: \ > file.h \ > file.cpp > > IO already accepts \ for continuation lines and # for comments so I > thought I'd just need to define : as an assignment operator but this is > where I've hit a snag. > > With “file: dep”, the colon appears to be treated as part of the > identifier. However, you can happily enter 1+1 so the same problem does > not apply to “+”. This doesn't seem to match my understanding of IO's > grammar. Trying with :=, I get the following: > > Io> value:="string" > > Exception: Slot value: not found. Must define slot using := operator before updating. > --------- > message 'updateSlot' in 'Command Line' on line 1 > > Io> value := "string" > ==> string > > Is there any workaround for this? > > I've used “call argAt(1) asString” to get the arguments in the > definition of the : operator. Is anyone aware of any parsing applied on > that argument that might prove troublesome? > > Thanks > > Oliver Kiddle > > PS. Sorry if you receive this mail twice, I tried to send it shortly > after subscribing but it never arrived in the Yahoo group. >