-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create symbols for gates in standard library (#185)
This commit implements the following. Upon encountering `include "stdgates.qasm"` symbols are created for gates in the standard library according to the spec. No corresponding file need exist. None is actually read or included. If there is such a file in the include path, it is ignored. Symbols carry a name and a type. The type `Gate` is parameterized by number of qubits and number of classical parameters. So the symbols created contain all the information that a declaration (but not definition) of the gate would carry. At the level of this parser/analyzer, this allows the gates to be used (called) after the include statement and allows type-checking to ensure that they are called with valid parameters (The latter is only partly implemented at the time of this commit.) If a name in the standard library is already bound, then a semantic error is recorded. Since no real file is actually included, the location associated with the error is that of the `include` statement.
- Loading branch information
Showing
6 changed files
with
118 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters