Anthony Kozar wrote on 17/07/2020 02:26:
> An option to write trace outputs to a file is a good idea. I prefer
> the option of being able to specify the trace file name too. Because
> there are at least 9-10 processes that write output to the Trace
> window in BP2 and several of them may be enabled at once, I'm thinking
> maybe we should have separate options for specifying the trace file
> and enabling each trace process. Something like
>
> --traceout filename
>
> --show-production
> --trace-production
> --step-production
> --step-subgrammars
> --choose-rules
> --show-time-setting
> --step-time-setting
> --trace-time-setting
> --trace-csound
>
> Once we have a more complete idea of how many command line options
> there will be, we can choose "short option" variants for the most
> commonly used options.
> I noticed that compilation errors also go to the Trace window. Should
> they or any of the other above outputs be directed to separate
> destinations?
By default let them go to the Trace output (+ Trace file), otherwise to
a specified file.
> While I added some code last night for the first 5 of the above trace
> processes, there are two main issues to deal with to make them useful.
> First, it appears that all lines are terminated by '\r' in the strings
> these processes output. As you probably know, on a Unix-like console
> a carriage return by itself repositions the next output to the
> beginning of the current line so that whatever is on that line gets
> overwritten. The second issue is that the "step" and "choose rules"
> processes need input from the user. I believe that all features
> requiring user input while BP is running should eventually be handled
> by a client application that uses the (not yet existent) BP API. In
> the mean time, I could probably rewrite the code for BP console to
> handle some of the simpler such input situations.
Options step-production, step-subgrammars, choose-rules and
step-time-settings cannot be used at the moment because they produce
dialogs expecting a reply from the user. Indeed the console could
display questions but the ouput will probably be too complex, and
certainly not manageable by a separate interface server.
So, "choose-rules" should be ignored until the implementation can manage
it. But the "step" options could simply activate producing a trace of
the process stored in a specified file (which could be "trace-xxx" by
default). The PHP interface will then read and display that file.
I would not bother too much about console output because any interface
that launches command lines will be able to read a file produced by the
output. It has an advantage: the output can be formatted for a more
user-friendly interpretation, including inserting links pointing at Help
entries.
For instance, compilation errors: create a file in which each line
contains the subgrammar number, the rule number and the diagnosis. The
interface will read this file and produce a display of the grammar,
hiliting rules that contain an error. We could even have a separate text
file containing error numbers and diagnoses, so you don't really need to
send the diagnosis to the file. Doing this would make it possible to be
more precise on the diagnosis, e.g. suggesting how the error will be
solved. In addition this would be a first step towards running BP in
different languages…
Bernard
>
> On 7/16/20, 4:58 AM, Bernard Bel wrote:
>> I suggest to write "trace" outputs to a "trace.txt" file near the
>> grammar or data file that produced it.
>> The PHP interface will look for "trace.txt" and display it on a pop-up
>> window.
>>
>> However it would be better to have options like:
>>
>> --trace-production somepath/sometracefile
>>
>> --show-production somepath/someproductionfile
>>
>> so that a different trace file will be produced by calls relating to
>> different projects.
>>
>> Bol Processor Git repository wrote on 16/07/2020 10:19:
>>>
>>>
>>> Branch: ANSI-branch
>>>
>>> New options --seed [num], --show-production, and --trace-production.
>>>
>>> FIXME: Because of carriage returns, some of the output from
>>> --show-production and --trace-production is overwritten on the console.
>>>
>>> By Anthony Kozar on 07/16/2020 08:18
>>> *View Changes*
>>> <https://sourceforge.net/p/bolprocessor/git/ci/2447a9f1f69cc2291e782226745438cdad065323/>
>>>
|