antlr4
antlr4 copied to clipboard
[cpp] add 'const' to constant functions
trafficstars
Some functions of class ParseTree, e. g.
std::string ParseTree::toStringTree(…)std::string ParseTree::toString()std::string ParseTree::getText()
are not intended to modify the object. Thus they should also be tagged as const in c++. Otherwise when handling const objects, these functions are not available. Actually one can not restrict objects as const.
Note:
ParseTreeType ParseTree::getTreeType() const is already const