| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
pyparsing.Literal Class Reference
Inheritance diagram for pyparsing.Literal:
[legend]
Collaboration diagram for pyparsing.Literal:
[legend]

## Public Member Functions
def | __init__
def | parseImpl
Public Member Functions inherited from pyparsing.Token
def | __init__
def | setName
Public Member Functions inherited from pyparsing.ParserElement
def | setDefaultWhitespaceChars
def | __init__
def | copy
def | setName
def | setResultsName
def | setBreak
def | setParseAction
def | addParseAction
def | setFailAction
def | preParse
def | parseImpl
def | postParse
def | tryParse
def | resetCache
def | enablePackrat
def | parseString
def | scanString
def | transformString
def | searchString
def | __add__
def | __radd__
def | __sub__
def | __rsub__
def | __mul__
def | __rmul__
def | __or__
def | __ror__
def | __xor__
def | __rxor__
def | __and__
def | __rand__
def | __invert__
def | __call__
def | suppress
def | leaveWhitespace
def | setWhitespaceChars
def | parseWithTabs
def | ignore
def | setDebugActions
def | setDebug
def | __str__
def | __repr__
def | streamline
def | checkRecursion
def | validate
def | parseFile
def | getException
def | __getattr__
def | __eq__
def | __ne__
def | __hash__
def | __req__
def | __rne__

## Public Attributes
| match
| matchLen
| firstMatchChar
| name
| errmsg
| mayReturnEmpty
| mayIndexError
Public Attributes inherited from pyparsing.Token
| errmsg
Public Attributes inherited from pyparsing.ParserElement
| parseAction
| failAction
| strRepr
| resultsName
| saveAsList
| skipWhitespace
| whiteChars
| copyDefaultWhiteChars
| mayReturnEmpty
| keepTabs
| ignoreExprs
| debug
| streamlined
| mayIndexError
| errmsg
| modalResults
| debugActions
| re
| callPreparse
| callDuringTry
| name
| myException

## Private Attributes
| __class__

## Additional Inherited Members
Static Public Attributes inherited from pyparsing.ParserElement
string | DEFAULT_WHITE_CHARS " \n\t\r"
tuple | setDefaultWhitespaceChars staticmethod(setDefaultWhitespaceChars)
tuple | resetCache staticmethod(resetCache)
tuple | enablePackrat staticmethod(enablePackrat)

## Detailed Description

    Token to exactly match a specified string.

Definition at line 1484 of file pyparsing.py.

## Constructor & Destructor Documentation

def pyparsing.Literal.__init__ | ( |  | self,
|  |  | matchString
| ) |  |

Definition at line 1486 of file pyparsing.py.

1486
1487 def __init__( self, matchString ):
1488 super(Literal,self).__init__()
1489 self.match = matchString
1490 self.matchLen = len(matchString)
1491 try:
1492 self.firstMatchChar = matchString[0]
1493 except IndexError:
1494 warnings.warn("null string passed to Literal; use Empty() instead",
1495 SyntaxWarning, stacklevel=2)
1496 self.__class__ = Empty
1497 self.name = '"%s"' % _ustr(self.match)
1498 self.errmsg = "Expected " + self.name
1499 self.mayReturnEmpty = False
1500 #self.myException.msg = self.errmsg
1501 self.mayIndexError = False

## Member Function Documentation

def pyparsing.Literal.parseImpl | ( |  | self,
|  |  | instring,
|  |  | loc,
|  |  | doActions = `True`
| ) |  |

Definition at line 1506 of file pyparsing.py.

1506
1507 def parseImpl( self, instring, loc, doActions=True ):
1508 if (instring[loc] == self.firstMatchChar and
1509 (self.matchLen==1 or instring.startswith(self.match,loc)) ):
1510 return loc+self.matchLen, self.match
1511 #~ raise ParseException( instring, loc, self.errmsg )
1512 exc = self.myException
1513 exc.loc = loc
1514 exc.pstr = instring
raise exc

## Member Data Documentation

pyparsing.Literal.__class__
| private

Definition at line 1495 of file pyparsing.py.

pyparsing.Literal.errmsg

Definition at line 1497 of file pyparsing.py.

pyparsing.Literal.firstMatchChar

Definition at line 1491 of file pyparsing.py.

pyparsing.Literal.match

Definition at line 1488 of file pyparsing.py.

pyparsing.Literal.matchLen

Definition at line 1489 of file pyparsing.py.

pyparsing.Literal.mayIndexError

Definition at line 1500 of file pyparsing.py.

pyparsing.Literal.mayReturnEmpty

Definition at line 1498 of file pyparsing.py.

pyparsing.Literal.name

Definition at line 1496 of file pyparsing.py.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/cmake/cmt2cmake/pyparsing.py