Hello,
I need a simple command line application (developed in C or C++ with Visual Studio) which parses a text file and emit some output files.
The command line would be something line:
[login to view URL] /input_files [login to view URL] [login to view URL] ... /output_h output.h /output_inc [login to view URL] /output_c output.c
The input file would be a text file with a list of "variables" definitions, between the "VARS_START / VARS_END" markers. Example input file:
-------
some strings here...
other text....
VARS_START
CounterVar <INT32><1>
PricePerPerson <INT16><0>
ErrorMessage <STRING><"Error!!!">
BufferOutput <BUFFER><400>
// specific var per person
PriceForTed <INT32><100>
VARS_END
some text...
-------
Basically, the application will parse the file ignoring all text outside the "VARS_START/VARS_END" markers. Notice that inside the VARS_START/END markers there can be comments (with //) which are also ignored
The application will parse all "variables" inside the VARS_START/END markers and will emmit the output files as follow:
1) "/output_h" parameter will emmit the following output file: (Notice the number on the right will be calculated with any CRC32 function from the given variable name)
#define CouterVar CRC("CounterVar")
#define PricePerPerson CRC("PricePerPerson")
#define ErrorMessage CRC("ErrorMessage")
#define BufferOut CRC("BufferOut")
#define PriceForTed CRC("PriceForTed")
So, the "CRC("CounterVar")" will be calculated by your parser, emitting the calculated CRC, so it would generate instead something like:
#define CounterVar 0x17182A282
#define PricePerPerson 0xB518C12
...
...
2) "/output_inc" parameter will generate a similar file like the above (but to be understood by an assembler).Example ouput for the input file:
CouterVar EQU 0x17182A282
PricePerPerson EQU 0xB518C12
...
...
3) "/output_c" parameter will generate an output file with the following output:
#include "myvarsdef.h"
void VarsDef_Initialize(void)
{
AddVar(CounterVar, INT32, 1);
AddVar(PricePerPerson, INT16, 0);
AddVar(ErrorMessage, STRING, "Error!!!");
AddVar(BufferOuput, BUFFER, 400);
AddVar(PriceForTed, INT32, 100);
}
4) NOTE: The application will emit an error message (just a simple MessageBox) when the same CRC is appearing two times in the "output_h" file. So, I can know if I have duplicated the same variable name or there is a CRC collision with two variables with different names but with same CRC
That's all! Any questions, just let me know!
Thanks!
Hello,
the task is well posed and clear(well understandable).
It seems there are no questions for now.
(Maybe one question: it can be one 'tag' VARS_START / VARS_END, or it can be multiple such tags in 1 input file? not so essential, just for curiosity).
I can write this project definitely.
If you wish, I can show you demo-version via video-file or somehow other way before bidding (in 1 day).
Choose me please :)
Thank you.
$100 USD w 1 dzień
4,9 (20 opinii)
5,2
5,2
9 freelancerzy składają oferty o średniej wysokości $177 USD dla tej pracy
Dear client, how are you?
I am a C++ programmer and mathematician.
Your task is very interesting for me. But still not completely clear.
Please check my "Profile & Work List" and tell me details if my skill is in your concern.
Looking forward to your response.
Thanks.