Main parser interface for generating AST from tokens
The parser is responsible for transforming a stream of tokens into an Abstract
Syntax Tree (AST) that represents the structure of the OpenQASM program. It acts
as a dispatcher, selecting the appropriate version-specific parser based on the
OpenQASM version being used.
The parsing process follows these steps:
Receive tokenized input from the lexer
Determine OpenQASM version (2.0 or 3.0)
Select appropriate parser implementation
Generate version-specific AST nodes
The specific Parser implementations can be found at:
Main parser interface for generating AST from tokens
The parser is responsible for transforming a stream of tokens into an Abstract Syntax Tree (AST) that represents the structure of the OpenQASM program. It acts as a dispatcher, selecting the appropriate version-specific parser based on the OpenQASM version being used.
The parsing process follows these steps:
The specific Parser implementations can be found at:
Example: Basic parsing workflow
Example: Version-specific parsing