
https://svn.lrde.epita.fr/svn/xrm/trunk Index: ChangeLog from SIGOURE Benoit <sigoure.benoit@lrde.epita.fr> Add MetaModules and some other extensions. * src/tools/parse-xrm.str: Factorize some code in common with parse-prism in parser-common.str. Improve use of addPosInfo. * src/tools/parse-prism.str: Likewise. * src/tools/parser-common.str: New. * src/lib/xrm/pp/xrm-module.str: Add MetaModule boxing. * src/lib/xrm/pp/xrm-to-abox.str: Import xrm-arrays. * src/lib/xrm/pp/xrm-arrays.meta: New. * src/lib/xrm/pp/xrm-arrays.str: New. * src/str/xrm-front.str: Use parse-xrm instead of receiving ATerms on stdin. Use addPosInfo by default. * src/str/prism-desugar.str: Update literals used in concrete syntax. * src/syn/xrm/XRM-Arrays.sdf: New. * src/syn/xrm/XRM-StaticIf.sdf: Add EBNF grammar in comments. * src/syn/xrm/XRM-Literals.sdf: New. * src/syn/xrm/XRM-Main.sdf: Import XRM-Literals. * src/syn/xrm/XRM-Module.sdf: Add MetaModule. * src/syn/prism/PRISM-MetaVars.sdf: Add a FIXME. * src/syn/prism/StrategoPRISM.sdf: Add a FIXME. Fix meta-escapes. * tests/xrm/outer-static-if.xpm: Update test case. * tests/xrm/outer-static-for-step.xpm, * tests/xrm/static-if.xpm, * tests/xrm/static-for-step.xpm, * tests/xrm/outer-static-for.xpm, * tests/xrm/static-for.xpm, * tests/test-xrm-front.sh.in: Adapt to xrm-front changes. src/lib/xrm/pp/xrm-arrays.meta | 1 src/lib/xrm/pp/xrm-arrays.str | 9 ++++ src/lib/xrm/pp/xrm-module.str | 8 +++ src/lib/xrm/pp/xrm-to-abox.str | 1 src/str/prism-desugar.str | 16 +++---- src/str/xrm-front.str | 29 +++++++++++- src/syn/prism/PRISM-MetaVars.sdf | 3 - src/syn/prism/StrategoPRISM.sdf | 7 +-- src/syn/xrm/XRM-Arrays.sdf | 19 ++++++++ src/syn/xrm/XRM-Literals.sdf | 12 +++++ src/syn/xrm/XRM-Main.sdf | 1 src/syn/xrm/XRM-Module.sdf | 9 ++++ src/syn/xrm/XRM-StaticIf.sdf | 18 ++++++++ src/tools/parse-prism.str | 81 ++---------------------------------- src/tools/parse-xrm.str | 81 ++---------------------------------- src/tools/parser-common.str | 77 ++++++++++++++++++++++++++++++++++ tests/test-xrm-front.sh.in | 12 ----- tests/xrm/outer-static-for-step.xpm | 5 -- tests/xrm/outer-static-for.xpm | 5 -- tests/xrm/outer-static-if.xpm | 7 --- tests/xrm/static-for-step.xpm | 5 -- tests/xrm/static-for.xpm | 5 -- tests/xrm/static-if.xpm | 7 --- 23 files changed, 214 insertions(+), 204 deletions(-) Index: src/tools/parse-xrm.str --- src/tools/parse-xrm.str (revision 25) +++ src/tools/parse-xrm.str (working copy) @@ -4,6 +4,7 @@ imports liblib tool-doc + parser-common strategies main-parse-xrm = @@ -11,7 +12,7 @@ xtc-io-wrap( parse-xrm-options , parse-xrm-usage - , parse-xrm-about + , parser-about , !["sglr", "implode-asfix", "XRM.tbl", "pp-aterm"] , parse-xrm ) @@ -25,18 +26,13 @@ strategies parse-xrm = - xtc-sglr-no-heuristics(get-parse-table, get-start-symbol) + where(?FILE(input-file-name) + !"stdin" => input-file-name) + ; xtc-sglr-no-heuristics(get-parse-table, get-start-symbol) ; if must-preserve-comments then xtc-transform(!"asfix-anno-comments", pass-verbose) end - /* - ** -p is supposed to be the original path of the file, used in the - ** position representation. The input of addPosInfo is an asfix file, - ** which is not the original source file. The -p option is almost - ** never used by addPosInfo but it's a "mandatory option" - */ ; if must-preserve-positions then - xtc-transform(!"addPosInfo", !["-p", "DummyFileName" + xtc-transform(!"addPosInfo", !["-p", input-file-name | <pass-verbose>()]) end ; xtc-implode-asfix @@ -44,18 +40,6 @@ xtc-transform(!"pp-aterm", pass-verbose) end - /* sglr options: - ** -fi: heuristic: injection count - ** -fe: heuristic: eagerness - ** -2: use AsFix2 output format - ** -A: ambiguities are treated as errors - ** -p <file>: parse table to use - ** -s <symbol>: start symbol to use - */ - xtc-sglr-no-heuristics(tbl, sort) = - xtc-transform(!"sglr", !["-fi", "-fe", "-2A", "-p", <tbl; xtc-find> (), - "-s", <sort> () | <pass-v-verbose> ()]) - strategies symbol-option = @@ -72,50 +56,6 @@ <get-config> "start-symbol" <+ !"ModulesFile" strategies - - preserve-comments-option = - Option("--preserve-comments" - , <set-preserve-comments> "yes" - , !HelpString("--preserve-comments", "Preserve source code - comments as annotations of the abstract syntax tree. [off]") - ) - - set-preserve-comments = - <set-config> ("preserve-comments", <id>) - - must-preserve-comments = - <get-config> "preserve-comments" => "yes" - -strategies - - preserve-positions-option = - Option("--preserve-positions" - , <set-preserve-positions> "yes" - , !HelpString("--preserve-positions", "Preserve source code positions in - the input file as annotations of the abstract syntax tree. - [off]") - ) - - set-preserve-positions = - <set-config> ("preserve-positions", <id>) - - must-preserve-positions = - <get-config> "preserve-positions" => "yes" - -strategies - pp-aterm-option = - Option("-A" + "--pp-aterm" - , <set-pp-aterm> "yes" - , !HelpString("-A | --pp-aterm", "Pretty print output with pp-aterm") - ) - - set-pp-aterm = - <set-config> ("pp-aterm", <id>) - - must-pp-aterm = - <get-config> "pp-aterm" => "yes" - -strategies /* ** We use two parse tables for performances. One of them (XRM.tbl) has a ** single start symbol (ModulesFile) and the other (XRM-StartSymbols) has @@ -145,14 +85,3 @@ , OptionUsage() , AutoReportBugs() ] - - parse-xrm-about = - <tool-doc> - [ AutoProgram() - , Author(Person("SIGOURE Benoit", "sigoure.benoit@lrde.epita.fr")) - , GNU_GPL("2006", "SIGOURE Benoit <sigoure.benoit@lrde.epita.fr>") - , Config([ - DefaultXTCRepository() - , CurrentXTCRepository() - ]) - ] Index: src/tools/parse-prism.str --- src/tools/parse-prism.str (revision 25) +++ src/tools/parse-prism.str (working copy) @@ -4,6 +4,7 @@ imports liblib tool-doc + parser-common strategies main-parse-prism = @@ -11,7 +12,7 @@ xtc-io-wrap( parse-prism-options , parse-prism-usage - , parse-prism-about + , parser-about , !["sglr", "implode-asfix", "PRISM.tbl", "pp-aterm"] , parse-prism ) @@ -25,18 +26,13 @@ strategies parse-prism = - xtc-sglr-no-heuristics(get-parse-table, get-start-symbol) + where(?FILE(input-file-name) + !"stdin" => input-file-name) + ; xtc-sglr-no-heuristics(get-parse-table, get-start-symbol) ; if must-preserve-comments then xtc-transform(!"asfix-anno-comments", pass-verbose) end - /* - ** -p is supposed to be the original path of the file, used in the - ** position representation. The input of addPosInfo is an asfix file, - ** which is not the original source file. The -p option is almost - ** never used by addPosInfo but it's a "mandatory option" - */ ; if must-preserve-positions then - xtc-transform(!"addPosInfo", !["-p", "DummyFileName" + xtc-transform(!"addPosInfo", !["-p", input-file-name | <pass-verbose>()]) end ; xtc-implode-asfix @@ -44,18 +40,6 @@ xtc-transform(!"pp-aterm", pass-verbose) end - /* sglr options: - ** -fi: heuristic: injection count - ** -fe: heuristic: eagerness - ** -2: use AsFix2 output format - ** -A: ambiguities are treated as errors - ** -p <file>: parse table to use - ** -s <symbol>: start symbol to use - */ - xtc-sglr-no-heuristics(tbl, sort) = - xtc-transform(!"sglr", !["-fi", "-fe", "-2A", "-p", <tbl; xtc-find> (), - "-s", <sort> () | <pass-v-verbose> ()]) - strategies symbol-option = @@ -72,50 +56,6 @@ <get-config> "start-symbol" <+ !"ModulesFile" strategies - - preserve-comments-option = - Option("--preserve-comments" - , <set-preserve-comments> "yes" - , !HelpString("--preserve-comments", "Preserve source code - comments as annotations of the abstract syntax tree. [off]") - ) - - set-preserve-comments = - <set-config> ("preserve-comments", <id>) - - must-preserve-comments = - <get-config> "preserve-comments" => "yes" - -strategies - - preserve-positions-option = - Option("--preserve-positions" - , <set-preserve-positions> "yes" - , !HelpString("--preserve-positions", "Preserve source code positions in - the input file as annotations of the abstract syntax tree. - [off]") - ) - - set-preserve-positions = - <set-config> ("preserve-positions", <id>) - - must-preserve-positions = - <get-config> "preserve-positions" => "yes" - -strategies - pp-aterm-option = - Option("-A" + "--pp-aterm" - , <set-pp-aterm> "yes" - , !HelpString("-A | --pp-aterm", "Pretty print output with pp-aterm") - ) - - set-pp-aterm = - <set-config> ("pp-aterm", <id>) - - must-pp-aterm = - <get-config> "pp-aterm" => "yes" - -strategies /* ** We use two parse tables for performances. One of them (PRISM.tbl) has a ** single start symbol (ModulesFile) and the other (PRISM-StartSymbols) has @@ -145,14 +85,3 @@ , OptionUsage() , AutoReportBugs() ] - - parse-prism-about = - <tool-doc> - [ AutoProgram() - , Author(Person("SIGOURE Benoit", "sigoure.benoit@lrde.epita.fr")) - , GNU_GPL("2006", "SIGOURE Benoit <sigoure.benoit@lrde.epita.fr>") - , Config([ - DefaultXTCRepository() - , CurrentXTCRepository() - ]) - ] Index: src/tools/parser-common.str --- src/tools/parser-common.str (revision 0) +++ src/tools/parser-common.str (revision 0) @@ -0,0 +1,77 @@ +// used by parse-prism and parse-xrm to factorize common strategies + +module parser-common + +strategies + + /* sglr options: + ** -fi: heuristic: injection count + ** -fe: heuristic: eagerness + ** -2: use AsFix2 output format + ** -A: ambiguities are treated as errors + ** -p <file>: parse table to use + ** -s <symbol>: start symbol to use + */ + xtc-sglr-no-heuristics(tbl, sort) = + xtc-transform(!"sglr", !["-fi", "-fe", "-2A", "-p", <tbl; xtc-find> (), + "-s", <sort> () | <pass-v-verbose> ()]) + +strategies + + preserve-comments-option = + Option("--preserve-comments" + , <set-preserve-comments> "yes" + , !HelpString("--preserve-comments", "Preserve source code + comments as annotations of the abstract syntax tree. [off]") + ) + + set-preserve-comments = + <set-config> ("preserve-comments", <id>) + + must-preserve-comments = + <get-config> "preserve-comments" => "yes" + +strategies + + preserve-positions-option = + Option("--preserve-positions" + , <set-preserve-positions> "yes" + , !HelpString("--preserve-positions", "Preserve source code positions in + the input file as annotations of the abstract syntax tree. + [off]") + ) + + set-preserve-positions = + <set-config> ("preserve-positions", <id>) + + must-preserve-positions = + <get-config> "preserve-positions" => "yes" + +strategies + pp-aterm-option = + Option("-A" + "--pp-aterm" + , <set-pp-aterm> "yes" + , !HelpString("-A | --pp-aterm", "Pretty print output with pp-aterm") + ) + + set-pp-aterm = + <set-config> ("pp-aterm", <id>) + + must-pp-aterm = + <get-config> "pp-aterm" => "yes" + +/** + * Documentation + */ +strategies + + parser-about = + <tool-doc> + [ AutoProgram() + , Author(Person("SIGOURE Benoit", "sigoure.benoit@lrde.epita.fr")) + , GNU_GPL("2006", "SIGOURE Benoit <sigoure.benoit@lrde.epita.fr>") + , Config([ + DefaultXTCRepository() + , CurrentXTCRepository() + ]) + ] Index: src/lib/xrm/pp/xrm-module.str --- src/lib/xrm/pp/xrm-module.str (revision 25) +++ src/lib/xrm/pp/xrm-module.str (working copy) @@ -10,3 +10,11 @@ ] KW["endmodule"] ] ]| + + prism-to-box: + MetaModule(array-access, dec-or-cmd-list) + -> box |[ V[ V is=2 [ H hs=1 [KW["module"] ~array-access ] + ~*dec-or-cmd-list + ] + KW["endmodule"] + ] ]| Index: src/lib/xrm/pp/xrm-to-abox.str --- src/lib/xrm/pp/xrm-to-abox.str (revision 25) +++ src/lib/xrm/pp/xrm-to-abox.str (working copy) @@ -23,6 +23,7 @@ xrm-module xrm-staticfor xrm-staticif + xrm-arrays strategies Index: src/lib/xrm/pp/xrm-arrays.meta --- src/lib/xrm/pp/xrm-arrays.meta (revision 0) +++ src/lib/xrm/pp/xrm-arrays.meta (revision 0) @@ -0,0 +1 @@ +Meta([Syntax("Stratego-Box")]) Index: src/lib/xrm/pp/xrm-arrays.str --- src/lib/xrm/pp/xrm-arrays.str (revision 0) +++ src/lib/xrm/pp/xrm-arrays.str (revision 0) @@ -0,0 +1,9 @@ +module xrm-arrays + +rules + + // Identifier ArraySubscript+ -> ArrayAccess + prism-to-box: + ArrayAccess(idf, subscripts) -> H hs=0 [ ~idf ~*subscripts-impl ] + where + <mapconcat(\ x -> [S("["), x, S("]")] \)> subscripts => subscripts-impl Index: src/str/xrm-front.str --- src/str/xrm-front.str (revision 25) +++ src/str/xrm-front.str (working copy) @@ -14,14 +14,18 @@ xrm-front-options , xrm-front-usage , xrm-front-about - , !["pp-prism", "pp-aterm"] + , !["parse-xrm", "pp-prism", "pp-aterm"] , main-wrapped ) main-wrapped = check-options - ; read-from + ; xtc-transform(!"parse-xrm", // parse input (returns a FILE) + !["-b", "--preserve-positions" | <pass-verbose>()]) + ; read-from // read parsed input + ; strip-annos ; xrm-front-pipeline // transformations + ; if not(must-keep-attributes) then strip-annos end ; if <get-config> "-b" then write-to // output binary ATerms else @@ -51,6 +55,7 @@ xrm-front-options = pp-prism-option + pp-aterm-option + + keep-attributes-option + desugar-option // check the options are consistent @@ -72,6 +77,21 @@ strategies + keep-attributes-option = + Option("-K" + "--keep-attributes" + , <set-keep-attributes> "yes" + , !HelpString("-K | --keep-attributes", "Don't remove attributes when + printing ATerms (this includes positions)") + ) + + set-keep-attributes = + <set-config> ("keep-attributes", <id>) + + must-keep-attributes = + <get-config> "keep-attributes" => "yes" + +strategies + pp-prism-option = Option("-P" + "--pp-prism" , <set-pp-prism> "yes" @@ -121,8 +141,9 @@ xrm-front-usage = <tool-doc> [ Usage("xrm-front [OPTIONS]") - , Summary("Transforms an eXtended Reactive Module abstract syntax - tree in ATerm format to a PRISM-equivalant abstract syntax tree.") + , Summary("Transforms an eXtended Reactive Module source file in a + PRISM-equivalant abstract syntax tree (default) or source + code. (see option -P)") , OptionUsage() , AutoReportBugs() ] Index: src/str/prism-desugar.str --- src/str/prism-desugar.str (revision 25) +++ src/str/prism-desugar.str (working copy) @@ -64,27 +64,27 @@ compare(s) = if s then !True() else !False() end catch-div-by-zero = - ?|[ e / 0 ]|; fatal-err-msg(|"Division by zero detected") + ?|[ e / 0D ]|; debug; fatal-err-msg(|"Division by zero detected") rules AddZero: - |[ e + 0 ]| -> |[ e ]| + |[ e + 0D ]| -> |[ e ]| AddZero: - |[ 0 + e ]| -> |[ e ]| + |[ 0D + e ]| -> |[ e ]| MulOne: - |[ e * 1 ]| -> |[ e ]| + |[ e * 1D ]| -> |[ e ]| MulOne: - |[ 1 * e ]| -> |[ e ]| + |[ 1D * e ]| -> |[ e ]| MulZero: - |[ e * 0 ]| -> |[ 0 ]| + |[ e * 0D ]| -> |[ 0D ]| MulZero: - |[ 0 * e ]| -> |[ 0 ]| + |[ 0D * e ]| -> |[ 0D ]| DivOne: - |[ e / 1 ]| -> |[ e ]| + |[ e / 1D ]| -> |[ e ]| EvalPlus: |[ d1 + d2 ]| -> |[ r ]| where <addR>(d1, d2) => r Index: src/syn/xrm/XRM-Arrays.sdf --- src/syn/xrm/XRM-Arrays.sdf (revision 0) +++ src/syn/xrm/XRM-Arrays.sdf (revision 0) @@ -0,0 +1,19 @@ +module XRM-Arrays +imports + PRISM-to-XRM +exports + + %% EBNF Grammar: Arrays + %% ArrayAccess ::= Identifier ArraySubscript {ArraySubscript} + %% + %% ArraySubscript ::= "[" Identifier "]" + + sorts ArrayAccess ArraySubscript + context-free syntax + Identifier ArraySubscript+ -> ArrayAccess {cons("ArrayAccess")} + "[" Identifier "]" -> ArraySubscript {bracket} + + %% Note: why use bracket here? + %% This is a work around. In SDF, if a production contains literals, + %% a constructor is required. With brackets, we specify that literals + %% are allowed there, however this does not create a node in the AST. Index: src/syn/xrm/XRM-StaticIf.sdf --- src/syn/xrm/XRM-StaticIf.sdf (revision 25) +++ src/syn/xrm/XRM-StaticIf.sdf (working copy) @@ -4,6 +4,24 @@ XRM-Module exports + %% EBNF Grammar: Static if-then-else + %% (* if-then-else at top-level *) + %% ModulesFileSection ::= + %% "if" Expression "then" ModulesFileSection {ModulesFileSection} "end" + %% | "if" Expression "then" + %% ModulesFileSection {ModulesFileSection} + %% "else" + %% ModulesFileSection {ModulesFileSection} + %% "end" + %% + %% DeclarationOrCommand ::= + %% "if" Expression "then" DeclarationOrCommand {DeclarationOrCommand} "end" + %% | "if" Expression "then" + %% DeclarationOrCommand {DeclarationOrCommand} + %% "else" + %% DeclarationOrCommand {DeclarationOrCommand} + %% "end" + context-free syntax %% if-then at top-level "if" Expression "then" ModulesFileSection+ "end" Index: src/syn/xrm/XRM-Literals.sdf --- src/syn/xrm/XRM-Literals.sdf (revision 0) +++ src/syn/xrm/XRM-Literals.sdf (revision 0) @@ -0,0 +1,12 @@ +module XRM-Literals +imports PRISM-to-XRM +exports + + syntax + <LInt-LEX> "d" -> <LDouble-CF> {bracket} + <LInt-LEX> "D" -> <LDouble-CF> {bracket} + <LInt-LEX> "f" -> <LDouble-CF> {bracket} + <LInt-LEX> "F" -> <LDouble-CF> {bracket} + + lexical restrictions + LDouble -/- [dDfF] Index: src/syn/xrm/XRM-Main.sdf --- src/syn/xrm/XRM-Main.sdf (revision 25) +++ src/syn/xrm/XRM-Main.sdf (working copy) @@ -5,3 +5,4 @@ XRM-Expression XRM-StaticFor XRM-StaticIf + XRM-Literals Index: src/syn/xrm/XRM-Module.sdf --- src/syn/xrm/XRM-Module.sdf (revision 25) +++ src/syn/xrm/XRM-Module.sdf (working copy) @@ -1,9 +1,18 @@ module XRM-Module imports PRISM-to-XRM + XRM-Arrays exports + %% EBNF Grammar: eXtended Modules + %% DeclarationOrCommand ::= Declaration | Command + %% Module ::= "module" ArrayAccess Declaration* Command* "endmodule" + sorts DeclarationOrCommand context-free syntax Declaration -> DeclarationOrCommand Command -> DeclarationOrCommand + + context-free syntax + "module" ArrayAccess DeclarationOrCommand* "endmodule" + -> Module {cons("MetaModule")} Index: src/syn/prism/PRISM-MetaVars.sdf --- src/syn/prism/PRISM-MetaVars.sdf (revision 25) +++ src/syn/prism/PRISM-MetaVars.sdf (working copy) @@ -4,7 +4,8 @@ [ijkln][0-9]* -> LInt {prefer} [dr][0-9]* -> LDouble {prefer} [xyzfgh][0-9]* -> ID {prefer} -%% [xyzfgh][0-9]* "'" -> IdentifierPrime {prefer} + %% FIXME: The following doesn't work + [xyzfgh][0-9]* "'" -> IdentifierPrime {prefer} [e][0-9]* -> Expression {prefer} "a"[0-9]* "*" -> {Identifier ","}+ {prefer} [m][0-9]* -> Module {prefer} Index: src/syn/prism/StrategoPRISM.sdf --- src/syn/prism/StrategoPRISM.sdf (revision 25) +++ src/syn/prism/StrategoPRISM.sdf (working copy) @@ -19,7 +19,8 @@ context-free syntax "~" StrategoTerm -> Expression {prefer,cons("FromTerm")} - "~id:" StrategoTerm -> Identifier {prefer,cons("FromTerm")} + "~id:" StrategoTerm -> ID {prefer,cons("FromTerm")} + %% FIXME: The following doesn't work "~id':" StrategoTerm -> IdentifierPrime {prefer,cons("FromTerm")} - "~int:" StrategoTerm -> Int {prefer,cons("FromTerm")} - "~double:" StrategoTerm -> Double {prefer,cons("FromTerm")} + "~int:" StrategoTerm -> LInt {prefer,cons("FromTerm")} + "~double:" StrategoTerm -> LDouble {prefer,cons("FromTerm")} Index: tests/xrm/outer-static-if.xpm --- tests/xrm/outer-static-if.xpm (revision 25) +++ tests/xrm/outer-static-if.xpm (working copy) @@ -1,16 +1,13 @@ probabilistic for i from 0 to 42 do - // FIXME: the following line shall be: - //module dummy[i] - // but this is not supported ATM if i<1 & i>41 then - module dummy + module dummy[i] x : [0..1]; [] x=0 -> x'=1; endmodule else - module dummy + module dummy[i] x : [0..2]; [] x=1 -> x'=2; endmodule Index: tests/xrm/outer-static-for-step.xpm --- tests/xrm/outer-static-for-step.xpm (revision 25) +++ tests/xrm/outer-static-for-step.xpm (working copy) @@ -1,10 +1,7 @@ probabilistic for i from 0 to 42 step 2 do - // FIXME: the following line shall be: - //module dummy[i] - // but this is not supported ATM - module dummy + module dummy[i] x : [0..1]; [] x=0 -> x'=1; endmodule Index: tests/xrm/static-if.xpm --- tests/xrm/static-if.xpm (revision 25) +++ tests/xrm/static-if.xpm (working copy) @@ -1,11 +1,8 @@ probabilistic for i from 0 to 42 do - // FIXME: the following line shall be: - //module dummy[i] - // but this is not supported ATM if i<1 & i>41 then - module dummy + module dummy[i] for i from 0 to 42 do // FIXME: x here shall be replaced with x[i] // but this is not supported ATM @@ -18,7 +15,7 @@ end endmodule else - module dummyelse + module dummyelse[i] y : [0..1]; [] y=0 -> y'=1; endmodule Index: tests/xrm/static-for-step.xpm --- tests/xrm/static-for-step.xpm (revision 25) +++ tests/xrm/static-for-step.xpm (working copy) @@ -1,10 +1,7 @@ probabilistic for i from 0 to 42 step 2 do - // FIXME: the following line shall be: - //module dummy[i] - // but this is not supported ATM - module dummy + module dummy[i] for i from 0 to 42 step 2 do // FIXME: x here shall be replaced with x[i] // but this is not supported ATM Index: tests/xrm/outer-static-for.xpm --- tests/xrm/outer-static-for.xpm (revision 25) +++ tests/xrm/outer-static-for.xpm (working copy) @@ -1,10 +1,7 @@ probabilistic for i from 0 to 42 do - // FIXME: the following line shall be: - //module dummy[i] - // but this is not supported ATM - module dummy + module dummy[i] x : [0..1]; [] x=0 -> x'=1; endmodule Index: tests/xrm/static-for.xpm --- tests/xrm/static-for.xpm (revision 25) +++ tests/xrm/static-for.xpm (working copy) @@ -1,10 +1,7 @@ probabilistic for i from 0 to 42 do - // FIXME: the following line shall be: - //module dummy[i] - // but this is not supported ATM - module dummy + module dummy[i] for i from 0 to 42 do // FIXME: x here shall be replaced with x[i] // but this is not supported ATM Index: tests/test-xrm-front.sh.in --- tests/test-xrm-front.sh.in (revision 25) +++ tests/test-xrm-front.sh.in (working copy) @@ -27,17 +27,9 @@ echo ">>> Starting the test for $basefile" test_cnt=$((test_cnt + 1)) - echo @ECHO_N@ " Parsing $basefile ... " - "@top_builddir@/src/tools/parse-xrm" -i "$file" -o "$outdir/$bfile.xpm.aterm" - if [ $? -ne 0 ]; then - echo 'FAILED, continuing with the next test...' - continue - fi - echo 'OK, no ambiguities found' - echo @ECHO_N@ " Converting $basefile into standard PRISM AST ... " "@top_builddir@/src/str/xrm-front" \ - -i "$outdir/$bfile.xpm.aterm" -o "$outdir/$bfile.pm.aterm" + -i "$file" -o "$outdir/$bfile.pm.aterm" if [ $? -ne 0 ]; then echo 'FAILED, continuing with the next test...' continue @@ -46,7 +38,7 @@ echo @ECHO_N@ " Converting $basefile into standard PRISM code ... " "@top_builddir@/src/str/xrm-front" -P \ - -i "$outdir/$bfile.xpm.aterm" -o "$outdir/$bfile.pm" + -i "$file" -o "$outdir/$bfile.pm" if [ $? -ne 0 ]; then echo 'FAILED, continuing with the next test...' continue