Skip to content
Owolabi Legunsen edited this page Jan 6, 2022 · 2 revisions

Notes on JavaMOP refactoring:

Parser

  1. Parsing is done using JavaCC (for specifying the grammar and generating the parser), and javaparser (for AST manipulation).
  2. A lot of old (pre 2010?) javaparser code was inlined in JavaMOP but has now been removed in favor of depending on the javaparser jar.
  3. JavaMOPParser.parse is the method that other classes call. For debugging, one can now invoke JavaParser directly (from the command line for example).
  4. Parsing works as follows JavaMOPMain calls JavaMOPParser.parse, which works as follows:
    1. JavaMOPParser.parse uses a parser generated from the syntax defined in javamop.jj to parse the Java parts of the .mop file.
    2. While parsing the .mop file, a parser generated from the syntax defined in aspectj.jj is used to parse the Java parts of the .mop file.
    3. (NEEDS-FIX) While parsing the .mop file, the getFormula method defined in javamop.jj is used to parse the logic formula. Perhaps it would be cleaner to do this step with the syntax of the various logics, which we have?
Clone this wiki locally