handling basic Makefile as domain specific language
Oliver Kiddle <[email protected]> Mon, 16 Apr 2012 00:08:59 +0200
| Newsgroups | gmane.comp.lang.io |
|---|---|
| Message-ID | <[email protected]> |
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.