public SourceSpan(SourceLocation start, int length) { Start = start; Length = length; }
public static int Compare(SourceLocation x, SourceLocation y) { if (x.Position < y.Position) return -1; if (x.Position == y.Position) return 0; return 1; }
public RuntimeException(String message, Exception inner, SourceLocation location) : base(message, inner) { Location = location; }
private Token CreateSpecialToken(Terminal term, CompilerContext context, SourceLocation location) { return Token.Create(term, context, location, string.Empty); }
public void ReportError(SourceLocation location, string message, params object[] args) { if (Errors.Count >= MaxErrors) return; if (args != null && args.Length > 0) message = string.Format(message, args); Errors.Add(new SyntaxError(location, message)); }
public Token CreateErrorTokenAndReportError(SourceLocation location, string content, string message, params object[] args) { ReportError(location, message, args); Token result = Token.Create(Grammar.SyntaxError, this, location, content); return result; }
public Token CreateErrorToken(SourceLocation location, string content) { return Token.Create(Grammar.SyntaxError, this, location, content); }