Common Function Notation

This is a lightweight data-exchange format, where the data is a function call. This does not define any specific function calls, but instead a meta-language, like JSON or XML. It is based on the syntax used by many languages for function calls.

A function is a command that may take inputs and will return an output. There is one outermost function call, and the return value of this function is the value that is intended to be used by the host program. Functions may have functions as parameters. If a function has no parameters, it may be refered to as a constant, although there is no requirement its return value may not be the same after all invocations the parenthesis are probably should be "Should" left out

The implementation I have doesn't support overloading. Additionally, it is expected that strings may be added if the need were to arise. Expect JSON-style strings. Booleans and Null don't need to be explicitly supported, since if needed they can be specified as zero-parameter functions with the appropriate name that returns true, false or null.

Syntax

function
name
name(values)
name
[A-Za-z_][A-Za-z_0-9]*
values
value
value,values
value
function
number

Related Resources

Parser.scala

A sample implementation written in Scala that parses such an object.