parserFwk.pyparsing.Keyword

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

## Type Keyword

       object --+
                |
    ParserElement --+
                    |
                Token --+
                        |
                       Keyword

Known Subclasses:
  `CaselessKeyword`

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)`
| ``copy`(self)` Make a copy of this ParserElement.
| `parseImpl(self, instring, loc, doActions)`
| ``setDefaultKeywordChars`(chars)` Overrides the default Keyword chars (Static method)
Inherited from `Token`: `setName` Inherited from `ParserElement`: `__add__`, `__and__`, `__call__`, `__getattr__`, `__invert__`, `__or__`, `__radd__`, `__rand__`, `__repr__`, `__ror__`, `__rxor__`, `__str__`, `__xor__`, `addParseAction`, `checkRecursion`, `enablePackrat`, `getException`, `ignore`, `leaveWhitespace`, `normalizeParseActionArgs`, `parseFile`, `parseString`, `parseWithTabs`, `postParse`, `preParse`, `resetCache`, `scanString`, `searchString`, `setBreak`, `setDebug`, `setDebugActions`, `setDefaultWhitespaceChars`, `setFailAction`, `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

### copy(self) Make a copy of this ParserElement. Useful for defining different parse actions for the same parsing pattern, using copies of the original parse element. Overrides: `parserFwk.pyparsing.ParserElement.copy` (inherited documentation)

Static Method Details

### setDefaultKeywordChars(chars) Overrides the default Keyword chars

Class Variable Details

    ### DEFAULT_KEYWORD_CHARS Type: `str` Value:
        'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'

Generated by Epydoc 2.1 on Sun Oct 07 01:31:52 2007 | http://epydoc.sf.net