in modules/ml-ext/ml/xgboost-model-parser/src/main/java/org/apache/ignite/ml/xgboost/parser/XGBoostModelParser.java [772:909]
public final XgTreeContext xgTree() throws RecognitionException {
XgTreeContext _localctx = new XgTreeContext(_ctx, getState());
enterRule(_localctx, 8, RULE_xgTree);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
setState(46);
xgHeader();
setState(47);
match(NEWLINE);
setState(83);
_errHandler.sync(this);
switch (getInterpreter().adaptivePredict(_input, 8, _ctx)) {
case 1: {
setState(54);
_errHandler.sync(this);
_alt = 1;
do {
switch (_alt) {
case 1: {
{
setState(50);
_errHandler.sync(this);
switch (getInterpreter().adaptivePredict(_input, 1, _ctx)) {
case 1: {
setState(48);
xgLeaf();
}
break;
case 2: {
setState(49);
xgNode();
}
break;
}
setState(52);
match(NEWLINE);
}
}
break;
default:
throw new NoViableAltException(this);
}
setState(56);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input, 2, _ctx);
}
while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER);
setState(64);
_errHandler.sync(this);
_la = _input.LA(1);
if (_la == INT) {
{
setState(60);
_errHandler.sync(this);
switch (getInterpreter().adaptivePredict(_input, 3, _ctx)) {
case 1: {
setState(58);
xgLeaf();
}
break;
case 2: {
setState(59);
xgNode();
}
break;
}
setState(62);
match(EOF);
}
}
}
break;
case 2: {
setState(74);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input, 6, _ctx);
while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {
if (_alt == 1) {
{
{
setState(68);
_errHandler.sync(this);
switch (getInterpreter().adaptivePredict(_input, 5, _ctx)) {
case 1: {
setState(66);
xgLeaf();
}
break;
case 2: {
setState(67);
xgNode();
}
break;
}
setState(70);
match(NEWLINE);
}
}
}
setState(76);
_errHandler.sync(this);
_alt = getInterpreter().adaptivePredict(_input, 6, _ctx);
}
setState(79);
_errHandler.sync(this);
switch (getInterpreter().adaptivePredict(_input, 7, _ctx)) {
case 1: {
setState(77);
xgLeaf();
}
break;
case 2: {
setState(78);
xgNode();
}
break;
}
setState(81);
match(EOF);
}
break;
}
}
}
catch (RecognitionException re) {
_localctx.exception = re;
_errHandler.reportError(this, re);
_errHandler.recover(this, re);
}
finally {
exitRule();
}
return _localctx;
}