Since the src-gen directory contains only generated files, I believe it should be removed/cleared out when cleaning a project.

(By the way, in build.generated.xml there is some cleaning of ${src-gen}, but that refers to the editor/java directory.)

Submitted by D. Pelsmaeker on 22 July 2014 at 15:19

On 22 July 2014 at 16:36 Gabriël Konat commented:

In the build file, src-gen refers to the directory where the generated Java files from Stratego source files will end up, if building to a JAR.


On 22 July 2014 at 17:00 Eduardo Amorim commented:

In this case, the build.generated.xml is still considering the old implementation in which there was no src-gen folder.
I am refactoring it to use Ant macros and to deal with the new location of the generated files.


On 22 July 2014 at 20:08 Guido Wachsmuth commented:

The generated Java files can also go into src-gen/editor/java. We can then let src-gen to the src-gen directory and introduce another variable for src-gen/editor/java.


On 22 July 2014 at 20:42 Gabriël Konat commented:

Probably best to do that in another refactoring.


On 4 November 2014 at 15:37 Gabriël Konat closed this issue.

On 23 July 2015 at 16:42 Peter Mosses commented:

In Spoofax-1.4, clean removes the contents of all folders in src-gen. Spoofax copies SDF2 files from syntax to src-gen/syntax at the start of each build, but it seems that when the build depends on copied SDF2 files (e.g., modules instantiating StategoMix) the first build after clean fails, reporting that it cannot find the copied file in the include path. After (manually) refreshing Eclipse, the copied file appears in the navigation, and repeating the build succeeds. Is this perhaps a bug in build.generated.xml?


On 1 August 2015 at 18:20 Guido Wachsmuth reopened this issue.

On 1 August 2015 at 18:20 Guido Wachsmuth tagged @edesouzaamorim

On 3 August 2015 at 11:14 Eduardo Amorim commented:

@pdmosses: In which target the ant build fails? What I tried here was, given the Entity project, I generated just the SDF2 files from the SDF3 files, copied them to syntax, deleted the SDF3 files, fixed all dependencies on the generated Stratego files from SDF3, and cleaned the project.
Indeed the copied SDF2 files do not show in src-gen/syntax after the first build, but at least in this case the build succeeded.
I will add the src-gen folder to the refresh target because it was not part of it, but I’m not sure if this will fix the failing build issue.


On 3 August 2015 at 12:08 Peter Mosses commented:

It’s right at the end:

stratego.jvm.helper:
        [java] cannot find the parse table for syntax "Stratego-CL" in the include path
        [java] parse error in /Volumes/HDD/pdm/SVN/CL-Editor/trans/generate.str
        [java] parse error in /Volumes/HDD/pdm/SVN/CL-Editor/trans/generate.str

Stratego-CL.sdf is the only SDF2 file in syntax. Previously in the same build, it correctly reported copying it:

copy-sdf2:
        [copy] Copying 1 file to /Volumes/HDD/pdm/SVN/CL-Editor/src-gen/syntax

Could Eclipse Workspace preferences affect refreshing during building? I have “Refresh on access” set, but not “Refresh using native hooks or polling”.


On 3 August 2015 at 13:25 Eduardo Amorim commented:

Ok, I think I understand it now. I believe it is not a problem of copying the SDF2 file nor generating the parse table, but how the mixed grammar tables are managed in Spoofax. I know that there is an old (annoying) issue of when you build a mixed grammar parse table, you have to restart Eclipse for it to actually work with your changes in the grammar, but I don’t know if it is actually related with that.
The parse table is definitely there, as previous targets such as pack-sdf and sdf2table that come before than stratego.jvm.helper and depend on the copied SDF2 file succeeded.
I think this issue is more related on how the Stratego compiler loads these resources when/before running.
@Gabriël, do you know something about it?

Log in to post comments