antlr / antlr/antlr4

Why this element doesn't have childrens?

Open
#4,367 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
19k
Forks
3.5k
PR merge metrics
No merged PRs in 30d

Description

```

[nightmare@nightmare-4061w1c rossijskij-yap]$ ./Построить.sh
сборка ../../Main.cpp
*
*
*
* ЗАПУСК ПРИЛОЖЕНИЯ:
*
[] Парсер построен: 1
123.0b 010101001e12
0
[nightmare@nightmare-4061w1c rossijskij-yap]$ ^C
```

```

else if (context->ЧИСЛО_С_ПЛАВАЮЩЕЙ_ТОЧКОЙ() != nullptr)
{
std::cout << context->ЧИСЛО_С_ПЛАВАЮЩЕЙ_ТОЧКОЙ()->toStringTree(true) << std::endl;
std::cout << context->ЧИСЛО_С_ПЛАВАЮЩЕЙ_ТОЧКОЙ()->children.size() << std::endl;
}
```
```

ЧИСЛО: ЗНАК_ЧИСЛА? ПОРАЗРЯДНОЕ_ЧИСЛО;
ЧИСЛО_С_ПЛАВАЮЩЕЙ_ТОЧКОЙ: ЗНАК_ЧИСЛА? ((ЧИСЛО? '.' ПОРАЗРЯДНОЕ_ЧИСЛО) | (ЧИСЛО '.' ПОРАЗРЯДНОЕ_ЧИСЛО?)) ЭПСИЛОН_ЧАСТЬ_ЧИСЛА?;
```

Why i can't get or how can i get segments of token rules?

Contributor guide

Open the contributing guide

Research direction

Start with Main.cpp and the generated parser context used for ЧИСЛО_С_ПЛАВАЮЩЕЙ_ТОЧКОЙ(), then compare its children access with the grammar rules shown in the issue. Reproduce the output using Построить.sh and determine why children.size() is zero despite the parse tree string; done means explaining or correcting access to the rule segments.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.