Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, parser, parent=None, invokingState=-1):
super(QuilParser.Pragma_nameContext, self).__init__(parent, invokingState)
self.parser = parser
def CIS(self):
return self.getToken(QuilParser.CIS, 0)
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
def getRuleIndex(self):
return QuilParser.RULE_classicalBinary
def param(self, i=None):
if i is None:
return self.getTypedRuleContexts(QuilParser.ParamContext)
else:
return self.getTypedRuleContext(QuilParser.ParamContext,i)
def PLUS(self):
return self.getToken(QuilParser.PLUS, 0)
def MINUS(self):
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
def sign(self):
return self.getTypedRuleContext(QuilParser.SignContext,0)
def SQRT(self):
return self.getToken(QuilParser.SQRT, 0)
def POWER(self):
return self.getToken(QuilParser.POWER, 0)