Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split LexGenerator out of Main #428

Merged
merged 6 commits into from
Oct 10, 2018
Merged

Conversation

regisd
Copy link
Member

@regisd regisd commented Oct 10, 2018

This is a minor refactoring to support multithreading #214

Split Main in 2 classes:

  • Main the cli client that parses the command line options
  • LexGenerator that generates java code
    The later is used by the cli, the jflex-maven-plugin, the ant task and the GUI, i.e. Main.generate(lexFile) becomes LexGenerator().generate(lexFile)

In the future, LexGenerator.generate() will not be static and have internal state in order to support multithreading.

This is a minor refactoring to support refacotring  jflex-de#214
In the future, LexGenerator.generate() will not be static and have internal state in order to support multithreading.
@regisd regisd requested a review from lsf37 as a code owner October 10, 2018 17:27
@regisd regisd self-assigned this Oct 10, 2018
@regisd regisd added this to the 1.7.1 milestone Oct 10, 2018
@regisd regisd added the code quality Code health and clean-up label Oct 10, 2018
Copy link
Member

@lsf37 lsf37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the comment that needs a tweak, everything looks fine.


/**
* This is the main class of JFlex controlling the scanner generation process. It is responsible for
* parsing the commandline, getting input files, starting up the GUI if necessary, etc.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment will need adjustment for the refactor, indicating which part is in which class in the new setting.

@regisd regisd merged commit c3ae263 into jflex-de:master Oct 10, 2018
@regisd regisd deleted the split-lexgenerator branch October 10, 2018 22:42
regisd pushed a commit that referenced this pull request Oct 10, 2018
Initial commit c3ae263
Author: Régis Décamps <[email protected]>
Date:   Thu Oct 11 00:42:45 2018 +0200

    Split LexGenerator out of Main (#428)

    * Split Main in Main and LexGenerator.
      This is a minor refactoring to support refacotring  #214
      In the future, LexGenerator.generate() will not be static and have internal state in order to support
      multithreading.

    * Update javadoc

    *Also  Make Main non instanciable.
@lsf37 lsf37 modified the milestones: 1.7.1, 1.8.0 Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Code health and clean-up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants