The following grammar is used for model specification when you do not estimate means and intercepts as explicit model parameters.
ModelSpecification
: Statement*
;
Statement
: EmptyStatement
| AssignmentStatement
| CovarianceStatement
| VariableStatement
;
EmptyStatement
: StatementDelimiter
;
StatementDelimiter
: @SemiColon
| @LineTerminator
;
AssignmentStatement
: @VariableName ( @Assignment | @Dependency ) Expression StatementDelimiterOrDocumentEnd
;
Expression
: AdditiveExpression
;
AdditiveExpression
: PrimaryExpression ( @Addition? AdditiveExpression )?
;
PrimaryExpression
: PrefixedVariableName
| @VariableName
;
PrefixedVariableName
: ParameterSpecification @Asterisk? @VariableName
;
ParameterSpecification
: emptyParen
| (
(
@OpenParenthesis (
StartValue
| ParamNameAndStartValue
| FixedValue
| AltParameterName
) @CloseParenthesis
)
)
;
emptyParen
: @OpenParenthesis @CloseParenthesis
;
StartValue
: Number @AQuestionMark
;
Number
: @IntegerNumber
| @RealNumber
;
ParamNameAndStartValue
: @ParameterName @AColon Number
;
FixedValue
: Number
;
AltParameterName
: @ParameterName
;
StatementDelimiterOrDocumentEnd
: StatementDelimiter
| @DocumentEnd
;
CovarianceStatement
: @VariableName @Covariance? @VariableName ParameterSpecification? StatementDelimiterOrDocumentEnd
;
VariableStatement
: @VariableName ParameterSpecification? StatementDelimiterOrDocumentEnd
;