Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungKI half beim Finden: iOS 27 schließt mehr als 100 Sicherheitslücken(21.09.2026 um 06:00 Uhr)
Sichere ProgrammierungWhat Is Rowhammer? How Can Repeated Memory Access Flip Bits in RAM?(21.09.2026 um 07:12 Uhr)
Sichere Programmierungnpm publish Ignores .gitignore: The .npmignore Override Rule(21.09.2026 um 07:15 Uhr)
Sichere ProgrammierungAphelion Editor - A free node-based video / VFX editor(21.09.2026 um 07:21 Uhr)
Sichere ProgrammierungGovernance Attack Surface Review: OKX(21.09.2026 um 07:31 Uhr)
Sichere ProgrammierungJSM Portal Request Create Property Panel Submit(21.09.2026 um 07:34 Uhr)
Reverse Engineeringsearch instructions assembly easy (X86,RISCV,AARCH64,etc)(20.09.2026 um 15:44 Uhr)
Sichere ProgrammierungKI half beim Finden: iOS 27 schließt mehr als 100 Sicherheitslücken(21.09.2026 um 06:00 Uhr)
Sichere ProgrammierungWhat Is Rowhammer? How Can Repeated Memory Access Flip Bits in RAM?(21.09.2026 um 07:12 Uhr)
Sichere Programmierungnpm publish Ignores .gitignore: The .npmignore Override Rule(21.09.2026 um 07:15 Uhr)
Sichere ProgrammierungAphelion Editor - A free node-based video / VFX editor(21.09.2026 um 07:21 Uhr)
Sichere ProgrammierungGovernance Attack Surface Review: OKX(21.09.2026 um 07:31 Uhr)
Sichere ProgrammierungJSM Portal Request Create Property Panel Submit(21.09.2026 um 07:34 Uhr)
Reverse Engineeringsearch instructions assembly easy (X86,RISCV,AARCH64,etc)(20.09.2026 um 15:44 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

A New Kind of Parser Method

Reagiere als Erste:r — dein Feedback zählt!

I don't know if you heard, but I'm pretty sure you know the method (or the concept) of Pratt parsing. To me, I don't really understand a lot of the concepts of Pratt parsing; binding power and NUD are way out of my league. Nevertheless, it's a really good parsing technique and is used a lot of times. But I've made another parsing method, more simpler to understand, and at the similar level.

What's the Name?
The name for this parsing method is D-M parsing, short for disambiguation-merging parsing. More about the disambiguating and the merging later.

What's the general way of using it?
Say you have an expression like this:
2 + foo(4, 5) \* 4 / 23
Notice that the operators and the terms go in this pattern: term-operator-term-operator, and ends at a term (assuming parenthesis were already resolved). My technique uses that pattern to its advantage:
We can separate those two things into two separate lists; terms and operators. In terms, we list out all the terms in the expression in order, so the terms list would look like the following:
2, foo(4, 5), 4, 23
And same with the operators, so it looks like this:
+, \*, /
See another pattern? the terms list is always one element larger than the operator list. Using that, too, we can now make our tree.

How to Make the Tree
Now comes the magic- when you group the term elements by pairs (yes, they overlap), you can make the pairs the same as the operator list's length. i.e.:
(2, foo(4, 5)), (foo(4, 5), 4), (4, 23)
This is crucial for the binary operators.
Now that we have normalized the lists to one length, we pass through the tree. We check the highest precedence (in this case, * and /), and start pairing from there. Now, if we list the operator and term's index, and match the first * with the corresponding pair- foo(4, 5), 4, we get our first tree- [foo(4, 5), 4]{*} (note: the curly braces is the operator, the square braces are for the arguments). We then remove the used * and the pair with [foo(4, 5), 4]{*}.
Currently, we have:
2, [foo(4, 5), 4]{*}, 23 as our terms list. now, we check for the next element with the same precedence; /.
And yeah, keep repeating the process; you should get:
[2, [[foo(4, 5), 4]{*}, 23]{/}]{+} as the final tree, or in coding terms-

add (
    2,
    divide (
        multiply (
            foo(4, 5),
            4
        ),
        23
    )
)

Okay, But Are There Any Hidden Things?
Yes, of course! This way of parsing needs a LOT more than just two lists and a grouper; we need a disambiguation part and a merging part. The disambiguation part is for splitting - into two core types, -u (unary) and -b (binary), splitting . into two core types, .n (numeric/decimal point) and .m (member access), and splitting ( into two core types, (n (numeric/grouping opening) and (c (function call).

The merger, though, that is one of the hard parts. you need to merge -u x into -x, a .m b into a.b, and foo .m bar (c 23, 24 ) into foo.bar(23, 24). its basically a mini-parser; except for only functions (and maybe a few mix-fix here and there); nothing else.

Once those two core components have ran, the final output is a list full of terms, operators, and group openers/closers. And, like any other parser, recursively parse those parentheses. Now, with your fully-parsed AST, you're good to go for an expression parser!

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten A New Kind of Parser Method

Thematisch verwandte Begriffe: Kind, Parser, Method · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94109 | openEQUELLA versions before 2026.1.0 contain a remote code execution vul…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick