Expression grammar#
Expression grammar describes precedence, assignment, calls, member access, conditions, lambdas, collection expressions, and other executable expressions.
Source#
| Property | Value |
|---|---|
| Grammar file | packages/business/language/grammar/expression.g4 |
| Grammar name | expression |
| Grammar kind | parser |
| Imports | common, literal |
| Imported by | annotation, api, app, BusinessLanguage, class, controls, entity, enum, errorHandling, field, form, function, iac, interface, module, program, query, rule, service, source_ui, struct, subscription, table, test, validation |
| Direct rule or token count | 161 |
How to use this page#
Read the examples first when authoring Business Language. Use the rule inventory when checking exact grammar coverage or when updating parser, lowering, editor, or documentation behavior.
Entry rules and syntax families#
Start with these rules when reading this grammar: expression, singleExpression, pipelineExpression, errorHandlingExpression, assignmentExpression, businessOperationExpression, conditionalExpression, typeCastingExpression, nullCoalescingExpression, logicalOrExpression.
- Declarations:
variableDeclaration - Statements:
addFieldStatement,attemptStatement,blockStatement,breakStatement,caseStatement,continueStatement,createTableStatement,ddlStatement, and 18 more - Expressions:
additiveExpression,assignmentExpression,businessOperationExpression,conditionalExpression,equalityExpression,errorCheckingExpression,errorHandlingExpression,httpRequestExpression, and 29 more - Clauses:
caseClause,catchClause,defaultClause,finallyClause,matchCaseClause,queryClause,queryExprOrderByClause - Types:
constructorType - Bodies:
queryExpressionBody - Literals:
arrayExpressionLiteral,typedObjectLiteral
Key grammar excerpts#
expression#
expression: singleExpression;singleExpression#
singleExpression
: pipelineExpression
;pipelineExpression#
pipelineExpression: errorHandlingExpression (PIPELINE errorHandlingExpression)*;Complete rule and token inventory#
addFieldStatement, additiveExpression, additiveExpressionNoLambda, argument, argumentList, arguments, arrayComprehension, arrayDestructuring
arrayExpressionElement, arrayExpressionLiteral, assignmentExpression, assignmentExpressionNoLambda, assignmentOperator, attemptStatement, blockStatement, breakStatement
businessOperationExpression, businessOperationExpressionNoLambda, caseClause, caseClauseList, caseStatement, caseStatementList, catchClause, catchClauseList
conditionalExpression, conditionalExpressionNoLambda, constructorType, continueStatement, createTableStatement, ddlStatement, defaultClause, deleteFieldStatement
deleteTableStatement, destructuringAssignment, destructuringElement, destructuringElementList, destructuringPattern, destructuringProperty, destructuringPropertyList, equalityExpression
equalityExpressionNoLambda, errorArgumentList, errorCheckingExpression, errorCheckingExpressionNoLambda, errorHandlingExpression, errorHandlingExpressionNoLambda, expression, expressionSequence
expressionSequenceNoDecl, expressionStatement, finallyClause, forInitializer, forInStatement, forInStatementBare, forStatement, genericArguments
httpRequestExpression, httpRequestMethod, httpRequestOptions, httpRequestPath, httpRequestTarget, identifierName, ifCondition, ifStatement
inlineInitializerExpression, lambdaExpression, lambdaParameter, lambdaParameterList, lockStatement, logicalAndExpression, logicalAndExpressionNoLambda, logicalOrExpression
logicalOrExpressionNoLambda, matchCaseClause, matchStatement, memberAccessName, memberOwnerReference, messageArguments, messageContext, messageContextProperty
messageRaise, multiplicativeExpression, multiplicativeExpressionNoLambda, navigateExpression, newConstructor, newConstructorSuffix, newExpression, nullCheckingExpression
nullCheckingExpressionNoLambda, nullCheckSuffix, nullCoalescingExpression, nullCoalescingExpressionNoLambda, objectCreationExpression, objectDestructuring, parameter, parameterList
pipelineExpression, pipelineExpressionNoLambda, postfixExpression, postfixExpressionNoLambda, postfixSuffix, powerExpression, powerExpressionNoLambda, prefixExpression
prefixExpressionNoLambda, prefixOperator, primaryExpression, primaryExpressionNoLambda, queryClause, queryClauseAssignmentExpression, queryClauseBusinessOperationExpression, queryClauseExpression
queryClauseList, queryExpression, queryExpressionBody, queryExpressionSetOperator, queryExprOrderByClause, queryExprOrderByItem, querySelectExpression, querySelectItem
querySourceExpression, querySubqueryExpression, querySubqueryHead, querySubqueryToken, raiseStatement, rangeExpression, rangeExpressionNoLambda, relationalExpression
relationalExpressionNoLambda, returnStatement, simpleVariableStatement, singleExpression, singleExpressionNoLambda, statement, statementList, statementTerminator
switchCase, switchCaseList, switchExpression, switchStatement, throwStatement, tryStatement, typeArgumentList, typeCastingExpression
typeCastingExpressionNoLambda, typedObjectLiteral, typedObjectLiteralSuffix, typedObjectProperty, typedObjectPropertyList, typedObjectPropertySeparator, unlockStatement, validateExpression
variableDeclaration, variableDeclarationList, variableInitializer, variableStatement, whenCase, whenCaseList, whenExpression, whenStatement
whileStatementExamples#
Conditional expression#
var approval_required: bool = invoice.total > policy.auto_post_limit;Call and member access#
var rounded_total: money = invoice.total.round(currency.decimal_places);Common authoring mistakes#
- Do not copy examples without checking the rule inventory for the exact grammar boundary.
- Do not add behavior that depends on missing configuration or undeclared user-facing errors.
Related guides#
- /language/expressions/
- /language/statements-control-flow/
Authoring notes#
- Keep examples aligned with the grammar source, not with inferred syntax from another language.
- Use declared messages for user-facing failures, and fail closed when required configuration is absent.