Posted 17 years ago by Vincent Parrett
Version: 4.0.0255
Avatar
Hi

Something that would surely speed the creation of new xml grammars would be a tool to convert a "standard" ENBF grammar to your xml based grammar. I'm working on a VBScript grammar and it's incredibly time consuming just getting the basics done. It wouldn't have to be perfect, I realise there are a bunch of different enbf "standards", just pick one (antlr style for example).

Regards

Vincent.

Comments (8)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks for the suggestion Vincent. If you come up with any simple code to do this in the meantime, please do post it for the benefit of others.


Actipro Software Support

Posted 17 years ago by Vincent Parrett
Avatar
I spent a couple of hours today writing some code to convert an enbf grammar to xml... only partially successful.. it really needs a full parser to make it work properly. I managed to produce the xml for most of the non terminals but it didn't cope with the terminals so well.

In the end, after spending several more hours fixing the mistakes it made, I get a "Stack Empty" error and I'm totally stuck as I have no idea what it is that it doesn't like. I'll email it to support.

Regards

Vincent
Posted 17 years ago by Paul Fuller
Avatar
Couldn't you use ANTLR to process a grammar and generate lexical and semantic parsers that would function with SyntaxEditor ? Either an XML definition or direct to code.

Seems like you could use the power of a mature product like ANTLR and just modify the output generation to suit.

Paul
Posted 17 years ago by Kelly Leahy - Software Architect, Milliman
Avatar
It would certainly be possible to make a parser generator work with SyntaxEditor, considering you can easily hand-write a parser that works with it. My parser is not generated, neither by the provided Actipro tools nor by other industry tools, since my language had some features that I just found easier to implement in a hand coded RD LL parser.

Kelly Leahy Software Architect Milliman, USA

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Vincent,

The part of the parser generator that builds the error message had a bug in it, which was why you got the stack empty message. What it really should have said is:
Production 'SubSafeImpExpr' allows for infinite left recursion:
SubSafeExpr -> SubSafeImpExpr

The error message bug is now fixed for the next maintenance release.

We wanted to do certain things with our parser generator that other ones we looked at didn't support and also wanted to make it tightly integrated with SyntaxEditor. But as Kelly said, our open-ended language model supports the use of any semantic parser. You can simply choose to call another one instead of ours.


Actipro Software Support

Posted 17 years ago by Vincent Parrett
Avatar
Thanks, any idea when the maint release will be? I suspect there are quite a few more non terminals with left recursion.. the grammar came from the Gold Parser page so it was designed for an LALR Parser. I used that because it seemed it have the most complete grammars for the languages I'm interested in.

I'm still very new to this stuff (never used enbf before) , so I was hoping the parser generator would help me find my mistakes :)

Regards

Vincent.
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Vincent,

Normally it does tell you where the errors are ok but in this case you found a bug that shouldn't have been there. If you run into it again, perhaps we can make you a custom preview build of the next maintenance release with the fix in it. Just email us if you need this before the next release is out (it may be a little bit since we just put one out a couple days ago).


Actipro Software Support

Posted 17 years ago by Vincent Parrett
Avatar
Thanks, emailed support.

I found an interesting tool while googling for info on dealing with the left recursion problem :

http://a510690.studentweb.abertay.ac.uk/EBNF/ProcessEBNF.html

It has an option to transform direct left recursion, unfortunately it barfs on my grammars (looks like it requires the production on one line or something), but it does give me the idea that it might be something you could look at for the grammar parser.. provide an option to spit out the transform.. just an idea for when you have some spare time :)

Regards

Vincent.
The latest build of this product (v24.1.0) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.