private void CheckSemantic() { Declaration entryPoint = null; foreach (var program in _programs) { foreach (var d in program.Declarations) { d.AddToScope(_globalScope); if (d.Name == _main) { if (entryPoint != null) { _log.Error("main already defined", d.Line, d.Column); } else { entryPoint = d; } } } } if (entryPoint != null) { entryPoint.CheckSemantic(_globalScope, _log); } }