Enki 1.1 Released

BCS BCS at pathlink.com
Wed Jun 14 15:37:18 PDT 2006


pragma wrote:
> In article <e6ptut$2c61$1 at digitaldaemon.com>, BCS says...
> 
>>>>.import("my.import.here");
>>>
>>Are these imports not always needed? Won't any parser use things from 
>>these modules? I would think that the basic imports _should_ be hard 
>>coded (or at least implicitly added to the imports list).
>>
>>On further thought only "enki.types" will _always_ be needed. 
>>"enki.BaseParser" will only be used if the default base class is used. 
>>But this is detectable, so again, it should be emitted unless the base 
>>class is changed.
> 
> 
> I'm inclined to agree, but its also at cross-purposes with the philosophy I had
> in mind with the tool.  I really think that it should try to impose as little as
> possible, wherever possible.  In this case, what happens if the user moves or
> renames 'types.d' to something else, or merged the templates in with their base
> parser?  I'd rather make imports explicit so the developer has this flexibility.
> 
> 

OK I'll grant that things might move, however in the general case those 
imports will be needed by most people. Good defaults make for good 
programs. How about make those imports the default and put in some sort 
of Override directive.


 >
 > Ah, now that's a serious bug.  Thanks for tracking it down.  I'm glad
 > that things are written such that you can find this stuff so easily.
 > Thanks for the patch!
 >

Find-in-files, grep and kin are wonderful aren't they. <g>


Another thought; as it is written, Enki is purely an ASCII text program. 
   It would be nice if the parsed data had its own type that, is only 
used for the input data. This would allow for the parsing of an array on 
any type (enums or structs come to mind). Of course this would requirer 
the introduction of a new terminal matching syntax.

Just a sketch of what might be done:
<code name="somewher.d">
...
enum bar { i1, i2, i3}

struct baz{
	bar thisType;
}
...
</code>

<code name="syn.bnf">
...

.parsetype(baz)

...

foo ::= @.thisType == bar.i1;

...
</code>



More information about the Digitalmars-d-announce mailing list