Whitespace and Command-Separating Lexemes

In all lexical states, unescaped newlines produce the NEWLINE token and change the lexical state to be LKEYWORD.

Initial State:

LKEYWORD, LNORM, LFILE, LLINE, LWORD, LSIGNAL, LBPT

Regular Expression: [\n]
Lexeme: NEWLINE
Change to State: LKEYWORD

In all lexical states except LLINE, a semicolon also changes the lexical state to be LKEYWORD.

This is because SEMICOLON is the command separator.

Initial State:

LKEYWORD, LNORM, LFILE, LSIGNAL, LBPT, LWORD

Regular Expression: ";"
Lexeme: SEMICOLON
Change to State: LKEYWORD

Commands can be nested, and the following transitions support this:

Initial State:

LNORM

Regular Expression: "{"
Lexeme: LBRACE
Change to State: LKEYWORD

Initial State:

LKEYWORD, LNORM, LFILE, LSIGNAL, LBPT

Regular Expression: "}"
Lexeme: RBRACE
Change to State: LKEYWORD

In most lexical states, the spaces, tabs, and escaped newlines are ignored. In the LLINE state, the spaces and tabs are part of the line, but escaped newlines are still ignored. In the LWORD state, the spaces and tabs are ignored, but escaped newlines are not.

Initial State:

LKEYWORD, LNORM, LFILE, LSIGNAL, LBPT

Regular Expression: [ \t]
\\\n
Lexeme: Ignored
Change to State: Unchanged

Initial State:

LLINE

Regular Expression: \\\n
Lexeme: Ignored
Change to State: Unchanged

Initial State:

LWORD

Regular Expression: [ \t]
Lexeme: Ignored
Change to State: Unchanged