Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automated migration from XML-based XBGF to Rascal-based
- Loading branch information
1 parent
17f20b5
commit 994e208
Showing
2 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@contributor{Vadim Zaytsev - vadim@grammarware.net - SWAT, CWI} | ||
module metarascal::XBGF2Rascal | ||
|
||
import String; | ||
import IO; | ||
import io::ReadBGF; | ||
import io::ReadXBGF; | ||
import export::XBNF; | ||
|
||
public void main(list[str] args) = main(|cwd:///|+args[0]); | ||
|
||
public void main(loc x) | ||
{ | ||
xbgf = readXBGF(x); | ||
writeFile(//|cwd:///Transformation.rsc|, | ||
|project://slps/src/metarascal/Transformation.rsc|, | ||
"@contributor{XBGF2Rascal} | ||
'module Transformation // feel free to change that after moving the file | ||
' | ||
'import syntax::BGF; | ||
'import syntax::XBGF; | ||
'import transform::XBGF; | ||
'import diff::GDT; | ||
' | ||
'BGFGrammar doTrafo(XBGFSequence x, BGFGrammar g) | ||
' = transform([<for(step <- xbgf){> | ||
' // <ppx(step)> | ||
' <step>,<}> | ||
' bypass() | ||
' ],g); | ||
'"); | ||
} | ||
|
||
public void tst() = main(|home:///projects/slps/topics/island/csharp-ecma-334-1/adapt.using.xbgf|); |