完成Parser定义以及表达式解析

This commit is contained in:
2026-02-14 23:03:46 +08:00
parent 35e479fd05
commit 878157c2fc
19 changed files with 771 additions and 102 deletions

View File

@@ -21,14 +21,15 @@ namespace Fig
IdentiExpr, // 标识符表达式
LiteralExpr, // 字面量表达式
UnaryExpr, // 一元表达式
BinaryExpr, // 二元表达式
TernaryExpr, // 三元表达式
PrefixExpr, // 一元 前缀表达式
InfixExpr, // 二元 中缀表达式
};
struct AstNode
{
AstType type = AstType::AstNode;
SourceLocation location;
virtual String toString() const = 0;
};
struct Expr : public AstNode