diff options
| author | Eli Zaretskii | 2023-03-19 08:09:33 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2023-03-19 08:09:33 +0200 |
| commit | 0bebd0e5f09b6fbed2e54f9b8464e93bdd6ad11e (patch) | |
| tree | 41d19f431cd3e1e293d9f9a8f829e84ad100fa63 /admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html | |
| parent | 6674c362ad94373dacd22b7fd426406539e8d957 (diff) | |
| download | emacs-0bebd0e5f09b6fbed2e54f9b8464e93bdd6ad11e.tar.gz emacs-0bebd0e5f09b6fbed2e54f9b8464e93bdd6ad11e.zip | |
; Remove 'build-module' and 'html-manual' directories from 'admin'
These files were temporarily in the repository and are
no longer needed, once they fulfilled their job.
Diffstat (limited to 'admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html')
| -rw-r--r-- | admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html b/admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html deleted file mode 100644 index 58f6b4e9d5a..00000000000 --- a/admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html +++ /dev/null | |||
| @@ -1,125 +0,0 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
| 2 | <html> | ||
| 3 | <!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ --> | ||
| 4 | <head> | ||
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
| 6 | <!-- This is the GNU Emacs Lisp Reference Manual | ||
| 7 | corresponding to Emacs version 29.0.50. | ||
| 8 | |||
| 9 | Copyright © 1990-1996, 1998-2023 Free Software Foundation, Inc. | ||
| 10 | |||
| 11 | Permission is granted to copy, distribute and/or modify this document | ||
| 12 | under the terms of the GNU Free Documentation License, Version 1.3 or | ||
| 13 | any later version published by the Free Software Foundation; with the | ||
| 14 | Invariant Sections being "GNU General Public License," with the | ||
| 15 | Front-Cover Texts being "A GNU Manual," and with the Back-Cover | ||
| 16 | Texts as in (a) below. A copy of the license is included in the | ||
| 17 | section entitled "GNU Free Documentation License." | ||
| 18 | |||
| 19 | (a) The FSF's Back-Cover Text is: "You have the freedom to copy and | ||
| 20 | modify this GNU manual. Buying copies from the FSF supports it in | ||
| 21 | developing GNU and promoting software freedom." --> | ||
| 22 | <title>Parsing Program Source (GNU Emacs Lisp Reference Manual)</title> | ||
| 23 | |||
| 24 | <meta name="description" content="Parsing Program Source (GNU Emacs Lisp Reference Manual)"> | ||
| 25 | <meta name="keywords" content="Parsing Program Source (GNU Emacs Lisp Reference Manual)"> | ||
| 26 | <meta name="resource-type" content="document"> | ||
| 27 | <meta name="distribution" content="global"> | ||
| 28 | <meta name="Generator" content="makeinfo"> | ||
| 29 | <meta name="viewport" content="width=device-width,initial-scale=1"> | ||
| 30 | |||
| 31 | <link href="index.html" rel="start" title="Top"> | ||
| 32 | <link href="Index.html" rel="index" title="Index"> | ||
| 33 | <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> | ||
| 34 | <link href="index.html" rel="up" title="Top"> | ||
| 35 | <link href="Abbrevs.html" rel="next" title="Abbrevs"> | ||
| 36 | <link href="Syntax-Tables.html" rel="prev" title="Syntax Tables"> | ||
| 37 | <style type="text/css"> | ||
| 38 | <!-- | ||
| 39 | a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em} | ||
| 40 | a.summary-letter {text-decoration: none} | ||
| 41 | blockquote.indentedblock {margin-right: 0em} | ||
| 42 | div.display {margin-left: 3.2em} | ||
| 43 | div.example {margin-left: 3.2em} | ||
| 44 | kbd {font-style: oblique} | ||
| 45 | pre.display {font-family: inherit} | ||
| 46 | pre.format {font-family: inherit} | ||
| 47 | pre.menu-comment {font-family: serif} | ||
| 48 | pre.menu-preformatted {font-family: serif} | ||
| 49 | span.nolinebreak {white-space: nowrap} | ||
| 50 | span.roman {font-family: initial; font-weight: normal} | ||
| 51 | span.sansserif {font-family: sans-serif; font-weight: normal} | ||
| 52 | span:hover a.copiable-anchor {visibility: visible} | ||
| 53 | ul.no-bullet {list-style: none} | ||
| 54 | --> | ||
| 55 | </style> | ||
| 56 | <link rel="stylesheet" type="text/css" href="./manual.css"> | ||
| 57 | |||
| 58 | |||
| 59 | </head> | ||
| 60 | |||
| 61 | <body lang="en"> | ||
| 62 | <div class="chapter" id="Parsing-Program-Source"> | ||
| 63 | <div class="header"> | ||
| 64 | <p> | ||
| 65 | Next: <a href="Abbrevs.html" accesskey="n" rel="next">Abbrevs and Abbrev Expansion</a>, Previous: <a href="Syntax-Tables.html" accesskey="p" rel="prev">Syntax Tables</a>, Up: <a href="index.html" accesskey="u" rel="up">Emacs Lisp</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p> | ||
| 66 | </div> | ||
| 67 | <hr> | ||
| 68 | <span id="Parsing-Program-Source-1"></span><h2 class="chapter">37 Parsing Program Source</h2> | ||
| 69 | |||
| 70 | <span id="index-syntax-tree_002c-from-parsing-program-source"></span> | ||
| 71 | <p>Emacs provides various ways to parse program source text and produce a | ||
| 72 | <em>syntax tree</em>. In a syntax tree, text is no longer considered a | ||
| 73 | one-dimensional stream of characters, but a structured tree of nodes, | ||
| 74 | where each node representing a piece of text. Thus, a syntax tree can | ||
| 75 | enable interesting features like precise fontification, indentation, | ||
| 76 | navigation, structured editing, etc. | ||
| 77 | </p> | ||
| 78 | <p>Emacs has a simple facility for parsing balanced expressions | ||
| 79 | (see <a href="Parsing-Expressions.html">Parsing Expressions</a>). There is also the SMIE library for | ||
| 80 | generic navigation and indentation (see <a href="SMIE.html">Simple Minded Indentation Engine</a>). | ||
| 81 | </p> | ||
| 82 | <p>In addition to those, Emacs also provides integration with | ||
| 83 | <a href="https://tree-sitter.github.io/tree-sitter">the tree-sitter | ||
| 84 | library</a>) if support for it was compiled in. The tree-sitter library | ||
| 85 | implements an incremental parser and has support from a wide range of | ||
| 86 | programming languages. | ||
| 87 | </p> | ||
| 88 | <dl class="def"> | ||
| 89 | <dt id="index-treesit_002davailable_002dp"><span class="category">Function: </span><span><strong>treesit-available-p</strong><a href='#index-treesit_002davailable_002dp' class='copiable-anchor'> ¶</a></span></dt> | ||
| 90 | <dd><p>This function returns non-<code>nil</code> if tree-sitter features are | ||
| 91 | available for the current Emacs session. | ||
| 92 | </p></dd></dl> | ||
| 93 | |||
| 94 | <p>To be able to parse the program source using the tree-sitter library | ||
| 95 | and access the syntax tree of the program, a Lisp program needs to | ||
| 96 | load a language definition library, and create a parser for that | ||
| 97 | language and the current buffer. After that, the Lisp program can | ||
| 98 | query the parser about specific nodes of the syntax tree. Then, it | ||
| 99 | can access various kinds of information about each node, and search | ||
| 100 | for nodes using a powerful pattern-matching syntax. This chapter | ||
| 101 | explains how to do all this, and also how a Lisp program can work with | ||
| 102 | source files that mix multiple programming languages. | ||
| 103 | </p> | ||
| 104 | |||
| 105 | <ul class="section-toc"> | ||
| 106 | <li><a href="Language-Definitions.html" accesskey="1">Tree-sitter Language Definitions</a></li> | ||
| 107 | <li><a href="Using-Parser.html" accesskey="2">Using Tree-sitter Parser</a></li> | ||
| 108 | <li><a href="Retrieving-Nodes.html" accesskey="3">Retrieving Nodes</a></li> | ||
| 109 | <li><a href="Accessing-Node-Information.html" accesskey="4">Accessing Node Information</a></li> | ||
| 110 | <li><a href="Pattern-Matching.html" accesskey="5">Pattern Matching Tree-sitter Nodes</a></li> | ||
| 111 | <li><a href="Multiple-Languages.html" accesskey="6">Parsing Text in Multiple Languages</a></li> | ||
| 112 | <li><a href="Tree_002dsitter-major-modes.html" accesskey="7">Developing major modes with tree-sitter</a></li> | ||
| 113 | <li><a href="Tree_002dsitter-C-API.html" accesskey="8">Tree-sitter C API Correspondence</a></li> | ||
| 114 | </ul> | ||
| 115 | </div> | ||
| 116 | <hr> | ||
| 117 | <div class="header"> | ||
| 118 | <p> | ||
| 119 | Next: <a href="Abbrevs.html">Abbrevs and Abbrev Expansion</a>, Previous: <a href="Syntax-Tables.html">Syntax Tables</a>, Up: <a href="index.html">Emacs Lisp</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p> | ||
| 120 | </div> | ||
| 121 | |||
| 122 | |||
| 123 | |||
| 124 | </body> | ||
| 125 | </html> | ||