Syntax error on line 16: Syntax Error after keyword next.
    next(BCR_state) :=
