更新IR,.g4修改

This commit is contained in:
rain2133
2025-06-21 18:06:29 +08:00
parent 3ed1c7fecd
commit 0a04c816cf
4 changed files with 446 additions and 21 deletions

View File

@@ -153,10 +153,10 @@ cond: lOrExp;
lValue: Ident (LBRACK exp RBRACK)*;
// 为了方便测试 primaryExp 可以是一个string
primaryExp: LPAREN exp RPAREN #parenExp
| lValue #lVal
| number #num
| string #str;
primaryExp: LPAREN exp RPAREN
| lValue
| number
| string;
number: ILITERAL | FLITERAL;
unaryExp: primaryExp #primExp