-
Notifications
You must be signed in to change notification settings - Fork 46
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
ANTLR "constExpression" parser exception #43
Comments
You can add project file with compiler directives. In sonar-project.properties add: sonar.delphi.sources.project=Project.dproj example:
but...
|
Thanks @jbabijczuk !! But still not working... It picked the dproj correctly:
|
Could you paste stack trace ? |
@jbabijczuk same stack trace of the issue... |
Hi @jbabijczuk! The parser stops in {$IFNDEF FPC} compiler directive in the next block:
The sources have some other compiler directives, but is only stopping at this line.
The parser also stops in comments with "{ }", adding a dot to separe "{.$", like this:
|
I don't have idea what is wrong. |
I've found a bug in parser of many classes of my app.
It's impossible to continue the analysis with those errors...
I've attached the source file and exception stack trace.
Source File:
EDevice.pas.zip
Exception:
Caused by: org.antlr.runtime.tree.RewriteEmptyStreamException: rule constExpression at org.antlr.runtime.tree.RewriteRuleElementStream._next(RewriteRuleElementStream.java:157) at org.antlr.runtime.tree.RewriteRuleElementStream.nextTree(RewriteRuleElementStream.java:144) at org.sonar.plugins.delphi.antlr.DelphiParser.constDeclaration(DelphiParser.java:3935) at org.sonar.plugins.delphi.antlr.DelphiParser.constSection(DelphiParser.java:3596) at org.sonar.plugins.delphi.antlr.DelphiParser.interfaceDecl(DelphiParser.java:3328) at org.sonar.plugins.delphi.antlr.DelphiParser.unitInterface(DelphiParser.java:1466) at org.sonar.plugins.delphi.antlr.DelphiParser.unit(DelphiParser.java:1222) at org.sonar.plugins.delphi.antlr.DelphiParser.file(DelphiParser.java:411) at org.sonar.plugins.delphi.antlr.ast.DelphiAST.<init>(DelphiAST.java:84) at org.sonar.plugins.delphi.DelphiSensor.analyseSourceFile(DelphiSensor.java:258) at org.sonar.plugins.delphi.DelphiSensor.parseSourceFile(DelphiSensor.java:235) at org.sonar.plugins.delphi.DelphiSensor.parseFiles(DelphiSensor.java:200) at org.sonar.plugins.delphi.DelphiSensor.analyse(DelphiSensor.java:108) at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58) at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50) at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:98) at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:185) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117) at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:243) at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:238) at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236) at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:228) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117) at org.sonar.batch.task.ScanTask.execute(ScanTask.java:55) at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86) at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:132) at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:117) at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:122) at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:79) at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
The text was updated successfully, but these errors were encountered: