diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-11-25 18:27:22 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-11-25 18:27:22 -0600 |
commit | 0b32ceadeace2e5650ecb5fe1daaebc571bb756d (patch) | |
tree | 652805d15a865eea7e2c1047ab90c2903ff200d2 /compilador/astree | |
parent | 4b78bc397a51456bd9d0bf08fbd6b1394b91c288 (diff) | |
download | javanol-0b32ceadeace2e5650ecb5fe1daaebc571bb756d.tar.gz javanol-0b32ceadeace2e5650ecb5fe1daaebc571bb756d.tar.bz2 javanol-0b32ceadeace2e5650ecb5fe1daaebc571bb756d.zip |
¡Expresiones if y while!
Diffstat (limited to 'compilador/astree')
-rw-r--r-- | compilador/astree/expr.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compilador/astree/expr.py b/compilador/astree/expr.py index d5a2cb0..c074553 100644 --- a/compilador/astree/expr.py +++ b/compilador/astree/expr.py @@ -114,9 +114,17 @@ class ReadExpr: # A return statement. # -# return a +# retorna a ReturnExpr = Optional[Expr] +# A while expression. +# +# mientras (cond) { } +@dataclass +class WhileExpr: + cond: Expr + body: Expr + # A Javañol expression. Expr = (AccessExpr | AssignExpr | BinarithmExpr | CallExpr | ConstantExpr | ForExpr | IfExpr | CompoundExpr | |