Skip to content

Instantly share code, notes, and snippets.

@tonyg
Created March 9, 2011 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyg/861726 to your computer and use it in GitHub Desktop.
Save tonyg/861726 to your computer and use it in GitHub Desktop.
Erlang, If You See What I Mean
(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