VCL language is more flexible than XVCL as it allows for adapt of a file even though the file don't contain any VCL commands (i.e. such adapt would simply copy the adapted file to the output stream).
However, when I today tried to adapt a Visual Studio Solution file (.sln), the generated output is "empty" when viewed in Notepad (even though the "source" .sln file looks fine in Notepad). I suspect that there may be some control characters or something that create some issue for the processor.
For adapt of a binary file, perhaps there should exist a VCL copy command (adapt-copy) and with such command there would be no need at all for VCL to make assumptions about file formats (as VCL could simply copy the whole file). Such adapt-copy command would however bring back the discussion of how the output is assigned, i.e. "adapt-copy" of the whole file would only work if the output is bounded by the start and end of the adapt command. Thus, the current approach where the output is set independently of the adapt command may seem somewhat mismatching and inconsistent with the output required for adapt-copy command.
For discussion....
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried to adapt an example cs project's solution file (a very simple project though), and the processor emitted the file's content to the output. Can You provide the solution file with which it didn't work?
Since it is textual content, if it doesn't work that must be a bug in VCL.
We could have two different possibilities to run #adapt-copy command:
#adapt-copy <expression>(where <expression> leads to file's relative or absolute path)
The processor copies the file's content in the current output file without executing any commands or evaluating any expressions inside it (without touching it's content).
#adapt-copy <expression1> <expression2>(where <expression(i)> leads to file's relative or absolute path)
The processor copies the <expression1> file's content into file <expression2> without executing any commands or evaluating any expressions inside it. With this command the 'normal' output of the processor won't change, and in the second file will go nothing but the first file's content.
So when the copy is done the output is the same as before.
I think the second option would be a good solution for copying binary files and would not bring any inconsistencies regarding the output changes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For #adapt-copy I would suggest the following:
We could have two different possibilities to run #adapt-copy command:
* #adapt-copy <expression>
(where <expression> leads to file's relative or absolute path)
* The processor copies the file's content in the current output file without executing any commands or evaluating any expressions inside it (without touching it's content).
* #adapt-copy <expression1> <expression2>
(where <expression(i)> leads to file's relative or absolute path)
* The processor copies the <expression1> file's content into file <expression2> without executing any commands or evaluating any expressions inside it. With this command the 'normal' output of the processor won't change, and in the second file will go nothing but the first file's content.
So when the copy is done the output is the same as before.
I think the second option would be a good solution for copying binary files and would not bring any inconsistencies regarding the output changes.
VCL language is more flexible than XVCL as it allows for adapt of a file even though the file don't contain any VCL commands (i.e. such adapt would simply copy the adapted file to the output stream).
However, when I today tried to adapt a Visual Studio Solution file (.sln), the generated output is "empty" when viewed in Notepad (even though the "source" .sln file looks fine in Notepad). I suspect that there may be some control characters or something that create some issue for the processor.
For adapt of a binary file, perhaps there should exist a VCL copy command (adapt-copy) and with such command there would be no need at all for VCL to make assumptions about file formats (as VCL could simply copy the whole file). Such adapt-copy command would however bring back the discussion of how the output is assigned, i.e. "adapt-copy" of the whole file would only work if the output is bounded by the start and end of the adapt command. Thus, the current approach where the output is set independently of the adapt command may seem somewhat mismatching and inconsistent with the output required for adapt-copy command.
For discussion....
Thank You for the suggestion!
If necessary, we can provide an option for that.
I tried to adapt an example cs project's solution file (a very simple project though), and the processor emitted the file's content to the output. Can You provide the solution file with which it didn't work?
Since it is textual content, if it doesn't work that must be a bug in VCL.
Example:
SPC.vcl:
out.txt
(I didn't modify the .sln file, for proper output we have to modify the " characters to escaped ones \")
For #adapt-copy I would suggest the following:
We could have two different possibilities to run #adapt-copy command:
So when the copy is done the output is the same as before.
I think the second option would be a good solution for copying binary files and would not bring any inconsistencies regarding the output changes.
I agree that 2nd option looks best for binary copy and may be all that we need.
On Thursday, 7 November 2013, 17:50, Daniel Dan danieldan88@users.sf.net wrote:
For #adapt-copy I would suggest the following:
We could have two different possibilities to run #adapt-copy command:
* #adapt-copy <expression>
(where <expression> leads to file's relative or absolute path)
* The processor copies the file's content in the current output file without executing any commands or evaluating any expressions inside it (without touching it's content).
* #adapt-copy <expression1> <expression2>
(where <expression(i)> leads to file's relative or absolute path)
* The processor copies the <expression1> file's content into file <expression2> without executing any commands or evaluating any expressions inside it. With this command the 'normal' output of the processor won't change, and in the second file will go nothing but the first file's content.
So when the copy is done the output is the same as before.
I think the second option would be a good solution for copying binary files and would not bring any inconsistencies regarding the output changes.
VCL vs XVCL and adapting binary files
Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/vclang/discussion/general/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Last edit: Ulf Pettersson 2013-11-08
Please refer to adapt-copy.