Commit a1edea6c authored by david_v's avatar david_v
Browse files

2003-06-20 Valentin David <valentin@lrde.epita.fr>

	* src/pack-boxedsdf/pack-boxedsdf.str,
	* src/pack-boxedsdf/sglr.str:
	Add the --syntax option.

	* src/boxed2sdf/boxed2sdf.str:
	Fix a little bug.
parent be1d50e3
2003-06-20 Valentin David <valentin@lrde.epita.fr>
* src/pack-boxedsdf/pack-boxedsdf.str,
* src/pack-boxedsdf/sglr.str:
Add the --syntax option.
* src/boxed2sdf/boxed2sdf.str:
Fix a little bug.
2003-06-18 Clement Vasseur <vasseu_c@lrde.epita.fr>
* Makefile.am, test/Makefile.am, src/pack-boxedsdf/Makefile.am,
......
......@@ -26,19 +26,13 @@ imports lib BoxedSdf2
strategies
/**
* Take an attribute list as input and return this list without the
* pp attributes
*/
skip-boxedattr = rec x([] <+ (?[BoxedAttr(_)|ys]; !ys; x) <+ [id|x])
/**
* Main strategy. Skip all the pp attributes in the AST.
*/
boxed2sdf = iowrap(
topdown(
try(attrs(skip-boxedattr)
; try(\ attrs([]) -> no-attrs \)
try(attrs(filter(not(BoxedAttr(id))))
; try(attrs([]); !no-attrs)
)
)
)
......@@ -38,6 +38,14 @@ imports lib Sdf2-Syntax
strategies
pack-options = syntax-option
syntax-option =
ArgOption("-s" + "--syntax"
, where(<set-config> ("-s", <id>))
, !"-s g|--syntax g Use syntax g, default BoxedSdf2"
)
// Parsing SDF files and chasing imports
pack-boxedsdf =
......
//
// This file is a modified version of the sglr.str frm the SDF Tools in the
// This file is a modified version of the sglr.str from the SDF Tools in the
// StrategoXT package.
//
......@@ -26,16 +26,25 @@
module sglr
imports exec asfix verbose xtc-lib
strategies
get-syntax = (<get-config> "-s" <+ !"BoxedSdf2")
; if-verbose2(debug(!"Using grammar: "))
; !(<id>, ".tbl")
; conc-strings
; (<find-in-path> (<id>, <get-config> "-I") <+ xtc-find)
; if-verbose6(debug(!"Using grammar table: "))
rules
parse-boxedsdf :
(infile, outfile) -> outfile
where <sglr>(<xtc-find>"BoxedSdf2.tbl", infile, outfile) => outfile
where <sglr>(<get-syntax>, infile, outfile) => outfile
parse-boxedsdf :
infile -> tree
where <is-string> infile
; <sglr>(<xtc-find>"BoxedSdf2.tbl", infile) => tree
; <sglr>(<get-syntax>, infile) => tree
sglr :
(tbl, infile, outfile) -> outfile
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment