FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems with Enki codegeneration

 
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries
View previous topic :: View next topic  
Author Message
KlausO



Joined: 16 Feb 2006
Posts: 27
Location: Germany

PostPosted: Tue Jun 20, 2006 2:57 am    Post subject: Problems with Enki codegeneration Reply with quote

Hello pragma,

I made a little test project for enki:

Code:

#  Test Grammar Definition
.module("enkitest.parser");

.import("enki.types");
.import("enki.BaseParser");

.define("bool","eoi","true","End of Input");
.define("bool","eol","true","End of Line");
.define("bool","err","true","Error");
.define("String","letter","true","Letter");
.define("String","digit","true","Digit");
.define("String","hexdigit","true","Hexdigit");
.define("String","any","true","any");
.define("String","newline","true","Newline");
.define("String","sp","true","Space(s)");
.define("String","ws","false","Whitespace");

.baseclass("BaseParser");
.classname("TestParser");
.start("SyntaxLine");

SyntaxLine
   ::= { DocComment ws } eoi;

DocComment
  ::= ("/""/""/" {any} eol)
    | ("/""*""*" {any} "*""/");


Trying to compile this I get an error from DMD

Code:

parser.d(130): declaration enkitest.parser.TestParser.parse_DocComment.start is
already defined


In the first version of this grammar I tried

Code:

DocComment
  ::= ("///" {any} eol)
    | ("/**" {any} "*/");


but this breaks the comment section before the generated rule code. So I tried to work arround this.

Apart from these minor issues enki is the best parsegen I have seen so far. It is simple and compact and easy to understand, but at the same time it offers powerful features and generates excellent parser code . Very Happy
Back to top
View user's profile Send private message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Tue Jun 20, 2006 6:44 am    Post subject: Reply with quote

Klaus,
The problem you're having is due to a bug in the codegen portion of Enki, combined with a very subtle bug in DMD:

http://d.puremagic.com/issues/show_bug.cgi?id=199

I have a hotfix available in SVN that resolves this, but no binary release as of yet:

http://svn.dsource.org/projects/ddl/trunk/enki/

Quote:
Apart from these minor issues enki is the best parsegen I have seen so far. It is simple and compact and easy to understand, but at the same time it offers powerful features and generates excellent parser code . Very Happy


Thank you! I tried very hard to do just that, and I'm glad that you like it. Smile
_________________
-- !Eric.t.Anderton at gmail
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DDL - D Dynamic Libraries All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group