Expression Editor
The Expression Editor is a general purpose editor/validator for expressions defined by an
ANTLR grammar and with input contexts described by JSON Schema.
The grammar (in 232) is a small initial subset of the existing expression grammar (Formula.g4). In order to use a
grammar for code completion it is useful to inject various rules to facilitate the discovery of a token's scope wrt
completion.
This uses the Javascript ANTLR4 runtime.
Development
The build:dev target includes a code generation step, based upon the grammar
(Expression.g4), to create various grammar specific source files in a non-repository gen/ directory. The code generator
is Java-based and saved in the repository in the bin/ directory. Directions for running the code generator are
available on the ANTLR site.
Do NOT checkin changes to the grammar without rebuilding and testing - the generated sources might be altered, and
might become incompatible with the other source files.
Future Directions
As the grammar is expanded in subsequent releases we might want to consider the use of this
code completion engine. This was not used in 232 because of
difficulties rolling up the Typescript ANTLR4 runtime upon which it depends. An early cut using this is available on
the branch https://git.soma.salesforce.com/BuilderFramework/builder-framework/tree/drobertson/DO-NOT-DELETE-typescript-completion-engine