Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hunter 3.0: (almost) no corrective heuristics, but support for labels…
…: enough to extract the third Ada grammar git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@1038 ab42f6e0-554d-0410-b580-99e487e6eeb2
- Loading branch information
1 parent
1837e61
commit 17176c2
Showing
11 changed files
with
811 additions
and
438 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
build: | ||
cd kempe && make build | ||
cd laemmel-verhoef && make build | ||
cd lncs-4348 && make build | ||
|
||
clean: | ||
cd kempe && make clean | ||
cd laemmel-verhoef && make clean | ||
cd lncs-4348 && make clean | ||
|
||
test: | ||
cd kempe && make test | ||
cd laemmel-verhoef && make test | ||
cd lncs-4348 && make test | ||
|
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
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 |
---|---|---|
@@ -1,9 +1,10 @@ | ||
build: | ||
../hunter.py src.context.free.syntax.txt config.edd ada.bgf | ||
../hunter.py src.context.free.syntax.txt config.edd ada.raw.bgf | ||
../../../../shared/tools/xbgf correct.xbgf ada.raw.bgf ada.bgf | ||
|
||
test: | ||
validate bgf ada.bgf | ||
checkbgf ada.bgf | ||
ls -1 *.bgf | xargs -n1 ../../../../shared/tools/validate bgf | ||
../../../../shared/tools/checkbgf ada.bgf | ||
|
||
clean: | ||
rm -rf *.bgf *.bnf |
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,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:xbgf="http://planet-sl.org/xbgf" xmlns:bgf="http://planet-sl.org/bgf"> | ||
<!-- Thanks Othon Batista, othonb@yahoo.com!--> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<terminal>--</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>-</terminal> | ||
</bgf:expression> | ||
<in> | ||
<nonterminal>unary_adding_operator</nonterminal> | ||
</in> | ||
</xbgf:replace> | ||
</xbgf:sequence> |
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,20 @@ | ||
build: | ||
make ada.bgf | ||
|
||
ada.bgf: src.syntax.summary.txt | ||
cp src.syntax.summary.txt src.prepared.txt | ||
#cat src.syntax.summary.txt | grep -v 1. | grep -v 2. | grep -v 3. | grep -v 4. | grep -v 5. | grep -v 6. | grep -v 7. | grep -v 8. | grep -v 9. | grep -v 0. | grep -v 'quotation mark' > src.prepared.txt | ||
perl -pi -w -e 's/{\|/{TERMINALBAR/g;' src.prepared.txt | ||
perl -pi -w -e 's/–/-/g;' src.prepared.txt | ||
perl -pi -w -e 's/J\./0\./g;' src.prepared.txt | ||
../hunter.py src.prepared.txt config.edd ada-1.bgf | ||
../../../../shared/tools/xbgf post-extract.xbgf ada-1.bgf ada-2.bgf | ||
../../../../shared/tools/xbgf correct.xbgf ada-2.bgf ada.bgf | ||
../../../../shared/tools/bgf2bnf ada.bgf ada.bnf | ||
|
||
test: | ||
ls -1 *.bgf | xargs -n1 ../../../../shared/tools/validate bgf | ||
../../../../shared/tools/checkbgf ada.bgf | ||
|
||
clean: | ||
rm -f *.bgf *.bnf src.prepared.txt |
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,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<edd:config xmlns:edd="http://planet-sl.org/edd"> | ||
<end-label-symbol>:</end-label-symbol> | ||
<defining-symbol>::=</defining-symbol> | ||
<definition-separator-symbol>|</definition-separator-symbol> | ||
<start-option-symbol>[</start-option-symbol> | ||
<end-option-symbol>]</end-option-symbol> | ||
<start-star-symbol>{</start-star-symbol> | ||
<end-star-symbol>}</end-star-symbol> | ||
<undefined-nonterminals-are-terminals>_</undefined-nonterminals-are-terminals> | ||
<ignore-extra-newlines/> | ||
<glue-nonalphanumeric-terminals/> | ||
<disregard-labels/> | ||
</edd:config> |
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,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:xbgf="http://planet-sl.org/xbgf" xmlns:bgf="http://planet-sl.org/bgf"> | ||
<xbgf:massage> | ||
<bgf:expression> | ||
<sequence> | ||
<bgf:expression> | ||
<nonterminal>variant</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<star> | ||
<bgf:expression> | ||
<nonterminal>variant</nonterminal> | ||
</bgf:expression> | ||
</star> | ||
</bgf:expression> | ||
</sequence> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<plus> | ||
<bgf:expression> | ||
<nonterminal>variant</nonterminal> | ||
</bgf:expression> | ||
</plus> | ||
</bgf:expression> | ||
</xbgf:massage> | ||
</xbgf:sequence> |
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,120 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xbgf:sequence xmlns:xbgf="http://planet-sl.org/xbgf" xmlns:bgf="http://planet-sl.org/bgf"> | ||
<!-- Interpreting the notation rule that | is a BNF bar unless encountered as {| --> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<nonterminal>TERMINALBAR</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>|</terminal> | ||
</bgf:expression> | ||
</xbgf:replace> | ||
<!-- should be defined elsewhere--> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<terminal>underline</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>underline</nonterminal> | ||
</bgf:expression> | ||
</xbgf:replace> | ||
<!-- Resolving the confusion of "pragma" and the pragma nonterminal --> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<nonterminal>pragma</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>pragma</terminal> | ||
</bgf:expression> | ||
<in> | ||
<nonterminal>pragma</nonterminal> | ||
</in> | ||
</xbgf:replace> | ||
<!-- Disambiguating "range" and the range nonterminal --> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<nonterminal>range</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>range</terminal> | ||
</bgf:expression> | ||
</xbgf:replace> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<sequence> | ||
<bgf:expression> | ||
<terminal>range</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>range</terminal> | ||
</bgf:expression> | ||
</sequence> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<sequence> | ||
<bgf:expression> | ||
<terminal>range</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>range</nonterminal> | ||
</bgf:expression> | ||
</sequence> | ||
</bgf:expression> | ||
<in> | ||
<nonterminal>range_constraint</nonterminal> | ||
</in> | ||
</xbgf:replace> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<terminal>range</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>range</nonterminal> | ||
</bgf:expression> | ||
<in> | ||
<nonterminal>discrete_range</nonterminal> | ||
</in> | ||
</xbgf:replace> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<terminal>range</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>range</nonterminal> | ||
</bgf:expression> | ||
<in> | ||
<nonterminal>relation</nonterminal> | ||
</in> | ||
</xbgf:replace> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<terminal>range</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>range</nonterminal> | ||
</bgf:expression> | ||
<in> | ||
<nonterminal>discrete_subtype_definition</nonterminal> | ||
</in> | ||
</xbgf:replace> | ||
<!-- Disambiguating "body" and the body nonterminal --> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<nonterminal>body</nonterminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<terminal>body</terminal> | ||
</bgf:expression> | ||
</xbgf:replace> | ||
<xbgf:replace> | ||
<bgf:expression> | ||
<terminal>body</terminal> | ||
</bgf:expression> | ||
<bgf:expression> | ||
<nonterminal>body</nonterminal> | ||
</bgf:expression> | ||
<in> | ||
<nonterminal>declarative_item</nonterminal> | ||
</in> | ||
</xbgf:replace> | ||
</xbgf:sequence> |
Oops, something went wrong.