En cours

Parse input file with specific (limited) "C variable definitions"

Hi,

I require a C/C++ function that parses an input file and creates an output file.

Example input file:

--------------------------------------------------------------------

BYTE b_var1 = 34;

BYTE b_var2 = POOL_VAR_RND_INITIALIZED;

BYTE b_var3;

BYTE b_array1[] = {0x11, 0x12, 0x55};

BYTE b_array2[4];

WORD w_var1 = 34;

WORD w_var2 = POOL_VAR_RND_INITIALIZED;

WORD w_array1[] = { 0x1111, 0x12, 0x5555 };

WORD w_array2[4];

DWORD d_var1 = 34;

DWORD d_var2 = POOL_VAR_RND_INITIALIZED;

DWORD d_array1[] = { 0x11, 0x12, 0x55 };

DWORD d_array2[4];

DWORD d_array3[5] = { 0x11, 0x12, 0x55, 0x44444444, 0x66666666 };

QWORD q_var1 = 0x1122334455;

QWORD q_array1[5] = { 0x11, 0x12, 0x55, 0x44444444, 0x66666666 };

LPBYTE pointer1 = NULL;

LPBYTE pointer2;

-------------------------------------------------------------

The output file will be the following for the above example (basically it's transforming each variable definition into a different format):

------------------------------------------------------------

// BYTE b_var1 = 34;

b_var1 <INT8><34>

// BYTE b_var2 = POOL_VAR_RND_INITIALIZED;

b_var2 <INT8><POOL_VAR_RND_INITIALIZED>

// BYTE b_var3;

b_var3 <INT8><0>

// BYTE b_array1[] = {0x11, 0x12, 0x55};

b_array1 <BUFFER><3 * sizeof(BYTE)>

<db><0x11, 0x12, 0x55>

// BYTE b_array2[4];

b_array2 <BUFFER><4 * sizeof(BYTE)>

// WORD w_var1 = 34;

w_var1 <INT16><34>

// WORD w_var2 = POOL_VAR_RND_INITIALIZED;

w_var2 <INT16><POOL_VAR_RND_INITIALIZED>

// WORD w_array1[] = { 0x1111, 0x12, 0x5555 };

w_array1 <BUFFER><3 * sizeof(WORD)>

<dw><0x1111, 0x12, 0x5555>

// WORD w_array2[4];

w_array1 <BUFFER><4 * sizeof(WORD)>

// DWORD d_var1 = 34;

d_var1 <INT32><34>

// DWORD d_var2 = POOL_VAR_RND_INITIALIZED;

d_var2 <INT32><POOL_VAR_RND_INITIALIZED>

// DWORD d_array1[] = { 0x11, 0x12, 0x55 };

d_array1 <BUFFER><3 * sizeof(DWORD)>

<dd><0x11, 0x12, 0x55>

// DWORD d_array2[4];

d_array2 <BUFFER><4 * sizeof(DWORD)>

// DWORD d_array3[5] = { 0x11, 0x12, 0x55, 0x44444444, 0x66666666 };

d_array3 <BUFFER><5 * sizeof(DWORD)>

<dd><0x11, 0x12, 0x55, 0x44444444, 0x66666666>

// QWORD q_var1 = 0x1122334455;

q_var1 <INT64><0x1122334455>

// QWORD q_array1[5] = { 0x11, 0x12, 0x55, 0x44444444, 0x66666666 };

q_array3 <BUFFER><5 * sizeof(QWORD)>

<dq><0x11, 0x12, 0x55, 0x44444444, 0x66666666>

// LPBYTE pointer1 = NULL;

pointer1 <POINTER><NULL>

// LPBYTE pointer2;

pointer2 <POINTER><0>

--------------------------------------------------

The different variable types are BYTE, WORD, DWORD, QWORD, LPBYTE.

The solution should compile under Visual Studio (I'm using VS2015)

If you have any questions, let me know please.

Thanks

Compétences : Programmation C, Programmation C++

Voir plus : input file mysql database, mturk input file, input file sql mysql, excel input file, mysql input file, input file

Concernant l'employeur :
( 62 commentaires ) Jerez de la Frontera, Spain

N° du projet : #12673861

Décerné à :

vano101

There is my bid. . .

33 $ USD en 1 jour
(1242 Commentaires)
7.4

34 freelance ont fait une offre moyenne de 93 $ pour ce travail

hbxfnzwpf

I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 6 years. My work is online game developing, and mainly focus on server side, using c++ under linux environ Plus

150 $ USD en 2 jours
(104 Commentaires)
6.8
LiangXiaoJin

Dear client, how are you? I am a C++ programmer and mathematician. No problem. Let's do. No problem. Let's do. No problem. Let's do. No problem. Let's do. No problem. Let's do. Please check my "Profile & Work Li Plus

150 $ USD en 1 jour
(30 Commentaires)
6.2
147 $ USD en 3 jours
(168 Commentaires)
6.3
freelancerLatino

Hello, I am expert with c and c++ since more than 20 years ago ... you can see my previous work and reputation. Please, give me all samples files. It is only about variables?. I may do it in few hours. Best regards!

50 $ USD en 2 jours
(75 Commentaires)
6.4
155 $ USD en 3 jours
(53 Commentaires)
5.2
svyatozar

Greetings! Please consider my bid. I'm currently available and can start any minute. Best regards, -Alexandre Kharlamov

55 $ USD en 1 jour
(24 Commentaires)
5.3
NewHorizons2016

Hola, I specialise in C++ based engineering (in the real world), and lately do freelancing due to health issues. If interested, I can implement this C++ function for you and send it off to you - within 12 hours. Plus

115 $ USD en 1 jour
(11 Commentaires)
4.9
usmanshery

Hi, i'm software engineer and expert c,c++,java and c# developer. I have 3 years experience in oo programing, data structures and algorithms, artificial intelligence algorithms, game programming socket programming and Plus

50 $ USD en 3 jours
(32 Commentaires)
4.8
60 $ USD en 1 jour
(22 Commentaires)
4.7
100 $ USD en 2 jours
(33 Commentaires)
4.8
45 $ USD en 3 jours
(33 Commentaires)
4.6
prince2502

Hello This problem belongs to the category of parser design which is a subset of compiler design. We will need to design a grammar for this language (Context free Grammar) and then make a parser and a translator. Plus

100 $ USD en 1 jour
(16 Commentaires)
4.4
harshdaga

Hi, I've got quite some experience with C and C++ and I'm sure I can finish this within a couple of hours. Is it okay with you to use the standard regex library in C++?

50 $ USD en 1 jour
(37 Commentaires)
4.6
DemonDeveloper

We are team of excellent developers. We have 2 year experience related to your project field. We can do your project and solve your all problems according to your requirements. We have read your description for project Plus

35 $ USD en 0 jours
(22 Commentaires)
4.2
lumeihui210

Dear sir. If I finished all,I will send result. So please send me a message. If you are OK,then award me. as soon as I get your message,I will develop this. Thank you.

155 $ USD en 10 jours
(3 Commentaires)
4.0
victor980410

Hello, I am experienced c,c++ programmer. I can do this task. Let me know if you are interested. Looking forward to hearing from you.

30 $ USD en 3 jours
(36 Commentaires)
4.0
raulbehl

Hello! Please check my profile/reviews to know a bit about me. It would be great if I could help you out. Thank you!

83 $ USD en 3 jours
(15 Commentaires)
3.8
zkutch

Hello More 20 years programming experience. I need more details to set real price and time. Regards. ----------------------------------------------------------------------------------------------------------------- Plus

50 $ USD en 1 jour
(9 Commentaires)
4.1
BeautiCG

Hi,dear. Thank you for your interest. I've just checked your project report,I'm able to perform this task with my developer team.I look forward to your proposal...

155 $ USD en 1 jour
(8 Commentaires)
3.8
ARKSolution2015

Dear Hiring Manager, Education: Masters Degree Experience: 4+ years I will do it for you with perfection and I will keep working on it until you are 110% satisfied with results. Feel free to message me. we ca Plus

150 $ USD en 5 jours
(8 Commentaires)
3.6