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

Completado Publicado hace 7 años Pagado a la entrega
Completado Pagado a la entrega

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

Programación en C Programación en C++

Nº del proyecto: #12673861

Sobre el proyecto

29 propuestas Proyecto remoto Activo hace 7 años

Adjudicado a:

vano101

There is my bid. . .

$33 USD en 1 día
(1444 comentarios)
7.7

29 freelancers están ofertando un promedio de $95 por este trabajo

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 Más

$150 USD en 1 día
(78 comentarios)
7.4
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 días
(126 comentarios)
7.4
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 Más

$150 USD en 2 días
(153 comentarios)
7.0
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. Más

$115 USD en 1 día
(34 comentarios)
6.3
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 Más

$50 USD en 3 días
(97 comentarios)
5.6
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 días
(49 comentarios)
5.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 día
(83 comentarios)
5.5
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 Más

$35 USD en 0 días
(48 comentarios)
4.9
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. Más

$100 USD en 1 día
(19 comentarios)
4.6
zkutch

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

$50 USD en 1 día
(15 comentarios)
4.6
nathaniel42

Obvious questions would be around what constitutes invalid input, and how should that be handled? Are lines of the input to be treated as strictly terminated by a semicolon (they can be split over multiple lines)? Más

$80 USD en 1 día
(1 comentario)
1.6
cracken

Hi, I am competitive to this kind of task, can take good care of this project. In fact, I already done related to this job before. Let me know the best of your time so we can discuss further based on your requirements Más

$249 USD en 3 días
(1 comentario)
1.8
adityapandey159

Sir, I would like to do your work. I know PHP very well. And having 3 years of PHP and web development experience. If you want a demo or ask a question. I am ready to work with you.

$55 USD en 3 días
(1 comentario)
0.4
amolm22665

I am working in C from last couple of years. and I like to face challenges like this where we need pure Brain and logic to design this. Well I can do it, No problem. I guess you need a generic solution by which any fil Más

$100 USD en 1 día
(0 comentarios)
0.0
igork1823

Hi. Yes I am a student, but I have a good knowledge in C++. I am using C++11. I cam finished you progect from 1 day as you need.

$30 USD en 2 días
(0 comentarios)
0.0
votuananhs

Hello, I can develop a function by using C language. If possible, I hope we will have discussion about this project. And I can do it for you. Thank you

$45 USD en 3 días
(0 comentarios)
0.0