grammar

Full name: ase2sprkkr.common.grammar

Module class hierarchy

Inheritance diagram of ase2sprkkr.common.grammar.White

Description

Various pyparsing grammar elements and a few useful routines.

Module Attributes

optional_line_end

Grammar for an optinal newline

line_end

Grammar for a required newline

end_of_file

Grammar for an end of file (ending whitespaces are allowed)

separator_pattern

Pattern for separating sections in an input file

separator

Grammar for separating sections in an input file

optional_quote

Grammar for an optional quote

Functions

addConditionEx(self, condition, message)

Add check condition to the pyparsing ParseElement, that, if it failed, raise a parse exception with a given message.

addParseActionEx(self, pa[, message])

Add parse action to a given pyparsing ParseElemenet, that, if it raise an exception, fail with a given message

delimitedList(expr, delim)

Delimited list with already suppressed delimiter (or with a in-results-wanted one)

generate_grammar()

Set the pyparsing newline handling and then restore to the original state

replace_whitechars(expr)

Classes

White(white)

Fix for whitechars in pp.White