<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>zehnpaard</author_name>
  <author_url>https://blog.hatena.ne.jp/zehnpaard/</author_url>
  <blog_title>Arantium Maestum</blog_title>
  <blog_url>https://zehnpaard.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>言語処理系</anon>
  </categories>
  <description>前回の記事は同じパースを何回も繰り返すので非効率だと書いたが、まずはどの程度非効率なのかを計測してからPackratパーサで効率化を図る。 計測 まずは問題の程度を計測したい。 こんなデコレータを定義する： def _print_call(func): @functools.wraps(func) def f(tokens): print(f&quot;{func} called in pos {tokens.i}&quot;) return func(tokens) return f Pythonのデコレータは関数をとり関数を（修飾して）返す高階関数で、@decorator_nameと他の関数定義の前の行に書く…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2021%2F09%2F13%2F071747&quot; title=&quot;PythonでLanguage Implementation Patternsのパーサと戯れる　Packratパーサ - Arantium Maestum&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-09-13 07:17:47</published>
  <title>PythonでLanguage Implementation Patternsのパーサと戯れる　Packratパーサ</title>
  <type>rich</type>
  <url>https://zehnpaard.hatenablog.com/entry/2021/09/13/071747</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
