Apr 21, 2010 at 10:44 PM
Edited Apr 22, 2010 at 8:51 AM
The thing is, quoted string can be split not only by a comma, but in any place. And split strings content have to be parsed all together.
constant FBGA256 : PIN_MAP_STRING :="IOD3 : D3 , IO” & ”C2 : C2”; // for "IOD3: D3, IOC2: C2"
So grammar for string would be:
MAP_PAIR.Rule = IO_ID +
":" + ID;
MAP_PAIR_SET.Rule = MakePlusRule(MAP_PAIR_SET, MAP_PAIR ,",");
And grammar for constant statement:
CONST_STMNT = ToTerm("constant") + NAME + ":" + TYPE + ":=" + quotedStringConcat;
The question is, can I use a single grammar for the parsing of the entire expression in a one pass?