Dear Anthony,
A few days ago I had suggested that when compiling a grammar we should
get it in the fully formated format so that subgrammar numbers and rule
numbers are explicit.
For instance the following grammar:
RND
S --> _chan(1) _vel(50) _volumecont _volume(80) A' B' C'
--------
RND
A' --> A A A A A A A A
B' --> B B B" B" C C D D D D E E E E
will be reformated as:
RND
gram#1[1] S --> _chan(1) _vel(50) _volumecont _volume(80) A' B' C'
--------
RND
gram#2[1] A' --> A A A A A A A A
gram#2[2] B' --> B B B" B" C C D D D D E E E E
Although BP does this automatically, it might have been a bit difficult
to export the updated grammar to a temporary file and reload it to
replace the original grammar.
For this reason I implemented reformat_grammar() in _basic_tasks.php
that does the same. Less complicated that I had anticipated!
I checked the process by compiling a few old grammars to trace reserved
words and everything that indicates that the current line is a rule and
needs numbering.
By the way, old grammars would notate "GRAM" instead of "gram": a
reminiscence of the Apple II version! ;-)
I also worked on the display of the Trace window. The console
application saves its output to a Trace text file if requested to do it.
But a display of the plain file on a browser window was incorrect
because of MacOS Roman versus Unicode encodings. So, the interface now
converts the text file to a HTML file with proper headers and correction
of garbage signs. It's done by clean_up_file() on the same PHP page.
I am now working on the issue of dealing with the bullet period ‘•’
which is not accepted by the console application. The trick will be to
save it as "•" and display it as a bullet.
As usual, the new version is on my site:
https://leti.lt/bolprocessor/
Bernard
|