assembly and c++
$10-30 USD
着払い
please complete this tassk in c ++
Add the appropriate actions to your parser to translate a source program into Three Address Code. For all class variables you must use offset notation.
Variables will have offsets starting at 0 and increasing based on the size of the variable.
ex. int num, sum;
int ave, limit;
num offset = 0 sum offset = 2
ave offset = 4 limit offset = 6
In three address code the variable limit would be referred to as _BP-6, however you may start your offsets at 2 as discussed in class if you like.
Parameters to methods will be referred to using positive offsets, for example:
Public int proc ( int num1, int num2)
Num2 would have offset 6 and num1 would have offset 4 and num1 would be referred to by _BP+4 as discussed in class. The C style will be used that pushes parameters from right to left.
Use the same name for the three address code file as the program's name only change the extension to .TAC. For example: if the input file is [url removed, login to view] the TAC file would have the name TEST15.tac.
You will need to add the following productions to your parser:
AssignStat -> idt = Expr |
idt = MethodCall |
MethodCall
MethodCall -> [url removed, login to view] ( Params )
ClassName -> idt
Params -> idt ParamsTail |
num ParamsTail|
ParamsTail -> , idt ParamsTail |
, num ParamsTail |
The statement:
[url removed, login to view](x,y);
Will result in the Three Address Statements:
push y
push x
call Proc
The statement:
A = [url removed, login to view](x,y);
Will result in the Three Address Statements:
push y
push x
call Proc
A = _AX
プロジェクトID: #10362155
プロジェクトについて
2人のフリーランサーが、平均$46 で、この仕事に入札しています。
Greetings, This task would be done during a day. Please contact me if it makes you interested my proposition. Thank you,
How are you? I did see your requirements seriously. If you hire me, you will receive enough satisfaction that you want. Also, you will save time and costs. If you want to know about my development ability, see my p もっと