Exemplo n.º 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);
 }
Exemplo n.º 2
0
 public SourceSpan(SourceLocation start, int length)
 {
     Start = start;
       Length = length;
 }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 private Token CreateSpecialToken(Terminal term, CompilerContext context, SourceLocation location)
 {
     return Token.Create(term, context, location, string.Empty);
 }
Exemplo n.º 5
0
 public void AddError(SourceLocation location, string message)
 {
     this.AddError(location, message, null);
 }
Exemplo n.º 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));
 }
Exemplo n.º 7
0
 public static Token Create(Terminal term, CompilerContext context, SourceLocation location, string text)
 {
     return(Create(term, context, location, text, text));
 }