Writing an Asciidoc Parser in Rust: Asciidocr
https://www.bikesbooksandbullshit.com/bullshit/2025/01/08/writing-an-asciidoc-parser-in-rust.html
Writing an Asciidoc Parser in Rust: Asciidocr
https://www.bikesbooksandbullshit.com/bullshit/2025/01/08/writing-an-asciidoc-parser-in-rust.html
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).
@ao_kenji @miodvallat : He added more #cheese in the #parser ?
I just extracted the expression #parser out of my pet #Basic interpreter. Together with the built-in functions, it's more than half the code. We don't realize how much #programming languages do for us.
 / #software / #CSV / #parser/ #performance
I used #ChatGPT to help with technical definitions and finding book references. If anything seems wrong or you spot any AI hallucinations, let me know and I'll fix it. The actual GitHub project and parser code came straight from my discoveries and experiments, no AI involved there.
Lexy: A parser combinator library for C++17
https://github.com/foonathan/lexy
#HackerNews #Lexy #C++17 #parser #combinator #library #programming #open-source #GitHub
Stop writing CLI validation. Parse it right the first time.
https://hackers.pub/@hongminhee/2025/stop-writing-cli-validation-parse-it-right-the-first-time
#commonLisp host language simple #parser #programming of #emacs #orgmode orgfiles.
I suspect I've got several things grievously wrong. For one, my parser is #typetheory -etic. And the recursion is more of an ascent than a descent.
https://screwlisp.small-web.org/programming/org-parser/
Still, it's interesting to see what an s-expression-ised org file is and is not.
Also some notes on the Karl Voit interview on org versus markdown this Sunday morning (Europe)
Comments solicited @dougmerritt @mdhughes @kentpitman and all.
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/
Tạo trình phân tích từ vựng (lexical parser) bằng Flex. Cài đặt: `sudo apt update && sudo apt upgrade && sudo apt install flex`. Hướng dẫn tạo file .l, định nghĩa quy tắc và hàm `main()` để nhận diện số, chuỗi,... Biên dịch và chạy. #lex #flex #parser #trìnhphântíchtừvựng #lập_trình #programming #code #dev
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
  }
}
```
mdq - by yshavit
https://github.com/yshavit/mdq
like #jq but for #Markdown: find specific elements in an md doc
Also available as a crate:
https://docs.rs/mdq/latest/mdq/
Tagging @wader  
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
In which I have Opinions about parsing and grammars - by Simon Tatham
https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/parsing/