示例#1
0
 public override bool SemanticAnalysis()
 {
     try
     {
         IsSemanticCorrect = WriteVariable.SemanticAnalysis();
         WriteVariable.MainVariable.WasUsed         = true;
         WriteVariable.MainVariable.WasNewValueUsed = true;
         MainVariable = WriteVariable.MainVariable;
         if (!WriteVariable.MainVariable.WasIdentified)
         {
             throw new UnidentifiedVariableException(WriteVariable.LineNumber, WriteVariable.MainVariable.Name);
         }
     }
     catch (SemanticException e)
     {
         Console.WriteLine(e.Message);
         IsSemanticCorrect = false;
     }
     return(IsSemanticCorrect);
 }
示例#2
0
 public override void GenerateIntermediateCode()
 {
     //тут может быть выражение
     WriteVariable.GenerateIntermediateCode();
     IntermediateCodeList.push(new WriteVarInterNode(MainVariable));
 }