-
-
Save rla/c9dd48b7db9ae056a651 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
digit(D) --> [D],{member(D, `0123456789`)}. | |
digits([D]) --> digit(D). | |
digits([D|Ds]) --> digit(D), digits(Ds). | |
number_term(N) --> digits(D), {number_codes(N, D)}. | |
infix_op(add) --> `+`. | |
infix_op(sub) --> `-`. | |
expression(N) --> number_term(N). | |
expression(func(Operator, E1, E2)) --> | |
expression(E1), infix_op(Operator), expression(E2). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment