mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

8.1K
active users

#parser

2 posts2 participants0 posts today
PostgreSQLPostgreSQL beyond 18: The next decade of intelligent, reliable data infrastructure It’s rare to witness a technology stay relevant for 35 years without losing its edge. PostgreSQL has not just su...<br><br><a rel="nofollow noopener" class="mention hashtag" href="https://mastodon.social/tags/PostgreSQL" target="_blank">#PostgreSQL</a> <a rel="nofollow noopener" class="mention hashtag" href="https://mastodon.social/tags/PostgreSQL" target="_blank">#PostgreSQL</a> <a rel="nofollow noopener" class="mention hashtag" href="https://mastodon.social/tags/AI" target="_blank">#AI</a> <a rel="nofollow noopener" class="mention hashtag" href="https://mastodon.social/tags/Query" target="_blank">#Query</a> <a rel="nofollow noopener" class="mention hashtag" href="https://mastodon.social/tags/parser" target="_blank">#parser</a> <a rel="nofollow noopener" class="mention hashtag" href="https://mastodon.social/tags/SQL/JSON" target="_blank">#SQL/JSON</a> <a rel="nofollow noopener" class="mention hashtag" href="https://mastodon.social/tags/Database" target="_blank">#Database</a> <a rel="nofollow noopener" class="mention hashtag" href="https://mastodon.social/tags/development" target="_blank">#development</a><br><br><a href="https://www.postgresql.fastware.com/blog/postgresql-beyond-18-the-next-decade-of-intelligent-reliable-data-infrastructure" rel="nofollow noopener" target="_blank">Origin</a> | <a href="https://awakari.com/sub-details.html?id=PostgreSQL" rel="nofollow noopener" target="_blank">Interest</a> | <a href="https://awakari.com/pub-msg.html?id=FWnEELitCtPZwSwIhBACaKPPeCm&amp;interestId=PostgreSQL" rel="nofollow noopener" target="_blank">Match</a>
रञ्जित (Ranjit Mathew)<p>Nice:</p><p>“Which Parsing Approach?” [2020], Laurence Tratt (<a href="https://tratt.net/laurie/blog/2020/which_parsing_approach.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">tratt.net/laurie/blog/2020/whi</span><span class="invisible">ch_parsing_approach.html</span></a>).</p><p>On HN: <a href="https://news.ycombinator.com/item?id=35800189" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">news.ycombinator.com/item?id=3</span><span class="invisible">5800189</span></a></p><p>On Lobsters: <a href="https://lobste.rs/s/9pcqys/which_parsing_approach" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">lobste.rs/s/9pcqys/which_parsi</span><span class="invisible">ng_approach</span></a></p><p><a href="https://mastodon.social/tags/Parsing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Parsing</span></a> <a href="https://mastodon.social/tags/Programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Programming</span></a> <a href="https://mastodon.social/tags/Compilers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Compilers</span></a> <a href="https://mastodon.social/tags/Interpreters" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Interpreters</span></a> <a href="https://mastodon.social/tags/Parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Parser</span></a> <a href="https://mastodon.social/tags/PLDI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PLDI</span></a></p>
Andrey DarkCat09<p>Всё же пришлось поизучать юникод.</p><p>Два четырёхзначных кодпоинта могут идти в суррогатной паре UTF-16, тогда декодировать их можно только вместе (там какой-то алгоритм с битовыми операциями).<br>То есть мне нужно обрабатывать такую ситуацию, когда в буфер попал первый кодпоинт из пары, без второго, и слать декодеру часть буфера <em>до</em> начала этой сломанной пары.<br>Иначе декодер выдаст не то. Склеивать полученные байты не&nbsp;поможет.</p><p>Пример: <code>\u1F4AF</code> — это эмоджи [💯]<br>В жсоне для кодирования юникода применяется UTF-16-BE, видимо чтобы количество цифр в кодпоинте всегда было 4 для удобства парсинга (удобства!! спасибо, блин).<br>Получаем <code>"\ud83d\udcaf"</code>.<br><code>\ud83d</code> — первый символ в суррогатной паре, leading UTF-16 surrogate, его можно определить по диапазону от <code>0xD800</code> до <code>0xDBFF</code> включительно.<br><code>\udcaf</code> — второй символ в паре, trailing UTF-16 surrogate, диапазон от <code>0xDC00</code> до <code>0xDFFF</code> включительно.</p><p>Если парсер смог прочитать только первый кодпоинт 0xD83D и дошёл до конца буфера, значит, trailing surrogate мы не&nbsp;считали, декодировать кодпоинт не&nbsp;получится. Вернём его обратно к вызывающему (см.&nbsp;переменную <code>leftovers</code>), чтобы он добавил кривой жсон-эскейп с этим кодпоинтом в буфер в следующий раз, когда будет читать байты дальше. А щас декодируем только часть строки до <code>\ud83d</code>, не&nbsp;захватывая этот эскейп.</p><p>Багфикс:<br><a href="https://git.dc09.ru/DarkCat09/proxishot/commit/e4873223f5" rel="nofollow noopener" target="_blank">https://git.dc09.ru/DarkCat09/proxishot/commit/e4873223f5</a></p><p>Разговор с самим собой:<br><a href="https://git.dc09.ru/DarkCat09/proxishot/issues/1" rel="nofollow noopener" target="_blank">https://git.dc09.ru/DarkCat09/proxishot/issues/1</a></p><p><a href="https://gts.dc09.ru/tags/unicode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>unicode</span></a> <a href="https://gts.dc09.ru/tags/utf16" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>utf16</span></a> <a href="https://gts.dc09.ru/tags/json" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>json</span></a> <a href="https://gts.dc09.ru/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a></p>
jnpn<p><a href="https://tratt.net/laurie/blog/2020/automatic_syntax_error_recovery.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">tratt.net/laurie/blog/2020/aut</span><span class="invisible">omatic_syntax_error_recovery.html</span></a></p><p><a href="https://mastodon.social/tags/grammar" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>grammar</span></a> <a href="https://mastodon.social/tags/cfg" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cfg</span></a> <a href="https://mastodon.social/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a> <a href="https://mastodon.social/tags/error" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>error</span></a></p>
codepilot<p>🚀 <a href="https://chaos.social/tags/Tokay" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Tokay</span></a> v0.6.12 is out!</p><p>A lot going on behind the scenes on <a href="https://chaos.social/tags/tokaylang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tokaylang</span></a>:<br>• <a href="https://chaos.social/tags/serde" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>serde</span></a> support → load precompiled CBOR-VMs, yielding in a faster-loading per-thread <a href="https://chaos.social/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a><br>• <a href="https://chaos.social/tags/WASM" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>WASM</span></a> support → Tokay now runs on Node <a href="https://chaos.social/tags/npm" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>npm</span></a><br>• Tokay Playground, an in-browser IDE, is in the works!</p><p>Try it &amp; help shape what’s next 💡<br>🔗 <a href="https://crates.io/crates/tokay" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">crates.io/crates/tokay</span><span class="invisible"></span></a><br>🔗 <a href="https://www.npmjs.com/package/tokay" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="">npmjs.com/package/tokay</span><span class="invisible"></span></a></p><p><a href="https://chaos.social/tags/rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rust</span></a> <a href="https://chaos.social/tags/compilers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compilers</span></a></p>
Abhinav 🌏<p>I'm starting a series of blog posts, in which I write a <a href="https://fantastic.earth/tags/bytecode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bytecode</span></a> <a href="https://fantastic.earth/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a> and a <a href="https://fantastic.earth/tags/virtualMachine" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>virtualMachine</span></a> for arithmetic in <a href="https://fantastic.earth/tags/Haskell" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Haskell</span></a>. We explore the following topics in the series:</p><p>- Parsing arithmetic expressions to ASTs.<br>- Compiling ASTs to bytecode.<br>- Interpreting ASTs.<br>- Efficiently executing bytecode in a VM.<br>- Disassembling bytecode and decompiling opcodes for debugging and testing.<br>- Unit testing and property-based testing for our compiler and VM.<br>- Benchmarking our code to see how the different passes perform.<br>- All the while keeping an eye on performance.</p><p>The first post of the series that focuses on writing the <a href="https://fantastic.earth/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a> is now out: <a href="https://abhinavsarkar.net/posts/arithmetic-bytecode-vm-parser/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">abhinavsarkar.net/posts/arithm</span><span class="invisible">etic-bytecode-vm-parser/</span></a></p><p><a href="https://fantastic.earth/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://fantastic.earth/tags/Blogging" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Blogging</span></a> <a href="https://fantastic.earth/tags/compilers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compilers</span></a> <a href="https://fantastic.earth/tags/programmingLanguages" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programmingLanguages</span></a></p>
IFComp<p>Today is the last day to register an intent to submit!<br>Until Midnight Eastern Time!</p><p>See you on: <a href="https://ifcomp.org/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">ifcomp.org/</span><span class="invisible"></span></a> !!</p><p><a href="https://mastodon.gamedev.place/tags/ifcomp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifcomp</span></a> <a href="https://mastodon.gamedev.place/tags/interactivefictioncompetition" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>interactivefictioncompetition</span></a> <a href="https://mastodon.gamedev.place/tags/ifcomp2025" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ifcomp2025</span></a> <a href="https://mastodon.gamedev.place/tags/interactivefiction" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>interactivefiction</span></a> <a href="https://mastodon.gamedev.place/tags/visualnovel" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>visualnovel</span></a> <a href="https://mastodon.gamedev.place/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a> <a href="https://mastodon.gamedev.place/tags/indiedev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>indiedev</span></a></p>
MrClon<p><span class="h-card" translate="no"><a href="https://mitra.do.rayslava.com/users/rayslava" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>rayslava</span></a></span> так почему тогда обвязка в виде лямбды спасает отца русской демократии?</p><p>Вот полный пример<br>```<br>import argparse<br>parser = argparse.ArgumentParser()<br><a href="https://mastodon.ml/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a>.add_argument("--foo", type=re.compile)<br>parser.add_argument("--foo", type=lambda s: re.compile(s))<br>args = parser.parse_args([ "--foo", ".*" ])<br>```<br>На вход функции переданной как type передаётся ровно один аргумент, собственно строка '.*'</p>
Jason Weatherly<p>Okay, added a few more features and I'm really liking the results. I added the `-` operator for `dice_groups` which was a bit more tricky than I thought it'd be. I also added the ability to roll a dice group multiple times via a `x`|`*` operator. I removed the requirement that a dice group has to have a damage type associated with it since the only way you can roll something like `1d4-1` is in a dice group since there is a minimum value of 1 associated with it.</p><p>The code lives here: <a href="https://codeberg.org/JamesTheBard/dice-roller" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">codeberg.org/JamesTheBard/dice</span><span class="invisible">-roller</span></a></p><p><a href="https://social.linux.pizza/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://social.linux.pizza/tags/lark" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lark</span></a> <a href="https://social.linux.pizza/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a> <a href="https://social.linux.pizza/tags/ttrpg" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ttrpg</span></a> <a href="https://social.linux.pizza/tags/diceroller" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>diceroller</span></a> <a href="https://social.linux.pizza/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>
Jason Weatherly<p>Okay, _now_ I'm done. Fixed a few parser errors and implemented a skew option (the `^` value) that will push the average value towards either 1 or the maximum of the dice. I like that once you get the parser up and running that it's easy to add stuff to it. I now am the official owner of a completely overkill dice running program.</p><p>For the example below, the skew is `2.0`. The random value is raised to the `1/skew` power before being multiplied by the number of sides of the die. If skew goes up, so do the results. If skew goes down, well, so do the results.</p><p>```<br>$ python main.py "^2 (2d6+2d8+12)[fire]+1d8[piercing]" | jq .<br>{<br> "results": {<br> "fire": 37,<br> "piercing": 7<br> }<br>}<br>```</p><p><a href="https://social.linux.pizza/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://social.linux.pizza/tags/statistics" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>statistics</span></a> <a href="https://social.linux.pizza/tags/ttrpgs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ttrpgs</span></a> <a href="https://social.linux.pizza/tags/dice" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dice</span></a> <a href="https://social.linux.pizza/tags/lark" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lark</span></a> <a href="https://social.linux.pizza/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a></p>
claude<p>Before starting the big work of porting my experimental <a href="https://post.lurk.org/tags/LiveCoding" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LiveCoding</span></a> <a href="https://post.lurk.org/tags/uzulang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>uzulang</span></a> <a href="https://post.lurk.org/tags/godwit" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>godwit</span></a> 's <a href="https://post.lurk.org/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a> from <a href="https://post.lurk.org/tags/Alex" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Alex</span></a> and <a href="https://post.lurk.org/tags/Happy" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Happy</span></a> to <a href="https://post.lurk.org/tags/Parsec" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Parsec</span></a>, I finally managed to get a snapshot working in <a href="https://post.lurk.org/tags/Termux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Termux</span></a> on my phone by making a tarball including the generated <a href="https://post.lurk.org/tags/Haskell" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Haskell</span></a> files on a machine where Alex and Happy were available and transferring it over network.</p><p>This isn't ideal as I can't edit the parser on my phone (no Alex/Happy there; at least not recent enough versions, old ones got via cjacker's Hugs 2019 improvement), so I still want to switch to Parsec which is not so horribly <a href="https://post.lurk.org/tags/GHC" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>GHC</span></a> -only (Parsec has a version that works with <a href="https://post.lurk.org/tags/MicroHs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MicroHs</span></a> and probably <a href="https://post.lurk.org/tags/Hugs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Hugs</span></a> <a href="https://post.lurk.org/tags/HaskellHugs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HaskellHugs</span></a> too).</p><p>I put the snapshot at<br><a href="https://mathr.co.uk/web/godwit.html#Download" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">mathr.co.uk/web/godwit.html#Do</span><span class="invisible">wnload</span></a> and meanwhile updated the bootstrap script as patching MicroHs isn't necessary any more.</p>
Jan :rust: :ferris:<p>mdq - by yshavit</p><p><a href="https://github.com/yshavit/mdq" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/yshavit/mdq</span><span class="invisible"></span></a></p><p>like <a href="https://floss.social/tags/jq" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jq</span></a> but for <a href="https://floss.social/tags/Markdown" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Markdown</span></a>: find specific elements in an md doc</p><p>Also available as a crate:<br><a href="https://docs.rs/mdq/latest/mdq/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">docs.rs/mdq/latest/mdq/</span><span class="invisible"></span></a></p><p>Tagging <span class="h-card" translate="no"><a href="https://fosstodon.org/@wader" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>wader</span></a></span> 😉 </p><p><a href="https://floss.social/tags/CLI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>CLI</span></a> <a href="https://floss.social/tags/Parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Parser</span></a> <a href="https://floss.social/tags/Rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Rust</span></a> <a href="https://floss.social/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a></p>
Henrik Jernevad<p>Any <a href="https://mastodon.social/tags/TOML" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TOML</span></a> nerds? Would you say this is valid TOML? (I'm building a parser.)</p><p>```<br>inline = { array = [ 1,<br>2 ] }<br>```</p><p>The spec says "No newlines are allowed between the curly braces unless they are valid within a value."</p><p>This includes multi-line strings, but do you interpret it to permit newlines in an array? The array itself is technically a single value inside which newlines are valid. It is obviously not "in the spirit" of inline tables but the ABNF grammar allows it.</p><p><a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://mastodon.social/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a></p>
Hacker News<p>Optimizing a Math Expression Parser in Rust</p><p><a href="https://rpallas.xyz/math-parser/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">rpallas.xyz/math-parser/</span><span class="invisible"></span></a></p><p><a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/Optimizing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Optimizing</span></a> <a href="https://mastodon.social/tags/Math" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Math</span></a> <a href="https://mastodon.social/tags/Expression" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Expression</span></a> <a href="https://mastodon.social/tags/Parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Parser</span></a> <a href="https://mastodon.social/tags/Rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Rust</span></a> <a href="https://mastodon.social/tags/Programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Programming</span></a> <a href="https://mastodon.social/tags/RustLang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>RustLang</span></a> <a href="https://mastodon.social/tags/Coding" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Coding</span></a> <a href="https://mastodon.social/tags/Efficiency" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Efficiency</span></a></p>
Habr<p>QapGen: Создаём мощные парсеры на C++</p><p>QapDSLv2 — это язык который транслируется в обычный C++ код. Он позволяет удобно и компактно задавать грамматики/правила разбора кода программ, значительно упрощая разработку компиляторов/анализаторов/трансляторов. QapGen — это генератор дерева_лексеров /парсеров описанных на QapDSLv2. Сама грамматика QapDSLv2 описана на QapDSLv2 на 100%. Поэтому QapGen как основной читатель этой грамматики сам генерирует часть своего кода(весь парсер QapDSLv2). Основные фишки QapDSLv2 + QapGen — это: 1) Отсутствие этапа токенизации — дерево лексеров разбивает входной поток на лексемы и сохраняет их в строго типизированных древовидных С++ структурах пропуская этап токенизации. 2) Генерация оптимизированного кода полиморфных лексеров . 3) Полное сохранение всех лексем(даже разделители сохраняются, такие как пробелы/переходы на новую строку и комментарии) в результирующем дереве. 4) Возможность сохранить как оригинальное дерево , так и модифицированное обратно в код/текст без потери разделителей/комментариев . 5) Автоматическая генерация кода посетителей (это такой паттерн проектирования). А теперь пример самой сочной части(рекурсивно самоописывающийся код): struct t_target_struct:i_target_item{ struct t_keyword{ string kw=any_str_from_vec(split("struct,class",",")); " "? // optional separator }; struct t_body_semicolon:i_struct_impl{";"}; struct t_body_impl:i_struct_impl{ "{" // жрём скобочку vector&lt;TAutoPtr&lt;i_target_item&gt;&gt; nested?; // рекурсия! " "? vector&lt;TAutoPtr&lt;i_struct_field&gt;&gt; arr?; // парсим поля " "? TAutoPtr&lt;t_cpp_code&gt; c?; // остальной С++ код " "? "}" }; struct t_parent{ string a_or_c=any_str_from_vec(split("=&gt;,:",",")); " "? t_name name; }; //точка входа в парсер: TAutoPtr&lt;t_keyword&gt; kw?; //парсим struct/class t_name name; //парсим имя " "? TAutoPtr&lt;t_parent&gt; parent?; " "? TAutoPtr&lt;i_struct_impl&gt; body; };</p><p><a href="https://habr.com/ru/articles/925420/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">habr.com/ru/articles/925420/</span><span class="invisible"></span></a></p><p><a href="https://zhub.link/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a> <a href="https://zhub.link/tags/parsergenerator" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parsergenerator</span></a> <a href="https://zhub.link/tags/lexers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lexers</span></a> <a href="https://zhub.link/tags/c" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>c</span></a>++ <a href="https://zhub.link/tags/tree" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>tree</span></a> <a href="https://zhub.link/tags/ast" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ast</span></a> <a href="https://zhub.link/tags/gamedev" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>gamedev</span></a> <a href="https://zhub.link/tags/dsl" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dsl</span></a> <a href="https://zhub.link/tags/compiler" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compiler</span></a></p>
Habr<p>Как создать свой парсер и AST-генератор на C++ с минимальными усилиями: знакомьтесь с QapDSLv2</p><p>QapDSLv2: Новый стандарт AST-heavy парсинга QapDSLv2 обеспечивает: Молниеносное построение AST Полное сохранение структуры исходного кода Простоту интерпретации и модификации грамматик Забудьте о любы других парсерах! С помощью QapDSLv2 можно создавать компиляторы/анализаторы/форматировщики кода за минуты/часы. // почти наглая лож Парсеры и генерация абстрактных синтаксических деревьев ( AST ) — это обычно долго, сложно и требует тонны шаблонного кода. Но что если я скажу, что теперь можно описывать грамматики и структуры данных одновременно и получать готовый, оптимизированный C++ код автоматически? QapDSLv2 — новый стандарт эффективности и удобства в парсинге . Это язык описания парсеров, который избавляет от синтаксического шума, упрощает интеграцию с C++ и позволяет создавать сложные анализаторы без боли и ошибок . Забудьте о бесконечных циклах отладки и непонятных генераторах — теперь всё просто, понятно и эффективно. В этой статье вы узнаете, как QapDSL v2 меняет правила игры в мире парсинга и компиляторов, увидите реальные примеры и поймёте, почему это важно для каждого, кто работает с языками программирования и обработкой текста . Готовы ускорить разработку и вывести свои проекты на новый уровень? QapGen — мощный генератор парсеров, построенный на основе QapDSLv2, который из грамматик QapDSLv2 сразу создаёт высокопроизводительный C++ парсер с типизированным AST , описанным прямо в грамматике. t_sep { string body = any (" \t\r\n"); } using " " as t_sep; t_value{ TAutoPtr&lt;i_value&gt; body; " "? } t_comma_value{ "," t_value body; " "? } t_array=&gt;i_value{ "[" " "? t_value first?; vector&lt;t_comma_value&gt; arr?; "]" " "? }</p><p><a href="https://habr.com/ru/articles/922128/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">habr.com/ru/articles/922128/</span><span class="invisible"></span></a></p><p><a href="https://zhub.link/tags/QapDSL" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>QapDSL</span></a> <a href="https://zhub.link/tags/Lexers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Lexers</span></a> <a href="https://zhub.link/tags/AST" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>AST</span></a> <a href="https://zhub.link/tags/Compilers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Compilers</span></a> <a href="https://zhub.link/tags/Parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Parser</span></a> <a href="https://zhub.link/tags/parsergenerator" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parsergenerator</span></a> <a href="https://zhub.link/tags/Parsers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Parsers</span></a> <a href="https://zhub.link/tags/C" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>C</span></a>++ <a href="https://zhub.link/tags/dsl" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>dsl</span></a></p>
Dzokero<p><span class="h-card" translate="no"><a href="https://pol.social/@siwa" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>siwa</span></a></span> </p><p>Polska warcząca <br><a href="https://mastodon.social/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a> </p><p>Sorki, ale mi się jakoś skojarzyło ;)</p>
Habr<p>Система аналитики и презентации данных с учётом ограничений системы F</p><p>Система аналитики и презентации данных — мой проект, который я выполнял в рамках курсовых работ во время обучения в институте. Описал основные шаги, идеи и поделился своими успехами.</p><p><a href="https://habr.com/ru/articles/916854/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">habr.com/ru/articles/916854/</span><span class="invisible"></span></a></p><p><a href="https://zhub.link/tags/%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D1%82%D0%B8%D0%BA%D0%B0" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>аналитика</span></a> <a href="https://zhub.link/tags/%D1%80%D0%B0%D0%B7%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B0" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>разработка</span></a> <a href="https://zhub.link/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://zhub.link/tags/streamlit" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>streamlit</span></a> <a href="https://zhub.link/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a></p>
Jan :rust: :ferris:<p>In which I have Opinions about parsing and grammars - by Simon Tatham</p><p><a href="https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/parsing/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">chiark.greenend.org.uk/~sgtath</span><span class="invisible">am/quasiblog/parsing/</span></a></p><p><a href="https://floss.social/tags/ProgrammingLanguage" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ProgrammingLanguage</span></a> <a href="https://floss.social/tags/PLT" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PLT</span></a> <a href="https://floss.social/tags/Parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Parser</span></a> <a href="https://floss.social/tags/Parsing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Parsing</span></a> <a href="https://floss.social/tags/Grammar" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Grammar</span></a></p>
Abhinav 🌏<p>The tiny but complete <a href="https://fantastic.earth/tags/JSON" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>JSON</span></a> <a href="https://fantastic.earth/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a> that I wrote in <a href="https://fantastic.earth/tags/Haskell" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Haskell</span></a> years ago is now featured in the 200-and-change collection of programs by <span class="h-card" translate="no"><a href="https://hachyderm.io/@dubroy" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>dubroy</span></a></span>: <a href="https://pdubroy.github.io/200andchange" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">pdubroy.github.io/200andchange</span><span class="invisible"></span></a></p><p><a href="https://fantastic.earth/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>