public ANTLRMessage([NotNull] ErrorType errorType, [Nullable] Exception e, IToken offendingToken, params object[] args) { this.errorType = errorType; this.e = e; this.args = args; this.offendingToken = offendingToken; }
public GrammarSemanticsMessage(ErrorType etype, string fileName, IToken offendingToken, params object[] args) : base(etype, offendingToken, args) { this.fileName = fileName; if (offendingToken != null) { line = offendingToken.Line; charPosition = offendingToken.CharPositionInLine; } }
public GrammarSyntaxMessage(ErrorType etype, string fileName, IToken offendingToken, RecognitionException antlrException, params object[] args) : base(etype, antlrException, offendingToken, args) { this.fileName = fileName; this.offendingToken = offendingToken; if (offendingToken != null) { line = offendingToken.Line; charPosition = offendingToken.CharPositionInLine; } }
public ToolMessage(ErrorType errorType, Exception e, params object[] args) : base(errorType, e, new CommonToken(TokenTypes.Invalid), args) { }
public ToolMessage(ErrorType errorType) : base(errorType) { }
public virtual void Panic(ErrorType errorType, params object[] args) { ToolMessage msg = new ToolMessage(errorType, args); Template msgST = GetMessageTemplate(msg); string outputMsg = msgST.Render(); if (FormatWantsSingleLineMessage()) { outputMsg = outputMsg.Replace('\n', ' '); } Panic(outputMsg); }
// S U P P O R T C O D E public virtual void Emit(ErrorType etype, ANTLRMessage msg) { var severity = etype.severity; if (severity == ErrorSeverity.WARNING_ONE_OFF || severity == ErrorSeverity.WARNING) { if (severity == ErrorSeverity.WARNING || !errorTypes.Contains(etype)) { warnings++; tool.Warning(msg); } } else if (severity == ErrorSeverity.ERROR_ONE_OFF || severity == ErrorSeverity.ERROR) { if (severity == ErrorSeverity.ERROR || !errorTypes.Contains(etype)) { errors++; tool.Error(msg); } } errorTypes.Add(etype); }
public virtual void GrammarError(ErrorType etype, string fileName, Antlr.Runtime.IToken token, params object[] args) { ANTLRMessage msg = new GrammarSemanticsMessage(etype, fileName, token, args); Emit(etype, msg); }
public virtual void ToolError(ErrorType errorType, Exception e, params object[] args) { ToolMessage msg = new ToolMessage(errorType, e, args); Emit(errorType, msg); }
/** * Raise a predefined message with some number of parameters for the StringTemplate but for which there * is no location information possible. * @param errorType The Message Descriptor * @param args The arguments to pass to the StringTemplate */ public virtual void ToolError(ErrorType errorType, params object[] args) { ToolError(errorType, null, args); }
public virtual void SyntaxError(ErrorType etype, string fileName, Antlr.Runtime.IToken token, Antlr.Runtime.RecognitionException antlrException, params object[] args) { ANTLRMessage msg = new GrammarSyntaxMessage(etype, fileName, token, antlrException, args); Emit(etype, msg); }
public override void GrammarError(ErrorType etype, Antlr.Runtime.IToken token, params object[] args) { tool.errMgr.GrammarError(etype, SourceName, token, args); }