How to use the pyquil._parser.gen2.QuilParser.QuilParser function in pyquil

To help you get started, we’ve selected a few pyquil examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
def __init__(self, parser, parent=None, invokingState=-1):
            super(QuilParser.Pragma_nameContext, self).__init__(parent, invokingState)
            self.parser = parser
github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
def CIS(self):
            return self.getToken(QuilParser.CIS, 0)
github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
pass
            elif token in [QuilParser.SIN, QuilParser.COS, QuilParser.SQRT, QuilParser.EXP, QuilParser.CIS]:
                localctx = QuilParser.FunctionExpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 327
                self.function()
                self.state = 328
                self.match(QuilParser.LPAREN)
                self.state = 329
                self.expression(0)
                self.state = 330
                self.match(QuilParser.RPAREN)
                pass
            elif token in [QuilParser.LBRACKET]:
                localctx = QuilParser.SegmentExpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 332
                self.segment()
                pass
            elif token in [QuilParser.PI, QuilParser.I, QuilParser.INT, QuilParser.FLOAT]:
                localctx = QuilParser.NumberExpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
                self.state = 333
                self.number()
                pass
            elif token in [QuilParser.PERCENTAGE]:
                localctx = QuilParser.VariableExpContext(self, localctx)
                self._ctx = localctx
                _prevctx = localctx
github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
def getRuleIndex(self):
            return QuilParser.RULE_classicalBinary
github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
def param(self, i=None):
            if i is None:
                return self.getTypedRuleContexts(QuilParser.ParamContext)
            else:
                return self.getTypedRuleContext(QuilParser.ParamContext,i)
github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
def PLUS(self):
            return self.getToken(QuilParser.PLUS, 0)
        def MINUS(self):
github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
def matrixRow(self):

        localctx = QuilParser.MatrixRowContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_matrixRow)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 182
            self.match(QuilParser.TAB)
            self.state = 183
            self.expression(0)
            self.state = 188
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==QuilParser.COMMA:
                self.state = 184
                self.match(QuilParser.COMMA)
                self.state = 185
                self.expression(0)
                self.state = 190
                self._errHandler.sync(self)
                _la = self._input.LA(1)

        except RecognitionException as re:
            localctx.exception = re
github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
def sign(self):
            return self.getTypedRuleContext(QuilParser.SignContext,0)
github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
def SQRT(self):
            return self.getToken(QuilParser.SQRT, 0)
github rigetti / pyquil / pyquil / _parser / gen2 / QuilParser.py View on Github external
def POWER(self):
            return self.getToken(QuilParser.POWER, 0)