aboutsummaryrefslogtreecommitdiffstats
path: root/admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html
diff options
context:
space:
mode:
authorEli Zaretskii2023-03-19 08:09:33 +0200
committerEli Zaretskii2023-03-19 08:09:33 +0200
commit0bebd0e5f09b6fbed2e54f9b8464e93bdd6ad11e (patch)
tree41d19f431cd3e1e293d9f9a8f829e84ad100fa63 /admin/notes/tree-sitter/html-manual/Parsing-Program-Source.html
parent6674c362ad94373dacd22b7fd426406539e8d957 (diff)
downloademacs-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.html125
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
7corresponding to Emacs version 29.0.50.
8
9Copyright © 1990-1996, 1998-2023 Free Software Foundation, Inc.
10
11Permission is granted to copy, distribute and/or modify this document
12under the terms of the GNU Free Documentation License, Version 1.3 or
13any later version published by the Free Software Foundation; with the
14Invariant Sections being "GNU General Public License," with the
15Front-Cover Texts being "A GNU Manual," and with the Back-Cover
16Texts as in (a) below. A copy of the license is included in the
17section entitled "GNU Free Documentation License."
18
19(a) The FSF's Back-Cover Text is: "You have the freedom to copy and
20modify this GNU manual. Buying copies from the FSF supports it in
21developing 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<!--
39a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
40a.summary-letter {text-decoration: none}
41blockquote.indentedblock {margin-right: 0em}
42div.display {margin-left: 3.2em}
43div.example {margin-left: 3.2em}
44kbd {font-style: oblique}
45pre.display {font-family: inherit}
46pre.format {font-family: inherit}
47pre.menu-comment {font-family: serif}
48pre.menu-preformatted {font-family: serif}
49span.nolinebreak {white-space: nowrap}
50span.roman {font-family: initial; font-weight: normal}
51span.sansserif {font-family: sans-serif; font-weight: normal}
52span:hover a.copiable-anchor {visibility: visible}
53ul.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>
65Next: <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> &nbsp; [<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
73one-dimensional stream of characters, but a structured tree of nodes,
74where each node representing a piece of text. Thus, a syntax tree can
75enable interesting features like precise fontification, indentation,
76navigation, 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
80generic 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
84library</a>) if support for it was compiled in. The tree-sitter library
85implements an incremental parser and has support from a wide range of
86programming 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'> &para;</a></span></dt>
90<dd><p>This function returns non-<code>nil</code> if tree-sitter features are
91available 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
95and access the syntax tree of the program, a Lisp program needs to
96load a language definition library, and create a parser for that
97language and the current buffer. After that, the Lisp program can
98query the parser about specific nodes of the syntax tree. Then, it
99can access various kinds of information about each node, and search
100for nodes using a powerful pattern-matching syntax. This chapter
101explains how to do all this, and also how a Lisp program can work with
102source 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>
119Next: <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> &nbsp; [<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>