quantum-circuit
Version:
Quantum Circuit Simulator
1,232 lines (1,041 loc) • 9.13 MB
JavaScript
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.QuantumCircuit = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
/**
* @license
*
* Copyright (c) 2016, Petar Korponaić <petar.korponaic@gmail.com>
*
* This source code is licensed under the MIT License, found in
* the LICENSE.txt file in the root directory of this source tree.
*/
var antlr4 = require('antlr4/index');
var QASMLexer = require('./QASMLexer');
var QASMParser = require('./QASMParser').QASMParser;
var QASMListener = require('./QASMListener').QASMListener;
var ErrorListener = function(errors) {
antlr4.error.ErrorListener.call(this);
this.errors = errors;
return this;
};
ErrorListener.prototype = Object.create(antlr4.error.ErrorListener.prototype);
ErrorListener.prototype.constructor = ErrorListener;
ErrorListener.prototype.syntaxError = function(rec, sym, line, col, msg, e) {
this.errors.push({
line: line,
col: col,
msg: msg
});
};
var QCQASMListener = function(circuit, compatibilityMode) {
this.circuit = circuit;
this.qregMap = {};
this.condition = {};
this.compatibilityMode = compatibilityMode;
QASMListener.call(this); // inherit default listener
return this;
};
var QASMImport = function(circuit, input, errorCallback, compatibilityMode) {
var chars = new antlr4.InputStream(input);
var lexer = new QASMLexer.QASMLexer(chars);
var tokens = new antlr4.CommonTokenStream(lexer);
var parser = new QASMParser(tokens);
parser.buildParseTrees = true;
parser.removeErrorListeners();
var errors = [];
var errorListener = new ErrorListener(errors);
parser.addErrorListener(errorListener);
var tree = parser.mainprog();
var QASM = new QCQASMListener(circuit, compatibilityMode);
antlr4.tree.ParseTreeWalker.DEFAULT.walk(QASM, tree);
if(errorCallback) {
errorCallback(errors);
}
};
// inherit default listener
QCQASMListener.prototype = Object.create(QASMListener.prototype);
QCQASMListener.prototype.constructor = QCQASMListener;
QCQASMListener.prototype.numQbit = function() {
var num = 0;
for(var reg in this.qregMap) {
num += this.qregMap[reg];
}
return num;
};
QCQASMListener.prototype.qregBase = function(qreg) {
var base = 0;
for(var reg in this.qregMap) {
if(reg == qreg) {
return base;
}
base += this.qregMap[reg];
}
return base;
};
QCQASMListener.prototype.qregLen = function(reg) {
return this.qregMap[reg] || 0;
};
// Enter a parse tree produced by QASMParser#mainprog.
QCQASMListener.prototype.enterMainprog = function(ctx) {
};
// Exit a parse tree produced by QASMParser#mainprog.
QCQASMListener.prototype.exitMainprog = function(ctx) {
};
// Enter a parse tree produced by QASMParser#statement.
QCQASMListener.prototype.enterStatement = function(ctx) {
var self = this;
// condition
var name = ctx.getChildCount() ? ctx.getChild(0).getText() : "";
if(name == "if") {
this.condition = {
creg: ctx.ID().getText(),
value: parseInt(ctx.INT().getText())
}
}
if(name == "barrier") {
var idlist = ctx.anylist() ? ctx.anylist().idlist() : null;
var mixedlist = ctx.anylist() ? ctx.anylist().mixedlist() : null;
if(idlist) {
//
// arguments are entire registers
// example: cx q,r;
//
var wires = [];
var regCount = idlist.ID().length;
for(var regIndex = 0; regIndex < regCount; regIndex++) {
var regName = idlist.ID()[regIndex].getText();
var numBits = self.qregLen(regName);
for(var bit = 0; bit < numBits; bit++) {
var wire = bit + self.qregBase(regName);
wires.push(wire);
}
}
var destCol = self.circuit.lastNonEmptyPlace(wires, false);
destCol += 1;
wires.map(function(destWire) {
self.circuit.addGate(name, destCol, destWire);
});
}
// arguments are qbits or mixed
if(mixedlist) {
if(mixedlist.ID().length != mixedlist.INT().length) {
//
// TODO: mixed qbits and entire registers
// example: cx q,r[0];
//
} else {
//
// qbits, for example: cx q[0],r[0];
//
var args = [];
var count = mixedlist.ID().length;
for(var i = 0; i < count; i++) {
args.push({ reg: mixedlist.ID()[i].getText(), bit: parseInt(mixedlist.INT()[i].getText()) });
}
var wires = [];
args.map(function(a) {
wires.push(a.bit + self.qregBase(a.reg));
});
self.circuit.addGate(name, -1, wires, {});
}
}
}
// subroutine (gate declaration)
if(ctx.gatedecl()) {
var gatedecl = ctx.gatedecl();
var args = [];
var params = [];
var ccount = gatedecl.getChildCount();
if(ccount > 2 && gatedecl.getChild(2).ID) {
// no params
args = gatedecl.getChild(2).ID();
} else {
if(ccount > 3 && gatedecl.getChild(3).ID) {
params = gatedecl.getChild(3).ID();
}
if(ccount > 5 && gatedecl.getChild(5).ID) {
// no params
args = gatedecl.getChild(5).ID();
}
}
var proto = Object.getPrototypeOf(this.circuit);
var customGate = new proto.constructor(args.length);
var customGateName = gatedecl.ID().getText();
var customGateRegs = [];
args.map(function(reg) {
customGateRegs.push(reg.getText());
});
params.map(function(par) {
var parName = par.getText();
customGate.params.push(parName);
});
if(ctx.goplist()) {
var goplist = ctx.goplist();
goplist.children.forEach(function(child, childIndex) {
if (child instanceof QASMParser.UopContext) {
// This child is a 'uop' operation
var uop = child;
var gateName = uop.ID() ? uop.ID().getText() : "";
if(gateName) {
var idlist = uop.anylist() ? uop.anylist().idlist() : null;
var mixedlist = uop.anylist() ? uop.anylist().mixedlist() : null;
var explist = uop.explist();
switch(gateName) {
case "CX": gateName = "cx"; break;
case "U": gateName = "u3"; break;
}
if(!self.circuit.basicGates[gateName] && !self.circuit.customGates[gateName]) {
// find gate by qasm name
for(var tmpName in self.circuit.basicGates) {
var tmpDef = self.circuit.basicGates[tmpName];
if(tmpDef.exportInfo && tmpDef.exportInfo.qasm && tmpDef.exportInfo.qasm.name && tmpDef.exportInfo.qasm.name == gateName) {
gateName = tmpName;
break;
}
// newer versions of qiskit exports to qasm with gate names undefined by qasm 2.0 definition...
if(tmpDef.exportInfo && tmpDef.exportInfo.qiskit && tmpDef.exportInfo.qiskit.name && tmpDef.exportInfo.qiskit.name == gateName) {
gateName = tmpName;
break;
}
}
}
var params = {};
if(explist && explist.exp()) {
var gateDef = self.circuit.basicGates[gateName];
if(!gateDef) {
gateDef = self.circuit.customGates[gateName];
}
if(gateDef) {
var paramList = explist.exp();
var paramDef = gateDef.params || [];
paramList.map(function(paramItem, paramIndex) {
var paramValue = paramItem.getText();
var paramName = paramDef.length >= paramIndex ? paramDef[paramIndex] : "";
if(paramName) {
params[paramName] = paramValue;
}
});
}
}
var options = { params: params };
var wires = [];
if(idlist) {
var count = idlist.ID().length;
for(var i = 0; i < count; i++) {
wires.push(customGateRegs.indexOf(idlist.ID()[i].getText()));
}
}
if(mixedlist) {
// ?
}
var external = self.circuit.customGates[gateName];
if(external) {
customGate.registerGate(gateName, JSON.parse(JSON.stringify(external)));
}
customGate.addGate(gateName, -1, wires, options);
}
} else {
var gateName = child.getText ? child.getText() : "";
if(gateName) {
switch(gateName) {
case "barrier": {
if(goplist.children.length > childIndex + 1) {
idlist = goplist.children[childIndex + 1];
if(idlist && idlist.ID) {
var wires = [];
if(idlist) {
var count = idlist.ID().length;
for(var i = 0; i < count; i++) {
wires.push(customGateRegs.indexOf(idlist.ID()[i].getText()));
}
var options = { params: {} };
customGate.addGate(gateName, -1, wires, options);
}
}
}
}; break;
}
}
}
});
}
this.circuit.registerGate(customGateName, customGate.save(false));
}
};
// Exit a parse tree produced by QASMParser#statement.
QCQASMListener.prototype.exitStatement = function(ctx) {
};
// Enter a parse tree produced by QASMParser#version.
QCQASMListener.prototype.enterVersion = function(ctx) {
};
// Exit a parse tree produced by QASMParser#version.
QCQASMListener.prototype.exitVersion = function(ctx) {
};
// Enter a parse tree produced by QASMParser#decl.
QCQASMListener.prototype.enterDecl = function(ctx) {
switch(ctx.getChild(0).getText()) {
case "qreg": this.qregMap[ctx.getChild(1).getText()] = parseInt(ctx.getChild(3).getText()); break;
case "creg": this.circuit.createCreg(ctx.getChild(1).getText(), parseInt(ctx.getChild(3).getText())); break;
}
};
// Exit a parse tree produced by QASMParser#decl.
QCQASMListener.prototype.exitDecl = function(ctx) {
};
// Enter a parse tree produced by QASMParser#gatedecl.
QCQASMListener.prototype.enterGatedecl = function(ctx) {
};
// Exit a parse tree produced by QASMParser#gatedecl.
QCQASMListener.prototype.exitGatedecl = function(ctx) {
};
// Enter a parse tree produced by QASMParser#goplist.
QCQASMListener.prototype.enterGoplist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#goplist.
QCQASMListener.prototype.exitGoplist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#qop.
QCQASMListener.prototype.enterQop = function(ctx) {
var self = this;
var condition = JSON.parse(JSON.stringify(this.condition));
this.condition = {};
var name = ctx.getChildCount() ? ctx.getChild(0).getText() : "";
if(name == "reset") {
var qreg = "";
var qbit = -1;
var count = ctx.argument().length;
for(var i = 0; i < count; i++) {
var arg = ctx.argument()[i];
if(i == 0) {
qreg = arg.ID().getText();
qbit = arg.INT() ? parseInt(arg.INT().getText()) : -1;
}
}
if(qreg) {
var numBits = self.qregLen(qreg);
if(qbit < 0) {
//
// argument is entire register
//
for(var x = 0; x < numBits; x++) {
self.circuit.addGate("reset", -1, x + self.qregBase(qreg), { condition: condition || {} } );
}
} else {
//
// both arguments are single bits
//
self.circuit.addGate("reset", -1, qbit + self.qregBase(qreg), { condition: condition || {} } );
}
}
}
if(name == "measure") {
var qreg = "";
var qbit = -1;
var creg = "";
var cbit = -1;
var count = ctx.argument().length;
for(var i = 0; i < count; i++) {
var arg = ctx.argument()[i];
if(i == 0) {
qreg = arg.ID().getText();
qbit = arg.INT() ? parseInt(arg.INT().getText()) : -1;
}
if(i == 1) {
creg = arg.ID().getText();
cbit = arg.INT() ? parseInt(arg.INT().getText()) : -1;
}
}
if(qreg && creg) {
var numBits = self.qregLen(qreg);
if(qbit < 0 && cbit < 0) {
//
// both arguments are entire registers
//
for(var x = 0; x < numBits; x++) {
self.circuit.addGate("measure", -1, x + self.qregBase(qreg), { creg: { name: creg, bit: x }, condition: condition || {} } );
}
} else {
if(qbit >= 0 && cbit >= 0) {
//
// both arguments are single bits
//
self.circuit.addGate("measure", -1, qbit + self.qregBase(qreg), { creg: { name: creg, bit: cbit }, condition: condition || {} } );
} else {
if(qbit >= 0 && cbit < 0) {
//
// qbit is single, creg is entire register
//
for(var x = 0; x < numBits; x++) {
self.circuit.addGate("measure", -1, qbit + self.qregBase(qreg), { creg: { name: creg, bit: x }, condition: condition || {} } );
}
} else {
//
// qbit is entire register, creg is single bit
//
for(var x = 0; x < numBits; x++) {
self.circuit.addGate("measure", -1, x + self.qregBase(qreg), { creg: { name: creg, bit: cbit }, condition: condition || {} } );
}
}
}
}
}
}
var uop = ctx.uop();
if(uop && uop.ID()) {
var gateName = uop.ID().getText();
var idlist = uop.anylist() ? uop.anylist().idlist() : null;
var mixedlist = uop.anylist() ? uop.anylist().mixedlist() : null;
var explist = uop.explist();
switch(gateName) {
case "CX": gateName = "cx"; break;
case "U": gateName = "u3"; break;
}
if(!self.circuit.basicGates[gateName] && !self.circuit.customGates[gateName]) {
// find gate by qasm name
for(var tmpName in self.circuit.basicGates) {
var tmpDef = self.circuit.basicGates[tmpName];
if(tmpDef.exportInfo && tmpDef.exportInfo.qasm && tmpDef.exportInfo.qasm.name && tmpDef.exportInfo.qasm.name == gateName) {
gateName = tmpName;
break;
}
// newer versions of qiskit exports to qasm with gate names undefined by qasm 2.0 definition...
if(tmpDef.exportInfo && tmpDef.exportInfo.qiskit && tmpDef.exportInfo.qiskit.name && tmpDef.exportInfo.qiskit.name == gateName) {
gateName = tmpName;
break;
}
}
}
var params = {};
if(explist && explist.exp()) {
var gateDef = self.circuit.basicGates[gateName];
if(!gateDef) {
gateDef = self.circuit.customGates[gateName];
}
if(gateDef) {
var paramList = explist.exp();
var paramDef = gateDef.params || [];
paramList.map(function(paramItem, paramIndex) {
var paramValue = paramItem.getText();
var paramName = paramDef.length >= paramIndex ? paramDef[paramIndex] : "";
if(paramName) {
params[paramName] = paramValue;
}
});
}
}
var options = { params: params, condition: condition || {} };
if(idlist) {
//
// arguments are entire registers
// example: cx q,r;
//
var numBits = self.qregLen(idlist.ID()[0].getText());
for(var x = 0; x < numBits; x++) {
var args = [];
var count = idlist.ID().length;
for(var i = 0; i < count; i++) {
args.push({ reg: idlist.ID()[i].getText(), bit: x });
}
var wires = [];
args.map(function(a) {
wires.push(a.bit + self.qregBase(a.reg));
});
self.circuit.addGate(gateName, -1, wires, options);
}
}
// arguments are qbits or mixed
if(mixedlist) {
if(mixedlist.ID().length != mixedlist.INT().length) {
//
// TODO: mixed qbits and entire registers
// example: cx q,r[0];
//
} else {
//
// qbits, for example: cx q[0],r[0];
//
var args = [];
var count = mixedlist.ID().length;
for(var i = 0; i < count; i++) {
args.push({ reg: mixedlist.ID()[i].getText(), bit: parseInt(mixedlist.INT()[i].getText()) });
}
var wires = [];
args.map(function(a) {
wires.push(a.bit + self.qregBase(a.reg));
});
self.circuit.addGate(gateName, -1, wires, options);
}
}
}
};
// Exit a parse tree produced by QASMParser#qop.
QCQASMListener.prototype.exitQop = function(ctx) {
};
// Enter a parse tree produced by QASMParser#uop.
QCQASMListener.prototype.enterUop = function(ctx) {
};
// Exit a parse tree produced by QASMParser#uop.
QCQASMListener.prototype.exitUop = function(ctx) {
};
// Enter a parse tree produced by QASMParser#anylist.
QCQASMListener.prototype.enterAnylist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#anylist.
QCQASMListener.prototype.exitAnylist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#idlist.
QCQASMListener.prototype.enterIdlist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#idlist.
QCQASMListener.prototype.exitIdlist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#mixedlist.
QCQASMListener.prototype.enterMixedlist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#mixedlist.
QCQASMListener.prototype.exitMixedlist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#argument.
QCQASMListener.prototype.enterArgument = function(ctx) {
};
// Exit a parse tree produced by QASMParser#argument.
QCQASMListener.prototype.exitArgument = function(ctx) {
};
// Enter a parse tree produced by QASMParser#explist.
QCQASMListener.prototype.enterExplist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#explist.
QCQASMListener.prototype.exitExplist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#exp.
QCQASMListener.prototype.enterExp = function(ctx) {
};
// Exit a parse tree produced by QASMParser#exp.
QCQASMListener.prototype.exitExp = function(ctx) {
};
// Enter a parse tree produced by QASMParser#unaryop.
QCQASMListener.prototype.enterUnaryop = function(ctx) {
};
// Exit a parse tree produced by QASMParser#unaryop.
QCQASMListener.prototype.exitUnaryop = function(ctx) {
};
module.exports = QASMImport;
},{"./QASMLexer":2,"./QASMListener":3,"./QASMParser":4,"antlr4/index":47}],2:[function(require,module,exports){
// Generated from QASM.g4 by ANTLR 4.7.1
// jshint ignore: start
var antlr4 = require('antlr4/index');
var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
"\u0002-\u0124\b\u0001\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004",
"\u0004\t\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t",
"\u0007\u0004\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004",
"\f\t\f\u0004\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010",
"\t\u0010\u0004\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013",
"\u0004\u0014\t\u0014\u0004\u0015\t\u0015\u0004\u0016\t\u0016\u0004\u0017",
"\t\u0017\u0004\u0018\t\u0018\u0004\u0019\t\u0019\u0004\u001a\t\u001a",
"\u0004\u001b\t\u001b\u0004\u001c\t\u001c\u0004\u001d\t\u001d\u0004\u001e",
"\t\u001e\u0004\u001f\t\u001f\u0004 \t \u0004!\t!\u0004\"\t\"\u0004#",
"\t#\u0004$\t$\u0004%\t%\u0004&\t&\u0004\'\t\'\u0004(\t(\u0004)\t)\u0004",
"*\t*\u0004+\t+\u0004,\t,\u0003\u0002\u0003\u0002\u0003\u0003\u0003\u0003",
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0004",
"\u0003\u0004\u0003\u0005\u0003\u0005\u0003\u0006\u0003\u0006\u0003\u0007",
"\u0003\u0007\u0003\u0007\u0003\b\u0003\b\u0003\b\u0003\t\u0003\t\u0003",
"\t\u0003\t\u0003\t\u0003\t\u0003\t\u0003\t\u0003\n\u0003\n\u0003\n\u0003",
"\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\u000b\u0003\u000b\u0003",
"\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003",
"\f\u0003\f\u0003\f\u0003\f\u0003\f\u0003\r\u0003\r\u0003\u000e\u0003",
"\u000e\u0003\u000f\u0003\u000f\u0003\u000f\u0003\u000f\u0003\u000f\u0003",
"\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0010\u0003\u0011\u0003",
"\u0011\u0003\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003\u0012\u0003",
"\u0012\u0003\u0012\u0003\u0012\u0003\u0013\u0003\u0013\u0003\u0013\u0003",
"\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003\u0014\u0003",
"\u0015\u0003\u0015\u0003\u0016\u0003\u0016\u0003\u0016\u0003\u0017\u0003",
"\u0017\u0003\u0018\u0003\u0018\u0003\u0019\u0003\u0019\u0003\u001a\u0003",
"\u001a\u0003\u001b\u0003\u001b\u0003\u001c\u0003\u001c\u0003\u001d\u0003",
"\u001d\u0003\u001d\u0003\u001d\u0003\u001e\u0003\u001e\u0003\u001e\u0003",
"\u001e\u0003\u001f\u0003\u001f\u0003\u001f\u0003\u001f\u0003 \u0003",
" \u0003 \u0003 \u0003!\u0003!\u0003!\u0003\"\u0003\"\u0003\"\u0003\"",
"\u0003\"\u0003#\u0003#\u0003#\u0003$\u0003$\u0003$\u0003$\u0003$\u0003",
"$\u0003$\u0005$\u00e1\n$\u0003%\u0003%\u0003%\u0006%\u00e6\n%\r%\u000e",
"%\u00e7\u0003&\u0003&\u0003&\u0006&\u00ed\n&\r&\u000e&\u00ee\u0003\'",
"\u0006\'\u00f2\n\'\r\'\u000e\'\u00f3\u0003(\u0003(\u0007(\u00f8\n(\f",
"(\u000e(\u00fb\u000b(\u0003)\u0006)\u00fe\n)\r)\u000e)\u00ff\u0003)",
"\u0003)\u0003*\u0003*\u0006*\u0106\n*\r*\u000e*\u0107\u0003*\u0003*",
"\u0003+\u0003+\u0003+\u0003+\u0007+\u0110\n+\f+\u000e+\u0113\u000b+",
"\u0003+\u0003+\u0003+\u0003+\u0003+\u0003,\u0003,\u0003,\u0003,\u0007",
",\u011e\n,\f,\u000e,\u0121\u000b,\u0003,\u0003,\u0003\u0111\u0002-\u0003",
"\u0003\u0005\u0004\u0007\u0005\t\u0006\u000b\u0007\r\b\u000f\t\u0011",
"\n\u0013\u000b\u0015\f\u0017\r\u0019\u000e\u001b\u000f\u001d\u0010\u001f",
"\u0011!\u0012#\u0013%\u0014\'\u0015)\u0016+\u0017-\u0018/\u00191\u001a",
"3\u001b5\u001c7\u001d9\u001e;\u001f= ?!A\"C#E$G%I&K\'M(O)Q*S+U,W-\u0003",
"\u0002\n\u0003\u00022;\u0004\u0002GGgg\u0004\u0002--//\u0003\u0002c",
"|\u0006\u00022;C\\aac|\u0005\u0002\u000b\f\u000e\u000f\"\"\u0007\u0002",
"/02;C\\aac|\u0004\u0002\f\f\u000f\u000f\u0002\u012d\u0002\u0003\u0003",
"\u0002\u0002\u0002\u0002\u0005\u0003\u0002\u0002\u0002\u0002\u0007\u0003",
"\u0002\u0002\u0002\u0002\t\u0003\u0002\u0002\u0002\u0002\u000b\u0003",
"\u0002\u0002\u0002\u0002\r\u0003\u0002\u0002\u0002\u0002\u000f\u0003",
"\u0002\u0002\u0002\u0002\u0011\u0003\u0002\u0002\u0002\u0002\u0013\u0003",
"\u0002\u0002\u0002\u0002\u0015\u0003\u0002\u0002\u0002\u0002\u0017\u0003",
"\u0002\u0002\u0002\u0002\u0019\u0003\u0002\u0002\u0002\u0002\u001b\u0003",
"\u0002\u0002\u0002\u0002\u001d\u0003\u0002\u0002\u0002\u0002\u001f\u0003",
"\u0002\u0002\u0002\u0002!\u0003\u0002\u0002\u0002\u0002#\u0003\u0002",
"\u0002\u0002\u0002%\u0003\u0002\u0002\u0002\u0002\'\u0003\u0002\u0002",
"\u0002\u0002)\u0003\u0002\u0002\u0002\u0002+\u0003\u0002\u0002\u0002",
"\u0002-\u0003\u0002\u0002\u0002\u0002/\u0003\u0002\u0002\u0002\u0002",
"1\u0003\u0002\u0002\u0002\u00023\u0003\u0002\u0002\u0002\u00025\u0003",
"\u0002\u0002\u0002\u00027\u0003\u0002\u0002\u0002\u00029\u0003\u0002",
"\u0002\u0002\u0002;\u0003\u0002\u0002\u0002\u0002=\u0003\u0002\u0002",
"\u0002\u0002?\u0003\u0002\u0002\u0002\u0002A\u0003\u0002\u0002\u0002",
"\u0002C\u0003\u0002\u0002\u0002\u0002E\u0003\u0002\u0002\u0002\u0002",
"G\u0003\u0002\u0002\u0002\u0002I\u0003\u0002\u0002\u0002\u0002K\u0003",
"\u0002\u0002\u0002\u0002M\u0003\u0002\u0002\u0002\u0002O\u0003\u0002",
"\u0002\u0002\u0002Q\u0003\u0002\u0002\u0002\u0002S\u0003\u0002\u0002",
"\u0002\u0002U\u0003\u0002\u0002\u0002\u0002W\u0003\u0002\u0002\u0002",
"\u0003Y\u0003\u0002\u0002\u0002\u0005[\u0003\u0002\u0002\u0002\u0007",
"b\u0003\u0002\u0002\u0002\td\u0003\u0002\u0002\u0002\u000bf\u0003\u0002",
"\u0002\u0002\rh\u0003\u0002\u0002\u0002\u000fk\u0003\u0002\u0002\u0002",
"\u0011n\u0003\u0002\u0002\u0002\u0013v\u0003\u0002\u0002\u0002\u0015",
"\u007f\u0003\u0002\u0002\u0002\u0017\u0087\u0003\u0002\u0002\u0002\u0019",
"\u008c\u0003\u0002\u0002\u0002\u001b\u008e\u0003\u0002\u0002\u0002\u001d",
"\u0090\u0003\u0002\u0002\u0002\u001f\u0095\u0003\u0002\u0002\u0002!",
"\u009a\u0003\u0002\u0002\u0002#\u009c\u0003\u0002\u0002\u0002%\u00a4",
"\u0003\u0002\u0002\u0002\'\u00a7\u0003\u0002\u0002\u0002)\u00ad\u0003",
"\u0002\u0002\u0002+\u00af\u0003\u0002\u0002\u0002-\u00b2\u0003\u0002",
"\u0002\u0002/\u00b4\u0003\u0002\u0002\u00021\u00b6\u0003\u0002\u0002",
"\u00023\u00b8\u0003\u0002\u0002\u00025\u00ba\u0003\u0002\u0002\u0002",
"7\u00bc\u0003\u0002\u0002\u00029\u00be\u0003\u0002\u0002\u0002;\u00c2",
"\u0003\u0002\u0002\u0002=\u00c6\u0003\u0002\u0002\u0002?\u00ca\u0003",
"\u0002\u0002\u0002A\u00ce\u0003\u0002\u0002\u0002C\u00d1\u0003\u0002",
"\u0002\u0002E\u00d6\u0003\u0002\u0002\u0002G\u00e0\u0003\u0002\u0002",
"\u0002I\u00e2\u0003\u0002\u0002\u0002K\u00e9\u0003\u0002\u0002\u0002",
"M\u00f1\u0003\u0002\u0002\u0002O\u00f5\u0003\u0002\u0002\u0002Q\u00fd",
"\u0003\u0002\u0002\u0002S\u0103\u0003\u0002\u0002\u0002U\u010b\u0003",
"\u0002\u0002\u0002W\u0119\u0003\u0002\u0002\u0002YZ\u0007\u007f\u0002",
"\u0002Z\u0004\u0003\u0002\u0002\u0002[\\\u0007q\u0002\u0002\\]\u0007",
"r\u0002\u0002]^\u0007c\u0002\u0002^_\u0007s\u0002\u0002_`\u0007w\u0002",
"\u0002`a\u0007g\u0002\u0002a\u0006\u0003\u0002\u0002\u0002bc\u0007=",
"\u0002\u0002c\b\u0003\u0002\u0002\u0002de\u0007*\u0002\u0002e\n\u0003",
"\u0002\u0002\u0002fg\u0007+\u0002\u0002g\f\u0003\u0002\u0002\u0002h",
"i\u0007k\u0002\u0002ij\u0007h\u0002\u0002j\u000e\u0003\u0002\u0002\u0002",
"kl\u0007?\u0002\u0002lm\u0007?\u0002\u0002m\u0010\u0003\u0002\u0002",
"\u0002no\u0007d\u0002\u0002op\u0007c\u0002\u0002pq\u0007t\u0002\u0002",
"qr\u0007t\u0002\u0002rs\u0007k\u0002\u0002st\u0007g\u0002\u0002tu\u0007",
"t\u0002\u0002u\u0012\u0003\u0002\u0002\u0002vw\u0007Q\u0002\u0002wx",
"\u0007R\u0002\u0002xy\u0007G\u0002\u0002yz\u0007P\u0002\u0002z{\u0007",
"S\u0002\u0002{|\u0007C\u0002\u0002|}\u0007U\u0002\u0002}~\u0007O\u0002",
"\u0002~\u0014\u0003\u0002\u0002\u0002\u007f\u0080\u0007k\u0002\u0002",
"\u0080\u0081\u0007p\u0002\u0002\u0081\u0082\u0007e\u0002\u0002\u0082",
"\u0083\u0007n\u0002\u0002\u0083\u0084\u0007w\u0002\u0002\u0084\u0085",
"\u0007f\u0002\u0002\u0085\u0086\u0007g\u0002\u0002\u0086\u0016\u0003",
"\u0002\u0002\u0002\u0087\u0088\u0007s\u0002\u0002\u0088\u0089\u0007",
"t\u0002\u0002\u0089\u008a\u0007g\u0002\u0002\u008a\u008b\u0007i\u0002",
"\u0002\u008b\u0018\u0003\u0002\u0002\u0002\u008c\u008d\u0007]\u0002",
"\u0002\u008d\u001a\u0003\u0002\u0002\u0002\u008e\u008f\u0007_\u0002",
"\u0002\u008f\u001c\u0003\u0002\u0002\u0002\u0090\u0091\u0007e\u0002",
"\u0002\u0091\u0092\u0007t\u0002\u0002\u0092\u0093\u0007g\u0002\u0002",
"\u0093\u0094\u0007i\u0002\u0002\u0094\u001e\u0003\u0002\u0002\u0002",
"\u0095\u0096\u0007i\u0002\u0002\u0096\u0097\u0007c\u0002\u0002\u0097",
"\u0098\u0007v\u0002\u0002\u0098\u0099\u0007g\u0002\u0002\u0099 \u0003",
"\u0002\u0002\u0002\u009a\u009b\u0007}\u0002\u0002\u009b\"\u0003\u0002",
"\u0002\u0002\u009c\u009d\u0007o\u0002\u0002\u009d\u009e\u0007g\u0002",
"\u0002\u009e\u009f\u0007c\u0002\u0002\u009f\u00a0\u0007u\u0002\u0002",
"\u00a0\u00a1\u0007w\u0002\u0002\u00a1\u00a2\u0007t\u0002\u0002\u00a2",
"\u00a3\u0007g\u0002\u0002\u00a3$\u0003\u0002\u0002\u0002\u00a4\u00a5",
"\u0007/\u0002\u0002\u00a5\u00a6\u0007@\u0002\u0002\u00a6&\u0003\u0002",
"\u0002\u0002\u00a7\u00a8\u0007t\u0002\u0002\u00a8\u00a9\u0007g\u0002",
"\u0002\u00a9\u00aa\u0007u\u0002\u0002\u00aa\u00ab\u0007g\u0002\u0002",
"\u00ab\u00ac\u0007v\u0002\u0002\u00ac(\u0003\u0002\u0002\u0002\u00ad",
"\u00ae\u0007W\u0002\u0002\u00ae*\u0003\u0002\u0002\u0002\u00af\u00b0",
"\u0007E\u0002\u0002\u00b0\u00b1\u0007Z\u0002\u0002\u00b1,\u0003\u0002",
"\u0002\u0002\u00b2\u00b3\u0007.\u0002\u0002\u00b3.\u0003\u0002\u0002",
"\u0002\u00b4\u00b5\u0007`\u0002\u0002\u00b50\u0003\u0002\u0002\u0002",
"\u00b6\u00b7\u0007,\u0002\u0002\u00b72\u0003\u0002\u0002\u0002\u00b8",
"\u00b9\u00071\u0002\u0002\u00b94\u0003\u0002\u0002\u0002\u00ba\u00bb",
"\u0007-\u0002\u0002\u00bb6\u0003\u0002\u0002\u0002\u00bc\u00bd\u0007",
"/\u0002\u0002\u00bd8\u0003\u0002\u0002\u0002\u00be\u00bf\u0007u\u0002",
"\u0002\u00bf\u00c0\u0007k\u0002\u0002\u00c0\u00c1\u0007p\u0002\u0002",
"\u00c1:\u0003\u0002\u0002\u0002\u00c2\u00c3\u0007e\u0002\u0002\u00c3",
"\u00c4\u0007q\u0002\u0002\u00c4\u00c5\u0007u\u0002\u0002\u00c5<\u0003",
"\u0002\u0002\u0002\u00c6\u00c7\u0007v\u0002\u0002\u00c7\u00c8\u0007",
"c\u0002\u0002\u00c8\u00c9\u0007p\u0002\u0002\u00c9>\u0003\u0002\u0002",
"\u0002\u00ca\u00cb\u0007g\u0002\u0002\u00cb\u00cc\u0007z\u0002\u0002",
"\u00cc\u00cd\u0007r\u0002\u0002\u00cd@\u0003\u0002\u0002\u0002\u00ce",
"\u00cf\u0007n\u0002\u0002\u00cf\u00d0\u0007p\u0002\u0002\u00d0B\u0003",
"\u0002\u0002\u0002\u00d1\u00d2\u0007u\u0002\u0002\u00d2\u00d3\u0007",
"s\u0002\u0002\u00d3\u00d4\u0007t\u0002\u0002\u00d4\u00d5\u0007v\u0002",
"\u0002\u00d5D\u0003\u0002\u0002\u0002\u00d6\u00d7\u0007r\u0002\u0002",
"\u00d7\u00d8\u0007k\u0002\u0002\u00d8F\u0003\u0002\u0002\u0002\u00d9",
"\u00da\u0005I%\u0002\u00da\u00db\u0005K&\u0002\u00db\u00e1\u0003\u0002",
"\u0002\u0002\u00dc\u00dd\u0005M\'\u0002\u00dd\u00de\u0005K&\u0002\u00de",
"\u00e1\u0003\u0002\u0002\u0002\u00df\u00e1\u0005I%\u0002\u00e0\u00d9",
"\u0003\u0002\u0002\u0002\u00e0\u00dc\u0003\u0002\u0002\u0002\u00e0\u00df",
"\u0003\u0002\u0002\u0002\u00e1H\u0003\u0002\u0002\u0002\u00e2\u00e3",
"\u0005M\'\u0002\u00e3\u00e5\u00070\u0002\u0002\u00e4\u00e6\t\u0002\u0002",
"\u0002\u00e5\u00e4\u0003\u0002\u0002\u0002\u00e6\u00e7\u0003\u0002\u0002",
"\u0002\u00e7\u00e5\u0003\u0002\u0002\u0002\u00e7\u00e8\u0003\u0002\u0002",
"\u0002\u00e8J\u0003\u0002\u0002\u0002\u00e9\u00ea\t\u0003\u0002\u0002",
"\u00ea\u00ec\t\u0004\u0002\u0002\u00eb\u00ed\t\u0002\u0002\u0002\u00ec",
"\u00eb\u0003\u0002\u0002\u0002\u00ed\u00ee\u0003\u0002\u0002\u0002\u00ee",
"\u00ec\u0003\u0002\u0002\u0002\u00ee\u00ef\u0003\u0002\u0002\u0002\u00ef",
"L\u0003\u0002\u0002\u0002\u00f0\u00f2\t\u0002\u0002\u0002\u00f1\u00f0",
"\u0003\u0002\u0002\u0002\u00f2\u00f3\u0003\u0002\u0002\u0002\u00f3\u00f1",
"\u0003\u0002\u0002\u0002\u00f3\u00f4\u0003\u0002\u0002\u0002\u00f4N",
"\u0003\u0002\u0002\u0002\u00f5\u00f9\t\u0005\u0002\u0002\u00f6\u00f8",
"\t\u0006\u0002\u0002\u00f7\u00f6\u0003\u0002\u0002\u0002\u00f8\u00fb",
"\u0003\u0002\u0002\u0002\u00f9\u00f7\u0003\u0002\u0002\u0002\u00f9\u00fa",
"\u0003\u0002\u0002\u0002\u00faP\u0003\u0002\u0002\u0002\u00fb\u00f9",
"\u0003\u0002\u0002\u0002\u00fc\u00fe\t\u0007\u0002\u0002\u00fd\u00fc",
"\u0003\u0002\u0002\u0002\u00fe\u00ff\u0003\u0002\u0002\u0002\u00ff\u00fd",
"\u0003\u0002\u0002\u0002\u00ff\u0100\u0003\u0002\u0002\u0002\u0100\u0101",
"\u0003\u0002\u0002\u0002\u0101\u0102\b)\u0002\u0002\u0102R\u0003\u0002",
"\u0002\u0002\u0103\u0105\u0007$\u0002\u0002\u0104\u0106\t\b\u0002\u0002",
"\u0105\u0104\u0003\u0002\u0002\u0002\u0106\u0107\u0003\u0002\u0002\u0002",
"\u0107\u0105\u0003\u0002\u0002\u0002\u0107\u0108\u0003\u0002\u0002\u0002",
"\u0108\u0109\u0003\u0002\u0002\u0002\u0109\u010a\u0007$\u0002\u0002",
"\u010aT\u0003\u0002\u0002\u0002\u010b\u010c\u00071\u0002\u0002\u010c",
"\u010d\u0007,\u0002\u0002\u010d\u0111\u0003\u0002\u0002\u0002\u010e",
"\u0110\u000b\u0002\u0002\u0002\u010f\u010e\u0003\u0002\u0002\u0002\u0110",
"\u0113\u0003\u0002\u0002\u0002\u0111\u0112\u0003\u0002\u0002\u0002\u0111",
"\u010f\u0003\u0002\u0002\u0002\u0112\u0114\u0003\u0002\u0002\u0002\u0113",
"\u0111\u0003\u0002\u0002\u0002\u0114\u0115\u0007,\u0002\u0002\u0115",
"\u0116\u00071\u0002\u0002\u0116\u0117\u0003\u0002\u0002\u0002\u0117",
"\u0118\b+\u0002\u0002\u0118V\u0003\u0002\u0002\u0002\u0119\u011a\u0007",
"1\u0002\u0002\u011a\u011b\u00071\u0002\u0002\u011b\u011f\u0003\u0002",
"\u0002\u0002\u011c\u011e\n\t\u0002\u0002\u011d\u011c\u0003\u0002\u0002",
"\u0002\u011e\u0121\u0003\u0002\u0002\u0002\u011f\u011d\u0003\u0002\u0002",
"\u0002\u011f\u0120\u0003\u0002\u0002\u0002\u0120\u0122\u0003\u0002\u0002",
"\u0002\u0121\u011f\u0003\u0002\u0002\u0002\u0122\u0123\b,\u0002\u0002",
"\u0123X\u0003\u0002\u0002\u0002\f\u0002\u00e0\u00e7\u00ee\u00f3\u00f9",
"\u00ff\u0107\u0111\u011f\u0003\b\u0002\u0002"].join("");
var atn = new antlr4.atn.ATNDeserializer().deserialize(serializedATN);
var decisionsToDFA = atn.decisionToState.map( function(ds, index) { return new antlr4.dfa.DFA(ds, index); });
function QASMLexer(input) {
antlr4.Lexer.call(this, input);
this._interp = new antlr4.atn.LexerATNSimulator(this, atn, decisionsToDFA, new antlr4.PredictionContextCache());
return this;
}
QASMLexer.prototype = Object.create(antlr4.Lexer.prototype);
QASMLexer.prototype.constructor = QASMLexer;
Object.defineProperty(QASMLexer.prototype, "atn", {
get : function() {
return atn;
}
});
QASMLexer.EOF = antlr4.Token.EOF;
QASMLexer.T__0 = 1;
QASMLexer.T__1 = 2;
QASMLexer.T__2 = 3;
QASMLexer.T__3 = 4;
QASMLexer.T__4 = 5;
QASMLexer.T__5 = 6;
QASMLexer.T__6 = 7;
QASMLexer.T__7 = 8;
QASMLexer.T__8 = 9;
QASMLexer.T__9 = 10;
QASMLexer.T__10 = 11;
QASMLexer.T__11 = 12;
QASMLexer.T__12 = 13;
QASMLexer.T__13 = 14;
QASMLexer.T__14 = 15;
QASMLexer.T__15 = 16;
QASMLexer.T__16 = 17;
QASMLexer.T__17 = 18;
QASMLexer.T__18 = 19;
QASMLexer.T__19 = 20;
QASMLexer.T__20 = 21;
QASMLexer.T__21 = 22;
QASMLexer.T__22 = 23;
QASMLexer.T__23 = 24;
QASMLexer.T__24 = 25;
QASMLexer.T__25 = 26;
QASMLexer.T__26 = 27;
QASMLexer.T__27 = 28;
QASMLexer.T__28 = 29;
QASMLexer.T__29 = 30;
QASMLexer.T__30 = 31;
QASMLexer.T__31 = 32;
QASMLexer.T__32 = 33;
QASMLexer.PI = 34;
QASMLexer.REAL = 35;
QASMLexer.SUBREAL = 36;
QASMLexer.EXPREAL = 37;
QASMLexer.INT = 38;
QASMLexer.ID = 39;
QASMLexer.WS = 40;
QASMLexer.FILENAME = 41;
QASMLexer.COMMENT = 42;
QASMLexer.LINE_COMMENT = 43;
QASMLexer.prototype.channelNames = [ "DEFAULT_TOKEN_CHANNEL", "HIDDEN" ];
QASMLexer.prototype.modeNames = [ "DEFAULT_MODE" ];
QASMLexer.prototype.literalNames = [ null, "'}'", "'opaque'", "';'", "'('",
"')'", "'if'", "'=='", "'barrier'",
"'OPENQASM'", "'include'", "'qreg'",
"'['", "']'", "'creg'", "'gate'", "'{'",
"'measure'", "'->'", "'reset'", "'U'",
"'CX'", "','", "'^'", "'*'", "'/'",
"'+'", "'-'", "'sin'", "'cos'", "'tan'",
"'exp'", "'ln'", "'sqrt'", "'pi'" ];
QASMLexer.prototype.symbolicNames = [ null, null, null, null, null, null,
null, null, null, null, null, null,
null, null, null, null, null, null,
null, null, null, null, null, null,
null, null, null, null, null, null,
null, null, null, null, "PI", "REAL",
"SUBREAL", "EXPREAL", "INT", "ID",
"WS", "FILENAME", "COMMENT", "LINE_COMMENT" ];
QASMLexer.prototype.ruleNames = [ "T__0", "T__1", "T__2", "T__3", "T__4",
"T__5", "T__6", "T__7", "T__8", "T__9",
"T__10", "T__11", "T__12", "T__13", "T__14",
"T__15", "T__16", "T__17", "T__18", "T__19",
"T__20", "T__21", "T__22", "T__23", "T__24",
"T__25", "T__26", "T__27", "T__28", "T__29",
"T__30", "T__31", "T__32", "PI", "REAL",
"SUBREAL", "EXPREAL", "INT", "ID", "WS",
"FILENAME", "COMMENT", "LINE_COMMENT" ];
QASMLexer.prototype.grammarFileName = "QASM.g4";
exports.QASMLexer = QASMLexer;
},{"antlr4/index":47}],3:[function(require,module,exports){
// Generated from QASM.g4 by ANTLR 4.7.1
// jshint ignore: start
var antlr4 = require('antlr4/index');
// This class defines a complete listener for a parse tree produced by QASMParser.
function QASMListener() {
antlr4.tree.ParseTreeListener.call(this);
return this;
}
QASMListener.prototype = Object.create(antlr4.tree.ParseTreeListener.prototype);
QASMListener.prototype.constructor = QASMListener;
// Enter a parse tree produced by QASMParser#mainprog.
QASMListener.prototype.enterMainprog = function(ctx) {
};
// Exit a parse tree produced by QASMParser#mainprog.
QASMListener.prototype.exitMainprog = function(ctx) {
};
// Enter a parse tree produced by QASMParser#statement.
QASMListener.prototype.enterStatement = function(ctx) {
};
// Exit a parse tree produced by QASMParser#statement.
QASMListener.prototype.exitStatement = function(ctx) {
};
// Enter a parse tree produced by QASMParser#version.
QASMListener.prototype.enterVersion = function(ctx) {
};
// Exit a parse tree produced by QASMParser#version.
QASMListener.prototype.exitVersion = function(ctx) {
};
// Enter a parse tree produced by QASMParser#include.
QASMListener.prototype.enterInclude = function(ctx) {
};
// Exit a parse tree produced by QASMParser#include.
QASMListener.prototype.exitInclude = function(ctx) {
};
// Enter a parse tree produced by QASMParser#filename.
QASMListener.prototype.enterFilename = function(ctx) {
};
// Exit a parse tree produced by QASMParser#filename.
QASMListener.prototype.exitFilename = function(ctx) {
};
// Enter a parse tree produced by QASMParser#decl.
QASMListener.prototype.enterDecl = function(ctx) {
};
// Exit a parse tree produced by QASMParser#decl.
QASMListener.prototype.exitDecl = function(ctx) {
};
// Enter a parse tree produced by QASMParser#gatedecl.
QASMListener.prototype.enterGatedecl = function(ctx) {
};
// Exit a parse tree produced by QASMParser#gatedecl.
QASMListener.prototype.exitGatedecl = function(ctx) {
};
// Enter a parse tree produced by QASMParser#goplist.
QASMListener.prototype.enterGoplist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#goplist.
QASMListener.prototype.exitGoplist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#qop.
QASMListener.prototype.enterQop = function(ctx) {
};
// Exit a parse tree produced by QASMParser#qop.
QASMListener.prototype.exitQop = function(ctx) {
};
// Enter a parse tree produced by QASMParser#uop.
QASMListener.prototype.enterUop = function(ctx) {
};
// Exit a parse tree produced by QASMParser#uop.
QASMListener.prototype.exitUop = function(ctx) {
};
// Enter a parse tree produced by QASMParser#anylist.
QASMListener.prototype.enterAnylist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#anylist.
QASMListener.prototype.exitAnylist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#idlist.
QASMListener.prototype.enterIdlist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#idlist.
QASMListener.prototype.exitIdlist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#mixedlist.
QASMListener.prototype.enterMixedlist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#mixedlist.
QASMListener.prototype.exitMixedlist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#argument.
QASMListener.prototype.enterArgument = function(ctx) {
};
// Exit a parse tree produced by QASMParser#argument.
QASMListener.prototype.exitArgument = function(ctx) {
};
// Enter a parse tree produced by QASMParser#explist.
QASMListener.prototype.enterExplist = function(ctx) {
};
// Exit a parse tree produced by QASMParser#explist.
QASMListener.prototype.exitExplist = function(ctx) {
};
// Enter a parse tree produced by QASMParser#exp.
QASMListener.prototype.enterExp = function(ctx) {
};
// Exit a parse tree produced by QASMParser#exp.
QASMListener.prototype.exitExp = function(ctx) {
};
// Enter a parse tree produced by QASMParser#atom.
QASMListener.prototype.enterAtom = function(ctx) {
};
// Exit a parse tree produced by QASMParser#atom.
QASMListener.prototype.exitAtom = function(ctx) {
};
// Enter a parse tree produced by QASMParser#unaryop.
QASMListener.prototype.enterUnaryop = function(ctx) {
};
// Exit a parse tree produced by QASMParser#unaryop.
QASMListener.prototype.exitUnaryop = function(ctx) {
};
exports.QASMListener = QASMListener;
},{"antlr4/index":47}],4:[function(require,module,exports){
// Generated from QASM.g4 by ANTLR 4.7.1
// jshint ignore: start
var antlr4 = require('antlr4/index');
var QASMListener = require('./QASMListener').QASMListener;
var grammarFileName = "QASM.g4";
var serializedATN = ["\u0003\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964",
"\u0003-\u0130\u0004\u0002\t\u0002\u0004\u0003\t\u0003\u0004\u0004\t",
"\u0004\u0004\u0005\t\u0005\u0004\u0006\t\u0006\u0004\u0007\t\u0007\u0004",
"\b\t\b\u0004\t\t\t\u0004\n\t\n\u0004\u000b\t\u000b\u0004\f\t\f\u0004",
"\r\t\r\u0004\u000e\t\u000e\u0004\u000f\t\u000f\u0004\u0010\t\u0010\u0004",
"\u0011\t\u0011\u0004\u0012\t\u0012\u0004\u0013\t\u0013\u0003\u0002\u0003",
"\u0002\u0007\u0002)\n\u0002\f\u0002\u000e\u0002,\u000b\u0002\u0003\u0003",
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003",
"\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0003\u0005\u0003W\n\u0003",
"\u0003\u0004\u0003\u0004\u0003\u0004\u0003\u0004\u0003\u0005\u0003\u0005",
"\u0003\u0005\u0003\u0005\u0003\u0006\u0003\u0006\u0003\u0007\u0003\u0007",
"\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007",
"\u0003\u0007\u0003\u0007\u0003\u0007\u0003\u0007\u0005\u0007o\n\u0007",
"\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003",
"\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003\b\u0003",
"\b\u0003\b\u0003\b\u0005\b\u0085\n\b\u0003\t\u0003\t\u0003\t\u0003\t",
"\u0003\t\u0006\t\u008c\n\t\r\t\u000e\t\u008d\u0003\n\u0003\n\u0003\n",
"\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0003\n\u0005",
"\n\u009b\n\n\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
"\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
"\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
"\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
"\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b\u0003\u000b",
"\u0003\u000b\u0005\u000b\u00bb\n\u000b\u0003\f\u0003\f\u0005\f\u00bf",
"\n\f\u0003\r\u0003\r\u0007\r\u00c3\n\r\f\r\u000e\r\u00c6\u000b\r\u0003",
"\r\u0003\r\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e",
"\u0007\u000e\u00cf\n\u000e\f\u000e\u000e\u000e\u00d2\u000b\u000e\u0003",
"\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0007",
"\u000e\u00da\n\u000e\f\u000e\u000e\u000e\u00dd\u000b\u000e\u0003\u000e",
"\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0007\u000e",
"\u00e5\n\u000e\f\u000e\u000e\u000e\u00e8\u000b\u000e\u0003\u000e\u0003",
"\u000e\u0007\u000e\u00ec\n\u000e\f\u000e\u000e\u000e\u00ef\u000b\u000e",
"\u0003\u000e\u0003\u000e\u0003\u000e\u0003\u000e\u0005\u000e\u00f5\n",
"\u000e\u0003\u000f\u0003\u000f\u0003\u000f\u0003\u000f\u0003\u000f\u0005",
"\u000f\u00fc\n\u000f\u0003\u0010\u0003\u0010\u0003\u0010\u0007\u0010",
"\u0101\n\u0010\f\u0010\u000e\u0010\u0104\u000b\u0010\u0003\u0010\u0003",
"\u0010\u0003\u0011\u0003\u0011\u0005\u0011\u010a\n\u0011\u0003\u0011",
"\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0005\u0011\u0111\n",
"\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003",
"\u0011\u0005\u0011\u0119\n\u0011\u0003\u0011\u0005\u0011\u011c\n\u0011",
"\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011\u0003\u0011",
"\u0003\u0011\u0003\u0011\u0003\u0011\u0007\u0011\u0127\n\u0011\f\u0011",
"\u000e\u0011\u012a\u000b\u0011\u0003\u0012\u0003\u0012\u0003\u0013\u0003",
"\u0013\u0003\u0013\u0002\u0003 \u0014\u0002\u0004\u0006\b\n\f\u000e",
"\u0010\u0012\u0014\u0016\u0018\u001a\u001c\u001e \"$\u0002\u0006\u0003",
"\u0002\u001c\u001d\u0003\u0002\u001a\u001b\u0004\u0002$%()\u0003\u0002",
"\u001e#\u0002\u0144\u0002&\u0003\u0002\u0002\u0002\u0004V\u0003\u0002",
"\u0002\u0002\u0006X\u0003\u0002\u0002\u0002\b\\\u0003\u0002\u0002\u0002",
"\n`\u0003\u0002\u0002\u0002\fn\u0003\u0002\u0002\u0002\u000e\u0084\u0003",
"\u0002\u0002\u0002\u0010\u008b\u0003\u0002\u0002\u0002\u0012\u009a\u0003",
"\u0002\u0002\u0002\u0014\u00ba\u0003\u0002\u0002\u0002\u0016\u00be\u0003",
"\u0002\u0002\u0002\u0018\u00c4\u0003\u0002\u0002\u0002\u001a\u00f4\u0003",
"\u0002\u0002\u0002\u001c\u00fb\u0003\u0002\u0002\u0002\u001e\u0102\u0003",
"\u0002\u0002\u0002 \u011b\u0003\u0002\u0002\u0002\"\u012b\u0003\u0002",
"\u0002\u0002$\u012d\u0003\u0002\u0002\u0002&*\u0005\u0006\u0004\u0002",
"\')\u0005\u0004\u0003\u0002(\'\u0003\u0002\u0002\u0002),\u0003\u0002",
"\u0002\u0002*(\u0003\u0002\u0002\u0002*+\u0003\u0002\u0002\u0002+\u0003",
"\u0003\u0002\u0002\u0002,*\u0003\u0002\u0002\u0002-W\u0005\f\u0007\u0002",
"./\u0005\u000e\b\u0002/0\u0005\u0010\t\u000201\u0007\u0003\u0002\u0002",
"1W\u0003\u0002\u0002\u000223\u0005\u000e\b\u000234\u0007\u0003\u0002",
"\u00024W\u0003\u0002\u0002\u000256\u0007\u0004\u0002\u000267\u0007)",
"\u0002\u000278\u0005\u0018\r\u000289\u0007\u0005\u0002\u00029W\u0003",
"\u0002\u0002\u0002:;\u0007\u0004\u0002\u0002;<\u0007)\u0002\u0002<=",
"\u0007\u0006\u0002\u0002=>\u0007\u0007\u0002\u0002>?\u0005\u0018\r\u0002",
"?@\u0007\u0005\u0002\u0002@W\u0003\u0002\u0002\u0002AB\u0007\u0004\u0002",
"\u0002BC\u0007)\u0002\u0002CD\u0007\u0006\u0002\u0002DE\u0005\u0018",
"\r\u0002EF\u0007\u0007\u0002\u0002FG\u0005\u0018\r\u0002GH\u0007\u0005",
"\u0002\u0002HW\u0003\u0002\u0002\u0002IW\u0005\u0012\n\u0002JK\u0007",
"\b\u0002\u0002KL\u0007\u0006\u0002\u0002LM\u0007)\u0002\u0002MN\u0007",
"\t\u0002\u0002NO\u0007(\u0002\u0002OP\u0007\u0007\u0002\u0002PW\u0005",
"\u0012\n\u0002QR\u0007\n\u0002\u0002RS\u0005\u0016\f\u0002ST\u0007\u0005",
"\u0002\u0002TW\u0003\u0002\u0002\u0002UW\u0005\b\u0005\u0002V-\u0003",
"\u0002\u0002\u0002V.\u0003\u0002\u0002\u0002V2\u0003\u0002\u0002\u0002",
"V5\u0003\u0002\u0002\u0002V:\u0003\u0002\u0002\u0002VA\u0003\u0002\u0002",
"\u0002VI\u0003\u0002\u0002\u0002VJ\u0003\u0002\u0002\u0002VQ\u0003\u0002",
"\u0002\u0002VU\u0003\u0002\u0002\u0002W\u0005\u0003\u0002\u0002\u0002",
"XY\u0007\u000b\u0002\u0002YZ\u0007%\u0002\u0002Z[\u0007\u0005\u0002",
"\u0002[\u0007\u0003\u0002\u0002\u0002\\]\u0007\f\u0002\u0002]^\u0005",
"\n\u0006\u0002^_\u0007\u0005\u0002\u0002_\t\u0003\u0002\u0002\u0002",
"`a\u0007+\u0002\u0002a\u000b\u0003\u0002\u0002\u0002bc\u0007\r\u0002",
"\u0002cd\u0007)\u0002\u0002de\u0007\u000e\u0002\u0002ef\u0007(\u0002",
"\u0002fg\u0007\u000f\u0002\u0002go\u0007\u0005\u0002\u0002hi\u0007\u0010",
"\u0002\u0002ij\u0007)\u0002\u0002jk\u0007\u000e\u0002\u0002kl\u0007",
"(\u0002\u0002lm\u0007\u000f\u0002\u0002mo\u0007\u0005\u0002\u0002nb",
"\u0003\u0002\u0002\u0002nh\u0003\u0002\u0002\u0002o\r\u0003\u0002\u0002",
"\u0002pq\u0007\u0011\u0002\u0002qr\u0007)\u0002\u0002rs\u0005\u0018",
"\r\u0002st\u0007\u0012\u0002\u0002t\u0085\u0003\u0002\u0002\u0002uv",
"\u0007\u0011\u0002\u0002vw\u0007)\u0002\u0002wx\u0007\u0006\u0002\u0002",
"xy\u0007\u0007\u0002\u0002yz\u0005\u0018\r\u0002z{\u0007\u0012\u0002",
"\u0002{\u0085\u0003\u0002\u0002\u0002|}\u0007\u0011\u0002\u0002}~\u0007",
")\u0002\u0002~\u007f\u0007\u0006\u0002\u0002\u007f\u0080\u0005\u0018",
"\r\u0002\u0080\u0081\u0007\u0007\u0002\u0002\u0081\u0082\u0005\u0018",
"\r\u0002\u0082\u0083\u0007\u0012\u0002\u0002\u0083\u0085\u0003\u0002",
"\u0002\u0002\u0084p\u0003\u0002\u0002\u0002\u0084u\u0003\u0002\u0002",
"\u0002\u0084|\u0003\u0002\u0002\u0002\u0085\u000f\u0003\u0002\u0002",
"\u0002\u0086\u008c\u0005\u0014\u000b\u0002\u0087\u0088\u0007\n\u0002",
"\u0002\u0088\u0089\u0005\u0018\r\u0002\u0089\u008a\u0007\u0005\u0002",
"\u0002\u008a\u008c\u0003\u0002\u0002\u0002\u008b\u0086\u0003\u0002\u0002",
"\u0002\u008b\u0087\u0003\u0002\u0002\u0002\u008c\u008d\u0003\u0002\u0002",
"\u0002\u008d\u008b\u0003\u0002\u0002\u0002\u008d\u008e\u0003\u0002\u0002",
"\u0002\u008e\u0011\u0003\u0002\u0002\u0002\u008f\u009b\u0005\u0014\u000b",
"\u0002\u0090\u0091\u0007\u0013\u0002\u0002\u0091\u0092\u0005\u001c\u000f",
"\u0002\u0092\u0093\u0007\u0014\u0002\u0002\u0093\u0094\u0005\u001c\u000f",
"\u0002\u0094\u0095\u0007\u0005\u0002\u0002\u0095\u009b\u0003\u0002\u0002",
"\u0002\u0096\u0097\u0007\u0015\u0002\u0002\u0097\u0098\u0005\u001c\u000f",
"\u0002\u0098\u0099\u0007\u0005\u0002\u0002\u0099\u009b\u0003\u0002\u0002",
"\u0002\u009a\u008f\u0003\u0002\u0002\u0002\u009a\u0090\u0003\u0002\u0002",
"\u0002\u009a\u0096\u0003\u0002\u0002\u0002\u009b\u0013\u0003\u0002\u0002",
"\u0002\u009c\u009d\u0007\u0016\u0002\u0002\u009d\u009e\u0007\u0006\u0002",
"\u0002\u009e\u009f\u0005\u001e\u0010\u0002\u009f\u00a0\u0007\u0007\u0002",
"\u0002\u00a0\u00a1\u0005\u001c\u000f\u0002\u00a1\u00a2\u0007\u0005\u0002",
"\u0002\u00a2\u00bb\u0003\u0002\u0002\u0002\u00a3\u00a4\u0007\u0017\u0002",
"\u0002\u00a4\u00a5\u0005\u001c\u000f\u0002\u00a5\u00a6\u0007\u0018\u0002",
"\u0002\u00a6\u00a7\u0005\u001c\u000f\u0002\u00a7\u00a8\u0007\u0005\u0002",
"\u0002\u00a8\u00bb\u0003\u0002\u0002\u0002\u00a9\u00aa\u0007)\u0002",
"\u0002\u00aa\u00ab\u0005\u0016\f\u0002\u00ab\u00ac\u0007\u0005\u0002",
"\u0002\u00ac\u00bb\u0003\u0002\u0002\u0002\u00ad\u00ae\u0007)\u0002",
"\u0002\u00ae\u00af\u0007\u0006\u0002\u0002\u00af\u00b0\u