Create a PHP normalizer in C

Đã Đóng

I need to make a C program based on Flex/Bison with two funcionalities:

1. executed as a standalone command:

pnorm <path-to-php/html>

2. Provide a function to other C programs... by example:

int pnorm(char *orig_filename, char *dest_filename) { ....... }

> In this case, the output is to dest_filename, not stdout.

The program should read an HTML/PHP file and print to stdout the result.

The result is normalized version of the PHP code.

The process should be done in 2 steps:

STEP 1:

======

- convert $variable= base64_decode(...) in $variable="<printable characters>"

- convert eval(base64_decode(...) in eval("<php code> (printable characters) ");

- convert eval(mutltiple_functions("...")) in eval("<php code> (printable));

Also consider the "string1" . "string2" posibility as the source string

Where multiple_functions are all possible combinations of:

- base64_decode

- str_rot13

- gzinflate

- gzuncompress

- stripslashes

*1 please note that the resulting PHP code is not to be executed, it is just to be analyzed. It can result with syntactic errors.

*2 Consider that there could be necessary to recursivelly do this job. It means that the base64_decode can result as a new encoded string with another combination of these functions.

STEP 2

======

Once all strings are replaced with the decoded version, the software should make the next changes to the code:

1. Take off all the comments (Multi line comments and single line comments)

2. Convert all text to lowercase (statements, strings and every text). Remember that PHP source code is UTF-8

3. Convert all strings delimitators to " (double quote)

4. Convert all strings like "ab" . "cd" to "abcd"

5. Convert all strings like "ab" .chr(65) . "cd" to "abAcd" (only with printable characters)

6. convert "ab" . chr(64+1) ."cd" to "abAcd" (for basic operations: +,-,*,^)

7. Convert all strings like "ab\065" and "ab\x41" to "abA" (only with printable characters)

8. Replace all CR,LF,TAB with a single space

9. Remove all repeated spaces. Example: echo "hello"; -> to echo "hello"

10 Remove reduntant spaces after and before parenthesis, braces and comparison ops:

if ( $a == 2 ) { echo "2"; } --> to --> if ($a==2) {echo "2";}

Be careful with:

1. Segmentation faults

2. buffer overrun

3. memory management

Please try not to use but the standard libraries. (accepted are flex,bison,pcre and the standard libraries)

Also pleaseprovide the makefile.

The HTML code (imagine there is PHP embeded in an HTML file) should be lowered case,removed the CR,LF,TAB, removed the comments. Javascript should be treated as HTML code.

Please make me any question if you need.

Please respect the price you give me. Think well before offer.

Kỹ năng: Lập trình C, PHP, Kiến trúc phần mềm

Xem thêm: Desarrollar logo para nueva empresa de software, Desarrollar logo para nueva empresa de software / Design logo for new software development company, Desarrollar software para admin de historia clínica, Desarrollar software para admin de historia clínica, facturación y agendamiento, Desarrollar software para admon de historia clínica, facturación y agendamiento, Desarrollar software y sitio web, Desarrollar software, Desarrollar software, desarrollar software para hotel, desarrollar software gestion contable ventas facturacion, desarrollar software control clientes, desarrollar software control clientes project, desarrollar software 2, cronograma actividades para desarrollar software, desarrollar software php, php create static pages database, php create multiple choice website, php create image text, php create install database script, php create image function, php create png multiple pngs, mysql data php create dynamic graphs, php create calendar, php create div, php create small database

Mã Dự Án: #14082585

19 freelancer đang chào giá trung bình $184 cho công việc này

Yknox

Hello I'm interesting your project very well I'm a Good C/C++, PHP, Java, Math, Algorithm expert. I m quite well experienced in these jobs. Let's go ahead with me I want to service for you continously. Tha Thêm

$180 USD trong 3 ngày
(482 Đánh Giá)
8.3
hbxfnzwpf

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

$150 USD trong 2 ngày
(97 Đánh Giá)
6.7
techwelf

Hi Let's clarify the requirement in details also if you want us to share our previous work let us know.we have a few questions about your project, please send us message so that we can discuss more. Thanks & regar Thêm

$237 USD trong 10 ngày
(78 Đánh Giá)
6.3
$155 USD trong 3 ngày
(88 Đánh Giá)
5.8
$150 USD trong 3 ngày
(46 Đánh Giá)
5.7
schoudhary1553

Greetings sir, i am an expert freelancer for this job and your 100% satisfaction is assured if you allow me to serve. Here is the reason. Why you should pick me? a) I am a very expert and have the same kind of ex Thêm

$250 USD trong 3 ngày
(22 Đánh Giá)
5.2
dunitech

Hey There !! We have Senn the job post of your And I am very interested to start work with you I am having major 13+ years experience in asp.net,C# mssql,html,html5, .net, mvc, MVC4,MVC5,php, MySQL,css,css3 Thêm

$155 USD trong 3 ngày
(4 Đánh Giá)
4.2
OCTAGRAM

Not sure if flex & co. stuff are appropriate for PHP. I don't know them well enough to make them do the trick, so I'll need custom state machine as lexer. I need some time to understand how to use it with bison. Long s Thêm

$228 USD trong 10 ngày
(13 Đánh Giá)
4.4
polarjin2017

Hello?, how are you? I have read your description in detail. So i can help you. I am experienced in windows and web development with Microsoft technologies using C#, ASP.NET, VB.NET, C++, Java, Android, iPhone and Wor Thêm

$155 USD trong 3 ngày
(5 Đánh Giá)
3.6
bitnester

Dear, I have several years of experience in C programming language. I have implemented several projects related to language translators using Lex and Yacc. I am confident that I can finish the parser according to Thêm

$133 USD trong 5 ngày
(2 Đánh Giá)
3.0
SilentStarMagic

Hi, I am a serious developer who aims to provide high quality services. If you contact me, we can discuss more things detail and will be achieved with each other's purpose. Good luck for your business…

$155 USD trong 2 ngày
(7 Đánh Giá)
3.1
israrsoft

Hello there, Deepak this side from India. Thank you for posting the project, I have studied your requirements... I Have 8+ years of exp in the PHP and I Have a great portfolio as well. I am a team player and Thêm

$155 USD trong 3 ngày
(8 Đánh Giá)
4.1
$208 USD trong 6 ngày
(1 Đánh Giá)
2.6
MetaoriginLab

Hey We are a team of Technical Developers and have got expertise in such stuff. Ping me if you are looking for a quick resolution

$188 USD trong 3 ngày
(2 Đánh Giá)
1.5
workbyz

Hi, I read through your project description very well and I am interested in doing this project. About me, I am a professional software developer with more than 5 years experience in making applications for small and Thêm

$230 USD trong 10 ngày
(0 Đánh Giá)
0.0
shaliniramadass

Hi, we are a 1000 + employee firm. Charging 6$ an hour. Can start any technology immediately. Direct access to developers via Skype, G talk and hotline – 24/7 availability for all 1000+ resource. We can bet you that no Thêm

$155 USD trong 3 ngày
(0 Đánh Giá)
0.0
techlogics4

Dear Prospect Hiring Manager. Thank you for giving me a chance to bid on your project. i am a serious bidder here and i have already worked on a similar project before and can deliver as u have mentioned I have Thêm

$208 USD trong 6 ngày
(1 Đánh Giá)
0.0
khancse3

Hi, I’m dedicated professional Web and Desktop Programmer & Developer and freelancer only. I have been working with challenge and hope to improve future plan with good network every client. If any client want to get Thêm

$155 USD trong 3 ngày
(0 Đánh Giá)
0.0
$207 USD trong 6 ngày
(0 Đánh Giá)
0.0
awame

Hello dear, I have good experience in C programming language. I have been using Lex/Flex and Bison/Yacc tools with several projects related to compilers and query processing tools. I have read and understood all Thêm

$200 USD trong 6 ngày
(3 Đánh Giá)
0.0