private void DeclareNewVariable(Identifier key, IResolvable value) { if (ReferenceTables.ContainsIdentifier(key)) { Exceptions.Add(new RedeclaredVariableWarning("Redeclared variable detected: " + key, key.SourceLocation)); } ReferenceTables.SetReference(key, value); }
public void Visit(QuestionUnit node) { ReferenceTables.SetReference(node.Identifier, node.DataType); if (!ReferenceTables.ContainsReference(node.DataType)) { var wrapper = _terminalWrapperFactory.CreateWrapper(node.DataType); node.Value = wrapper; ReferenceTables.SetValue(node.DataType, wrapper); } }
public void Visit(StatementUnit node) { node.Expression.Accept(this); ReferenceTables.SetReference(node.Identifier, node.Expression); }