Let's go through it together--the Web page is broken down into words and trees.
That's lexing and parsing, and we do that first.
This is right; the Web page is then interpreted--that's True.
Some of the fragments or elements that we come across
might be JavaScript--embedded JavaScript--
so then we have to call the JavaScript interpreter.
So thus far, the first 3 seem pretty good.
Eventually, the user's JavaScript code on the Web page
may call: write--at which point we'll have to
store all of that output so that we can display it on the Web page.
That's good.
Ah! But then here we're suggesting that the
JavaScript interpreter calls the graphics library.
This is an erroneous step; in our particular architecture,
the JavaScript interpreter returns all of the strings to the HTML interpreter
and that interpreter, then, calls the graphics library.
This is what's known as a Design Decision.
For our particular Web browser,
only the HTML interpreter is going to call the graphics library.
That's not the only way to do it.
Just like there's more than one way to build a house,
there's more than one way to build or design a Web browser.
We've just decided for this particular one,
that only the HTML interpreter's going to call the graphics library.
I claim that's going to simplify the amount of code we'd have to write.
一緒に見ていきます
“Webページは単語に分解され木になる”
これは字句解析と構文解析で初めに行います
正しいですね
“その後Webページは解釈される”
これも正しいです
断片や要素のいくつかは
埋め込まれたJavaScriptかもしれません
従ってJavaScriptインタプリタを
呼び出す必要があります
最初の3つは正しいようです
最終的にユーザの“JavaScriptのコードは
writeを呼ぶ”ことがあり
その時には出力を保存して
最後にWebページに表示します
これもよさそうですね
しかしここで“JavaScriptインタプリタが”
“画像処理ライブラリを呼ぶ”と言っています
これは私たちの設計では間違いです
JavaScriptインタプリタは
HTMLインタプリタに文字列をすべて渡し
HTMLインタプリタが画像処理ライブラリを呼びます
これが設計の決定です
私たちのWebブラウザでは
画像処理ライブラリを呼び出せるのは
HTMLインタプリタだけです
しかし唯一の方法ではありません
家を建てる方法が1つでないように
Webブラウザを設計する方法もいくつかあります
今回はHTMLインタプリタだけが
画像処理ライブラリを呼ぶ設計を選びました
これは単純に 書かなければいけないコードの量を
減らすためです
Vamos resolver isso juntos. A página web é separada em palavras e árvores.
Isso é lexing e parsing, e fazemos isso primeiro.
Isso está correto. A página web é então interpretada -- isso é verdade.
Alguns dos fragmentos, ou elementos, que encontramos
podem ser JavaScript -- JavaScript embutido --
de modo que temos que chamar o interpretador JavaScript.
Até aqui, os 3 primeiros passos estão ok.
Eventualemente, o código JavaScript do usuário, na página web,
pode chmar "write", ponto no qual temos que
armazenar tuda essa saída, de modo que possamos exibi-la na página web.
Isso está ok.
Ah! Mas então estamos sugerindo que
o interpretador JavaScript chama a biblioteca gráfica.
Esse passo está errado: em nossa arquitetura particular,
o interpretador JavaScritp retorna todos os strings para o interpretador HTML,
e este interpretador então chama a biblioteca gráfica.
Isso é conhecido como `decisão de projeto'.
No nosso web browser particular,
apenas o interpretador HTML irá chamar a biblioteca gráfica.
Essa não é a única maneira de fazer isso.
Assim como exsite mais de uma maneira de construir uma casa,
existe também mais de uma maneira de projetar um web browser.
Apenas decidimos adotar esta, em particular,
em que apenas o interpretador HTML irá chamar a biblioteca gráfica.
Eu afirmo que isso simplifica a quantidade de código que temos que escrever.