Created
October 15, 2020 13:01
-
-
Save rockey5520/aff5abe737bea57f07e4ce845627f1d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.expression; | |
| |
public sealed interface Expr | |
permits ConstantExpr, PlusExpr, TimesExpr, NegExpr {...} | |
| |
public record ConstantExpr(int i) implements Expr {...} | |
public record PlusExpr(Expr a, Expr b) implements Expr {...} | |
public record TimesExpr(Expr a, Expr b) implements Expr {...} | |
public record NegExpr(Expr e) implements Expr {...} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment