WHITESPACE = _{ " " | "\t" } // Allow tabs and multiple spaces instruction = { ASCII_ALPHA+ } // Instruction, e.g., "CLS" or "LDX" parameter = { ("0x" | "0X") ~ ASCII_HEX_DIGIT+ } // Parameter format, e.g., "0X250" comment = { ";" ~ (!"\n" ~ ANY)* } // Capture everything after ";", up to end of line parameters = { (parameter ~ (WHITESPACE* ~ ","* ~ WHITESPACE* ~ parameter)*)?} // Zero or more parameters record = { instruction ~ WHITESPACE* ~ parameters ~ WHITESPACE* ~ comment? } // Record structure file = { SOI ~ (record ~ (("\r\n" | "\n") | WHITESPACE*))* ~ EOI } // Allow for trailing newlines and empty lines