feat: 按照open_set中的示例调整语法 (#71)
添加了构建LR分析表冲突的报错 Reviewed-on: PostGuard/Canon#71
This commit is contained in:
6
Canon.Core/Exceptions/ReduceAndShiftConflictException.cs
Normal file
6
Canon.Core/Exceptions/ReduceAndShiftConflictException.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Canon.Core.Exceptions;
|
||||
|
||||
public class ReduceAndShiftConflictException : Exception
|
||||
{
|
||||
|
||||
}
|
||||
17
Canon.Core/Exceptions/ReduceConflictException.cs
Normal file
17
Canon.Core/Exceptions/ReduceConflictException.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Canon.Core.GrammarParser;
|
||||
|
||||
namespace Canon.Core.Exceptions;
|
||||
|
||||
public class ReduceConflictException(LrState originState, Terminator lookAhead, NonTerminator left1, NonTerminator left2)
|
||||
: Exception
|
||||
{
|
||||
public LrState OriginState { get; } = originState;
|
||||
|
||||
public Terminator LookAhead { get; } = lookAhead;
|
||||
|
||||
public NonTerminator Left1 { get; } = left1;
|
||||
|
||||
public NonTerminator Left2 { get; } = left2;
|
||||
|
||||
public override string Message => "Reduce Conflict!";
|
||||
}
|
||||
Reference in New Issue
Block a user