io.joern.rubysrc2cpg.astcreation

Members list

Type members

Classlikes

class AntlrParser(filename: String)

A consumable wrapper for the RubyParser class used to parse the given file and be disposed thereafter. This includes a "hacky" recovery of the parser when unsupported constructs are encountered by simply not parsing those lines.

A consumable wrapper for the RubyParser class used to parse the given file and be disposed thereafter. This includes a "hacky" recovery of the parser when unsupported constructs are encountered by simply not parsing those lines.

Value parameters

filename

the file path to the file to be parsed.

parsingTimeoutMs

grammar dependent, during development we may see input that would cause the parser to hang. To induce completion we need a timeout.

Attributes

Supertypes
class Object
trait Matchable
class Any
class AstCreator(val filename: String, global: Global, parser: ResourceManagedParser, packageContext: PackageContext, projectRoot: Option[String]) extends AstCreatorBase, AstNodeBuilder[ParserRuleContext, AstCreator], AstForPrimitivesCreator, AstForStatementsCreator, AstForExpressionsCreator, AstForDeclarationsCreator, AstForTypesCreator, AstCreatorHelper

Attributes

Supertypes
trait AstNodeBuilder[ParserRuleContext, AstCreator]
class AstCreatorBase
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AstCreator
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AstCreator
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AstCreator
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AstCreator
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AstCreator
Self type

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AstCreator
Self type
object GlobalTypes

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
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.

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.

parserTimeoutMs

how long the parser may attempt parsing a file before bailing out.

Attributes

Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any