// This is VISITED only within Expression as an variable // In FunctionDecl and VariableDecl it is added to SymbolTable public override void OnAnalyzerVisit(SemanticAnalyzer analyzer, int block) { BlockId = block; if (true) { symbol = analyzer.FindVariable(BlockId, IdentifierName); Return = (ReturnType)((VariableSymbol)symbol).VariableType; } }
public override ReturnType CalcReturnType(SemanticAnalyzer analyzer) { return(Return == ReturnType.Void ? (ReturnType)analyzer.FindVariable(BlockId, IdentifierName).VariableType : Return); }