Logo Search packages:      
Sourcecode: yapps2 version File versions  Download package

def yapps::runtime::Scanner::peek (   self,
  types,
  kw 
)

Returns the token type for lookahead; if there are any args
then the list of args is the set of token types to allow

Definition at line 325 of file runtime.py.

00325                                   :
            """Returns the token type for lookahead; if there are any args
            then the list of args is the set of token types to allow"""
            context = kw.get("context",None)
            if self.last_token is None:
                  self.last_types = types
                  self.last_token = self.token(types,context)
            elif self.last_types:
                  for t in types:
                        if t not in self.last_types:
                              raise NotImplementedError("Unimplemented: restriction set changed")
            return self.last_token.type
            
      def scan(self, type, **kw):


Generated by  Doxygen 1.6.0   Back to index