missing generation of pp file after deletion
I deleted the generated file xyz.generated.pp. Now it is not generated again on build (like the *.generated.esv files). How can I bring Spoofax to generate a pp file again for this language?
Submitted by Otto Hausbacher on 15 August 2010 at 20:38
Issue Log
This seems to be caused by an annoying limitation of the
<dependset>
task in Ant. A workaround would be to change your syntax or to delete theinclude/
directory to tell Ant it needs to refresh the generated pretty printer.
Both workarounds work nice on the Spoofax tour example ‘entities’. They do not work on my project. So I created a new Spoofax project and adapted it to my grammar. On build the generated pp file was deleted. When importing the tour example again, on build the generated pp file was generated again. I will have to minimize my project to see where the reason could be to find. Meanwhile I tried out a very minimal grammar example and even here an error was indicated in the Xy.generated.pp file:
module languages/boo/Boo
imports Common
exports sorts Start A
context-free syntax
'foo' -> Start {cons("Start")}
Xy.generated.pp:
[
Start – _1,
Start.1:ci-lit – _1,
Start.1:ci-lit.1:“foo” – // error: *)
]
*) Multiple messages:
- Syntax error, ‘"’ not expected here
- Syntax error, ‘"’ not expected here
Thanks for the followup. The problem seems to be that the pretty printer generator doesn’t support case-insensitive literals like
'foo'
(now reported as StrategoXT/836). You can use normal, case-sensitive literals instead by using double quotes:"foo"
.(If that’s not what causing this problem, then it may also be caused by productions with only a literal as the pattern?)
Unfortunately I need a case-insensitive grammar. I found a workaround by using the following intermedia step:
module languages/boo/Boo
imports Common
exports sorts Start A LA
context-free syntax
A -> Start {cons("Start")} LA -> A {cons("A")} %% new
lexical syntax %% new
'foo' -> LA %% new
This gives an error free Xy.generated.pp:
[
Start – _1,
Start.1:iter-star – _1,
A – _1
]
I applied this to my whole project.
Then the Xy.generated.pp file was generated fine without any errors
(but the default syntax coloring for keywords - in this case for A - was lost).
Log in to post comments