java, c, c++, perl related easy questions -- 2

Suljettu Julkaistu 3 vuotta sitten Maksettu toimituksen yhteydessä
Suljettu Maksettu toimituksen yhteydessä

1. Create a code that allows you to create an ordered list of tokens. This code should take in a file as input and process that file for the following lexemes:

• Perl style identifiers

• Literals:

– Java-Style string literals

– C-Style integer literals

– C-Style character literals

– C-Style floating-point literals

• Non-Alphanumeric special symbols that denote ( at least two of which must be more than two characters ):

– Addition

– Assignment

– Subtraction

– Division

– Multiplication

– Increment

– Decrement

– Modulo Operator

– Logical And

– Logical Or

– Logical Not

– Open Code Block

– Close Code Block

– Open Function parameter

– Close Function parameter

You may choose whatever symbol you represent for the special symbol but this must be explained in the comments with the operation represents which symbol. Every type of lexeme defined must have a unique token equivalence. In this language, every identifier must be followed by a non-alphanumeric character (excluding the character) to denote the end of the identifier. In this language, every literal must be followed by white space or a special symbol to mark its end.

2. Write three functions in C or C++: one that declares a large array statically, one that declares the same large array on the stack, and one that creates the same large array from the heap. Call each of the subprograms a large number of times (at least 100,000) and output the time required by each. Explain the results.

3. Write an EBNF or CFG that while handling prefix/preorder Arithmetic Operations (addition, subtraction, multiplication, division, modulo) with the proper order of operations? What all types of parsers can be used to show the syntax for this? Justify your answer.

4. What features of the compilation process allow us to determine the reference environment for any at any given line of code in the program. Answer this question for both dynamic and static scoping? Does the type of scoping change this answer? Explain why?

5. Detail how you would go about adding reserved words into the problem where you are designing your own lexical analyzer? How would you have to change your code? What would you have to add to let users choose a reserve word as an identifier?

6. Write a recursive decent algorithm for a java while statement, a Javas if statement, an logical/mathematical expression based on the rules you created in your lexical analyzer, and a mathematical assignment statement, where the statement may be an empty function. Supply the EBNF rule for each.

7. Given the natural constraints of an RDA explain how you would go about the creation of a Statement function in your RDA that would allow the statement to either be a while statement, an if-statement, or an assignment statement.

8. Perl allows both static and a kind of dynamic scoping. Write a Perl program that uses both and clearly shows the difference in the effect of the two. Explain clearly the difference between the dynamic scoping described in this chapter and that implemented in Perl.

Perl C-ohjelmointi Java C++ -ohjelmointi

Projektin tunnus: #28218619

Tietoa projektista

4 ehdotusta Etäprojekti Aktiivinen 3 vuotta sitten

4 freelanceria on tarjonnut keskimäärin $156 tähän työhön

hbxfnzwpf

I am very proficient in c/c++. I have 17 years c/c++ developing experience now, and have worked for more than 10 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environm Lisää

$200 USD 3 päivässä
(213 arvostelua)
7.3
omer19

Hello. How are you today? I have read your project description clearly. I have developed projects of Perl C Programming Java C++ Programming and have 8 years experience. I want to work with you for a long time. Thank Lisää

$250 USD 17 päivässä
(1 arvostelu)
2.0
evglitp

Dear, sir. I'm very glade to get a chance I bid your task. I'm an expert in C/C++,C#,JAVA .NET and debugging I have a lot of experiences in this aspect 3+ years. If you hire me, you 'll get a good result in a short t Lisää

$140 USD 7 päivässä
(0 arvostelua)
0.0
ashu9560

Hi, I am skilled and experienced in c/c++ Java and Perl. Generally I don't do freelancing. But this project seems to be perfect one for me. Also, I need to pay my credit card bill....so let me know, since it's a mutua Lisää

$35 USD 5 päivässä
(0 arvostelua)
0.0