Versions Compared

Key

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

...

grammar fragment

code

A

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

A B

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

A^ B

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

A B^

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

A B^ C

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

A B^ C^ D

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

...