Exemplo n.º 1
0
 def getStateString(self, s:DFAState):
     n = s.stateNumber
     baseStateStr = ( ":" if s.isAcceptState else "") + "s" + str(n) + ( "^" if s.requiresFullContext else "")
     if s.isAcceptState:
         if s.predicates is not None:
             return baseStateStr + "=>" + str_list(s.predicates)
         else:
             return baseStateStr + "=>" + str(s.prediction)
     else:
         return baseStateStr
Exemplo n.º 2
0
 def getStateString(self, s):
     n = s.stateNumber
     baseStateStr = ( u":" if s.isAcceptState else u"") + u"s" + unicode(n) + \
         ( u"^" if s.requiresFullContext else u"")
     if s.isAcceptState:
         if s.predicates is not None:
             return baseStateStr + u"=>" + str_list(s.predicates)
         else:
             return baseStateStr + u"=>" + unicode(s.prediction)
     else:
         return baseStateStr
Exemplo n.º 3
0
 def getStateString(self, s):
     n = s.stateNumber
     baseStateStr = ( u":" if s.isAcceptState else u"") + u"s" + unicode(n) + \
         ( u"^" if s.requiresFullContext else u"")
     if s.isAcceptState:
         if s.predicates is not None:
             return baseStateStr + u"=>" + str_list(s.predicates)
         else:
             return baseStateStr + u"=>" + unicode(s.prediction)
     else:
         return baseStateStr
Exemplo n.º 4
0
 def __unicode__(self):
     with StringIO() as buf:
         buf.write(str_list(self.configs))
         if self.hasSemanticContext:
             buf.write(u",hasSemanticContext=")
             buf.write(unicode(self.hasSemanticContext))
         if self.uniqueAlt != ATN.INVALID_ALT_NUMBER:
             buf.write(u",uniqueAlt=")
             buf.write(unicode(self.uniqueAlt))
         if self.conflictingAlts is not None:
             buf.write(u",conflictingAlts=")
             buf.write(unicode(self.conflictingAlts))
         if self.dipsIntoOuterContext:
             buf.write(u",dipsIntoOuterContext")
         return buf.getvalue()
Exemplo n.º 5
0
 def __unicode__(self):
     with StringIO() as buf:
         buf.write(str_list(self.configs))
         if self.hasSemanticContext:
             buf.write(u",hasSemanticContext=")
             buf.write(unicode(self.hasSemanticContext))
         if self.uniqueAlt!=ATN.INVALID_ALT_NUMBER:
             buf.write(u",uniqueAlt=")
             buf.write(unicode(self.uniqueAlt))
         if self.conflictingAlts is not None:
             buf.write(u",conflictingAlts=")
             buf.write(unicode(self.conflictingAlts))
         if self.dipsIntoOuterContext:
             buf.write(u",dipsIntoOuterContext")
         return buf.getvalue()