File: index.rst

package info (click to toggle)
python-tatsu 5.17.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,516 kB
  • sloc: python: 13,185; makefile: 127
file content (81 lines) | stat: -rw-r--r-- 2,390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
.. Copyright (c) 2017-2026 Juancarlo AƱez (apalala@gmail.com)
.. SPDX-License-Identifier: BSD-4-Clause

.. tatsu documentation master file, created by
   sphinx-quickstart on Mon May  1 18:01:31 2017.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

.. include:: links.rst


|TatSu|
=======

    *At least for the people who send me mail about a new language that
    they're designing, the general advice is: do it to learn about how
    to write a compiler. Don't have any expectations that anyone will
    use it, unless you hook up with some sort of organization in a
    position to push it hard. It's a lottery, and some can buy a lot of
    the tickets. There are plenty of beautiful languages (more beautiful
    than C) that didn't catch on. But someone does win the lottery, and
    doing a language at least teaches you something.*

    `Dennis Ritchie`_ (1941-2011) Creator of the C_ programming
    language and of Unix_



|TatSu| is a tool that takes grammars in extended `EBNF`_ as input, and
outputs `memoizing`_ (`Packrat`_) `PEG`_ parsers in `Python`_. The classic
variations of EBNF_ (Tomassetti, EasyExtend, Wirth) and `ISO EBNF`_ are also
supported as input grammar format.

Why use a PEG_ parser? Because `regular languages`_ (those that can be parsed
with Python's ``re`` package) *"cannot count"*. Any language with nested structures
or with balancing of demarcations requires more than regular expressions to
be parsed.

|TatSu| can compile a grammar stored in a string into a ``tatsu.grammars``
object model. The model can be used to parse any input, much like the `re`_
module does with compiled regular expressions. The model can also be used to
generate a Python_ module that implements the parser.

|TatSu| supports `left-recursive`_  rules in PEG_ grammars, and it honors *left-associativity* in the resulting parse trees.

.. toctree::
    :maxdepth: 4

    intro
    rationale
    install
    use
    parserconfig
    syntax
    directives
    ast
    semantics
    models
    translation
    left_recursion
    mini-tutorial
    traces
    antlr
    examples
    support
    credits
    contributors
    contributing
    license

.. toctree::
    :hidden:



.. comment out
    Indices and tables
    ==================
    * :ref:`genindex`
    * :ref:`modindex`
    * :ref:`search`