Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How to Write Parser in PHP
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Jan Tvrdík
April 12, 2018
Programming
100
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
67
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
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
780
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
200
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
500
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
710
Cloudflare is Agents
chimame
0
190
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
2
910
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
150
業務時間外もAIに働いてもらう話
colorful12
3
9.6k
ALB ログから Trace を気合で繋げる技術
fohte
7
840
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
270
Discordを用いたラボオートメーション関連情報収集の自動化
noguhiro2002
0
480
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
250
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
230
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
680
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
180
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
Building the Perfect Custom Keyboard
takai
2
860
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Amusing Abliteration
ianozsvald
1
280
Facilitating Awesome Meetings
lara
57
7.1k
Leo the Paperboy
mayatellez
8
2.2k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
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