Based on a report by Zorko on the BlackBox community forum I have created
https://redmine.blackboxframework.org/issues/186 for fixing an inconsistency
between the documentation and the parsing of code procedures.
Dev/Docu/P-S-I.odc specifies that code procedures are a comma-separated sequence of constant expressions.
Leading, trailing, or multiple adjacent commas are not allowed.
In addition, the docu allows arbitrary constant expressions, not only integer and string literals.
The parser in DevCPP.GetCode therefore needs to be aligned with the docu.
It is expected that there are no compatibility issues with existing code and if there are any,
they would be flagged by the compiler and the fix is trivial.
- Josef
issue-#186 aligning code procedure syntax with docu
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#186 aligning code procedure syntax with docu
A possible fix has been committed on github.
For a test version see http://blackboxframework.org/unstable/i ... 1.1021.zip.
For the changes see https://redmine.blackboxframework.org/p ... a4d9f1453b.
The changes are:
1. illegal commas are marked as errors.
2. any constant expression resulting in an int or string is allowed.
This allows for example to use symbolic opcodes.
- Josef
For a test version see http://blackboxframework.org/unstable/i ... 1.1021.zip.
For the changes see https://redmine.blackboxframework.org/p ... a4d9f1453b.
The changes are:
1. illegal commas are marked as errors.
2. any constant expression resulting in an int or string is allowed.
This allows for example to use symbolic opcodes.
- Josef
Re: issue-#186 aligning code procedure syntax with docu
I do not quite understand the intention of this change,What problem to solve? help the porting of external code ?
Is there some examples to explain it's new EBNF ?
luowy
Is there some examples to explain it's new EBNF ?
luowy
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#186 aligning code procedure syntax with docu
In practice there is no difference at all. All code procedures that follow the grammar in P-S-I.odc will of course continue to compile.luowy wrote:I do not quite understand the intention of this change,What problem to solve? help the porting of external code ?
Is there some examples to explain it's new EBNF ?
luowy
P-S-I.odc specifies code procedures in the following way:
The only (minor) problem was that the compiler did not check all syntax errors.Code procedures make it possible to use special code sequences not generated by the compiler. They are declared using the following special syntax:
ProcDecl = PROCEDURE "[" SysFlag "]" IdentDef [FormalPars]
[ConstExpr {"," ConstExpr}] ";".
It was for example possible to add a comma at the beginning or the end or in between.
In addition, it did not allow ConstExpr but only simple special cases of ConstExpr.
With this fix the compiler follows the specification in P-S-I.odc.
- Josef
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#186 aligning code procedure syntax with docu
Has everybody (anybody?) reviewed and tested this change?
From my point of view it would be ready for voting.
- Josef
From my point of view it would be ready for voting.
- Josef
Re: issue-#186 aligning code procedure syntax with docu
In Spain on motorbike; can't look at it for at least a week.Josef Templ wrote:Has everybody (anybody?) reviewed and tested this change?
From my point of view it would be ready for voting.
- Josef
I assume that empty code procedures are still possible?
Robert
Re: issue-#186 aligning code procedure syntax with docu
elegant code! I have checked it;