Skip to content

Commit 3ee58fc

Browse files
committed
fix
1 parent 211a5a6 commit 3ee58fc

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

  • csharp/ToolGood.Algorithm/math
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Antlr4.Runtime;
2+
using Antlr4.Runtime.Misc;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Text;
6+
using ToolGood.Algorithm.Internals.Visitors;
7+
8+
namespace ToolGood.Algorithm.math
9+
{
10+
partial class mathParser
11+
{
12+
private AntlrErrorData ErrorData;
13+
public void AddErrorData(AntlrErrorData data)
14+
{
15+
ErrorData = data;
16+
}
17+
18+
public override void NotifyErrorListeners(IToken offendingToken, string msg, RecognitionException e)
19+
{
20+
ErrorData.IsError = true;
21+
ErrorData.ErrorMsg = msg;
22+
//base.NotifyErrorListeners(offendingToken, msg, e);
23+
}
24+
}
25+
partial class mathLexer
26+
{
27+
private AntlrErrorData ErrorData;
28+
public void AddErrorData(AntlrErrorData data)
29+
{
30+
ErrorData = data;
31+
}
32+
public override void NotifyListeners(LexerNoViableAltException e)
33+
{
34+
ErrorData.IsError = true;
35+
ErrorData.ErrorMsg = "Lexer is err";
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)