Abstract Syntax
The abstract syntax of a language defines its core structure. If you want to elaborate the abstract syntax JSON file, you need to consider: Elements: The elements of the language. If your language is based on UML Activity Diagrams, for example, it might include elements such as activities, decisions, control flows, and forks/joins. The syntax is as follows.
Each element:
- Is a JSON object.
- Should be named in PascalCase notation.
- (Optional) Contain a properties key with an array of JSONs value.
"elements": {
"<nameOfElement>": {
"properties": [
"..."
]
}
}
- Each property is an array that defines the properties of an element. A property is composed of:
- A name key, with a string value in PascalCase notation.
- A type key, with a string value limited to String, Integer and Boolean.
- A comment key, with a string value.
- A possibleValues key a name, a domain or type, possible values and a comment specified as follows.
{
"..."
"properties": [
{
"name": "<nameOfProperty>",
"type": "<AvailablePropertyTypes>", // String, Integer or Boolean
"comment": "<commentOfProperty>",
"possibleValues": "<AvailablePossibleValues>"
}
]
"..."
}
Define the relationships
Define how the concepts relate to each other. For instance, an activity might have multiple outgoing control flows, and a decision might have multiple incoming and outgoing control flows.
Define the language constraints
Identify any constraints on your language. For example, every control flow might need to have a start and end activity.