Esempio n. 1
0
 public SourceSpan(SourceLocation start, int length)
 {
     Start = start;
       Length = length;
 }
Esempio n. 2
0
 public static int Compare(SourceLocation x, SourceLocation y)
 {
     if (x.Position < y.Position) return -1;
       if (x.Position == y.Position) return 0;
       return 1;
 }
Esempio n. 3
0
 public RuntimeException(String message, Exception inner, SourceLocation location)
     : base(message, inner)
 {
     Location = location;
 }
Esempio n. 4
0
 private Token CreateSpecialToken(Terminal term, CompilerContext context, SourceLocation location)
 {
     return Token.Create(term, context, location, string.Empty);
 }
Esempio n. 5
0
 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));
 }
Esempio n. 6
0
 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;
 }
Esempio n. 7
0
 public Token CreateErrorToken(SourceLocation location, string content)
 {
     return Token.Create(Grammar.SyntaxError, this, location, content);
 }