backpatching n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Backpatching PowerPoint Presentation
Download Presentation
Backpatching

Loading in 2 Seconds...

play fullscreen
1 / 11

Backpatching - PowerPoint PPT Presentation


  • 170 Views
  • Uploaded on

Backpatching. דוגמא: switch. דוגמא switch :. הדקדוק. שלבי פיתרון. שלב I – תרשים פריסת הקוד. שלב II – סכימת תירגום. תכונות סמנטיות שנצטרך S – nextlist E – place C – value, quad, nextlist CL – nextlist , quad_list (stack) value_list (stack). שלב II – סכימת תירגום.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Backpatching' - jamal-stevens


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
backpatching

Backpatching

דוגמא: switch

slide6
שלב II – סכימת תירגום
  • תכונות סמנטיות שנצטרך

S –nextlist

E – place

C – value, quad, nextlist

CL – nextlist, quad_list (stack)

value_list (stack)

slide7
שלב II – סכימת תירגום
  • מרקרים שימושים

N →ε

{

N.nextlist = makelist(nextquad);

emit('goto ___');

}

M →ε

{

M.quad = nextquad();

}

slide8
שלב II – סכימת תירגום
  • הכללים סמנטיים:

C →casenum: M S ;break;

{

C.quad = M.quad;

C.value = num.value;

C.nextlist = S.nextlist;

}

slide9
שלב II – הכללים סמנטיים

C L → C

{

CL.quad_list = newstack();

CL.quad_list.push(C.quad);

CL.value_list = newstack();

CL.value_list.push(C.value);

CL.nextlist = C.nextlist;

}

slide10
שלב II – הכללים סמנטיים

C L → C CL1

{

CL.quad_list = CL1.quad_list;

CL.quad_list.push(C.quad);

CL.value_list = CL1. value_list;

CL.value_list.push(C.value);

CL.nextlist = merge(

C.nextlist, CL1.nextlist);

}

slide11
שלב II – הכללים סמנטיים

S → switch(E N){CL}

{

backpatch(N.nextlist, nextquad() );

while (!CL.value_list.empty())

{

value = CL.value_list.pop();

quad= CL. quad_list.pop();

emit('if' || E.place || '='

||value || 'goto‘ ||quad);

}

S.nextlist = merge(CL.nextlist,

makelist(nextquad());

emit(“goto __”);

}