Parses an argument value.
Tokens to parse.
An AST node representing the argument value.
Parses a list of argument values.
Tokens to parse.
An array of AST nodes representing the argument values.
Parses a list of identifiers.
Tokens to parse.
An array of AST nodes representing the identifiers.
Calling this method parses the code represented by the provided tokens.
The abstract syntax tree.
Delegates the parsing of the next set of tokens to the appropriate method.
Remaining tokens to parse.
Whether encountered identifiers should be consider variable initializations or references.
A set of AST nodes.
OpenQASM 2.0 Parser
A straightforward recursive descent parser for OpenQASM 2.0 that produces a simplified AST structure appropriate for the more limited feature set of the 2.0 language specification.
Example: Basic parsing workflow