Skip to content

Commit

Permalink
switching C# extraction from pdf2bgf to Grammar Hunter
Browse files Browse the repository at this point in the history
  • Loading branch information
grammarware committed Jan 17, 2013
1 parent 352733a commit 70c81d4
Show file tree
Hide file tree
Showing 6 changed files with 869 additions and 3 deletions.
11 changes: 11 additions & 0 deletions topics/grammars/csharp/ecma-334-1/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
extract:
${hunter} src.fixed.txt config.edd output.bgf
xbgf fix.xbgf output.bgf good.bgf
gdts good.bgf grammar.bgf

fix:
grep -v 1 src.grammar.txt | 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 SPECIFICATION | grep -v Appendix > src.fixed.txt

hunt:
${hunter} src.grammar.txt config.edd output.bgf

extract2:
${tooldir}/pdf2bgf src.grammar.txt raw.bgf banned-lines.lst keywords.lst
${tooldir}/xbgf post-extract.xbgf raw.bgf grammar.bgf

Expand Down
22 changes: 22 additions & 0 deletions topics/grammars/csharp/ecma-334-1/config.edd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<edd:config xmlns:edd="http://planet-sl.org/edd">
<break-tokens-at-whitespace/>
<defining-symbol>: \n</defining-symbol>
<multiple-defining-symbol>: oneof \n</multiple-defining-symbol>
<definition-separator-symbol> \n</definition-separator-symbol>
<postfix-option-symbol>opt</postfix-option-symbol>
<terminal-if-undefined>
<except>identifier</except>
<except>literal</except>
</terminal-if-undefined>
<nonterminal-if-contains>
<what>-</what>
<except>-</except>
<except>--</except>
<except>-=</except>
</nonterminal-if-contains>
<mask>
<token>ñ</token>
<terminal>-</terminal>
</mask>
</edd:config>
19 changes: 19 additions & 0 deletions topics/grammars/csharp/ecma-334-1/fix.xbgf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<xbgf:sequence xmlns:xbgf="http://planet-sl.org/xbgf" xmlns:bgf="http://planet-sl.org/bgf">
<xbgf:replace>
<bgf:expression>
<nonterminal>-</nonterminal>
</bgf:expression>
<bgf:expression>
<terminal>-</terminal>
</bgf:expression>
</xbgf:replace>
<xbgf:replace>
<bgf:expression>
<terminal>DOUBLEDOT</terminal>
</bgf:expression>
<bgf:expression>
<terminal>:</terminal>
</bgf:expression>
</xbgf:replace>
</xbgf:sequence>
Loading

0 comments on commit 70c81d4

Please sign in to comment.