Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes
xpidl.IDLParser Class Reference

List of all members.

Public Member Functions

def t_multilinecomment
def t_singlelinecomment
def t_IID
def t_IDENTIFIER
def t_LCDATA
def t_INCLUDE
def t_STRING
def t_directive
def t_newline
def t_nativeid_NATIVEID
def t_ANY_error
def p_idlfile
def p_productions_start
def p_productions_cdata
def p_productions_include
def p_productions_interface
def p_typedef
def p_native
def p_afternativeid
def p_anyident
def p_attributes
def p_attlist_start
def p_attlist_continue
def p_attribute
def p_attributeval
def p_interface
def p_ifacebody
def p_ifacebase
def p_members_start
def p_members_continue
def p_member_cdata
def p_member_const
def p_number_decimal
def p_number_hex
def p_number_identifier
def p_number_paren
def p_number_neg
def p_number_add
def p_number_shift
def p_number_bitor
def p_member_att
def p_member_method
def p_paramlist
def p_moreparams_start
def p_moreparams_continue
def p_param
def p_paramtype
def p_optreadonly
def p_dictionary
def p_dictbody
def p_dictmembers_start
def p_dictmembers_continue
def p_dictmember
def p_optnullable
def p_optdefvalue
def p_identifier
def p_raises
def p_idlist
def p_idlist_continue
def p_error
def __init__
def clearComments
def token
def parse
def getLocation

Public Attributes

 lexer
 parser

Static Public Attributes

dictionary keywords
list tokens
tuple states
string hexchar = r'[a-fA-F0-9]'
string t_NUMBER = r'-?\d+'
string t_HEXNUM = r'0x%s+'
string t_LSHIFT = r'<<'
string t_RSHIFT = r'>>'
string literals = '"(){}[],;:=|+-*?'
string t_ignore = ' \t'
string t_nativeid_ignore = ''
tuple precedence

Private Attributes

 _doccomments

Detailed Description

Definition at line 1088 of file xpidl.py.


Constructor & Destructor Documentation

def xpidl.IDLParser.__init__ (   self,
  outputdir = '' 
)

Definition at line 1565 of file xpidl.py.

01565 
01566     def __init__(self, outputdir=''):
01567         self._doccomments = []
01568         self.lexer = lex.lex(object=self,
01569                              outputdir=outputdir,
01570                              lextab='xpidllex',
01571                              optimize=1)
01572         self.parser = yacc.yacc(module=self,
01573                                 outputdir=outputdir,
01574                                 debugfile='xpidl_debug',
01575                                 tabmodule='xpidlyacc',
01576                                 optimize=1)


Member Function Documentation

Definition at line 1577 of file xpidl.py.

01577 
01578     def clearComments(self):
01579         self._doccomments = []

def xpidl.IDLParser.getLocation (   self,
  p,
  i 
)

Definition at line 1597 of file xpidl.py.

01597 
01598     def getLocation(self, p, i):
01599         return Location(self.lexer, p.lineno(i), p.lexpos(i))

Here is the caller graph for this function:

def xpidl.IDLParser.p_afternativeid (   self,
  p 
)
afternativeid : 

Definition at line 1241 of file xpidl.py.

01241 
01242     def p_afternativeid(self, p):
01243         """afternativeid : """
01244         # this is a place marker: we switch the lexer into literal identifier
01245         # mode here, to slurp up everything until the closeparen
01246         self.lexer.begin('nativeid')

def xpidl.IDLParser.p_anyident (   self,
  p 
)
anyident : IDENTIFIER
    | CONST

Definition at line 1247 of file xpidl.py.

01247 
01248     def p_anyident(self, p):
01249         """anyident : IDENTIFIER
01250                     | CONST"""
01251         p[0] = {'value': p[1],
01252                 'location': self.getLocation(p, 1)}

Here is the call graph for this function:

def xpidl.IDLParser.p_attlist_continue (   self,
  p 
)
attlist : attribute ',' attlist

Definition at line 1266 of file xpidl.py.

01266 
01267     def p_attlist_continue(self, p):
01268         """attlist : attribute ',' attlist"""
01269         p[0] = list(p[3])
01270         p[0].insert(0, p[1])

def xpidl.IDLParser.p_attlist_start (   self,
  p 
)
attlist : attribute

Definition at line 1262 of file xpidl.py.

01262 
01263     def p_attlist_start(self, p):
01264         """attlist : attribute"""
01265         p[0] = [p[1]]

def xpidl.IDLParser.p_attribute (   self,
  p 
)
attribute : anyident attributeval

Definition at line 1271 of file xpidl.py.

01271 
01272     def p_attribute(self, p):
01273         """attribute : anyident attributeval"""
01274         p[0] = (p[1]['value'], p[2], p[1]['location'])

def xpidl.IDLParser.p_attributes (   self,
  p 
)
attributes : '[' attlist ']'
      | 

Definition at line 1253 of file xpidl.py.

01253 
01254     def p_attributes(self, p):
01255         """attributes : '[' attlist ']'
01256                       | """
01257         if len(p) == 1:
01258             p[0] = {'attlist': []}
01259         else:
01260             p[0] = {'attlist': p[2],
01261                     'doccomments': p.slice[1].doccomments}

def xpidl.IDLParser.p_attributeval (   self,
  p 
)
attributeval : '(' IDENTIFIER ')'
        | '(' IID ')'
        | 

Definition at line 1275 of file xpidl.py.

01275 
01276     def p_attributeval(self, p):
01277         """attributeval : '(' IDENTIFIER ')'
01278                         | '(' IID ')'
01279                         | """
01280         if len(p) > 1:
01281             p[0] = p[2]

def xpidl.IDLParser.p_dictbody (   self,
  p 
)
dictbody : '{' dictmembers '}'
     | 

Definition at line 1489 of file xpidl.py.

01489 
01490     def p_dictbody(self, p):
01491         """dictbody : '{' dictmembers '}'
01492                      | """
01493         if len(p) > 1:
01494             p[0] = p[2]

def xpidl.IDLParser.p_dictionary (   self,
  p 
)
dictionary : attributes DICTIONARY IDENTIFIER ifacebase dictbody ';'

Definition at line 1471 of file xpidl.py.

01471 
01472     def p_dictionary(self, p):
01473         """dictionary : attributes DICTIONARY IDENTIFIER ifacebase dictbody ';'"""
01474         atts, DICTIONARY, name, base, body, SEMI = p[1:]
01475         attlist = atts['attlist']
01476         doccomments = []
01477         if 'doccomments' in atts:
01478             doccomments.extend(atts['doccomments'])
01479         doccomments.extend(p.slice[2].doccomments)
01480 
01481         l = lambda: self.getLocation(p, 2)
01482 
01483         p[0] = Dictionary(name=name,
01484                           attlist=attlist,
01485                           base=base,
01486                           members=body,
01487                           location=l(),
01488                           doccomments=doccomments)

Here is the call graph for this function:

def xpidl.IDLParser.p_dictmember (   self,
  p 
)
dictmember : attributes IDENTIFIER optnullable IDENTIFIER optdefvalue ';'

Definition at line 1504 of file xpidl.py.

01504 
01505     def p_dictmember(self, p):
01506         """dictmember : attributes IDENTIFIER optnullable IDENTIFIER optdefvalue ';'"""
01507         if 'doccomments' in p[1]:
01508             doccomments = p[1]['doccomments']
01509         else:
01510             doccomments = p.slice[2].doccomments
01511 
01512         p[0] = Attribute(type=p[2],
01513                          name=p[4],
01514                          attlist=p[1]['attlist'],
01515                          readonly=False,
01516                          nullable=p[3] is not None,
01517                          defvalue=p[5],
01518                          location=self.getLocation(p, 1),
01519                          doccomments=doccomments)

Here is the call graph for this function:

def xpidl.IDLParser.p_dictmembers_continue (   self,
  p 
)
dictmembers : dictmember dictmembers

Definition at line 1499 of file xpidl.py.

01499 
01500     def p_dictmembers_continue(self, p):
01501         """dictmembers : dictmember dictmembers"""
01502         p[0] = list(p[2])
01503         p[0].insert(0, p[1])

def xpidl.IDLParser.p_dictmembers_start (   self,
  p 
)
dictmembers : 

Definition at line 1495 of file xpidl.py.

01495 
01496     def p_dictmembers_start(self, p):
01497         """dictmembers : """
01498         p[0] = []

def xpidl.IDLParser.p_error (   self,
  t 
)

Definition at line 1558 of file xpidl.py.

01558 
01559     def p_error(self, t):
01560         if not t:
01561             raise IDLError("Syntax Error at end of file. Possibly due to missing semicolon(;), braces(}) or both", None)
01562         else:
01563             location = Location(self.lexer, t.lineno, t.lexpos)
01564             raise IDLError("invalid syntax", location)

def xpidl.IDLParser.p_identifier (   self,
  p 
)
identifier : DICTIONARY
      | IDENTIFIER

Definition at line 1536 of file xpidl.py.

01536 
01537     def p_identifier(self, p):
01538         """identifier : DICTIONARY
01539                       | IDENTIFIER"""
01540         p[0] = p[1]

def xpidl.IDLParser.p_idlfile (   self,
  p 
)
idlfile : productions

Definition at line 1201 of file xpidl.py.

01201 
01202     def p_idlfile(self, p):
01203         """idlfile : productions"""
01204         p[0] = IDL(p[1])

def xpidl.IDLParser.p_idlist (   self,
  p 
)
idlist : IDENTIFIER

Definition at line 1549 of file xpidl.py.

01549 
01550     def p_idlist(self, p):
01551         """idlist : IDENTIFIER"""
01552         p[0] = [p[1]]

def xpidl.IDLParser.p_idlist_continue (   self,
  p 
)
idlist : IDENTIFIER ',' idlist

Definition at line 1553 of file xpidl.py.

01553 
01554     def p_idlist_continue(self, p):
01555         """idlist : IDENTIFIER ',' idlist"""
01556         p[0] = list(p[3])
01557         p[0].insert(0, p[1])

def xpidl.IDLParser.p_ifacebase (   self,
  p 
)
ifacebase : ':' IDENTIFIER
     | 

Definition at line 1317 of file xpidl.py.

01317 
01318     def p_ifacebase(self, p):
01319         """ifacebase : ':' IDENTIFIER
01320                      | """
01321         if len(p) == 3:
01322             p[0] = p[2]

def xpidl.IDLParser.p_ifacebody (   self,
  p 
)
ifacebody : '{' members '}'
     | 

Definition at line 1311 of file xpidl.py.

01311 
01312     def p_ifacebody(self, p):
01313         """ifacebody : '{' members '}'
01314                      | """
01315         if len(p) > 1:
01316             p[0] = p[2]

def xpidl.IDLParser.p_interface (   self,
  p 
)
interface : attributes INTERFACE IDENTIFIER ifacebase ifacebody ';'

Definition at line 1282 of file xpidl.py.

01282 
01283     def p_interface(self, p):
01284         """interface : attributes INTERFACE IDENTIFIER ifacebase ifacebody ';'"""
01285         atts, INTERFACE, name, base, body, SEMI = p[1:]
01286         attlist = atts['attlist']
01287         doccomments = []
01288         if 'doccomments' in atts:
01289             doccomments.extend(atts['doccomments'])
01290         doccomments.extend(p.slice[2].doccomments)
01291 
01292         l = lambda: self.getLocation(p, 2)
01293 
01294         if body is None:
01295             # forward-declared interface... must not have attributes!
01296             if len(attlist) != 0:
01297                 raise IDLError("Forward-declared interface must not have attributes",
01298                                list[0][3])
01299 
01300             if base is not None:
01301                 raise IDLError("Forward-declared interface must not have a base",
01302                                l())
01303             p[0] = Forward(name=name, location=l(), doccomments=doccomments)
01304         else:
01305             p[0] = Interface(name=name,
01306                              attlist=attlist,
01307                              base=base,
01308                              members=body,
01309                              location=l(),
01310                              doccomments=doccomments)

Here is the call graph for this function:

def xpidl.IDLParser.p_member_att (   self,
  p 
)
member : attributes optreadonly ATTRIBUTE IDENTIFIER identifier ';'

Definition at line 1398 of file xpidl.py.

01398 
01399     def p_member_att(self, p):
01400         """member : attributes optreadonly ATTRIBUTE IDENTIFIER identifier ';'"""
01401         if 'doccomments' in p[1]:
01402             doccomments = p[1]['doccomments']
01403         elif p[2] is not None:
01404             doccomments = p[2]
01405         else:
01406             doccomments = p.slice[3].doccomments
01407 
01408         p[0] = Attribute(type=p[4],
01409                          name=p[5],
01410                          attlist=p[1]['attlist'],
01411                          readonly=p[2] is not None,
01412                          nullable=False,
01413                          defvalue=None,
01414                          location=self.getLocation(p, 3),
01415                          doccomments=doccomments)

Here is the call graph for this function:

def xpidl.IDLParser.p_member_cdata (   self,
  p 
)
member : CDATA

Definition at line 1332 of file xpidl.py.

01332 
01333     def p_member_cdata(self, p):
01334         """member : CDATA"""
01335         p[0] = CDATA(p[1], self.getLocation(p, 1))

Here is the call graph for this function:

def xpidl.IDLParser.p_member_const (   self,
  p 
)
member : CONST IDENTIFIER IDENTIFIER '=' number ';' 

Definition at line 1336 of file xpidl.py.

01336 
01337     def p_member_const(self, p):
01338         """member : CONST IDENTIFIER IDENTIFIER '=' number ';' """
01339         p[0] = ConstMember(type=p[2], name=p[3],
01340                            value=p[5], location=self.getLocation(p, 1),
01341                            doccomments=p.slice[1].doccomments)
01342 
01343 # All "number" products return a function(interface)

Here is the call graph for this function:

def xpidl.IDLParser.p_member_method (   self,
  p 
)
member : attributes IDENTIFIER IDENTIFIER '(' paramlist ')' raises ';'

Definition at line 1416 of file xpidl.py.

01416 
01417     def p_member_method(self, p):
01418         """member : attributes IDENTIFIER IDENTIFIER '(' paramlist ')' raises ';'"""
01419         if 'doccomments' in p[1]:
01420             doccomments = p[1]['doccomments']
01421         else:
01422             doccomments = p.slice[2].doccomments
01423 
01424         p[0] = Method(type=p[2],
01425                       name=p[3],
01426                       attlist=p[1]['attlist'],
01427                       paramlist=p[5],
01428                       location=self.getLocation(p, 3),
01429                       doccomments=doccomments,
01430                       raises=p[7])

Here is the call graph for this function:

def xpidl.IDLParser.p_members_continue (   self,
  p 
)
members : member members

Definition at line 1327 of file xpidl.py.

01327 
01328     def p_members_continue(self, p):
01329         """members : member members"""
01330         p[0] = list(p[2])
01331         p[0].insert(0, p[1])

def xpidl.IDLParser.p_members_start (   self,
  p 
)
members : 

Definition at line 1323 of file xpidl.py.

01323 
01324     def p_members_start(self, p):
01325         """members : """
01326         p[0] = []

def xpidl.IDLParser.p_moreparams_continue (   self,
  p 
)
moreparams : ',' param moreparams

Definition at line 1444 of file xpidl.py.

01444 
01445     def p_moreparams_continue(self, p):
01446         """moreparams : ',' param moreparams"""
01447         p[0] = list(p[3])
01448         p[0].insert(0, p[2])

def xpidl.IDLParser.p_moreparams_start (   self,
  p 
)
moreparams :

Definition at line 1440 of file xpidl.py.

01440 
01441     def p_moreparams_start(self, p):
01442         """moreparams :"""
01443         p[0] = []

def xpidl.IDLParser.p_native (   self,
  p 
)
native : attributes NATIVE IDENTIFIER afternativeid '(' NATIVEID ')' ';'

Definition at line 1234 of file xpidl.py.

01234 
01235     def p_native(self, p):
01236         """native : attributes NATIVE IDENTIFIER afternativeid '(' NATIVEID ')' ';'"""
01237         p[0] = Native(name=p[3],
01238                       nativename=p[6],
01239                       attlist=p[1]['attlist'],
01240                       location=self.getLocation(p, 2))

Here is the call graph for this function:

def xpidl.IDLParser.p_number_add (   self,
  p 
)
number : number '+' number
  | number '-' number
  | number '*' number

Definition at line 1369 of file xpidl.py.

01369 
01370     def p_number_add(self, p):
01371         """number : number '+' number
01372                   | number '-' number
01373                   | number '*' number"""
01374         n1 = p[1]
01375         n2 = p[3]
01376         if p[2] == '+':
01377             p[0] = lambda i: n1(i) + n2(i)
01378         elif p[2] == '-':
01379             p[0] = lambda i: n1(i) - n2(i)
01380         else:
01381             p[0] = lambda i: n1(i) * n2(i)

def xpidl.IDLParser.p_number_bitor (   self,
  p 
)
number : number '|' number

Definition at line 1392 of file xpidl.py.

01392 
01393     def p_number_bitor(self, p):
01394         """number : number '|' number"""
01395         n1 = p[1]
01396         n2 = p[3]
01397         p[0] = lambda i: n1(i) | n2(i)

def xpidl.IDLParser.p_number_decimal (   self,
  p 
)
number : NUMBER

Definition at line 1344 of file xpidl.py.

01344 
01345     def p_number_decimal(self, p):
01346         """number : NUMBER"""
01347         n = int(p[1])
01348         p[0] = lambda i: n

def xpidl.IDLParser.p_number_hex (   self,
  p 
)
number : HEXNUM

Definition at line 1349 of file xpidl.py.

01349 
01350     def p_number_hex(self, p):
01351         """number : HEXNUM"""
01352         n = int(p[1], 16)
01353         p[0] = lambda i: n

def xpidl.IDLParser.p_number_identifier (   self,
  p 
)
number : IDENTIFIER

Definition at line 1354 of file xpidl.py.

01354 
01355     def p_number_identifier(self, p):
01356         """number : IDENTIFIER"""
01357         id = p[1]
01358         loc = self.getLocation(p, 1)
01359         p[0] = lambda i: i.getConst(id, loc)

Here is the call graph for this function:

def xpidl.IDLParser.p_number_neg (   self,
  p 
)
number : '-' number %prec UMINUS

Definition at line 1364 of file xpidl.py.

01364 
01365     def p_number_neg(self, p):
01366         """number : '-' number %prec UMINUS"""
01367         n = p[2]
01368         p[0] = lambda i: - n(i)

def xpidl.IDLParser.p_number_paren (   self,
  p 
)
number : '(' number ')'

Definition at line 1360 of file xpidl.py.

01360 
01361     def p_number_paren(self, p):
01362         """number : '(' number ')'"""
01363         p[0] = p[2]

def xpidl.IDLParser.p_number_shift (   self,
  p 
)
number : number LSHIFT number
  | number RSHIFT number

Definition at line 1382 of file xpidl.py.

01382 
01383     def p_number_shift(self, p):
01384         """number : number LSHIFT number
01385                   | number RSHIFT number"""
01386         n1 = p[1]
01387         n2 = p[3]
01388         if p[2] == '<<':
01389             p[0] = lambda i: n1(i) << n2(i)
01390         else:
01391             p[0] = lambda i: n1(i) >> n2(i)

def xpidl.IDLParser.p_optdefvalue (   self,
  p 
)
optdefvalue : '=' STRING
       | 

Definition at line 1528 of file xpidl.py.

01528 
01529     def p_optdefvalue(self, p):
01530         """optdefvalue : '=' STRING
01531                        | """
01532         if len(p) > 1:
01533             p[0] = p[2]
01534         else:
01535             p[0] = None

def xpidl.IDLParser.p_optnullable (   self,
  p 
)
optnullable : '?'
       | 

Definition at line 1520 of file xpidl.py.

01520 
01521     def p_optnullable(self, p):
01522         """optnullable : '?'
01523                        | """
01524         if len(p) > 1:
01525             p[0] = p[1]
01526         else:
01527             p[0] = None

def xpidl.IDLParser.p_optreadonly (   self,
  p 
)
optreadonly : READONLY
       | 

Definition at line 1463 of file xpidl.py.

01463 
01464     def p_optreadonly(self, p):
01465         """optreadonly : READONLY
01466                        | """
01467         if len(p) > 1:
01468             p[0] = p.slice[1].doccomments
01469         else:
01470             p[0] = None

def xpidl.IDLParser.p_param (   self,
  p 
)
param : attributes paramtype IDENTIFIER identifier

Definition at line 1449 of file xpidl.py.

01449 
01450     def p_param(self, p):
01451         """param : attributes paramtype IDENTIFIER identifier"""
01452         p[0] = Param(paramtype=p[2],
01453                      type=p[3],
01454                      name=p[4],
01455                      attlist=p[1]['attlist'],
01456                      location=self.getLocation(p, 3))

Here is the call graph for this function:

def xpidl.IDLParser.p_paramlist (   self,
  p 
)
paramlist : param moreparams
     | 

Definition at line 1431 of file xpidl.py.

01431 
01432     def p_paramlist(self, p):
01433         """paramlist : param moreparams
01434                      | """
01435         if len(p) == 1:
01436             p[0] = []
01437         else:
01438             p[0] = list(p[2])
01439             p[0].insert(0, p[1])

def xpidl.IDLParser.p_paramtype (   self,
  p 
)
paramtype : IN
     | INOUT
     | OUT

Definition at line 1457 of file xpidl.py.

01457 
01458     def p_paramtype(self, p):
01459         """paramtype : IN
01460                      | INOUT
01461                      | OUT"""
01462         p[0] = p[1]

def xpidl.IDLParser.p_productions_cdata (   self,
  p 
)
productions : CDATA productions

Definition at line 1209 of file xpidl.py.

01209 
01210     def p_productions_cdata(self, p):
01211         """productions : CDATA productions"""
01212         p[0] = list(p[2])
01213         p[0].insert(0, CDATA(p[1], self.getLocation(p, 1)))

Here is the call graph for this function:

def xpidl.IDLParser.p_productions_include (   self,
  p 
)
productions : INCLUDE productions

Definition at line 1214 of file xpidl.py.

01214 
01215     def p_productions_include(self, p):
01216         """productions : INCLUDE productions"""
01217         p[0] = list(p[2])
01218         p[0].insert(0, Include(p[1], self.getLocation(p, 1)))

Here is the call graph for this function:

def xpidl.IDLParser.p_productions_interface (   self,
  p 
)
productions : interface productions
       | dictionary productions
       | typedef productions
       | native productions

Definition at line 1219 of file xpidl.py.

01219 
01220     def p_productions_interface(self, p):
01221         """productions : interface productions
01222                        | dictionary productions
01223                        | typedef productions
01224                        | native productions"""
01225         p[0] = list(p[2])
01226         p[0].insert(0, p[1])

def xpidl.IDLParser.p_productions_start (   self,
  p 
)
productions : 

Definition at line 1205 of file xpidl.py.

01205 
01206     def p_productions_start(self, p):
01207         """productions : """
01208         p[0] = []

def xpidl.IDLParser.p_raises (   self,
  p 
)
raises : RAISES '(' idlist ')'
  | 

Definition at line 1541 of file xpidl.py.

01541 
01542     def p_raises(self, p):
01543         """raises : RAISES '(' idlist ')'
01544                   | """
01545         if len(p) == 1:
01546             p[0] = []
01547         else:
01548             p[0] = p[3]

def xpidl.IDLParser.p_typedef (   self,
  p 
)
typedef : TYPEDEF IDENTIFIER IDENTIFIER ';'

Definition at line 1227 of file xpidl.py.

01227 
01228     def p_typedef(self, p):
01229         """typedef : TYPEDEF IDENTIFIER IDENTIFIER ';'"""
01230         p[0] = Typedef(type=p[2],
01231                        name=p[3],
01232                        location=self.getLocation(p, 1),
01233                        doccomments=p.slice[1].doccomments)

Here is the call graph for this function:

def xpidl.IDLParser.parse (   self,
  data,
  filename = None 
)

Definition at line 1587 of file xpidl.py.

01587 
01588     def parse(self, data, filename=None):
01589         if filename is not None:
01590             self.lexer.filename = filename
01591         self.lexer.lineno = 1
01592         self.lexer.input(data)
01593         idl = self.parser.parse(lexer=self)
01594         if filename is not None:
01595             idl.deps.append(filename)
01596         return idl

def xpidl.IDLParser.t_ANY_error (   self,
  t 
)

Definition at line 1187 of file xpidl.py.

01187 
01188     def t_ANY_error(self, t):
01189         raise IDLError("unrecognized input",
01190                        Location(lexer=self.lexer,
01191                                 lineno=self.lexer.lineno,
01192                                 lexpos=self.lexer.lexpos))

def xpidl.IDLParser.t_directive (   self,
  t 
)

Definition at line 1170 of file xpidl.py.

01170 
01171     def t_directive(self, t):
01172         r'\#(?P<directive>[a-zA-Z]+)[^\n]+'
01173         raise IDLError("Unrecognized directive %s" % t.lexer.lexmatch.group('directive'),
01174                        Location(lexer=self.lexer, lineno=self.lexer.lineno,
01175                                 lexpos=self.lexer.lexpos))

def xpidl.IDLParser.t_IDENTIFIER (   self,
  t 
)

Definition at line 1146 of file xpidl.py.

01146 
01147     def t_IDENTIFIER(self, t):
01148         r'unsigned\ long\ long|unsigned\ short|unsigned\ long|long\ long|[A-Za-z][A-Za-z_0-9]*'
01149         t.type = self.keywords.get(t.value, 'IDENTIFIER')
01150         return t

def xpidl.IDLParser.t_IID (   self,
  t 
)

Definition at line 1142 of file xpidl.py.

01142 
01143     def t_IID(self, t):
        return t
def xpidl.IDLParser.t_INCLUDE (   self,
  t 
)

Definition at line 1158 of file xpidl.py.

01158 
01159     def t_INCLUDE(self, t):
01160         r'\#include[ \t]+"[^"\n]+"'
01161         inc, value, end = t.value.split('"')
01162         t.value = value
01163         return t

def xpidl.IDLParser.t_LCDATA (   self,
  t 
)

Definition at line 1151 of file xpidl.py.

01151 
01152     def t_LCDATA(self, t):
01153         r'(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?'
01154         t.type = 'CDATA'
01155         t.value = t.lexer.lexmatch.group('cdata')
01156         t.lexer.lineno += t.value.count('\n')
01157         return t

def xpidl.IDLParser.t_multilinecomment (   self,
  t 
)

Definition at line 1133 of file xpidl.py.

01133 
01134     def t_multilinecomment(self, t):
01135         r'/\*(?s).*?\*/'
01136         t.lexer.lineno += t.value.count('\n')
01137         if t.value.startswith("/**"):
01138             self._doccomments.append(t.value)

def xpidl.IDLParser.t_nativeid_NATIVEID (   self,
  t 
)

Definition at line 1180 of file xpidl.py.

01180 
01181     def t_nativeid_NATIVEID(self, t):
01182         r'[^()\n]+(?=\))'
01183         t.lexer.begin('INITIAL')
01184         return t

def xpidl.IDLParser.t_newline (   self,
  t 
)

Definition at line 1176 of file xpidl.py.

01176 
01177     def t_newline(self, t):
01178         r'\n+'
01179         t.lexer.lineno += len(t.value)

def xpidl.IDLParser.t_singlelinecomment (   self,
  t 
)

Definition at line 1139 of file xpidl.py.

01139 
01140     def t_singlelinecomment(self, t):
01141         r'(?m)//.*?$'

def xpidl.IDLParser.t_STRING (   self,
  t 
)

Definition at line 1164 of file xpidl.py.

01164 
01165     def t_STRING(self, t):
01166         r'"[^"\n]+"'
01167         begin, value, end = t.value.split('"')
01168         t.value = value
01169         return t

def xpidl.IDLParser.token (   self)

Definition at line 1580 of file xpidl.py.

01580 
01581     def token(self):
01582         t = self.lexer.token()
01583         if t is not None and t.type != 'CDATA':
01584             t.doccomments = self._doccomments
01585             self._doccomments = []
01586         return t


Member Data Documentation

Definition at line 1566 of file xpidl.py.

string xpidl.IDLParser.hexchar = r'[a-fA-F0-9]' [static]

Definition at line 1122 of file xpidl.py.

dictionary xpidl.IDLParser.keywords [static]
Initial value:
{
        'const': 'CONST',
        'interface': 'INTERFACE',
        'dictionary': 'DICTIONARY',
        'in': 'IN',
        'inout': 'INOUT',
        'out': 'OUT',
        'attribute': 'ATTRIBUTE',
        'raises': 'RAISES',
        'readonly': 'READONLY',
        'native': 'NATIVE',
        'typedef': 'TYPEDEF'
        }

Definition at line 1089 of file xpidl.py.

Definition at line 1567 of file xpidl.py.

string xpidl.IDLParser.literals = '"(){}[],;:=|+-*?' [static]

Definition at line 1129 of file xpidl.py.

Definition at line 1571 of file xpidl.py.

Initial value:
(
        ('left', '|'),
        ('left', 'LSHIFT', 'RSHIFT'),
        ('left', '+', '-'),
        ('left', '*'),
        ('left', 'UMINUS'),
    )

Definition at line 1193 of file xpidl.py.

tuple xpidl.IDLParser.states [static]
Initial value:
(
        ('nativeid', 'exclusive'),
    )

Definition at line 1118 of file xpidl.py.

string xpidl.IDLParser.t_HEXNUM = r'0x%s+' [static]

Definition at line 1125 of file xpidl.py.

string xpidl.IDLParser.t_ignore = ' \t' [static]

Definition at line 1131 of file xpidl.py.

string xpidl.IDLParser.t_LSHIFT = r'<<' [static]

Definition at line 1126 of file xpidl.py.

string xpidl.IDLParser.t_nativeid_ignore = '' [static]

Definition at line 1185 of file xpidl.py.

string xpidl.IDLParser.t_NUMBER = r'-?\d+' [static]

Definition at line 1124 of file xpidl.py.

string xpidl.IDLParser.t_RSHIFT = r'>>' [static]

Definition at line 1127 of file xpidl.py.

list xpidl.IDLParser.tokens [static]
Initial value:
[
        'IDENTIFIER',
        'CDATA',
        'INCLUDE',
        'IID',
        'NUMBER',
        'HEXNUM',
        'LSHIFT',
        'RSHIFT',
        'NATIVEID',
        'STRING',
        ]

Definition at line 1103 of file xpidl.py.


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