I have built a FCL grammar as mentioned in this thread:
http://forum.lazarus.freepascal.org/index.php/topic,33830.msg296041.html#msg296041There are no warnings nor errors, and I can successfuly test the grammar in Gold Test Window. However when I compile the grammar and try to parse the same code in LazarusGoldEngine (which can also be found in thread mentioned above) I get parsing errors.
This is a minimal grammar to demonstrate the problem (nice to see that BNF color highlighting works in this forum):
"Case Sensitive" = False
"Start Symbol" = <range>
Comment Block @= { Nesting = All, Advance = Character }
Comment Start = '{'
Comment End = '}'
Comment Line = '//'
ASSIGN = ':='
SEMI = ';'
LEFTPAR = '('
RIGHTPAR = ')'
DOUBLEPOINT = '..'
<range>
::= RANGE ASSIGN LEFTPAR 0 DOUBLEPOINT 100 RIGHTPAR SEMI
I compile it in Gold to create CGT file, and load CGT file into Lazarus GoldEngine.
1) Now, if I use this code as test input:
I get this error while parsing in Lazarus GoldEngine:
Line 1: Syntax Error: Expecting the following tokens: LEFTPAR
RANGE and ASSIGN tokens are recognized, but LEFTPAR not although it is there.
2) Also if I use a comment line as test input:
I get this error while parsing in Lazarus GoldEngine:
Line 1: Lexical Error: Cannot recognize token: s
Problem 1 is a major one, and currently a deal breaker since I could not figure out how to overcome it. Problem 2 is a minor one and it looks like GoldEngine ignores whole comment group defined in Gold. Not pleasant, and it would be nice if it could be fixed, but I think that i could eventually overcome it with some effort.
Problems are the same with both old non-generics Lazarus GoldEngine version and new Thaddy's version with generics.
I do hope that someone can take a look at this and help since I would really hate to drop GoldEngine