0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

構文木と結合

Posted at

結合の仕方は構文木の深さだけではわからなかった...

左結合、右結合について、四則演算なら左側に「(」が連続していれば左結合、逆が右結合だと思っていました。
左結合: (((1 + 2) + 3) + 4)
右結合: (1 + (2 + (3 + 4)))

同じように木構造も左結合は左側が深い、といったルールだとずっと考えていたのですが、文法のつくりかたによってそうではない場合もあるのですね。

これは足し算引き算の文法で左再帰を除去するときに気づきました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?