Advertisement
Guest User

ast

a guest
Jan 25th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. Program
  2. Block
  3. FuncDecl
  4. signature: Signature
  5. name: Name(value: "check_if_prime")
  6. parameters: [ Param
  7. name: Name(value: "num")
  8. type: Scheme
  9. type: Int
  10. generic args: None ]
  11. codomain: Scheme
  12. type: Bool
  13. generic args: None
  14. typevars: None
  15. body: Block
  16. ExprInstr
  17. expr: IfInstr
  18. cond: InfixOp
  19. left_operand: Name(value: "num")
  20. right_operand: LitExpr
  21. IntLit(1)
  22. operator: GREATER
  23. body: Block
  24. ForInstr
  25. for: Param
  26. name: Name(value: "i")
  27. type: Unspecified
  28. in: Range
  29. beginning: LitExpr
  30. IntLit(2)
  31. end: Name(value: "num")
  32. step: None
  33. body: Block
  34. ExprInstr
  35. expr: IfInstr
  36. cond: InfixOp
  37. left_operand: InfixOp
  38. left_operand: Name(value: "num")
  39. right_operand: Name(value: "i")
  40. operator: MODULO
  41. right_operand: LitExpr
  42. IntLit(0)
  43. operator: EQ
  44. body: Block
  45. ReturnInstr
  46. Name(value: "false")
  47. else_branch: Block()
  48. ExprInstr
  49. expr: Name(value: "true")
  50. else_branch: Block
  51. ExprInstr
  52. expr: Name(value: "false")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement