java.lang.Object
org.matwoess.jsourceprofiler.tool.instrument.ParserState

public class ParserState extends Object
Companion class for the Parser, generated by the attributed grammar in JavaFile.atg. It is the most important class of the instrumentation tool.

It is used to keep track of the current parser state and contains methods to enter and leave parsed program components. Each enter and leave method is responsible for building the metadata model of the parsed Java file.

Additionally, it contains methods to register labels and control flow breaks, setting the package name and all the logic handling the starting end ending of code regions.

  • Constructor Details

    • ParserState

      public ParserState(Parser p)
      Creates a new ParserState, linked to the given parser. Additionally, it creates a new logger object.
      Parameters:
      p - the parser object to link to