antlr4 icon indicating copy to clipboard operation
antlr4 copied to clipboard

[cpp] add 'const' to constant functions

Open MSchleinkoferV opened this issue 11 months ago • 0 comments
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

MSchleinkoferV avatar Dec 17 '24 14:12 MSchleinkoferV