Module pyparsing :: Class Keyword
[frames | no frames]

Type Keyword

   object --+        
ParserElement --+    
            Token --+

Token to exactly match a specified string as a keyword, that is, it must be immediately followed by a non-keyword character. Compare with Literal:
 Literal("if") will match the leading 'if' in 'ifAndOnlyIf'.
 Keyword("if") will not; it will only match the leading 'if in 'if x=1', or 'if(y==2)'
Accepts two optional constructor arguments in addition to the keyword string: identChars is a string of characters that would be valid identifier characters, defaulting to all alphanumerics + "_" and "$"; caseless allows case-insensitive matching, default is False.
Method Summary
  __init__(self, matchString, identChars, caseless)
Make a copy of this ParseElement.
  parseImpl(self, instring, loc, doActions)
Overrides the default Keyword chars (Static method)
Inherited from Token: setName
Inherited from ParserElement: __add__, __invert__, __or__, __radd__, __repr__, __ror__, __rxor__, __str__, __xor__, checkRecursion, ignore, leaveWhitespace, parse, parseFile, parseString, parseWithTabs, postParse, preParse, scanString, setDebug, setDebugActions, setDefaultWhitespaceChars, setParseAction, setResultsName, setWhitespaceChars, skipIgnorables, streamline, suppress, transformString, tryParse, validate
Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Variable Summary
str DEFAULT_KEYWORD_CHARS = 'abcdefghijklmnopqrstuvwxyzABCDE...
Inherited from ParserElement: DEFAULT_WHITE_CHARS

Instance Method Details


Make a copy of this ParseElement. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element.
pyparsing.ParserElement.copy (inherited documentation)

Static Method Details


Overrides the default Keyword chars

Class Variable Details



Generated by Epydoc 2.1 on Sun Jun 12 22:30:07 2005