Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
How to Write Parser in PHP
Search
Jan Tvrdík
April 12, 2018
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
How to Write Parser in PHP
Jan Tvrdík
April 12, 2018
More Decks by Jan Tvrdík
See All by Jan Tvrdík
Runtime Types in TypeScript
jantvrdik
0
70
Writing Readable Migrations with Nextras Migrations
jantvrdik
1
120
Nextras Mail Panel
jantvrdik
0
180
Writing reliable migrations with Nextras Migrations
jantvrdik
1
710
Other Decks in Programming
See All in Programming
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
760
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
22
22k
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
280
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
200
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.6k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
610
パーソナライズPodcastを作った話
repunit11
0
130
パスワード再設定メールのURLについて知っておこう
uyuki234
0
110
ジョジョの世界をXRで再現する
mofurune
0
150
Java 27新機能 / Java 27 new features
kishida
2
220
AWSに止められる覚悟してますか?
morizo_1984
2
530
速習iPhone Duo対応
yuukiw00w
2
980
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
14
40k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
520
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
480
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
440
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
940
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
720
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
570
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Transcript
Jan Tvrdík
None
None
process of splitting text into words The square is blue
. The square is blue.
process of organizing sequence of words into structure The square
is blue .
The square is blue . D N V A NP
VP S
process of given meaning to the word structure
normally done by simple state machine fastest state machine in
PHP = PCRE
None
None
can be optimized to a single preg_* call by using
a smart trick David Grudl has taught me
None
ready to use lexer = nette/tokenizer
always start by writing a grammar EBNF simple not standardized
ABNF slightly less friendly than EBNF standardized by IETF PEG the coolest not standardized
multiple approaches possible easiest to start with is recursive descent
parser because it matches the grammar
JsonValue = JsonBool / JsonNull / JsonNumber / JsonString /
JsonArray / JsonObject JsonBool = TokenTrue / TokenFalse JsonNull = TokenNull
JsonNumber = TokenNumber JsonString = TokenString JsonArray = TokenSquareBracketOpen JsonArrayItems?
TokenSquareBracketClose JsonArrayItems = JsonValue (TokenComma JsonValue)* ...
None
Twitter + GitHub @JanTvrdik