MCPcopy Create free account

hub / github.com/pyparsing/pyparsing / functions

Functions1,655 in github.com/pyparsing/pyparsing

↓ 499 callersMethodparse_string
Parse a string with respect to the parser definition. This function is intended as the primary interface to the client code.
pyparsing/core.py:1274
↓ 492 callersMethodset_name
Define name for this expression, makes debugging and exception messages clearer. If `__diag__.enable_debug_on_named_expressions` is s
pyparsing/core.py:2139
↓ 255 callersMethodset_parse_action
Define one or more actions to perform when successfully matching parse element definition. Parse actions can be called to perform da
pyparsing/core.py:686
↓ 162 callersMethodadd_parse_action
Add one or more parse actions to expression's list of parse actions. See :class:`set_parse_action`. See examples in :class:`copy`.
pyparsing/core.py:802
↓ 161 callersFunctiontest
(s, expected)
examples/fourFn.py:166
↓ 152 callersMethodas_list
Returns the parse results as a nested list of matching tokens, all converted to strings. If ``flatten`` is True, all the nesting leve
pyparsing/results.py:589
↓ 127 callersMethoddump
Diagnostic method for listing out the contents of a :class:`ParseResults`. Accepts an optional ``indent`` argument so that th
pyparsing/results.py:761
↓ 126 callersMethodsuppress
(self)
pyparsing/core.py:6686
↓ 110 callersMethodassertParseResultsEquals
Unit test assertion to compare a :class:`ParseResults` object with an optional ``expected_list``, and compare any defined res
pyparsing/testing.py:150
↓ 109 callersMethodsplit
Generator method to split a string using the given expression as a separator. May be called with optional ``maxsplit`` argument, to l
pyparsing/core.py:1572
↓ 106 callersMethodappend
Add single element to end of ``ParseResults`` list of elements. Example: .. doctest:: >>> numlist = Word(nums)[
pyparsing/results.py:459
↓ 104 callersMethodrun_tests
Execute the parse expression on a series of test strings, showing each test, the parsed results or where the parse failed. Quick and
pyparsing/core.py:2287
↓ 97 callersFunctionone_of
Helper to quickly define a set of alternative :class:`Literal` s, and makes sure to do longest-first testing when there is a conflict, regardl
pyparsing/helpers.py:176
↓ 72 callersMethodcopy
Returns a copy of this expression. Generally only used internally by pyparsing.
pyparsing/core.py:3300
↓ 71 callersMethodassertParseAndCheckList
Convenience wrapper assert to test a parser element and input string, and assert that the resulting :meth:`ParseResults.as_li
pyparsing/testing.py:162
↓ 66 callersMethodassertRaises
Simple wrapper to print out the exceptions raised after assertRaises
tests/test_unit.py:117
↓ 64 callersFunctionreplaced_by_pep8
(compat_name: str, fn: C)
pyparsing/util.py:450
↓ 57 callersMethodscan_string
Scan the input string for expression matches. Each match will return the matching tokens, start location, and end location. May be
pyparsing/core.py:1350
↓ 56 callersMethodset_results_name
Define name for referencing matching tokens as a nested attribute of the returned parse results. Normally, results names are
pyparsing/core.py:617
↓ 54 callersMethodusing_each
Yields a sequence of ``class(obj, **class_kwargs)`` for obj in seq. Example: .. testcode:: LPAR, RPAR, LBRACE,
pyparsing/core.py:472
↓ 51 callersMethodignore
Define expression to be ignored (e.g., comments) while doing pattern matching; may be called repeatedly, to define multiple comment o
pyparsing/core.py:6068
↓ 49 callersMethod__init__
( self, exprs: typing.Iterable[ParserElement], savelist: bool = False )
pyparsing/core.py:4678
↓ 46 callersMethodsearch_string
Another extension to :class:`scan_string`, simplifying the access to the tokens found to match the given parse expression. May be ca
pyparsing/core.py:1513
↓ 45 callersFunctiondeprecate_argument
( kwargs: dict[str, Any], arg_name: str, default_value=None, *, new_name: str = "" )
pyparsing/util.py:500
↓ 45 callersMethodtransform_string
Extension to :class:`scan_string`, to modify matching text with modified tokens that may be returned from a parse action. To use ``t
pyparsing/core.py:1454
↓ 42 callersMethodassertRaisesParseException
( self, exc_type=ParseException, expected_msg=None, msg=None )
pyparsing/testing.py:264
↓ 38 callersMethodappend
Add an expression to the list of expressions related to this ParseExpression instance.
pyparsing/core.py:4317
↓ 34 callersMethoditems
(self)
pyparsing/results.py:327
↓ 33 callersMethodcreate_diagram
Create a railroad diagram for the parser. Parameters: - ``output_html`` (str or file-like object) - output target for gener
pyparsing/core.py:2529
↓ 31 callersMethodextend
Add sequence of elements to end of :class:`ParseResults` list of elements. Example: .. testcode:: patt = Word(a
pyparsing/results.py:483
↓ 29 callersMethodfrom_call
If you call this function in the same way that you would call the constructor, it will store the arguments as you expect. For example
pyparsing/diagram/__init__.py:158
↓ 29 callersMethodleave_whitespace
Extends ``leave_whitespace`` defined in base class.
pyparsing/core.py:6326
↓ 29 callersMethodstreamline
(self)
pyparsing/core.py:4688
↓ 28 callersMethodenable_packrat
Enables "packrat" parsing, which adds memoizing to the parsing logic. Repeated parse attempts at the same string location (which happ
pyparsing/core.py:1223
↓ 22 callersMethodexplain
Method to translate the Python internal traceback into a list of the pyparsing expressions that caused the exception to be raised.
pyparsing/exceptions.py:249
↓ 22 callersMethodkeys
(self)
pyparsing/results.py:321
↓ 21 callersMethodpop
Removes and returns item at specified index (default= ``last``). Supports both ``list`` and ``dict`` semantics for ``pop()``. If
pyparsing/results.py:336
↓ 19 callersMethod_run
(self, name)
tests/test_examples.py:11
↓ 19 callersFunctioncol
Returns current column within a string, counting newlines as line separators. The first column is number 1. Note: the default parsing be
pyparsing/util.py:44
↓ 18 callersMethodadd_condition
Add a boolean predicate function to expression's list of parse actions. See :class:`set_parse_action` for function call signatures. Unlike ``s
pyparsing/core.py:816
↓ 17 callersMethod_parse
(self, sql_stmt)
examples/bigquery_view_parser.py:50
↓ 15 callersFunction_isvec
(ident)
examples/LAparser.py:159
↓ 15 callersMethodas_dict
Returns the named parse results as a nested dictionary. Example: .. doctest:: >>> integer = pp.Word(pp.nums)
pyparsing/results.py:628
↓ 15 callersMethodpprint
Pretty-printer for parsed results as a list, using the `pprint <https://docs.python.org/3/library/pprint.html>`_ module. Acce
pyparsing/results.py:839
↓ 15 callersMethodset_debug
Enable display of debugging messages while doing pattern matching. Set ``flag`` to ``True`` to enable, ``False`` to disable.
pyparsing/core.py:2057
↓ 15 callersMethodwith_line_numbers
Helpful method for debugging a parser - prints a string with line and column numbers. (Line and column numbers are 1-based by default
pyparsing/testing.py:278
↓ 14 callersMethod__init__
(self, desc)
examples/adventureEngine.py:48
↓ 14 callersFunction_ismat
(ident)
examples/LAparser.py:166
↓ 14 callersFunction_isscalar
(ident)
examples/LAparser.py:173
↓ 14 callersMethodassertDoesNotWarn
(self, warning_type: type = UserWarning, msg: str = None)
tests/test_unit.py:147
↓ 14 callersMethodassertWarns
Simple wrapper to print out the warnings raised after assertWarns
tests/test_unit.py:133
↓ 14 callersMethodignore_whitespace
Extends ``ignore_whitespace`` defined in base class.
pyparsing/core.py:6333
↓ 14 callersMethodset_default_whitespace_chars
r""" Overrides the default whitespace chars Example: .. doctest:: # default whitespace chars are space, <TAB> a
pyparsing/core.py:405
↓ 14 callersFunctionsrange
r"""Helper to easily define string ranges for use in :class:`Word` construction. Borrows syntax from regexp ``'[]'`` string range definitions:
pyparsing/core.py:6784
↓ 13 callersFunctionadd_digits
(n, limit, c, s)
examples/roman_numerals.py:62
↓ 13 callersMethodclear
(self)
pyparsing/util.py:165
↓ 13 callersMethodget
(_, key)
pyparsing/util.py:113
↓ 13 callersMethodidentifier
a pyparsing Word expression for an identifier using this range's definitions for identchars and identbodychars
pyparsing/unicode.py:113
↓ 13 callersFunctionroman_numeral_literal
(numeral_string, value)
examples/roman_numerals.py:9
↓ 13 callersMethodsub
r""" Return :class:`Regex` with an attached parse action to transform the parsed result as if called using `re.sub(expr, repl, string)
pyparsing/core.py:3591
↓ 13 callersMethodvalues
(self)
pyparsing/results.py:324
↓ 12 callersFunction_run_main_and_capture
Parse the Tiny program, build the main AST node, execute it, and capture stdout. Returns (return_value, stdout_text).
examples/tiny/tests/test_tiny_ast_nodes.py:13
↓ 12 callersMethodfrom_statement_type
Return the TinyNode subclass matching `type_name`. Iterates over direct subclasses. If deeper inheritance hierarchies are created, th
examples/tiny/tiny_ast.py:67
↓ 12 callersFunctioninfix_notation
Helper method for constructing grammars of expressions made up of operators working in a precedence hierarchy. Operators may be unary or bina
pyparsing/helpers.py:785
↓ 12 callersFunctiontestPrint
(x)
examples/jsonParser.py:129
↓ 11 callersMethodexecute
Execute this node against the given engine. Subclasses must implement this method.
examples/tiny/tiny_ast.py:99
↓ 11 callersFunctionparse_tiny
Parse a TINY source string and return structured ParseResults. Args: text: Source code to parse.
examples/tiny/tiny_parser.py:265
↓ 10 callersFunctionbench
( name: str, fn: Callable[[], None], iters: int = 4 )
tests/perf_pyparsing.py:12
↓ 10 callersMethodline
Return the line of text where the exception occurred.
pyparsing/exceptions.py:141
↓ 10 callersMethodmatch
(self, text, expr)
examples/booleansearchparser.py:315
↓ 10 callersFunctionputItemInRoom
(i, r)
examples/adventureEngine.py:638
↓ 10 callersMethodrestore
(self)
pyparsing/testing.py:97
↓ 9 callersMethoddisable_memoization
Disables active Packrat or Left Recursion parsing and their memoization This method also works if neither Packrat nor Left Recursion
pyparsing/core.py:1150
↓ 9 callersMethodeval
(self)
examples/eval_arith.py:96
↓ 9 callersMethodevaluate
(self, argument)
examples/searchparser.py:187
↓ 9 callersMethodget
(self)
examples/tiny/tiny_repl.py:44
↓ 9 callersMethodlineno
Return the 1-based line number of text where the exception occurred.
pyparsing/exceptions.py:148
↓ 9 callersFunctionto_railroad
Convert a pyparsing element tree into a list of diagrams. This is the recommended entrypoint to diagram creation if you want to access the Ra
pyparsing/diagram/__init__.py:231
↓ 8 callersFunction_escape_regex_range_chars
(s: str)
pyparsing/util.py:179
↓ 8 callersFunction_now
()
examples/delta_time.py:79
↓ 8 callersMethodeval_expr
Evaluate an expression built by pyparsing's infix_notation and tokens. Accepts primitives (int/float/str), identifiers (str that is a declare
examples/tiny/tiny_engine.py:230
↓ 8 callersFunctionflatten
(nested_list)
tests/test_unit.py:61
↓ 8 callersMethodfrom_parsed
Construct an instance from a parser `ParseResults` group.
examples/tiny/tiny_ast.py:81
↓ 8 callersMethodgenerate_railroad
Generate an intermediate list of NamedDiagrams from a pyparsing expression.
tests/test_diagram.py:73
↓ 8 callersMethodinsert
Inserts new element at location index in the list of parsed tokens. Similar to ``list.insert()``. Example: .. doct
pyparsing/results.py:426
↓ 8 callersFunctionmake_compressed_re
Create a regular expression string from a list of words, collapsing by common prefixes and optional suffixes. Calls itself recursively t
pyparsing/util.py:355
↓ 8 callersMethodsave
(self)
pyparsing/testing.py:65
↓ 7 callersFunction_collapse_string_to_ranges
r""" Take a string or list of single-character strings, and return a string of the consecutive characters in that string collapsed into gr
pyparsing/util.py:242
↓ 7 callersFunctionautoname_elements
Utility to simplify mass-naming of parser elements, for generating railroad diagram with named subdiagrams.
pyparsing/core.py:6871
↓ 7 callersMethodclear
(self)
pyparsing/core.py:1073
↓ 7 callersMethodcol
Return the 1-based column on the line of text where the exception occurred.
pyparsing/exceptions.py:155
↓ 7 callersMethodenable_left_recursion
Enables "bounded recursion" parsing, which allows for both direct and indirect left-recursion. During parsing, left-recursive :class:
pyparsing/core.py:1165
↓ 7 callersMethodinline_literals_using
Set class to be used for inclusion of string literals into a parser. Example: .. doctest:: :options: +NORMALIZE
pyparsing/core.py:433
↓ 7 callersMethodparseImpl
(self, instring, loc, do_actions=True)
pyparsing/core.py:4700
↓ 7 callersMethodrecurse
(self)
pyparsing/core.py:2196
↓ 7 callersMethodset_whitespace_chars
Overrides the default whitespace chars
pyparsing/core.py:1965
↓ 7 callersMethodsuppress_warning
Suppress warnings emitted for a particular diagnostic on this expression. Example: .. doctest:: >>> label = pp
pyparsing/core.py:536
↓ 6 callersMethod_coerce
(self, value: object, dtype: str)
examples/tiny/tiny_engine.py:335
↓ 6 callersMethod_to_number
Return a numeric value for v following Tiny semantics. Rules: - If v is already an int or float, return it unchanged (no float coerci
examples/tiny/tiny_engine.py:352
↓ 6 callersMethodassertParseAndCheckDict
Convenience wrapper assert to test a parser element and input string, and assert that the resulting :meth:`ParseResults.as_di
pyparsing/testing.py:176
next →1–100 of 1,655, ranked by callers