The OpenQASM source code to tokenize
Optionalcursor: numberStarting position in the input string (defaults to 0)
Optionalversion: number | OpenQASMVersionOpenQASM version to use for lexing (defaults to 3.0)
Array of token tuples [TokenType, value?]
Tokenizes OpenQASM source code into an array of tokens.
This is the main entry point for lexical analysis. It automatically selects the appropriate lexer implementation based on the OpenQASM version and returns an array of tokens that can be consumed by the parser.
Each token is represented as a tuple containing: