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

Lex files should throw more informative exception on failure #50

Closed
WaldoFR opened this issue Jul 6, 2017 · 1 comment
Closed

Lex files should throw more informative exception on failure #50

WaldoFR opened this issue Jul 6, 2017 · 1 comment

Comments

@WaldoFR
Copy link

WaldoFR commented Jul 6, 2017

Currently, annalysis failure result by throwing a JFlexException, however :

  • Some lex do not relate any message with the exception;
  • Some of the message included in the exception are not informative;
  • In case a file is badly encoded for the parser, it's impossible to be known by the user.
@WaldoFR WaldoFR added the bug label Jul 6, 2017
@WaldoFR WaldoFR added this to the Version 3.0 milestone Jul 6, 2017
@WaldoFR WaldoFR self-assigned this Jul 6, 2017
@WaldoFR WaldoFR changed the title Lex files should throw more informative exception on fail Lex files should throw more informative exception on failure Jul 6, 2017
@WaldoFR
Copy link
Author

WaldoFR commented Aug 25, 2017

Exception improvement

JFlexException now raise :

  • Rule causing failure
  • Error message
  • File parsed causing failure
  • Line & Column of the failure
  • Last word parsed and decimal value of the caracters causing problem.

Bad encoding message

The following Shell rules do not throws exception at all. They should be edited to throw failure on undesirable behaviour however the error state seems to be commonly used by other states :

  • COM.DATA.Initialisation
  • COM.FLOW.Recursion
  • COM.NAME.Homonymy

Other shell rules were edited to throw JFlexException when failing to read one character.

A warning message telling to verify that file's format is UNIX acceptable has been added.

WaldoFR pushed a commit to WaldoFR/i-CodeCNES that referenced this issue Aug 25, 2017
+ JFlexException can raise filename, line, columns, error message, last
parsed word and rule causing failure
+ Lexers now raise more details on encoding failure
+ JFlexException messages are now shown in i-Code UI
+ JFlexException contains a function to display the information message
with raised elements.
+ Shell rules (except the COMFLOWRecusion, COMNAMEHomonymy,
COMDATAInitialisation) do throw JFlexException when reaching error
state.
+ i-Code UI warning messageDialog was improved.
+ AbstractChecker contains a function to translate string into decimal
values of each character in it. This is useful to display information
when form feed or carriage return from non-Unix encoding files are
causing analysis failures.
+ Analyzer was edited to rethrow JFlexExceptions thrown from
CallableCheckers using ExecutionException from java.util.concurrent
WaldoFR pushed a commit to WaldoFR/i-CodeCNES that referenced this issue Sep 4, 2017
- Every exceptions thrown by checkers are sending more informative
messages

- Code was improved as defined in cnescatlab#77 with a logger & part of PMD &
checkstyle issues were solved

About the logger, a new class UILogger was made. It runs
org.eclipse.logger logger so all the logs are written directly to /*.log
file of ./metadata of workspace and /configuration of eclipse folder.
To precise the level of log a parameter must be indicated on the launch,
as defined in this page :
(https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html
). So the following argument can be used to define level of the logger
-Declipse.log.level=<level> where level can be INFO, WARNING, or ERROR.

An important change was made on ConfigurationPagePreferences that was
using CheckerTableViewer and MetricsTableViewer in a composite
Container. These class are now extending Composite that contains a
search SWT.label, a SWT.Text (for the search input) and a TableViewer
with Checkers and parameters relatives to them. Old composite containing
these class was replaced by the new CheckerComposite and
MetricsComposite.
WaldoFR pushed a commit to WaldoFR/i-CodeCNES that referenced this issue Sep 6, 2017
@WaldoFR WaldoFR closed this as completed Sep 13, 2017
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
+ JFlexException can raise filename, line, columns, error message, last
parsed word and rule causing failure
+ Lexers now raise more details on encoding failure
+ JFlexException messages are now shown in i-Code UI
+ JFlexException contains a function to display the information message
with raised elements.
+ Shell rules (except the COMFLOWRecusion, COMNAMEHomonymy,
COMDATAInitialisation) do throw JFlexException when reaching error
state.
+ i-Code UI warning messageDialog was improved.
+ AbstractChecker contains a function to translate string into decimal
values of each character in it. This is useful to display information
when form feed or carriage return from non-Unix encoding files are
causing analysis failures.
+ Analyzer was edited to rethrow JFlexExceptions thrown from
CallableCheckers using ExecutionException from java.util.concurrent
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
- Every exceptions thrown by checkers are sending more informative
messages

- Code was improved as defined in cnescatlab#77 with a logger & part of PMD &
checkstyle issues were solved

About the logger, a new class UILogger was made. It runs
org.eclipse.logger logger so all the logs are written directly to /*.log
file of ./metadata of workspace and /configuration of eclipse folder.
To precise the level of log a parameter must be indicated on the launch,
as defined in this page :
(https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html
). So the following argument can be used to define level of the logger
-Declipse.log.level=<level> where level can be INFO, WARNING, or ERROR.

An important change was made on ConfigurationPagePreferences that was
using CheckerTableViewer and MetricsTableViewer in a composite
Container. These class are now extending Composite that contains a
search SWT.label, a SWT.Text (for the search input) and a TableViewer
with Checkers and parameters relatives to them. Old composite containing
these class was replaced by the new CheckerComposite and
MetricsComposite.
begarco pushed a commit to begarco/i-CodeCNES that referenced this issue Jan 25, 2020
begarco pushed a commit that referenced this issue Feb 2, 2020
+ JFlexException can raise filename, line, columns, error message, last
parsed word and rule causing failure
+ Lexers now raise more details on encoding failure
+ JFlexException messages are now shown in i-Code UI
+ JFlexException contains a function to display the information message
with raised elements.
+ Shell rules (except the COMFLOWRecusion, COMNAMEHomonymy,
COMDATAInitialisation) do throw JFlexException when reaching error
state.
+ i-Code UI warning messageDialog was improved.
+ AbstractChecker contains a function to translate string into decimal
values of each character in it. This is useful to display information
when form feed or carriage return from non-Unix encoding files are
causing analysis failures.
+ Analyzer was edited to rethrow JFlexExceptions thrown from
CallableCheckers using ExecutionException from java.util.concurrent
begarco pushed a commit that referenced this issue Feb 2, 2020
- Every exceptions thrown by checkers are sending more informative
messages

- Code was improved as defined in #77 with a logger & part of PMD &
checkstyle issues were solved

About the logger, a new class UILogger was made. It runs
org.eclipse.logger logger so all the logs are written directly to /*.log
file of ./metadata of workspace and /configuration of eclipse folder.
To precise the level of log a parameter must be indicated on the launch,
as defined in this page :
(https://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-options.html
). So the following argument can be used to define level of the logger
-Declipse.log.level=<level> where level can be INFO, WARNING, or ERROR.

An important change was made on ConfigurationPagePreferences that was
using CheckerTableViewer and MetricsTableViewer in a composite
Container. These class are now extending Composite that contains a
search SWT.label, a SWT.Text (for the search input) and a TableViewer
with Checkers and parameters relatives to them. Old composite containing
these class was replaced by the new CheckerComposite and
MetricsComposite.
begarco pushed a commit that referenced this issue Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant