Commit 4f3ef5f2 authored by anisko_r's avatar anisko_r
Browse files

2002-12-03 Robert Anisko <robert@lrde.epita.fr>

	* configure.ac: Update.
	* src/Makefile.am (SUBDIRS): Update.
	* test/Makefile.am: Remove disambiguation tests.
	* src/disambiguate: Remove directory.  This filter is obsolete.
parent 18d53785
2002-12-03 Robert Anisko <robert@lrde.epita.fr>
* configure.ac: Update.
* src/Makefile.am (SUBDIRS): Update.
* test/Makefile.am: Remove disambiguation tests.
* src/disambiguate: Remove directory. This filter is obsolete.
2002-10-16 Akim Demaille <akim@epita.fr>
* README: New.
......
......@@ -16,7 +16,6 @@ AC_INIT(cpp-grammar, 0.1)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_FILES(config/Makefile)
AC_CONFIG_FILES([config/sdf-check], [chmod +x config/sdf-check])
AC_CONFIG_FILES([config/disambiguate-check], [chmod +x config/disambiguate-check])
AM_INIT_AUTOMAKE([foreign 1.6 dist-bzip2])
......@@ -146,5 +145,5 @@ COMPILER_SYNTAX_CHECK="$CXX -ansi -pedantic -fsyntax-only"
AC_SUBST(COMPILER_SYNTAX_CHECK)
# Output Files
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile src/grammar/Makefile src/disambiguate/Makefile src/attribute/Makefile src/signature/Makefile test/Makefile])
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile src/grammar/Makefile src/attribute/Makefile src/signature/Makefile test/Makefile])
AC_OUTPUT
;; -*- Prcs -*-
(Created-By-Prcs-Version 1 3 2)
(Project-Description "Meta/SDF Grammar for C++")
(Project-Version meta-c++-grammar 0 85)
(Parent-Version meta-c++-grammar 0 84)
(Version-Log "Add README.")
(Project-Version meta-c++-grammar 0 86)
(Parent-Version meta-c++-grammar 0 85)
(Version-Log "2002-12-03 Robert Anisko <robert@lrde.epita.fr>
* configure.ac: Update.
* src/Makefile.am (SUBDIRS): Update.
* test/Makefile.am: Remove disambiguation tests.
* src/disambiguate: Remove directory. This filter is obsolete.")
(New-Version-Log "")
(Checkin-Time "Wed, 16 Oct 2002 15:49:45 +0200")
(Checkin-Login akim)
(Checkin-Time "Tue, 03 Dec 2002 18:10:59 +0100")
(Checkin-Login anisko_r)
(Populate-Ignore
(
;; Temporary files.
......@@ -77,7 +82,7 @@
)
(Project-Keywords)
(Files
(ChangeLog (meta-c++-grammar/0_ChangeLog 1.82 640))
(ChangeLog (meta-c++-grammar/0_ChangeLog 1.83 640))
(Makefile.am (meta-c++-grammar/f/34_Makefile.a 1.2 640))
(TODO (meta-c++-grammar/f/27_TODO 1.2 640))
(README (meta-c++-grammar/g/37_README 1.1 644))
......@@ -87,7 +92,7 @@
(config/disambiguate-check.in (meta-c++-grammar/f/38_disambigua 1.6 640))
(config/sdf-check.in (meta-c++-grammar/f/37_sdf-check. 1.3 640))
(config/xt-rules.mk (meta-c++-grammar/f/35_xt-rules.m 1.6 640))
(configure.ac (meta-c++-grammar/f/44_configure. 1.9 640))
(configure.ac (meta-c++-grammar/f/44_configure. 1.10 640))
(lib/Layout.sdf (meta-c++-grammar/4_Layout.sdf 1.2 640))
(lib/Makefile.am (meta-c++-grammar/f/49_Makefile.a 1.2 640))
......@@ -100,22 +105,10 @@
(prj (meta-c++-grammar.prj) :symlink)
(src/Makefile.am (meta-c++-grammar/f/46_Makefile.a 1.4 640))
(src/Makefile.am (meta-c++-grammar/f/46_Makefile.a 1.5 640))
(src/attribute/Makefile.am (meta-c++-grammar/g/31_Makefile.a 1.2 640))
(src/attribute/Main.r (meta-c++-grammar/g/32_Main.r 1.1 640))
(src/disambiguate/Ambiguity.r (meta-c++-grammar/f/6_Ambiguity. 1.1 640))
(src/disambiguate/Candidate.r (meta-c++-grammar/f/7_Candidate. 1.4 640))
(src/disambiguate/Check.r (meta-c++-grammar/f/8_Check.r 1.3 640))
(src/disambiguate/Declaration.r (meta-c++-grammar/f/9_Declaratio 1.1 640))
(src/disambiguate/Declare.r (meta-c++-grammar/f/10_Declare.r 1.6 640))
(src/disambiguate/Disambiguate.r (meta-c++-grammar/f/11_Disambigua 1.1 640))
(src/disambiguate/Identifier.r (meta-c++-grammar/f/12_Identifier 1.4 640))
(src/disambiguate/Kinds.r (meta-c++-grammar/f/13_Kinds.r 1.1 640))
(src/disambiguate/Main.r (meta-c++-grammar/f/14_Main.r 1.1 640))
(src/disambiguate/Makefile.am (meta-c++-grammar/f/48_Makefile.a 1.3 640))
(src/disambiguate/Typedef.r (meta-c++-grammar/f/15_Typedef.r 1.1 640))
(src/grammar/AccessSpecifiers.sdf (meta-c++-grammar/5_AccessSpec 1.4 640))
(src/grammar/AdditiveExpressions.sdf (meta-c++-grammar/6_AdditiveEx 1.6 640))
(src/grammar/AndExpressions.sdf (meta-c++-grammar/7_AndExpress 1.5 640))
......@@ -196,7 +189,7 @@
(src/grammar/UsingDeclarations.sdf (meta-c++-grammar/b/28_UsingDecla 1.4 640))
(src/grammar/UsingDirectives.sdf (meta-c++-grammar/b/29_UsingDirec 1.5 640))
(test/Makefile.am (meta-c++-grammar/f/45_Makefile.a 1.2 640))
(test/Makefile.am (meta-c++-grammar/f/45_Makefile.a 1.3 640))
(test/g++/abi/bitfield1.C (meta-c++-grammar/b/30_bitfield1. 1.1 640))
(test/g++/abi/bitfield2.C (meta-c++-grammar/b/31_bitfield2. 1.1 640))
(test/g++/abi/empty4.C (meta-c++-grammar/b/32_empty4.C 1.1 640))
......
SUBDIRS = grammar signature disambiguate attribute
SUBDIRS = grammar signature attribute
module Ambiguity
imports
AsFixTrees
rules
Ambiguity : x@amb (_) -> x
strategies
ambiguity = Ambiguity
module Candidate
imports
AsFixTrees
Ambiguity
rules
Candidate-Identifier : x@appl (prod (_, cf (sort ("PrimaryExpression")), _),
[appl (prod (_, cf (sort ("IdExpression")), _),
[appl (prod (_, cf (sort ("UnqualifiedId")), _),
[appl (prod (_, cf (sort ("Identifier")), _),
_)])])]) -> x
where < topdown (not (ambiguity)) > x
Candidate-Typedef-Name : x@appl (prod (_, cf (sort ("TypeName")), _),
[appl (prod (_, cf (sort ("TypedefName")), _),
_)]) -> x
where < topdown (not (ambiguity)) > x
Candidate-Class-Name : x@appl (prod (_, cf (sort ("TypeName")), _),
[appl (prod (_, cf (sort ("ClassName")), _),
_)]) -> x
where < topdown (not (ambiguity)) > x
Candidate-Enum-Name : x@appl (prod (_, cf (sort ("TypeName")), _),
[appl (prod (_, cf (sort ("EnumName")), _),
_)]) -> x
where < topdown (not (ambiguity)) > x
strategies
candidate = Candidate-Identifier <+ Candidate-Typedef-Name <+ Candidate-Class-Name <+ Candidate-Enum-Name
module Check
imports
scoped-finite-map
string
imports
AsFixTrees
Kinds
rules
Check-Identifier : name@appl (prod (_, cf (sort ("PrimaryExpression")), _),
[appl (prod (_, cf (sort ("IdExpression")), _),
[appl (prod (_, cf (sort ("UnqualifiedId")), _),
[appl (prod (_, cf (sort ("Identifier")), _),
[appl (prod (_, cf (sort ("ID")), _),
[appl (_,
string)])])])])]) -> name
where < implode-string > string => x
; < not (rewrite (!"outer")) > x
; < debug > "identifier"
; < debug > x
Check-Typedef-Name : name@appl (prod (_, cf (sort ("TypeName")), _),
[appl (prod (_, cf (sort ("TypedefName")), _),
[appl (prod (_, cf (sort ("Identifier")), _),
[appl (prod (_, cf (sort ("ID")), _),
[appl (_,
string)])])])]) -> name
where < implode-string > string => x
; < rewrite (!"outer") > x => type-kind
; < debug > type-kind
; < debug > x
Check-Class-Name : name@appl (prod (_, cf (sort ("TypeName")), _),
[appl (prod (_, cf (sort ("ClassName")), _),
[appl (prod (_, cf (sort ("Identifier")), _),
[appl (prod (_, cf (sort ("ID")), _),
[appl (_,
string)])])])]) -> name
where < implode-string > string => x
; < rewrite (!"outer") > x => class-kind
; < debug > class-kind
; < debug > x
Check-Enum-Name : name@appl (prod (_, cf (sort ("TypeName")), _),
[appl (prod (_, cf (sort ("EnumName")), _),
[appl (prod (_, cf (sort ("Identifier")), _),
[appl (prod (_, cf (sort ("ID")), _),
[appl (_,
string)])])])]) -> name
where < implode-string > string => x
; < rewrite (!"outer") > x => enum-kind
; < debug > enum-kind
; < debug > x
strategies
check = Check-Identifier <+ Check-Typedef-Name <+ Check-Class-Name <+ Check-Enum-Name
module Declaration
imports
AsFixTrees
rules
Declaration : x@appl (prod (_, cf (sort ("SimpleDeclaration")), _),
_) -> x
strategies
declaration = Declaration
module Declare
imports
AsFixTrees
Booleans
Declaration
Identifier
Kinds
Typedef
rules
Declare-Enum-Forward : x@appl (prod (_, cf (sort ("ElaboratedTypeSpecifier")), _),
[lit ("enum"), _, _, _]) -> x
where < oncebu (identifier) > x
; < rewrite (!"temporary") > "result" => y
; < assert (!"outer") > (y, enum-kind)
; < debug > "Forward enumeration definition"
; < debug > y
Declare-Class-Forward : x@appl (prod (_, cf (sort ("ElaboratedTypeSpecifier")), _),
[appl (prod (_, cf (sort ("ClassKey")), _), _),
_, _, _]) -> x
where < oncebu (identifier) > x
; < rewrite (!"temporary") > "result" => y
; < assert (!"outer") > (y, class-kind)
; < debug > "Forward class definition"
; < debug > y
Declare-Typename-Forward : x@appl (prod (_, cf (sort ("TemplateParameter")), _),
[lit ("typename"), _]) -> x
where < oncebu (identifier) > x
; < rewrite (!"temporary") > "result" => y
; < assert (!"outer") > (y, type-kind)
; < debug > "Forward typename definition"
; < debug > y
Declare-Enum : x@appl (prod (_, cf (sort ("EnumSpecifier")), _),
_) -> x
where < oncebu (identifier) > x
; < rewrite (!"temporary") > "result" => y
; < assert (!"outer") > (y, enum-kind)
; < debug > "Enum definition"
; < debug > y
Declare-Class : x@appl (prod (_, cf (sort ("ClassHead")), _),
_) -> x
where < oncebu (identifier) > x
; < rewrite (!"temporary") > "result" => y
; < assert (!"outer") > (y, class-kind)
; < debug > "Class definition"
; < debug > y
Declare-Type : x@appl (prod (_, cf (sort ("SimpleDeclaration")), _),
[specifiers, declarators, _]) -> x
where < oncebu (typedef) > x
; < topdown (not (ambiguity)) > x
; < oncebu (identifier) > declarators
; < rewrite (!"temporary") > "result" => y
; < assert (!"outer") > (y, type-kind)
; < debug > "Type definition"
; < debug > y
strategies
declare-typename = Declare-Typename-Forward
declare-enum = Declare-Enum-Forward <+ Declare-Enum
declare-class = Declare-Class-Forward <+ Declare-Class
declare-type = try (Declare-Type)
declare = try (declare-type ; try (declare-enum <+ declare-class <+ declare-typename))
module Disambiguate
imports
Ambiguity
AsFixTrees
Booleans
Candidate
Check
Declare
rules
Disambiguate : amb (ts) -> t
where < drop-until (scope (!"outer", disambiguate)); Hd > ts => t
strategies
disambiguate-node-non-ambiguous = if (candidate, check, id); declare
disambiguate-node-ambiguous = Disambiguate; declare
disambiguate-node = if (ambiguity, disambiguate-node-ambiguous, disambiguate-node-non-ambiguous)
disambiguate = topdownS (disambiguate-node, ambiguity)
module Identifier
imports
AsFixTrees
rules
Identifier : x@appl (prod (_, cf (sort ("Identifier")), _),
[appl (prod (_, cf (sort ("ID")), _),
[appl (_,
y)])]) -> x
where < implode-string > y => z
; < assert (!"temporary") > ("result", z)
UnqualifiedIdentifier : x@appl (prod (_, cf (sort ("UnqualifiedId")), _),
[appl (prod (_, cf (sort ("Identifier")), _),
[appl (prod (_, cf (sort ("ID")), _),
[appl (_,
y)])])]) -> x
where < implode-string > y => z
; < assert (!"temporary") > ("result", z)
strategies
identifier = Identifier
unqualified-identifier = UnqualifiedIdentifier
module Kinds
signature
constructors
enum-kind : Kind
type-kind : Kind
class-kind : Kind
ident-kind : Kind
module Main
imports
io
scoped-finite-map
imports
Disambiguate
strategies
init = id
main = stdio (init-name-space (!"outer");
init-name-space (!"temporary");
begin-scope (!"outer");
begin-scope (!"temporary");
init;
scope (!"outer", disambiguate);
end-scope (!"outer");
end-scope (!"temporary");
exit-name-space (!"outer");
exit-name-space (!"temporary"))
# xt rules
include $(top_srcdir)/config/xt-rules.mk
bin_SCRIPTS = cpp-disambiguate
SRCS = Ambiguity.r \
Candidate.r \
Check.r \
Declaration.r \
Declare.r \
Disambiguate.r \
Identifier.r \
Kinds.r \
Main.r \
Typedef.r
cpp-disambiguate : $(SRCS)
@SC@ -I $(top_srcdir)/lib/prelude \
-I $(top_srcdir)/lib/asfix \
-I $(top_srcdir)/src/disambiguate \
-i Main.r \
-o cpp-disambiguate
EXTRA_DIST = $(SRCS)
CLEANFILES = cpp-disambiguate *.c *.dep *.tree
module Typedef
imports
AsFixTrees
rules
Typedef : x@lit ("typedef") -> x
strategies
typedef = test (Typedef)
# TODO : have a real automake-powered test suite :(
check : check-parse check-disambiguate
check : check-parse
TABLE = $(top_builddir)/src/grammar/Cpp.tbl
DISAMBIGUATE = $(top_builddir)/src/disambiguate/cpp-disambiguate
check-parse : $(TABLE)
$(top_srcdir)/config/sdf-check `find . -name '*.cc' -o -name '*.C'`\
| tee parse.log
check-disambiguate : $(TABLE) $(DISAMBIGUATE)
$(top_srcdir)/config/disambiguate-check `find our/disambiguate -name '*.cc' -o -name '*.C'` \
| tee disambiguate.log
CLEANFILES = parse.log disambiguate.log
CLEANFILES = parse.log
EXTRA_DIST = g++ our
.PHONY: check-parse check-disambiguate
.PHONY: check-parse
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