So let's say we have a slightly more complicated grammar.
T is our start symbol; it goes to (p Q r)
or (p Q s), so there are two strings in this grammar.
It will 100 percent increase, over the previous grammar--
(p Q r) and (p Q s) are both there--
and the input is: (P q r)--wow, that's really lucky!
That's one of the strings in the grammar.
It's almost as if we planned these things in advance.
So now we'll give you a chance to try this out.
I have written down, here,
five possible facts about the parsing chart
for this grammar, on this 3-token input.
Chart[1] has this, chart[1] has that.
This is an element of chart[1], this is an element of chart[2].
And what I'd like you to do in this multiple multiple choice quiz
is check all of the boxes that are correct.
So if we do see: big (Q) goes to little (q) dot,
from 1 in chart[2], check this box.
Check all the boxes that apply.
少し複雑な文法があるとします
開始シンボルのTをpQrに変えるか
pQsに換えるとすると
言語に含まれる文は2つになります
前の文法の100%増しです
pQrとpQsがあり
幸運にも入力はpqrで
2つのうちの1つです
計画されていたようですね
例題をやってみましょう
これを見てください
この文法および入力によって作られる
構文解析の5つの命題を書きます
chart[1]はこれを含み
これはchart[2]の要素です
この複数選択式の小テストでは
正しいものをチェックしてください
例えばQ->q・from1が
chart[2]に含まれるならここにチェックです
ではやってみてください
Suponha que temos uma gramática um pouco mais complicada.
T é o noso símbolo inicial. T -> p Q r
ou T -> p Q s. Portanto, existem 2 strings nesta gramática.
É 100% a mais que na gramática anterior --
temos p Q r e também p Q s.
E a entrada é p q r -- wow! isso é uma sorte!
Este é um dos strings da gramática.
É quase como se tivéssemos planejado isso antes.
Então, agora vou dar a você a chance de tentar.
Escrevi aqui
5 possíveis fatos sobre a tabela do parser
para esta gramática, sobre esta entrada de 3 tokens.
chart[1] tem isto, e chart[1] tem isto.
Isto é um elemento de chart[1] e isto é um elemento de chart[2].
O que eu quero que você faça este teste de múltipla escolha
é marcar todas as opções que são corretas.
Então, se você vê Q -> q •.
from 1, em chart[2], marque esta opção.
Marque todas as corretas