Семантика языков программирования. Семантический анализ и элементы генерации объектного кода или интерпретации, страница 13

  </rightPart>

 </rule>

 <rule for='GramaConstruction' leftPart='MathExp'>

  <rightPart>

   <symbol>U</symbol>

   <symbol>R</symbol>

  </rightPart>

 </rule>

 <rule for='Classes' leftPart='MethodOrData'>

  <rightPart>

   <string>.</string>

   <action>prog=prog+"."+currentLexem.textOfWord;postFix.push(currentLexem.textOfWord);</action>

   <symbol>id</symbol>

   <action>postFix.push(".");</action>

   <symbol>WhatIsIt</symbol>

  </rightPart>

 </rule>

 <rule for='Classes' leftPart='RestOper'>

  <rightPart>

   <action>firstPriznak=false;</action>

   <string>.</string>

   <action>prog=prog+"."+currentLexem.textOfWord;postFix.push(currentLexem.textOfWord);</action>

   <symbol>id</symbol>

   <action>postFix.push(".");</action>

   <symbol>RestOper</symbol>

  </rightPart>

 </rule>

 <rule for='Classes' leftPart='RestOper'>

  <rightPart>

   <action>funcStack.push(postFix.pop());

funcCall.push(postFix.size());</action>

   <symbol>FunctionArgs</symbol>

  </rightPart>

 </rule>

 <rule for='Classes' leftPart='RestOper'>

  <rightPart>

   <action>funcCall.pop();prog=prog+"=";</action>

   <symbol>assign</symbol>

   <symbol>NowOrExp</symbol>

   <action>postFix.push("&lt;=");</action>

  </rightPart>

 </rule>

 <rule for='Classes' leftPart='LogicOper'>

  <rightPart>

   <symbol>NowOrExp</symbol>

   <action>memoryStack.push(currentLexem.textOfWord);

if(currentLexem.textOfWord.toString().compareTo("=&gt;")==0)

prog=prog+"&gt;=";

else {

     if(currentLexem.textOfWord.toString().compareTo("=&lt;")==0)

prog=prog+"&lt;=";

else {

  if(currentLexem.textOfWord.toString().compareTo("=")==0)

prog=prog+"==";

else

prog=prog+currentLexem.textOfWord;

}}</action>

   <symbol>comp</symbol>

   <symbol>NowOrExp</symbol>

   <action>postFix.push(memoryStack.pop());</action>

  </rightPart>

 </rule>

 <rule for='Classes' leftPart='case'>

  <rightPart>

   <action>caseCount=(Integer)labels.pop();

selectCount=(Integer)labels.peek();

postFix.push("select"+selectCount+"case"+(caseCount++)+":");

labels.push(caseCount);prog=prog+currentLexem.textOfWord+" ";</action>

   <string>case</string>

   <string>(</string>

   <action>postFix.push(currentLexem.textOfWord);prog=prog+currentLexem.textOfWord+":";</action>

   <symbol>const</symbol>

   <action>postFix.push("case");

caseCount=(Integer)labels.pop();

selectCount=(Integer)labels.peek();

postFix.push("select"+selectCount+"case"+caseCount);

postFix.push("JMPF");

labels.push(caseCount);</action>

   <string>)</string>

   <symbol>OperBlock</symbol>

   <symbol>endcase</symbol>

  </rightPart>

 </rule>

 <rule for='Classes' leftPart='MethodArgs'>

  <rightPart>

   <symbol>NowOrExp</symbol>

   <symbol>OtherMethodArg</symbol>

  </rightPart>

 </rule>

 <rule for='Classes' leftPart='MethodArgs'>

  <rightPart>

  </rightPart>

 </rule>

 <rule for='GramaConstruction' leftPart='U'>

  <rightPart>

   <symbol>V</symbol>

   <symbol>W</symbol>

  </rightPart>

 </rule>

 <rule for='Classes' leftPart='R'>