grammar

Full name: ase2sprkkr.common.grammar

Module class hierarchy

Inheritance diagram of ase2sprkkr.common.grammar.Forward, ase2sprkkr.common.grammar.SkipToRegex, ase2sprkkr.common.grammar.Suppress, ase2sprkkr.common.grammar.TokenConverter, ase2sprkkr.common.grammar.Transparent, 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)

optional_quote

Grammar for an optional quote

Functions

add_condition_ex(self, condition, message)

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

add_parse_action_ex(self, pa[, message])

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

as_delimiter(grammar[, written])

Return a suppressed delimiter grammar named by its written form.

delimitedList(expr, delim)

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

generate_grammar()

Share SPRKKR parser defaults until the last grammar builder exits.

replace_whitechars(expr)

separator_grammar(char)

Pattern for separating sections in an input file

separator_pattern(char)

Classes

Forward([expr])

SkipToRegex(pattern[, include_pattern, ...])

Skip to given regex

Suppress(expr)

TokenConverter(expr[, savelist])

Transparent(expr[, savelist])

Pyparsing ParseElementEnhance wrongly takes care about whitespaces, if there is nested Forward with whitespaces not already set.

White(white)

Fix for whitechars in pp.White