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));
if ( root==null && kids.size()>0 ) root = _adaptor.nil();
_adaptor.addChildren(rulePostProcessing(root, kids); // A
_localctx.tree = root;

A B

Code Block
kids.add(_adaptor.create($A));
kids.add(_adaptor.create($B));
if (
root==null && kids.size()>0 ) root = _adaptor.nil();
_adaptor.addChildren(rulePostProcessing(root, kids); // ^(nil A B)
_localctx.tree = root;

A^ B

Code Block
root = root==null ? $A : _adaptor.becomeRoot(root, $A, kids);
kids.add(_adaptor.create($B));
if ( root==null && kids.size()>0 )
root = _adaptor.nil();
_adaptor.addChildrenrulePostProcessing(root, kids); // ^(A B)
_localctx.tree = root;

A B^

Code Block
kids.add(_adaptor.create($A));
root = root==null ? $B : _adaptor.becomeRoot(root, $B, kids);
if ( root==null && kids.size()>0
) root = _adaptor.nil();
_adaptor.addChildrenrulePostProcessing(root, kids); // ^(B A)
_localctx.tree = root;

A B^ C

Code Block
kids.add(_adaptor.create($A));
root = root==null ? $B : _adaptor.becomeRoot(root, $B, kids);
kids.add(_adaptor.create($C));
if
( root==null && kids.size()>0 ) root = _adaptor.nil();
_adaptor.addChildren(rulePostProcessing(root, kids); // ^(B A C)
_localctx.tree = root;

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));
if ( root==null && kids.size()>0 ) root = _adaptor.nil();
_adaptor.create(rulePostProcessing(root, kids); // ^(C ^(B A) D)
_localctx.tree = root;

a^ b

Code Block
root = root==null ? $a.tree : _adaptor.becomeRoot(root, $a.tree, kids);
kids.add($b);
if (
root==null && kids.size()>0 ) root = _adaptor.nil();
_adaptor.addChildrenrulePostProcessing(root, kids); // ^(A B)
_localctx.tree = root;

...