-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
46 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
namespace ConsoleApp8; | ||
using System.Numerics; | ||
|
||
public interface IASTVisitor<T> | ||
namespace ConsoleApp8; | ||
|
||
public interface IASTVisitor<T> where T : INumber<T> | ||
{ | ||
T VisitBinOp(BinOp binOp); | ||
T VisitNum(Num num); | ||
T VisitBinOp(BinOp<T> binOp); | ||
T VisitNum(Num<T> num); | ||
} | ||
|
||
public abstract record AST | ||
public abstract record AST<T> where T : INumber<T> | ||
{ | ||
public abstract T Accept<T>(IASTVisitor<T> visitor); | ||
public abstract T Accept(IASTVisitor<T> visitor); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters