ResourceManagedParser

io.joern.rubysrc2cpg.parser.ResourceManagedParser
class ResourceManagedParser(clearLimit: Double) extends AutoCloseable

A re-usable parser object that clears the ANTLR DFA-cache if it determines that the memory usage is becoming large. Once this parser is closed, the whole cache is evicted.

This is done in this way since clearing the cache after each file is inefficient, since the cache must be re-built every time, but the cache can become unnecessarily large at times. The cache also does not evict itself at the end of parsing.

Value parameters

clearLimit

the percentage of used heap to clear the DFA-cache on.

Attributes

Graph
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def close(): Unit

Attributes

Definition Classes
AutoCloseable
def parse(filename: String): Try[ProgramContext]