Commit cd5d97bc authored by david_v's avatar david_v
Browse files

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

	* src/import-cxx-cons/Makefile.am,
	* src/import-cxx-cons/import-cxx-cons.str: New files.

	* src/deterministic/Dxx.sdf:
	Deleted file.

	* src/deterministic/Dxx-main.sdf,
	* src/deterministic/Dxx-nocons.sdf: New files.

	* src/deterministic/Makefile.am:
	Now generate Dxx.sdf with import-cxx-cons tool and Dxx-nocons.sdf.
	The constructors in Dxx are now the same as Cxx.

	* src/cxxsdf/Makefile.am:
	New file. This directory is reseved for Cxx grammar files after
	using sdf-option and sdf-cons.

	* src/dxx-to-cxx/Makefile.am,
	* src/dxx-to-cxx/dxx-to-cxx.str,
	* src/cxx-to-dxx/Makefile.am,
	* src/cxx-to-dxx/cxx-to-dxx.str: Deleted files.

	* configure.ac,
	* src/Makefile.am: Some directories added or deleted

	* src/signature/Makefile.am,
	* src/pp/Makefile.am,
	* src/sdf/Makefile.am,
	* src/strategocxx/Makefile.am:
	Use Dxx.
parent f292afdc
2003-06-17 Valentin David <valentin@lrde.epita.fr>
* src/import-cxx-cons/Makefile.am,
* src/import-cxx-cons/import-cxx-cons.str: New files.
* src/deterministic/Dxx.sdf:
Deleted file.
* src/deterministic/Dxx-main.sdf,
* src/deterministic/Dxx-nocons.sdf: New files.
* src/deterministic/Makefile.am:
Now generate Dxx.sdf with import-cxx-cons tool and Dxx-nocons.sdf.
The constructors in Dxx are now the same as Cxx.
* src/cxxsdf/Makefile.am:
New file. This directory is reseved for Cxx grammar files after
using sdf-option and sdf-cons.
* src/dxx-to-cxx/Makefile.am,
* src/dxx-to-cxx/dxx-to-cxx.str,
* src/cxx-to-dxx/Makefile.am,
* src/cxx-to-dxx/cxx-to-dxx.str: Deleted files.
* configure.ac,
* src/Makefile.am: Some directories added or deleted
* src/signature/Makefile.am,
* src/pp/Makefile.am,
* src/sdf/Makefile.am,
* src/strategocxx/Makefile.am:
Use Dxx.
2003-06-13 Valentin David <valentin@lrde.epita.fr>
* config/sdf-check.in: Use Cxx.tbl.
......
......@@ -52,12 +52,12 @@ AC_SUBST(COMPILER_SYNTAX_CHECK)
# Output Files
AC_CONFIG_FILES([Makefile
src/Makefile
src/import-cxx-cons/Makefile
src/grammar/Makefile
src/cxxsdf/Makefile
src/deterministic/Makefile
src/attribute/Makefile
src/signature/Makefile
src/dxx-to-cxx/Makefile
src/cxx-to-dxx/Makefile
src/pp/Makefile
src/sdf/Makefile
src/strategocxx/Makefile
......
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 2)
(Project-Description "Meta/SDF Grammar for C++")
(Project-Version meta-c++-grammar 0 112)
(Parent-Version meta-c++-grammar 0 111)
(Version-Log "2003-06-13 Valentin David <valentin@lrde.epita.fr>
(Project-Version meta-c++-grammar 0 113)
(Parent-Version meta-c++-grammar 0 112)
(Version-Log "2003-06-17 Valentin David <valentin@lrde.epita.fr>
* config/sdf-check.in: Use Cxx.tbl.
* src/import-cxx-cons/Makefile.am,
* src/import-cxx-cons/import-cxx-cons.str: New files.
* */Makefile.am, bootstrap: autoxt in config
* src/deterministic/Dxx.sdf:
Deleted file.
* configure.ac: Now --with-sdf-option and --with-boxedsdf.
* src/deterministic/Dxx-main.sdf,
* src/deterministic/Dxx-nocons.sdf: New files.
* src/pp/pp-cxx.str: Use the generated grammar.
* src/pp/Options.pp: New file.
* src/pp/Cxx-pretty.pp: Deleted file.
* src/pp/pp-dxx.str: New file.
* src/deterministic/Makefile.am:
Now generate Dxx.sdf with import-cxx-cons tool and Dxx-nocons.sdf.
The constructors in Dxx are now the same as Cxx.
* src/grammar/*.sdf: Pretty-print attributes added !
* src/grammar/Makefile.am,
* src/deterministic/Makefile.am: Use BoxedSdf.
* src/cxxsdf/Makefile.am:
New file. This directory is reseved for Cxx grammar files after
using sdf-option and sdf-cons.
* src/dxx-to-cxx/Makefile.am,
* src/dxx-to-cxx/dxx-to-cxx.str,
* src/cxx-to-dxx/Makefile.am,
* src/cxx-to-dxx/cxx-to-dxx.str: Deleted files.
* configure.ac,
* src/Makefile.am: Some directories added or deleted
* src/signature/Makefile.am,
* src/pp/Makefile.am,
* src/sdf/Makefile.am,
* src/strategocxx/Makefile.am:
Use Dxx.
")
(New-Version-Log "")
(Checkin-Time "Fri, 13 Jun 2003 21:26:58 +0200")
(Checkin-Time "Tue, 17 Jun 2003 17:38:59 +0200")
(Checkin-Login david_v)
(Populate-Ignore
(
......@@ -93,17 +109,17 @@
)
(Project-Keywords)
(Files
(ChangeLog (meta-c++-grammar/0_ChangeLog 1.108 600))
(ChangeLog (meta-c++-grammar/0_ChangeLog 1.109 600))
(Makefile.am (meta-c++-grammar/f/34_Makefile.a 1.9 644))
(README (meta-c++-grammar/g/37_README 1.3 600))
(config/Makefile.am (meta-c++-grammar/f/40_Makefile.a 1.3 644))
(config/ccview.sh (meta-c++-grammar/f/36_ccview.sh 1.1 700))
(config/disambiguate-check.in (meta-c++-grammar/f/38_disambigua 1.6 600))
(config/sdf-check.in (meta-c++-grammar/f/37_sdf-check. 1.6 600))
(configure.ac (meta-c++-grammar/f/44_configure. 1.21 600))
(configure.ac (meta-c++-grammar/f/44_configure. 1.22 600))
(src/grammar/Layout.sdf (meta-c++-grammar/4_Layout.sdf 1.3 644))
(prj (meta-c++-grammar.prj) :symlink)
(src/Makefile.am (meta-c++-grammar/f/46_Makefile.a 1.14 644))
(src/Makefile.am (meta-c++-grammar/f/46_Makefile.a 1.15 644))
(src/attribute/Makefile.am (meta-c++-grammar/g/31_Makefile.a 1.6 644))
(src/attribute/asfix-attribute.str (meta-c++-grammar/g/32_Main.r 1.3 600))
(src/grammar/AccessSpecifiers.sdf (meta-c++-grammar/5_AccessSpec 1.4 644))
......@@ -186,8 +202,8 @@
(src/grammar/UsingDeclarations.sdf (meta-c++-grammar/b/28_UsingDecla 1.5 644))
(src/grammar/UsingDirectives.sdf (meta-c++-grammar/b/29_UsingDirec 1.6 644))
(src/deterministic/Dxx.sdf (meta-c++-grammar/g/38_Cpp-det.sd 1.9 600))
(src/deterministic/Makefile.am (meta-c++-grammar/g/39_Makefile.a 1.7 644))
(src/deterministic/Makefile.am (meta-c++-grammar/g/39_Makefile.a 1.8 644))
(test/Makefile.am (meta-c++-grammar/f/45_Makefile.a 1.4 644))
(test/g++/abi/bitfield1.C (meta-c++-grammar/b/30_bitfield1. 1.1 600))
......@@ -414,20 +430,20 @@
(test/our/expressions/primary-lit-integer-17-fail.cc (meta-c++-grammar/e/44_primary-li 1.1 600))
(test/our/expressions/primary-par.cc (meta-c++-grammar/e/45_primary-pa 1.1 600))
(test/our/expressions/primary-this.cc (meta-c++-grammar/e/46_primary-th 1.1 600))
(src/signature/Makefile.am (meta-c++-grammar/g/33_Makefile.a 1.8 644))
(src/dxx-to-cxx/Makefile.am (meta-c++-grammar/g/40_Makefile.a 1.7 644))
(src/dxx-to-cxx/dxx-to-cxx.str (meta-c++-grammar/g/41_Main.r 1.6 600))
(src/cxx-to-dxx/Makefile.am (meta-c++-grammar/g/42_Makefile.a 1.7 644))
(src/cxx-to-dxx/cxx-to-dxx.str (meta-c++-grammar/g/43_Main.r 1.6 600))
(src/signature/Makefile.am (meta-c++-grammar/g/33_Makefile.a 1.9 644))
(bootstrap (meta-c++-grammar/g/45_bootstrap 1.3 700))
(src/pp/unbox.str (meta-c++-grammar/g/46_unbox.str 1.1 600))
(src/pp/pp-cxx.str (meta-c++-grammar/g/47_pp-cpp.str 1.4 600))
(src/pp/Makefile.am (meta-c++-grammar/g/48_Makefile.a 1.6 644))
(src/pp/Makefile.am (meta-c++-grammar/g/48_Makefile.a 1.7 644))
(src/sdf/Makefile.am (meta-c++-grammar/g/50_Makefile.a 1.2 644))
(src/sdf/Makefile.am (meta-c++-grammar/g/50_Makefile.a 1.3 644))
(src/strategocxx/CxxVariables.sdf (meta-c++-grammar/g/51_CxxVariabl 1.2 644))
(src/strategocxx/StrategoCxx.sdf (meta-c++-grammar/h/0_StrategoCx 1.2 644))
(src/strategocxx/Makefile.am (meta-c++-grammar/h/1_Makefile.a 1.3 644))
(src/strategocxx/Makefile.am (meta-c++-grammar/h/1_Makefile.a 1.4 644))
;; Files deleted by depopulate at Fri, 13 Jun 2003 17:35:12 +0200,
;; from version 0.111(w), by david_v:
......@@ -443,6 +459,36 @@
;; to version 0.111(w), by david_v:
(src/pp/pp-dxx.str (meta-c++-grammar/h/3_pp-dxx.str 1.1 600))
;; Files added by populate at Tue, 17 Jun 2003 17:24:41 +0200,
;; to version 0.112(w), by david_v:
(src/cxxsdf/Makefile.am (meta-c++-grammar/h/4_Makefile.a 1.1 644))
;; Files added by populate at Tue, 17 Jun 2003 17:25:22 +0200,
;; to version 0.112(w), by david_v:
(src/deterministic/Dxx-main.sdf (meta-c++-grammar/h/5_Dxx-main.s 1.1 600))
(src/import-cxx-cons/Makefile.am (meta-c++-grammar/h/6_Makefile.a 1.1 644))
(src/import-cxx-cons/import-cxx-cons.str (meta-c++-grammar/h/7_import-cxx 1.1 644))
;; Files deleted by depopulate at Tue, 17 Jun 2003 17:25:39 +0200,
;; from version 0.112(w), by david_v:
; (src/deterministic/Dxx.sdf ())
;; Files deleted by depopulate at Tue, 17 Jun 2003 17:26:18 +0200,
;; from version 0.112(w), by david_v:
; (src/dxx-to-cxx/Makefile.am ())
; (src/dxx-to-cxx/dxx-to-cxx.str ())
; (src/cxx-to-dxx/Makefile.am ())
; (src/cxx-to-dxx/cxx-to-dxx.str ())
;; Files added by populate at Tue, 17 Jun 2003 17:28:17 +0200,
;; to version 0.112(w), by david_v:
(src/deterministic/Dxx-nocons.sdf (meta-c++-grammar/h/8_Dxx-nocons 1.1 600))
)
(Merge-Parents)
(New-Merge-Parents)
include $(top_srcdir)/config/Makefile.xt
SUBDIRS = grammar deterministic signature attribute dxx-to-cxx cxx-to-dxx \
SUBDIRS = import-cxx-cons \
grammar cxxsdf \
deterministic signature attribute \
pp sdf strategocxx
BOOTCLEAN_SUBDIRS = $(SUBDIRS)
include $(top_srcdir)/config/Makefile.xt
-include cxx-to-dxx.c.dep
SCFLAGS = --main $* --verbose 0
STRINCLUDES = -I $(top_srcdir)/src/signature
bin_PROGRAMS = cxx-to-dxx
BOOTCLEANFILES = cxx-to-dxx.c
EXTRA_DIST = cxx-to-dxx.str
CLEANFILES = cxx-to-dxx.c.dep
module cxx-to-dxx
imports
lib
imports
Dxx
rules
//
// All the following rules have the same purpose. They transform
// chunks of bare C++ into annotated C++ (in short, it simply
// add the annotations of deterministic C++ programs).
//
Expr-Prim-0 : Identifier3 (x) -> Identifier10 (x)
Expr-Prim-1 : TemplateId (x) -> TemplateId3 (x)
Expr-Prim-2 : Identifier4 (x) -> Identifier11 (x)
Expr-Prim-3 : TemplateId1 (x) -> TemplateId4 (x)
Dcl-Spec-0 : DeclSpecifier-p (x) -> DeclSpecifier-p1 (x)
Dcl-Enum-0 : Identifier6 (x) -> Identifier12 (x)
Dcl-Enum-1 : Identifier7 (x) -> Identifier13 (x)
Namespace-Def-0 : Identifier (x) -> Identifier14 (x)
Namespace-Def-1 : Identifier1 (x) -> Identifier15 (x)
Namespace-Def-2 : namespace (x, y) -> namespace4 (x, y)
Class-0 : Identifier9 (x) -> Identifier16 (x)
Class-1 : TemplateId2 (x) -> TemplateId5 (x)
Gram-Key-0 : Identifier5 (x) -> Identifier17 (x)
Expr-0 : x@AssignmentExpression-p1 (_) -> Expression3 (x)
strategies
expr-prim = Expr-Prim-0 + Expr-Prim-1 + Expr-Prim-2 + Expr-Prim-3
dcl-spec = Dcl-Spec-0
dcl-enum = Dcl-Enum-0 + Dcl-Enum-1
namespace-def = Namespace-Def-0 + Namespace-Def-1
class = Class-0 + Class-1
gram-key = Gram-Key-0
expr = Expr-0
strategies
Cxx-to-dxx = expr-prim + dcl-spec + dcl-enum + namespace-def + class +
gram-key + expr
cxx-to-dxx = iowrap (topdown (try (Cxx-to-dxx)))
include $(top_srcdir)/config/Makefile.xt
PGEN_FLAGS = -m $*
sdfdata_DATA = Cxx.ppdef
noinst_DATA = $(SDFS)
$(SDFS): $(top_builddir)/src/grammar/Cxx.ppdef
unpack-sdf $(top_builddir)/src/grammar/Cxx.ppdef
Cxx.ppdef: $(top_builddir)/src/grammar/Cxx.ppdef
cp $(top_builddir)/src/grammar/Cxx.ppdef .
SDFS = \
AccessSpecifiers.sdf \
AdditiveExpressions.sdf \
AndExpressions.sdf \
AsmDefinitions.sdf \
AssignmentExpressions.sdf \
BaseSpecifiers.sdf \
BooleanLiterals.sdf \
CastExpressions.sdf \
CharacterLiterals.sdf \
Characters.sdf \
ClassSpecifiers.sdf \
CompoundStatements.sdf \
ConditionalExpressions.sdf \
ConstantExpressions.sdf \
ConversionFunctionIds.sdf \
Cxx.sdf \
CtorInitializers.sdf \
CvQualifiers.sdf \
DeclarationStatements.sdf \
Declarations.sdf \
Declarators.sdf \
DeleteExpressions.sdf \
ElaboratedTypeSpecifiers.sdf \
EnumSpecifiers.sdf \
EqualityExpressions.sdf \
EscapeSequences.sdf \
ExceptionSpecifications.sdf \
ExclusiveOrExpressions.sdf \
ExplicitInstantiations.sdf \
ExplicitSpecializations.sdf \
ExpressionStatements.sdf \
Expressions.sdf \
FloatingLiterals.sdf \
FunctionDefinitions.sdf \
FunctionSpecifiers.sdf \
IdExpressions.sdf \
Identifiers.sdf \
InclusiveOrExpressions.sdf \
InitDeclarators.sdf \
Initializers.sdf \
IntegerLiterals.sdf \
IterationStatements.sdf \
JumpStatements.sdf \
Keywords.sdf \
LabeledStatements.sdf \
LinkageSpecifications.sdf \
Literals.sdf \
LogicalAndExpressions.sdf \
LogicalOrExpressions.sdf \
MemberSpecifications.sdf \
MultiplicativeExpressions.sdf \
NamespaceAliases.sdf \
Namespaces.sdf \
NewExpressions.sdf \
OperatorFunctionIds.sdf \
ParameterDeclarations.sdf \
PmExpressions.sdf \
PostfixExpressions.sdf \
PrimaryExpressions.sdf \
RelationalExpressions.sdf \
SelectionStatements.sdf \
ShiftExpressions.sdf \
SimpleTypeSpecifiers.sdf \
Specifiers.sdf \
Statements.sdf \
StorageClassSpecifiers.sdf \
StringLiterals.sdf \
TemplateDeclarations.sdf \
TemplateIds.sdf \
TemplateParameters.sdf \
ThrowExpressions.sdf \
TranslationUnits.sdf \
TryBlocks.sdf \
TypeIds.sdf \
TypeSpecifiers.sdf \
UnaryExpressions.sdf \
UsingDeclarations.sdf \
UsingDirectives.sdf \
Dummy.sdf \
Layout.sdf
CLEANFILES = Cxx.ppdef $(SDFS)
......@@ -41,36 +41,36 @@ exports
%% 5.1 [expr.prim]
%% Ambiguous rules in: grammar/IdExpressions.sdf
"/*[uid]*/" Identifier "/*[!uid]*/" -> UnqualifiedId { prefer }
"/*[uid]*/" TemplateId "/*[!uid]*/" -> UnqualifiedId { prefer }
"/*[qid]*/" "::" Identifier "/*[!qid]*/" -> QualifiedId { prefer }
"/*[qid]*/" "::" TemplateId "/*[!qid]*/" -> QualifiedId { prefer }
"/*[nns]*/" NestedNameSpecifier "/*[!nns]*/" -> NestedNameSpecifier { prefer }
"/*[uid]*/" Identifier "/*[!uid]*/" -> UnqualifiedId { prefer, pp(H hs=0[KW["/*[uid]*/"] _1 KW["/*[!uid]*/"]]) }
"/*[uid]*/" TemplateId "/*[!uid]*/" -> UnqualifiedId { prefer, pp(H hs=0[KW["/*[uid]*/"] _1 KW["/*[!uid]*/"]]) }
"/*[qid]*/" "::" Identifier "/*[!qid]*/" -> QualifiedId { prefer, pp(H hs=0[KW["/*[qid]*/::"] _1 KW["/*[!qid]*/"]]) }
"/*[qid]*/" "::" TemplateId "/*[!qid]*/" -> QualifiedId { prefer, pp(H hs=0[KW["/*[qid]*/::"] _1 KW["/*[!qid]*/"]]) }
"/*[nns]*/" NestedNameSpecifier "/*[!nns]*/" -> NestedNameSpecifier { prefer, pp(H hs=0[KW["/*[nns]*/"] _1 KW["/*[!nns]*/"]]) }
%% 5.18 [expr.comma]
%% Ambiguous rules in: grammar/Expressions.sdf
"/*[expr]*/" Expression "/*[!expr]*/" -> Expression { prefer }
"/*[expr]*/" Expression "/*[!expr]*/" -> Expression { prefer, pp(H hs=0[KW["/*[expr]*/"] _1 KW["/*[!expr]*/"]]) }
%% 7.1 [dcl.spec]
%% Ambiguous rules in: grammar/Specifiers.sdf
"/*[dss]*/" DeclSpecifier+ "/*[!dss]*/" -> DeclSpecifierSeq { prefer }
"/*[dss]*/" DeclSpecifier+ "/*[!dss]*/" -> DeclSpecifierSeq { prefer, pp(H hs=0[KW["/*[dss]*/"] _1 KW["/*[!dss]*/"]]) }
%% 7.2 [dcl.enum]
%% Ambiguous rules in: grammar/EnumSpecifiers.sdf
"/*[en]*/" Identifier "/*[!en]*/" -> EnumName { prefer }
"/*[etor]*/" Identifier "/*[!etor]*/" -> Enumerator { prefer }
"/*[en]*/" Identifier "/*[!en]*/" -> EnumName { prefer, pp(H hs=0[KW["/*[en]*/"] _1 KW["/*[!en]*/"]]) }
"/*[etor]*/" Identifier "/*[!etor]*/" -> Enumerator { prefer, pp(H hs=0[KW["/*[etor]*/"] _1 KW["/*[!etor]*/"]]) }
%% 7.3.1 [namespace.def]
%% Ambiguous rules in: grammar/Namespaces.sdf
"/*[ns]*/" Identifier "/*[!ns]*/" -> OriginalNamespaceName { prefer }
"/*[al]*/" Identifier "/*[!al]*/" -> NamespaceAlias { prefer }
"namespace" "/*[org]*/" Identifier "/*[!org]*/" "{" NamespaceBody "}" -> OriginalNamespaceDefinition { prefer }
"/*[ns]*/" Identifier "/*[!ns]*/" -> OriginalNamespaceName { prefer, pp(H hs=0[KW["/*[ns]*/"] _1 KW["/*[!ns]*/"]]) }
"/*[al]*/" Identifier "/*[!al]*/" -> NamespaceAlias { prefer, pp(H hs=0[KW["/*[al]*/"] _1 KW["/*[!al]*/"]]) }
"namespace" "/*[org]*/" Identifier "/*[!org]*/" "{" NamespaceBody "}" -> OriginalNamespaceDefinition { prefer, pp(H hs=0[KW["/*[org]*/"] _1 KW["/*[!org]*/"]]) }
%% 9 [class]
%% Ambiguous rules in: grammar/ClassSpecifiers.sdf
"/*[cl]*/" Identifier "/*[!cl]*/" -> ClassName { prefer }
"/*[cl]*/" TemplateId "/*[!cl]*/" -> ClassName { prefer }
"/*[cl]*/" Identifier "/*[!cl]*/" -> ClassName { prefer, pp(H hs=0[KW["/*[cl]*/"] _1 KW["/*[!cl]*/"]]) }
"/*[cl]*/" TemplateId "/*[!cl]*/" -> ClassName { prefer, pp(H hs=0[KW["/*[cl]*/"] _1 KW["/*[!cl]*/"]]) }
%% A.1 [gram.key]
%% Ambiguous rules in: grammar/SimpleTypeSpecifiers.sdf
"/*[tn]*/" Identifier "/*[!tn]*/" -> TypedefName { prefer }
"/*[tn]*/" Identifier "/*[!tn]*/" -> TypedefName { prefer, pp(H hs=0[KW["/*[tn]*/"] _1 KW["/*[!tn]*/"]]) }
......@@ -4,11 +4,20 @@ PGEN_FLAGS = -m $*
pkgdata_DATA = Dxx.def Dxx.tbl Dxx.pp.af
EXTRA_DIST = $(SDFS)
EXTRA_DIST = \
Dxx-nocons.sdf \
Dxx-main.sdf
SDFS = \
Dxx.sdf
Dxx.sdf: Dxx-nocons.sdf
$(BOXEDSDF)/bin/parse-boxedsdf -i $< | \
env XTC_REPOSITORY=$(BOXEDSDF)/share/boxedsdf/XTC \
$(top_builddir)/src/import-cxx-cons/import-cxx-cons \
-c $(top_builddir)/src/grammar/Cxx.ppdef | \
$(BOXEDSDF)/bin/pp-boxedsdf -o $@
Dxx.def: Dxx.ppdef
$(BOXEDSDF)/bin/parse-boxedsdf -i $< | \
$(BOXEDSDF)/bin/boxed2sdf | \
......@@ -22,12 +31,9 @@ Dxx.pp: Dxx.ppdef
Dxx.ppdef: $(SDFS)
$(BOXEDSDF)/bin/pack-boxedsdf \
-I $(top_srcdir)/lib \
-I $(top_srcdir)/src/grammar \
-i $(top_srcdir)/src/deterministic/Dxx.sdf \
| $(ASFIX_TOOLS)/bin/implode-asfix \
| $(SDF_OPTION)/bin/sdf-option \
| $(SDF_TOOLS)/bin/sdf-cons \
| $(SDF_TOOLS)/bin/sdf-bracket \
| $(BOXEDSDF)/bin/pp-boxedsdf -o $@
CLEANFILES = Dxx.def Dxx.tbl Dxx.pp Dxx.pp.af Dxx.ppdef
-I $(top_builddir)/src/cxxsdf \
-I $(top_builddir)/src/deterministic \
-i $(top_srcdir)/src/deterministic/Dxx-main.sdf \
| $(ASFIX_TOOLS)/bin/asfix-yield -o $@
CLEANFILES = Dxx.def Dxx.tbl Dxx.pp Dxx.pp.af Dxx.ppdef Dxx.sdf
include $(top_srcdir)/config/Makefile.xt
-include dxx-to-cxx.c.dep
SCFLAGS = --main $* --verbose 0
STRINCLUDES = -I $(top_srcdir)/src/signature
bin_PROGRAMS = dxx-to-cxx
BOOTCLEANFILES = dxx-to-cxx.c
EXTRA_DIST = dxx-to-cxx.str
CLEANFILES = dxx-to-cxx.c.dep
dxx-to-cxx.c: dxx-to-cxx.str $(top_srcdir)/src/signature/Dxx.str
module dxx-to-cxx
imports
lib
imports
Dxx
rules
//
// All the following rules have the same purpose. They transform
// chunks of annotated C++ into usual C++ (in short, it simply
// strips the annotations of deterministic C++ programs).
//
Expr-Prim-0 : Identifier10 (x) -> Identifier3 (x)
Expr-Prim-1 : TemplateId3 (x) -> TemplateId (x)
Expr-Prim-2 : Identifier11 (x) -> Identifier4 (x)
Expr-Prim-3 : TemplateId4 (x) -> TemplateId1 (x)
Expr-Prim-4 : NestedNameSpecifier (x) -> x
Dcl-Spec-0 : DeclSpecifier-p1 (x) -> DeclSpecifier-p (x)
Dcl-Enum-0 : Identifier12 (x) -> Identifier6 (x)
Dcl-Enum-1 : Identifier13 (x) -> Identifier7 (x)
Namespace-Def-0 : Identifier14 (x) -> Identifier (x)
Namespace-Def-1 : Identifier15 (x) -> Identifier1 (x)
Namespace-Def-2 : namespace4 (x, y) -> namespace (x, y)
Class-0 : Identifier16 (x) -> Identifier9 (x)
Class-1 : TemplateId5 (x) -> TemplateId2 (x)
Gram-Key-0 : Identifier17 (x) -> Identifier5 (x)
Expr-0 : Expression3 (x) -> x
strategies
expr-prim = Expr-Prim-0 + Expr-Prim-1 + Expr-Prim-2 + Expr-Prim-3 + Expr-Prim-4
dcl-spec = Dcl-Spec-0
dcl-enum = Dcl-Enum-0 + Dcl-Enum-1
namespace-def = Namespace-Def-0 + Namespace-Def-1 + Namespace-Def-2
class = Class-0 + Class-1
gram-key = Gram-Key-0
expr = Expr-0
strategies
Dxx-to-cxx = expr-prim + dcl-spec + dcl-enum + namespace-def + class +
gram-key + expr
dxx-to-cxx = iowrap (topdown (try (Dxx-to-cxx)))
include $(top_srcdir)/config/Makefile.xt
-include import-cxx-cons.c.dep
noinst_PROGRAMS = import-cxx-cons
SCFLAGS = --main $*
STRINCLUDES = -I $(BOXEDSDF)/share/boxedsdf \
-I $(XTC)/share/xtc
CLEANFILES = import-cxx-cons import-cxx-cons.c.dep
BOOTCLEANFILES = import-cxx-cons.c
/**
* Cxx Grammar
* Copyright (C) 2003 LRDE
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* import-cxx-cons
*
* Put constructors on Dxx grammar so as to be the same as Cxx ones.
*
* Author: Valentin David <valentin@lrde.epita.fr>
*/
module import-cxx-cons
imports BoxedSdf2 lib xtc-lib stratego-xt-xtc-tools
signature
constructors
CxxGrammar : String -> Option
rules
/**
* :: String -> Term
*
* Parse the Cxx grammar file
*/
readtxtpp : infile -> tree
where xtc-temp-files(<xtc-transform(!"sglr",
!["-2", "-p", <xtc-find>"BoxedSdf2.tbl"])> FILE(infile)
; xtc-implode-asfix
; read-from => tree)
strategies
/**
* -c/--cxx grammar
* to specify the pp table
*/
cxx-option =
ArgOption("-c" + "--cxx"
, where(<set-config> ("-c",<id>)); !CxxGrammar(<id>)
, !"-c f|--cxx f Read cxx grammar from f"
)
/**
* iowrap with the new option.
*/
my-iowrap(s) =
iowrap(
(
(option-defined(?CxxGrammar(cxx)), id)
; (id, \ i -> (i,<readtxtpp> cxx) \)
<+ !"bad -c option, try --help."; debug; giving-up)
; (id, s)
, cxx-option)
rules
EmmitProd : p@prod(a,b,c) -> p