Find Jobs
Hire Freelancers

I need to execute the code for a parsed input

$10-30 USD

Dibatalkan
Disiarkan lebih dari 7 tahun yang lalu

$10-30 USD

Dibayar semasa penghantaran
PROJECT DESCRIPTION For this assignment we are expanding on assignment 3. Now that we have parsed input, we will execute the code. As a reminder, the language has the following rules: 1. An empty string is a semantic error. 2. The language contains only two types: a string and an integer. 3. The language contains only two statements: a print statement, and a set statement. 4. PRINT means evaluate the expression and printing the result on standard out. 5. SET means evaluate the expression and save the value in the variable named ID 6. It is an error to use a variable that has not been set. 7. The addition and multiplication operators associate left-to-right. 8. Addition is defined only between two integers or two strings. String addition is concatenation. 9. Multiplication is defined between two integers or between an integer and a string. Multiplying a string by an integer X repeats the string X times. 10. The language includes a subscripting operator which may have one or two expressions inside the square bracket, separated by a semicolon. Both expressions must evaluate to integers, which are used as indexes into the string (starting, of course, from zero). A single expression results in a string containing the single character at that position. Two expressions results in a substring beginning at the first position and ending at the character before the second position. If either of the expressions would access a character that is not in the string, this will be deemed a runtime error. 11. All other combination of types and operations are undefined. For this assignment, after parsing you must perform all semantic checks and execute the program. Please note that some of the checks can be performed statically (an empty string constant is an error, and using a variable before setting it is an error), but some can only be performed at run time. Failing a static check should print an error message and stop execution. Failing a dynamic check should print the string RUNTIME ERROR followed by a description of the error (for example; RUNTIME ERROR types being added are not permitted). Observe that doing this assignment involves evaluating the parse tree, which is a recursive operation. Defining a virtual eval() function, with different implementations in different classes, is a useful approach. It’s also likely that you will need to define some idea of a Type and a Value for this assignment. The eval() function will likely want to return a Value, and will need to test a Type. Your program should read the file whose name is passed as a command line argument, or the standard input if no command line argument is provided. You may divide this assignment into as many files as you like. You MUST use p2lex.h from the last assignment, with no changes. You MUST have your lexical analyzer in a separate file.
ID Projek: 12511277

Tentang projek

10 cadangan
Projek jarak jauh
Aktif 7 tahun yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
10 pekerja bebas membida secara purata $70 USD untuk pekerjaan ini
Avatar Pengguna
Hi, I'm a OS expert experienced C/C++/ObjC developing. I can develop almost kinds of C/C++/ObjC codes for any OS : Windows, Linux, MAC OS X... I can use almost of develop libraries such as QT, MFC, boost... and IDE tools that you prefer. I had done several developing tasks related operating systems or applications. I can also develop IPhone/IPad Apps with Corona SDK, Obj C, QT and Swift Please check my profile and contact with me. Best regards!
$54 USD dalam 1 hari
5.0 (206 ulasan)
9.0
9.0
Avatar Pengguna
A proposal has not yet been provided
$120 USD dalam 3 hari
4.9 (337 ulasan)
7.2
7.2
Avatar Pengguna
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 environment. I used c++ to make many great projects, for example, I made the tools which can convert java files into c++ scripts, of course garbage collection included, this job is very similar to a compiler, and is very complex. I also made our own mobile game using c++, I can show you the demo of client, if you like. I am very proficient in java also. I have a very good review on Freelancer.com, I never miss a project once I accept the job, you can check my review. Trust me, please let expert help you.
$150 USD dalam 2 hari
4.9 (113 ulasan)
6.9
6.9
Avatar Pengguna
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 and we can move forward to the next step. Thanks, Joseph C Ocero
$99 USD dalam 1 hari
5.0 (12 ulasan)
4.6
4.6
Avatar Pengguna
hey :), what is the deadline for the project? .
$45 USD dalam 1 hari
4.8 (6 ulasan)
3.0
3.0
Avatar Pengguna
According to description basically Semantical analyzer for a Language Compiler step1: Based on the BNF or Grammar of Language type information can be collected at lexical analysis only step2: Depending on output form of parser(syntax tree or parse tree) and Grammar of Language Type checking can be done
$40 USD dalam 2 hari
4.9 (3 ulasan)
2.3
2.3
Avatar Pengguna
I have been working as a software developer for more than one and half year on C++ and having good knowledge of algorithms and data structures and good problem solving skills
$30 USD dalam 3 hari
3.6 (4 ulasan)
2.9
2.9
Avatar Pengguna
I AM GOOD IN C C++ C# AND JAVA I CAN DO IT AS I AM A STUDENT AND KNOW HOW TO DEAL WITH ASSIGNMENTS VERY WELL.
$25 USD dalam 10 hari
0.0 (1 ulasan)
0.0
0.0
Avatar Pengguna
good in c++ programming and logically good to perform task accurately
$111 USD dalam 3 hari
0.0 (0 ulasan)
0.0
0.0
Avatar Pengguna
senior javascript developer, a c lover. need rating and some interest jobs.
$25 USD dalam 2 hari
0.0 (0 ulasan)
0.0
0.0

Tentang klien

Bendera PAKISTAN
LAHORE, Pakistan
5.0
6
Ahli sejak Ogo 6, 2016

Pengesahan Klien

Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.