Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def exp : Parser[Any] = term ~ opt("<"|">"|"<="|">=" ~ term)
- def term : Parser[Any] = term1 ~ opt("=="|"<>" ~ term1)
- def term1: Parser[Any] = term2 ~ rep("&&"|"||" ~ term2)
- def term2: Parser[Any] = term3 ~ rep("+"|"-" ~ term3)
- def term3: Parser[Any] = term4 ~ rep(("*"|"/"|"\\"|"%") ~ term4)
- def term4: Parser[Any] = term5 ~ rep("^" ~ term5)
- def term5: Parser[Any] = opt("!") ~ term6
- def term6: Parser[Any] = opt("-"|"+") ~ term7
- def term7: Parser[Any] = term8 ~ opt("[" ~ exp ~ "]")
- def term8: Parser[Any] = term9 ~ rep("." ~ ident ~ opt("(" ~ explist ~ ")"))
- def term9: Parser[Any] = ("new" ~ ident ~ "(" ~ explist ~ ")")|term10
- def term10: Parser[Any] = ident| lit| "(" ~ exp ~ ")"| "self"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement