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

Ολοκληρωμένο Αναρτήθηκε Πριν 7 χρόνια Πληρώθηκε κατά την παράδοση
Ολοκληρωμένο Πληρώθηκε κατά την παράδοση

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

Γλώσσα Προγραμματισμού C Προγραμματισμός C++

Ταυτότητα Εργασίας: #12673861

Σχετικά με την εργασία

29 προτάσεις Απομακρυσμένη εργασία Ενεργό Πριν 7 χρόνια

Ανατέθηκε στον:

vano101

There is my bid. . .

$33 USD σε 1 μέρα
(1444 Αξιολογήσεις)
7.7

29 freelancers κάνουν προσφορές κατά μέσο όρο $95 για αυτή τη δουλειά

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 Περισσότερα

$150 USD σε 1 μέρα
(78 Αξιολογήσεις)
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 σε 2 μέρες
(126 Αξιολογήσεις)
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 Περισσότερα

$150 USD σε 2 μέρες
(153 Αξιολογήσεις)
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. Περισσότερα

$115 USD σε 1 μέρα
(34 Αξιολογήσεις)
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 Περισσότερα

$50 USD σε 3 μέρες
(97 Αξιολογήσεις)
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 σε 3 μέρες
(49 Αξιολογήσεις)
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 σε 1 μέρα
(83 Αξιολογήσεις)
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 Περισσότερα

$35 USD σε 0 μέρες
(48 Αξιολογήσεις)
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. Περισσότερα

$100 USD σε 1 μέρα
(19 Αξιολογήσεις)
4.6
zkutch

Hello More 20 years programming experience. I need more details to set real price and time. Regards. ----------------------------------------------------------------------------------------------------------------- Περισσότερα

$50 USD σε 1 μέρα
(15 Αξιολογήσεις)
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)? Περισσότερα

$80 USD σε 1 μέρα
(1 Κριτική)
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 Περισσότερα

$249 USD σε 3 μέρες
(1 Κριτική)
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 σε 3 μέρες
(1 Κριτική)
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 Περισσότερα

$100 USD σε 1 μέρα
(0 Αξιολογήσεις)
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 σε 2 μέρες
(0 Αξιολογήσεις)
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 σε 3 μέρες
(0 Αξιολογήσεις)
0.0