Created
March 9, 2011 05:08
-
-
Save tonyg/861726 to your computer and use it in GitHub Desktop.
Erlang, If You See What I Mean
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
(define-language model-erlang | |
(world ((module ...) (actor ...))) | |
(module-dictionary (module ...)) | |
(module (atom ;; module name | |
(atom value) ...)) ;; (constant-name constant-definition) - incl functions | |
(atom string) | |
(actor (pid (message ...) (link ...) (monitor ...) process)) | |
(pid variable-not-otherwise-mentioned) | |
(message any) | |
(link pid) | |
(monitor (pid ref)) | |
(ref variable-not-otherwise-mentioned) | |
(process (module ;; current active module | |
expr)) | |
(value number | |
atom | |
(fun (variable ...) expr)) | |
(expr value | |
variable | |
(call (expr expr) expr ...) ;; module:fun(arg, ...) | |
(call expr expr ...) ;; fun(arg, ...) | |
(send expr expr) | |
(receive (variable) expr) | |
(spawn expr)) | |
(context hole | |
(call (context expr) expr ...) | |
(call (value context) expr ...) | |
(call (value value) value ... context expr ...) | |
(call context expr ...) | |
(call value value ... context expr ...) | |
(send context expr) | |
(send value context))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment