Re: Multiple definitions for 'Comment Line'

Skip to first unread message


Aug 27, 2012, 6:46:10 PM8/27/12
In 5, when you use one of the group definitions, you are specifying the name of a terminal rather than a regular expression. You can define a second comment line definition and then set it to whitespace.

Comment2 Line = '--'
Comment2 @= {Type = Noise}

On Sunday, August 26, 2012 7:39:05 AM UTC-7, David Pond wrote:
Comment lines in MDX can begin with either '//' or '--'. From what I've read I should be able to write the following in my grammar:

Comment Line = '//' || '--'

But the grammar check fails with this message:

Syntax Error

Read: |
Expecting: New Line.

I'm using Gold Parser Builder 5.2, anyone know where I've gone wrong?



Dave Dolan

Sep 10, 2012, 2:05:35 PM9/10/12
As far as I know, your options are limited: you can re-write the
calitha engine, or use a different engine that already supplies
version 5 support. New technology sometimes breaks old code.

On Mon, Sep 10, 2012 at 3:40 AM, LordZ <> wrote:
> I hit this same problem trying to make some changes to an old project using
> gold/calitha for .NET. After reading the docs and fooling around for a long
> time, I finally figured out what Devon said here (before finding this post).
> However, it works fine when testing it in the Gold Builder, but I get parser
> errors about an unexpected token on the additional comment line group
> terminal. My best guess is that since this is a version 5 feature and
> calitha lib is a version 1.0 cgt engine, it does not work with calitha. Does
> this make sense? What can I do???
> Here are my comment terminals:
> Comment Line = '//'
> Comment Start = '/*'
> Comment End = '*/'
> Comment2 @= { Type = Noise }
> Comment2 Line = '%'
> Comment3 @= { Type = Noise }
> Comment3 Line = '#'
> Thanks!
> --
> You received this message because you are subscribed to the Google Groups
> "GOLD Parsing System" group.
> To view this discussion on the web visit
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Dave Dolan

Cody Zuschlag

Sep 10, 2012, 4:52:55 PM9/10/12
So I realized the project was build using calitha 1.13... tomorrow I may try with calitha 1.5, the changelog says stuff about fixing handling of comments. But if my theory about the 5.0 vs 1.0 cgt files is true, then it shouldn't matter.

In the end I may just try to track down the person who built the project the first time and see if they have the version of the gold builder used to generate the tables with the original grammar. Or bug Devon about getting the last pre version 5 version of gold builder... there seems to be some demand for that but yet there is no archive of previous versions... Although, the project is kind of a cluster f' hack job, so unless I can get the ok from management to rework the current parser implementation, my plan is to disassociate myself from the parsing aspects :-( but that's another story.

Cody Zuschlag

Sep 10, 2012, 4:55:11 PM9/10/12
oops... meant to say I may try with calitha 1.15...

Cody Zuschlag

Sep 11, 2012, 5:24:28 AM9/11/12
I can validate that the behavior is the same with calitha 1.15, it does not support the group construct of gold builder 5.0 and therefore treats the Comments terminal special. Thus confirming that calitha combined gold builder 5.2.0 do not allow for multiple line comment terminals. Therefore forcing anyone still using calitha to use an old version of gold builder...

And just to clarify, my bit of ranting two emails ago was related to the project at my work (and how it was implemented)... nothing to do with gold/calitha (which seems pretty cool) :-) just wanted make that clear.
Reply all
Reply to author
0 new messages