diff options
Diffstat (limited to 'compilador/astree')
-rw-r--r-- | compilador/astree/expr.py | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/compilador/astree/expr.py b/compilador/astree/expr.py index c074553..527e606 100644 --- a/compilador/astree/expr.py +++ b/compilador/astree/expr.py @@ -49,6 +49,13 @@ class BinarithmExpr: lvalue: Expr rvalue: Expr +# A break expression. +# +# detener +@dataclass +class BreakExpr: + pass + # A function call expression. # # foo(bar) @@ -68,6 +75,13 @@ class CallExpr: class CompoundExpr: exprs: List[Expr] +# A continue expression. +# +# continuar +@dataclass +class ContinueExpr: + pass + # A scalar value. Value = bool | str | int | type(None) @@ -115,7 +129,9 @@ class ReadExpr: # A return statement. # # retorna a -ReturnExpr = Optional[Expr] +@dataclass +class ReturnExpr: + expr: Optional[Expr] # A while expression. # @@ -126,6 +142,7 @@ class WhileExpr: body: Expr # A Javañol expression. -Expr = (AccessExpr | AssignExpr | BinarithmExpr | CallExpr | - ConstantExpr | ForExpr | IfExpr | CompoundExpr | - PrintExpr | ReadExpr | ReturnExpr) +Expr = (AccessExpr | AssignExpr | BinarithmExpr | BreakExpr | + CallExpr | ConstantExpr | ContinueExpr | ForExpr | + IfExpr | CompoundExpr | PrintExpr | ReadExpr | + ReturnExpr) |