Difficulty with character having special meaning after new line
40 views
Skip to first unread message
Peter Frazer
unread,
Sep 5, 2012, 12:01:43 PM9/5/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gold-pars...@googlegroups.com
I am trying to define a grammar in which the character '*' starts a line comment if it is the first character on a line and am having difficult distinguishing it from a multiply symbol (also '*' but never at start of line).
I am currently using GOLD Parser Builder 3.0.1 as I have some problems with the new .egt format. I found a comment in the documentation about 'older grammars using regular expressions to define comments' but I could not figure out how to do it. I tried a variety of things like {CR}'*' but whatever I try I get an error either in building the grammar or in parsing.
The '*' could also start a comment at the very beginning of the file.
Any suggestions greatly appreciated.
Peter.
Devin Cook
unread,
Sep 5, 2012, 4:26:33 PM9/5/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gold-pars...@googlegroups.com
Are you parsing COBOL? Are new-lines significant in the grammar? In
may older language like COBOL and FORTRAN, they use a preprocesser
that removes these lines before the text is parsed.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gold-pars...@googlegroups.com
The documentation, on the site, is pretty lacking... :(
In this case, it seems that the grammar is context-sensitive. The
location of the asterisk, on the screen, impacts how it is viewed. It
will probably be easier to write a simple preprocessor that removes
the commented lines. The resulting temporary file can be fed to the
parser.
> --
> You received this message because you are subscribed to the Google Groups
> "GOLD Parsing System" group.
> To view this discussion on the web visit