The following grammar is used for model specification when you estimate means and intercepts as explicit model parameters.
ModelSpecification
: Statement*
;
Statement
: EmptyStatement
| AssignmentStatement
| CovarianceStatement
| VariableStatement
;
EmptyStatement
: StatementDelimiter
;
StatementDelimiter
: @SemiColon
| @LineTerminator
| @SingleLineCommentStartDelimiter
;
AssignmentStatement
: @VariableName (
@Assignment
| @Dependency
) Expression StatementDelimiterOrDocumentEnd
;
Expression
: ParameterSpecification @Addition AdditiveExpression
;
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
;
AdditiveExpression
: PrimaryExpression ( @Addition? AdditiveExpression )?
;
PrimaryExpression
: PrefixedVariableName
| @VariableName
;
PrefixedVariableName
: ParameterSpecification @Asterisk? @VariableName
;
StatementDelimiterOrDocumentEnd
: StatementDelimiter
| @DocumentEnd
;
CovarianceStatement
: @VariableName @Covariance? @VariableName ParameterSpecification? StatementDelimiterOrDocumentEnd
;
VariableStatement
: @VariableName ( ParameterSpecification @Comma ParameterSpecification )? StatementDelimiterOrDocumentEnd
;