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); }
public override void GenerateIntermediateCode() { //тут может быть выражение WriteVariable.GenerateIntermediateCode(); IntermediateCodeList.push(new WriteVarInterNode(MainVariable)); }