#parser — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #parser, aggregated by home.social.
-
От регулярок к ANTLR4: три архитектурных решения на парсере бизнес-формул
Три года назад я писал свой первый коммерческий парсер на ANTLR4 — для бизнес-формул аналитической системы. Несколько лет спустя я бы сделал его иначе в трёх центральных местах. Разбираю каждое: левая рекурсия для приоритета операторов, Listener vs Visitor, и почему getText() для повторного парсинга — антипаттерн.
https://habr.com/ru/articles/1027742/
#antlr #antlr4 #парсер #parser #грамматика #dsl #java #spring_boot #compiler #code_generation
-
Мотивация, оптимизация, коробочка, жабочка и «налог на усталость»
Я не программист. Я архитектор, проектирую дома, а полгода назад не знала, где живут скрипты и питоны. Но когда важный для меня чат в Telegram собрались удалять, я попросила нейросеть написать парсер – и пропала. С тех пор прошло полгода. Я всё ещё доделываю приложение. У него есть имя – Розитта, розовая робожаба на иконке. И оно пожирает мои ночи, деньги на такси и остатки семейного спокойствия. Это не история успеха за 4 дня. Это история о том, как взрослый человек с семьёй, работой и падающим забором ушёл в вайбкодинговый запой – и что из этого вышло. Все совпадения с реальными нейросетями не случайны, а промпты – настоящие. Заглянуть в цифровое болото
https://habr.com/ru/articles/1022674/
#telethon #parser #deepseek #околоайтишник #telegram #вайбкодинг
-
#Development #Launches
Syntaqlite Playground · Parse, format, validate, and tokenize SQLite queries, https://ilo.im/16by65_____
#Parser #Formatter #Validator #Tokenizer #SQL #SQLite #Databases #Server #WebDev #Backend -
#Development #Launches
Syntaqlite Playground · Parse, format, validate, and tokenize SQLite queries, https://ilo.im/16by65_____
#Parser #Formatter #Validator #Tokenizer #SQL #SQLite #Databases #Server #WebDev #Backend -
#Development #Launches
Syntaqlite Playground · Parse, format, validate, and tokenize SQLite queries, https://ilo.im/16by65_____
#Parser #Formatter #Validator #Tokenizer #SQL #SQLite #Databases #Server #WebDev #Backend -
#Development #Launches
Syntaqlite Playground · Parse, format, validate, and tokenize SQLite queries, https://ilo.im/16by65_____
#Parser #Formatter #Validator #Tokenizer #SQL #SQLite #Databases #Server #WebDev #Backend -
This week on the blog: the latest release of my Ophis assembler hit an ugly corner of 6502 assembly language syntax (Z80 has it too, x86 and m68k don't), and that turns out to be a good excuse to drop a couple of thousand words on parsing theory.
Also, the Bison parser generator is cooler than it was the last time I looked at it.
-
chibicc-dumper makes public.
A JSON dumper tool derived from chibicc that can output C language tokens and ASTs.This is a small tool that extracts token sequences and ASTs from C source code and outputs them as JSON.
With this tool, generating bridge code—such as FFI—from C source code becomes easier than before. -
One Open-source Project Daily
Simple .INI file parser in C, good for embedded systems
https://github.com/benhoyt/inih
#1ospd #opensource #c #configparser #embeddedsystems #ini #parser -
Initially, I was just fooling around, creating code snippets to see how it all may fit together. Quick, dirty hacks you know.
But somehow things got more and more refined and today I was able to test my little two-word #textadventure #game #parser by walking between two rooms.
Written using #gforth but also works with #dxforth on #cpm80
-
Initially, I was just fooling around, creating code snippets to see how it all may fit together. Quick, dirty hacks you know.
But somehow things got more and more refined and today I was able to test my little two-word #textadventure #game #parser by walking between two rooms.
Written using #gforth but also works with #dxforth on #cpm80
-
Initially, I was just fooling around, creating code snippets to see how it all may fit together. Quick, dirty hacks you know.
But somehow things got more and more refined and today I was able to test my little two-word #textadventure #game #parser by walking between two rooms.
Written using #gforth but also works with #dxforth on #cpm80
-
Initially, I was just fooling around, creating code snippets to see how it all may fit together. Quick, dirty hacks you know.
But somehow things got more and more refined and today I was able to test my little two-word #textadventure #game #parser by walking between two rooms.
Written using #gforth but also works with #dxforth on #cpm80
-
Initially, I was just fooling around, creating code snippets to see how it all may fit together. Quick, dirty hacks you know.
But somehow things got more and more refined and today I was able to test my little two-word #textadventure #game #parser by walking between two rooms.
Written using #gforth but also works with #dxforth on #cpm80
-
Increasing the performance of WebAssembly Text Format parser by 350%
https://blog.gplane.win/posts/improve-wat-parser-perf.html
#HackerNews #WebAssembly #Performance #Wat #Parser #Optimization #350% #TechNews
-
Httpz – Zero-Allocation HTTP/1.1 Parser for OxCaml
#HackerNews #Httpz #ZeroAllocation #HTTP1.1 #Parser #OxCaml #OpenSource
-
Does anyone have any info on #iBisPaint / #iBisPaintX s proprietary *.ipv transferformat ?
( https://alcea-wisteria.de/z_files/files/testipv.ipv )
Their drawing app writes this file each action you takes, can replay the whole artwork(even recover from systemcrashes)
Its insanely robust and its beginning and end contain device #metadata and art name info
But .. How can we parse the actual info ?
* #brush used
* paste action
* line drawn
etc
..
I'm at a loss
#AskFedi #ReverseEngineering #parser
#Ghidra
#repost •acws #acws -
Back to some code exercises. Technically, you could write a #textadventure game in #Forth using the dictionary and the command prompt. I've seen at least one code snippet following such an approach.
However, I want a "classic" #parser (e.g. TAKE SWORD) and make sure it keeps the user "fenced" inside the game engine.
This means I need arrays of strings to provide lists of words the parser can check the user input against.
So here is some basic research on how to accomplish this in #gforth (also works with #dxforth)
-
Back to some code exercises. Technically, you could write a #textadventure game in #Forth using the dictionary and the command prompt. I've seen at least one code snippet following such an approach.
However, I want a "classic" #parser (e.g. TAKE SWORD) and make sure it keeps the user "fenced" inside the game engine.
This means I need arrays of strings to provide lists of words the parser can check the user input against.
So here is some basic research on how to accomplish this in #gforth (also works with #dxforth)
-
Back to some code exercises. Technically, you could write a #textadventure game in #Forth using the dictionary and the command prompt. I've seen at least one code snippet following such an approach.
However, I want a "classic" #parser (e.g. TAKE SWORD) and make sure it keeps the user "fenced" inside the game engine.
This means I need arrays of strings to provide lists of words the parser can check the user input against.
So here is some basic research on how to accomplish this in #gforth (also works with #dxforth)
-
Back to some code exercises. Technically, you could write a #textadventure game in #Forth using the dictionary and the command prompt. I've seen at least one code snippet following such an approach.
However, I want a "classic" #parser (e.g. TAKE SWORD) and make sure it keeps the user "fenced" inside the game engine.
This means I need arrays of strings to provide lists of words the parser can check the user input against.
So here is some basic research on how to accomplish this in #gforth (also works with #dxforth)
-
Back to some code exercises. Technically, you could write a #textadventure game in #Forth using the dictionary and the command prompt. I've seen at least one code snippet following such an approach.
However, I want a "classic" #parser (e.g. TAKE SWORD) and make sure it keeps the user "fenced" inside the game engine.
This means I need arrays of strings to provide lists of words the parser can check the user input against.
So here is some basic research on how to accomplish this in #gforth (also works with #dxforth)
-
Проблемы с которыми я столкнулся при написании рекурсивного парсера journal в Linux
Добрый день, всем читающим данную статью. При анализе артефактов с Linux систем journal являются источником огромного количества полезной информации. Существет большое количесвто утилит, которые парсят journal. Однако, у всех этих утилит есть свои минусы. По этой причине, у меня возникла идея написать свой кроссплатформенный парсер файлов journal , который мог бы обрабатывать не только файлы, но и директории, с возможностью экспорта в различные форматы и сортировке по временным меткам. В процессе написания данного инструмента я столкнулся с несколькими проблемами и хочу поделиться способами, которыми я их решал.
https://habr.com/ru/articles/979144/
#journal #journalctl #parser #go #linux #opensourse #recursive #forensics #dfir #triage
-
We keep improving our #OCL #parser and #evaluator, e.g. https://github.com/BESSER-PEARL/BESSER/issues/367#event-21642067463
Keep reporting your issues!
-
Building a High-Performance OpenAPI Parser in Go
https://www.speakeasy.com/blog/building-speakeasy-openapi-go-library
#HackerNews #OpenAPI #Go #Parser #HighPerformance #Programming #TechBlog
-
𝗥𝗲𝗴𝘂𝗹𝗲𝘅:
#Regex #UI #Regulex #Parser #Visualizer
https://thewhale.cc/posts/regulex
JavaScript Regular Expression Visualizer.
-
This is TSQLparser, a complete T-SQL parser written in Go. It's the kind of thing you use when you want to abandon Microsoft SQL Server for good (parser, lexer, and AST builder, to be exact).
And here it is, GPL 3.0 licenced, or email me if you have any other ideas:
[email protected]https://github.com/ha1tch/tsqlparser
#golang #foss #tsql #mssql #mssqlserver #db #database #parser #microsoft #sql #sqlite #postgres
-
On top of my GDevelop jam success yesterday, it turns out that "A Normal Morning" also placed 8th in ECTOCOMP's La Petite Mort category!
https://damonwakes.itch.io/a-normal-morning
#InteractiveFiction #ECTOCOMP #Inform7 #Inform #parser #horror -
Aujourd'hui dans la suite de son tutoriel, @Onirie nous explique comment créer une fiction interactive avec donjon.fi
https://www.fiction-interactive.fr/tutoriel-creer-une-histoire-avec-donjon-fi/
-
Tags are sets. Many apps support tagging of content, but most of them (incl. Mastodon) treat tags only as singular/isolated topic filters, akin to a flat folder-based approach. But tagging can be so, so much more powerful when treating tags as sets and offering users the possibility to combine and query tagged content as sets (think Venn diagrams), i.e. allowing tags to be combined using AND/OR/NOT aka intersection/union/difference operations...
Below is a simple query engine to do just that in ~40 lines of code (sans comments), incl. using an extensible interpreter for a simple Lisp-like S-Expression language to define arbitrarily complex nested tag queries (the code is actually lifted & simplified from my personal knowledge graph tooling, also talked about here recently[1]...)
https://gist.github.com/postspectacular/ff997a4f1016b17bbfe9beb989984ac3
For example, the query:
`(and (or 'Alps' 'PNW') (or 'LandscapePhotography' 'NaturePhotography') (not 'Monochrome'))`
...would select all items which have been tagged with `Alps` OR `PNW`, AND have at least one of the two photography tags given, but have NOT the `Monochrome` tag.
Whilst this syntax is probably alien-looking to the average user, it'd would be fairly straightforward to create visual/structural UIs for defining such queries (over the past 20 years I've done that myself several times already), heck even a SLM (small language model) could be used to translate natural language into such query expressions — what matters here is the widespread lack of treating tags this way in terms of conceptual/data modeling in most applications. Imagine being able to use hashtags this way on Mastodon to assemble personalized timelines (and extend the system to not just deal with hashtags, but other post metadata/provenance too)...
The code example illustrates how, with the right tools, such features are actually not hard to implement (or to integrate into existing apps). The example uses the following #ThingUmbrella packages for its key functionality:
- https://thi.ng/associative: Set-theory operations, custom Map/Set data types (unused here)
- https://thi.ng/lispy: Customizable/extensible S-expression parser, interpreter & runtime
- https://thi.ng/oquery: Optimized object and array pattern query engine[1] https://mastodon.thi.ng/@toxi/115497555185158157
#Tagging #Sets #QueryEngine #Lisp #Syntax #Parser #Interpreter #TypeScript #JavaScript
-
Published new Guile-DSV release -- version 0.8.0:
https://github.com/artyom-poptsov/guile-dsv/releases/tag/v0.8.0This release includes one bugfix and some new parameters for procedures in the "(dsv table)" API, that allow to control how tables are formatted.
Also Guile-DSV Info documentation now describes table parameters in detail.
"README" file got updated as well -- now it has better formatting, and it is more informative.
-
Boa release v0.21:
https://boajs.dev/blog/2025/10/22/boa-release-21
#Boa is an experimental #JavaScript lexer, #parser and #compiler written in #Rust. It now passes 94.12% of conformance tests in the official #ECMAScript Test Suite (Test262).
-
I ran the #ELF #parser of #sydbox over 60k #Linux #malware samples from #Virusshare and 40k orcs which are malformed elves generated by the Melkor ELF #Fuzzer and got no crashes. The parser is written in #rustlang. It's free from unsafe code and arithmetic side effects. Syd parses ELF at exec(3) and mmap(2) boundary to perform various restrictions for binaries such as PIE and non-executable stack. #exherbo #security
-
So, Mr. Dayvi Schuster managed to "accidentally" invent a #Zig #dotenv #parser while actually trying to do something else entirely. 🙄 Bravo, #genius — it's like discovering penicillin while searching for a lost sock. 🙃 Maybe next, you'll stumble upon cold fusion while making a sandwich. 🥪✨
https://dayvster.com/blog/accidentally-made-a-zig-dotenv-parser/ #invention #accidental #coding #humor #innovation #HackerNews #ngated -
You can't parse XML with regex. Let's do it anyways
https://sdomi.pl/weblog/26-nobody-here-is-free-of-sin/
#ycombinator #xml #regexp #parser #bash #html #xhtml #regular_expression -
Oh joy, yet another #C++17 #parser combinator library! 🎉 Because what the world really needed was more creative ways to torture ourselves with syntactic nightmares and verbose error messages. 🚀 GitHub's endless quest to make #programming as enjoyable as a root canal continues unabated. 🙄
https://github.com/foonathan/lexy #combinators #humor #GitHub #developer #woes #HackerNews #ngated -
Oh joy, yet another #C++17 #parser combinator library! 🎉 Because what the world really needed was more creative ways to torture ourselves with syntactic nightmares and verbose error messages. 🚀 GitHub's endless quest to make #programming as enjoyable as a root canal continues unabated. 🙄
https://github.com/foonathan/lexy #combinators #humor #GitHub #developer #woes #HackerNews #ngated -
Oh joy, yet another #C++17 #parser combinator library! 🎉 Because what the world really needed was more creative ways to torture ourselves with syntactic nightmares and verbose error messages. 🚀 GitHub's endless quest to make #programming as enjoyable as a root canal continues unabated. 🙄
https://github.com/foonathan/lexy #combinators #humor #GitHub #developer #woes #HackerNews #ngated -
Oh joy, yet another #C++17 #parser combinator library! 🎉 Because what the world really needed was more creative ways to torture ourselves with syntactic nightmares and verbose error messages. 🚀 GitHub's endless quest to make #programming as enjoyable as a root canal continues unabated. 🙄
https://github.com/foonathan/lexy #combinators #humor #GitHub #developer #woes #HackerNews #ngated -
Lexy: A parser combinator library for C++17
https://github.com/foonathan/lexy
#HackerNews #Lexy #C++17 #parser #combinator #library #programming #open-source #GitHub
-
Nice:
“Which Parsing Approach?” [2020], Laurence Tratt (https://tratt.net/laurie/blog/2020/which_parsing_approach.html).
On HN: https://news.ycombinator.com/item?id=35800189
On Lobsters: https://lobste.rs/s/9pcqys/which_parsing_approach
#Parsing #Programming #Compilers #Interpreters #Parser #PLDI
-
I'm starting a series of blog posts, in which I write a #bytecode #compiler and a #virtualMachine for arithmetic in #Haskell. We explore the following topics in the series:
- Parsing arithmetic expressions to ASTs.
- Compiling ASTs to bytecode.
- Interpreting ASTs.
- Efficiently executing bytecode in a VM.
- Disassembling bytecode and decompiling opcodes for debugging and testing.
- Unit testing and property-based testing for our compiler and VM.
- Benchmarking our code to see how the different passes perform.
- All the while keeping an eye on performance.The first post of the series that focuses on writing the #parser is now out: https://abhinavsarkar.net/posts/arithmetic-bytecode-vm-parser/
-
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.
The code lives here: https://codeberg.org/JamesTheBard/dice-roller
-
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.
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.
```
$ python main.py "^2 (2d6+2d8+12)[fire]+1d8[piercing]" | jq .
{
"results": {
"fire": 37,
"piercing": 7
}
}
``` -
Any #TOML nerds? Would you say this is valid TOML? (I'm building a parser.)
```
inline = { array = [ 1,
2 ] }
```The spec says "No newlines are allowed between the curly braces unless they are valid within a value."
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.
-
Optimizing a Math Expression Parser in Rust
https://rpallas.xyz/math-parser/
#HackerNews #Optimizing #Math #Expression #Parser #Rust #Programming #RustLang #Coding #Efficiency
-
QapGen: Создаём мощные парсеры на C++
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<TAutoPtr<i_target_item>> nested?; // рекурсия! " "? vector<TAutoPtr<i_struct_field>> arr?; // парсим поля " "? TAutoPtr<t_cpp_code> c?; // остальной С++ код " "? "}" }; struct t_parent{ string a_or_c=any_str_from_vec(split("=>,:",",")); " "? t_name name; }; //точка входа в парсер: TAutoPtr<t_keyword> kw?; //парсим struct/class t_name name; //парсим имя " "? TAutoPtr<t_parent> parent?; " "? TAutoPtr<i_struct_impl> body; };
https://habr.com/ru/articles/925420/
#parser #parsergenerator #lexers #c++ #tree #ast #gamedev #dsl #compiler
-
Как создать свой парсер и AST-генератор на C++ с минимальными усилиями: знакомьтесь с QapDSLv2
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<i_value> body; " "? } t_comma_value{ "," t_value body; " "? } t_array=>i_value{ "[" " "? t_value first?; vector<t_comma_value> arr?; "]" " "? }
https://habr.com/ru/articles/922128/
#QapDSL #Lexers #AST #Compilers #Parser #parsergenerator #Parsers #C++ #dsl
-
Had an enjoyable afternoon building a custom #cli #parser to replace #argparse in our internal tooling. I like its ease of use. But it is a custom parser and works only for my specific use case, but for use case it does more than argparse can and is simpler to use. #comandline #python