public static Element Parse(string projName, string p, XDocument xdoc, Common.IMarkupErrorLog log) { try { return(Parse(new Parser(projName, p, xdoc, log))); } catch (XmlException e) { log.ReportError(p, e.LineNumber, e.Message); throw; } }
public static Generator Resolve(FileSourceInfo source, AST.Element e, ContentMode contentMode, InstanceType instanceType, Common.IMarkupErrorLog log) { var g = e.Generator; if (g is UnspecifiedGenerator) { var ug = (UnspecifiedGenerator)g; if (contentMode == ContentMode.Default || e.UXKey != null) { if (instanceType == InstanceType.Local) { return(new InstanceGenerator()); } else if (instanceType == InstanceType.Global) { return(new GlobalInstanceGenerator(null)); } else { throw new Exception("Unhandled instance type: " + instanceType); } } else if (contentMode == ContentMode.Template) { var t = (UnspecifiedGenerator)g; return(new TemplateGenerator(null, t.Case, t.IsDefaultCase)); } else { log.ReportError(source.FileName, source.LineNumber, "Unknown content mode: " + contentMode); return(new InstanceGenerator()); } } else { return(g); } }
void ReportError(string message) { _log.ReportError(_filePath, 1, message); }
void ReportError(UXIL.Node node, string message) { _log.ReportError(node.Source.FileName, node.Source.LineNumber, message); }