From eea62bd250931904e69b0234d45f087532a697d3 Mon Sep 17 00:00:00 2001 From: grammarware Date: Fri, 11 Feb 2011 14:36:37 +0000 Subject: [PATCH] BNF and EBNF from ASF+SDF Grammar Library git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@949 ab42f6e0-554d-0410-b580-99e487e6eeb2 --- topics/grammars/bnf/Makefile | 11 +++++++++ topics/grammars/bnf/bnf-bgf.bgf | 2 -- topics/grammars/bnf/correct.bnf.xbgf | 35 +++++++++++++++++++++++++++ topics/grammars/bnf/correct.ebnf.xbgf | 35 +++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 topics/grammars/bnf/Makefile create mode 100644 topics/grammars/bnf/correct.bnf.xbgf create mode 100644 topics/grammars/bnf/correct.ebnf.xbgf diff --git a/topics/grammars/bnf/Makefile b/topics/grammars/bnf/Makefile new file mode 100644 index 00000000..2b881f06 --- /dev/null +++ b/topics/grammars/bnf/Makefile @@ -0,0 +1,11 @@ +all: + ../../../shared/tools/sdf2bgf ../../../../sdf-library/trunk/library/languages/bnf/syntax/*.sdf bnf-sdf.bgf + ../../../shared/tools/sdf2bgf ../../../../sdf-library/trunk/library/languages/ebnf/syntax/*.sdf ebnf-sdf.bgf + ../../../shared/tools/xbgf correct.bnf.xbgf bnf-sdf.bgf _.bgf + ../../../shared/tools/subgrammar _.bgf Rules bnf-sdf.fix.bgf + ../../../shared/tools/xbgf correct.ebnf.xbgf ebnf-sdf.bgf _.bgf + ../../../shared/tools/subgrammar _.bgf Grammar ebnf-sdf.fix.bgf + @rm -f _.bgf + +test: + @ls -1 *.bgf | xargs -n1 ../../../shared/tools/validate bgf \ No newline at end of file diff --git a/topics/grammars/bnf/bnf-bgf.bgf b/topics/grammars/bnf/bnf-bgf.bgf index 3df126a8..44dc28df 100644 --- a/topics/grammars/bnf/bnf-bgf.bgf +++ b/topics/grammars/bnf/bnf-bgf.bgf @@ -2,8 +2,6 @@ grammar - production - expression grammar diff --git a/topics/grammars/bnf/correct.bnf.xbgf b/topics/grammars/bnf/correct.bnf.xbgf new file mode 100644 index 00000000..8b7bb1db --- /dev/null +++ b/topics/grammars/bnf/correct.bnf.xbgf @@ -0,0 +1,35 @@ + + + + Rules + + + + NonTerminal + + + + < + + + string + + + > + + + + + + + + Terminal + + string + + + + + Element + + diff --git a/topics/grammars/bnf/correct.ebnf.xbgf b/topics/grammars/bnf/correct.ebnf.xbgf new file mode 100644 index 00000000..9255d9b2 --- /dev/null +++ b/topics/grammars/bnf/correct.ebnf.xbgf @@ -0,0 +1,35 @@ + + + + Grammar + + + + String + + + + " + + + string + + + " + + + + + + + + IdCon + + string + + + + + Expression + +