Beispiel #1
0
 private void ReportError(SourceLocation location, string message, params object[] args)
 {
     if (args != null && args.Length > 0)
     message = string.Format(message, args);
       _context.AddError(location, message, _currentState);
 }
Beispiel #2
0
 public SourceSpan(SourceLocation start, int length)
 {
     Start = start;
       Length = length;
 }
Beispiel #3
0
 public static Token CreateSyntaxErrorToken(CompilerContext context, SourceLocation location, string message, params object[] args)
 {
     if (args != null && args.Length > 0)
     message = string.Format(message, args);
       return Token.Create(Grammar.SyntaxError, context, location, message);
 }
 private Token CreateSpecialToken(Terminal term, CompilerContext context, SourceLocation location)
 {
     return Token.Create(term, context, location, string.Empty);
 }
Beispiel #5
0
 public void AddError(SourceLocation location, string message)
 {
     this.AddError(location, message, null);
 }
Beispiel #6
0
 public void AddError(SourceLocation location, string message, ParserState state)
 {
     if (Errors.Count < 20) //just for now, 20 is max
     Errors.Add(new SyntaxError(location, message, state));
 }
Beispiel #7
0
 public static Token Create(Terminal term, CompilerContext context, SourceLocation location, string text)
 {
     return(Create(term, context, location, text, text));
 }