Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

grammar fragment

code

A

Code Block
kids.add(_adaptor.create($A));
_adaptor.addChildren(root, kids); // A
_localctx.tree = _root0;

A B

Code Block
kids.add(_adaptor.create($A));
kids.add(_adaptor.create($B));
_adaptor.addChildren(root, kids); // ^(nil A B)
_localctx.tree = _root0;

A^ B

Code Block
root = root==null ? $A : _adaptor.becomeRoot(root, $A, kids);
kids.add(_adaptor.create($A$B));
_adaptor.addChildren(root, kids); // ^(A B)
_localctx.tree = _root0;

A B^

Code Block
kids.add(_adaptor.create($A));
root = root==null ? $B : _adaptor.becomeRoot(root, $B, kids);
_adaptor.addChildren(root, kids); // ^(B A)
_localctx.tree = _root0;

A B^ C

Code Block
kids.add(_adaptor.create($A));
root = root==null ? $B : _adaptor.becomeRoot(root, $B, kids);
kids.add(_adaptor.create($C));
_adaptor.addChildren(root, kids); // ^(B A C)
_localctx.tree = _root0;

A B^ C^ D

Code Block
kids.add(_adaptor.create($A));
root = root==null ? $B : _adaptor.becomeRoot(root, $B, kids);
root = root==null ? $C : _adaptor.becomeRoot(root, $C, kids);
kids.add(_adaptor.create($D));
_adaptor.create(root, kids); // ^(C ^(B A) D)
_localctx.tree = _root0;

...