Utilities

In addition to the back-end support that JFuncMachine provides, it also has a few utilities for language development, or at least for more rapid prototyping of a language.

S-Expressions

S-expressions can be an easy way to define a language because you don’t have to deal with precedence. The parsing is generally pretty straightforward. The org.jfuncmachine.sexprlang.parser package provides a simple S-expression parser that can read files or parse strings.

S-Expression to Object Mapping

Part of the parsing process of a language is getting it into an intermediate representation, and there are often several layers of intermediate representation. JFuncMachine’s expressions are one form of intermediate representation.

The org.jfuncmachine.sexprlang.translate package provides some utilities for mapping S-expressions directly onto Java objects.

Unification Support

There is a utility class to support type unification. You still have to write the details of the unification. The utilities provide a TypeHolder class that can be unified with other type holders.