[PATCH] D121108: [pseudo] Add readme

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 7 07:05:01 PST 2022


This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.
Closed by commit rG68b4e2d703e3: [pseudo] Add readme (authored by sammccall).

Changed prior to commit:
  https://reviews.llvm.org/D121108?vs=413432&id=413456#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121108/new/

https://reviews.llvm.org/D121108

Files:
  clang/lib/Tooling/Syntax/Pseudo/README.md


Index: clang/lib/Tooling/Syntax/Pseudo/README.md
===================================================================
--- /dev/null
+++ clang/lib/Tooling/Syntax/Pseudo/README.md
@@ -0,0 +1,37 @@
+# clang pseudoparser
+
+This directory implements an approximate heuristic parser for C++, based on the
+clang lexer, the C++ grammar, and the GLR parsing algorithm.
+
+It parses a file in isolation, without reading its included headers.
+The result is a strict syntactic tree whose structure follows the C++ grammar.
+There is no semantic analysis, apart from guesses to disambiguate the parse.
+Disambiguation can optionally be guided by an AST or a symbol index.
+
+For now, the best reference on intended scope is the [design proposal],
+with further discussion on the [RFC].
+
+## Dependencies between pseudoparser and clang
+
+Dependencies are limited because they don't make sense, but also to avoid
+placing a burden on clang mantainers.
+
+The pseudoparser reuses the clang lexer (clangLex and clangBasic libraries) but
+not the higher-level libraries (Parse, Sema, AST, Frontend...).
+
+When the pseudoparser should be used together with an AST (e.g. to guide
+disambiguation), this is a separate "bridge" library that depends on both.
+
+Clang does not depend on the pseudoparser at all. If this seems useful in future
+it should be discussed by RFC.
+
+## Parity between pseudoparser and clang
+
+The pseudoparser aims to understand real-world code, and particularly the
+languages and extensions supported by Clang.
+
+However we don't try to keep these in lockstep: there's no expectation that
+Clang parser changes are accompanied by pseudoparser changes or vice versa.
+
+[design proposal]: https://docs.google.com/document/d/1eGkTOsFja63wsv8v0vd5JdoTonj-NlN3ujGF0T7xDbM/edit
+[RFC]: https://discourse.llvm.org/t/rfc-a-c-pseudo-parser-for-tooling/59217/49


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121108.413456.patch
Type: text/x-patch
Size: 1867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220307/8774191c/attachment-0001.bin>


More information about the cfe-commits mailing list