/// <summary> /// Check that variable exists and that it is not used befor it is declared. /// </summary> /// <param name="semActs">The semantic analyser</param> /// <param name="exp">The variable expression</param> private void CheckVariable(SemActs semActs, VariableExpr exp) { if (!_currentSymScope.Contains(exp.Name)) { AddError("Variable " + exp.Name + " does not exist", exp); } }
/// <summary> /// Check that variable exists and that it is not used befor it is declared. /// </summary> /// <param name="semActs">The semantic analyser</param> /// <param name="exp">The variable expression</param> private SemanticCheckResult CheckVariable(SemActs semActs, VariableExpr exp) { if (!_currentSymScope.Contains(exp.Name)) { return(NodeError("Variable " + exp.Name + " does not exist", exp)); } return(SemanticCheckResult.Valid); }
/// <summary> /// Get the symbol associated with the supplied name /// </summary> /// <param name="name">Name of the symbol</param> /// <returns></returns> public bool Contains(string name) { return(_current.Contains(name)); }