Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
asdl.ASDLScanner Class Reference
Inheritance diagram for asdl.ASDLScanner:
Inheritance graph
[legend]
Collaboration diagram for asdl.ASDLScanner:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def tokenize
def t_id
def t_string
def t_xxx
def t_punctuation
def t_comment
def t_newline
def t_whitespace
def t_default
def makeRE
def reflect
def error

Public Attributes

 rv
 lineno
 re
 index2func
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 64 of file asdl.py.


Member Function Documentation

def spark.GenericScanner.error (   self,
  s,
  pos 
) [inherited]

Definition at line 72 of file spark.py.

00072 
00073     def error(self, s, pos):
00074         output("Lexical error at position %s" % pos)
00075         raise SystemExit

Here is the call graph for this function:

Here is the caller graph for this function:

def spark.GenericScanner.makeRE (   self,
  name 
) [inherited]

Definition at line 58 of file spark.py.

00058 
00059     def makeRE(self, name):
00060         doc = getattr(self, name).__doc__
00061         rv = '(?P<%s>%s)' % (name[2:], doc)
00062         return rv

Here is the call graph for this function:

Here is the caller graph for this function:

def spark.GenericScanner.reflect (   self) [inherited]

Definition at line 63 of file spark.py.

00063 
00064     def reflect(self):
00065         rv = []
00066         for name in _namelist(self):
00067             if name[:2] == 't_' and name != 't_default':
00068                 rv.append(self.makeRE(name))
00069 
00070         rv.append(self.makeRE('t_default'))
00071         return '|'.join(rv)

Here is the call graph for this function:

Here is the caller graph for this function:

def asdl.ASDLScanner.t_comment (   self,
  s 
)

Definition at line 90 of file asdl.py.

00090 
00091     def t_comment(self, s):
00092         r"\-\-[^\n]*"
00093         pass

def asdl.ASDLScanner.t_default (   self,
  s 
)

Reimplemented from spark.GenericScanner.

Definition at line 102 of file asdl.py.

00102 
00103     def t_default(self, s):
00104         r" . +"
00105         raise ValueError("unmatched input: %r" % s)

def asdl.ASDLScanner.t_id (   self,
  s 
)

Definition at line 72 of file asdl.py.

00072 
00073     def t_id(self, s):
00074         r"[\w\.]+"
00075         # XXX doesn't distinguish upper vs. lower, which is
00076         # significant for ASDL.
00077         self.rv.append(Id(s, self.lineno))

def asdl.ASDLScanner.t_newline (   self,
  s 
)

Definition at line 94 of file asdl.py.

00094 
00095     def t_newline(self, s):
00096         r"\n"
00097         self.lineno += 1

def asdl.ASDLScanner.t_punctuation (   self,
  s 
)

Definition at line 86 of file asdl.py.

00086 
00087     def t_punctuation(self, s):
00088         r"[\{\}\*\=\|\(\)\,\?\:]"
00089         self.rv.append(Token(s, self.lineno))

def asdl.ASDLScanner.t_string (   self,
  s 
)

Definition at line 78 of file asdl.py.

00078 
00079     def t_string(self, s):
00080         r'"[^"]*"'
00081         self.rv.append(String(s, self.lineno))

def asdl.ASDLScanner.t_whitespace (   self,
  s 
)

Definition at line 98 of file asdl.py.

00098 
00099     def t_whitespace(self, s):
00100         r"[ \t]+"
00101         pass

def asdl.ASDLScanner.t_xxx (   self,
  s 
)

Definition at line 82 of file asdl.py.

00082 
00083     def t_xxx(self, s): # not sure what this production means
00084         r"<="
00085         self.rv.append(Token(s, self.lineno))

def asdl.ASDLScanner.tokenize (   self,
  input 
)

Reimplemented from spark.GenericScanner.

Definition at line 66 of file asdl.py.

00066 
00067     def tokenize(self, input):
00068         self.rv = []
00069         self.lineno = 1
00070         super(ASDLScanner, self).tokenize(input)
00071         return self.rv


Member Data Documentation

Definition at line 54 of file spark.py.

Definition at line 68 of file asdl.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 52 of file spark.py.

Definition at line 67 of file asdl.py.


The documentation for this class was generated from the following file: