Skip to content

Commit

Permalink
Java grammars added to the zoo
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@795 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed May 7, 2010
1 parent 6cdf991 commit 4a843e3
Show file tree
Hide file tree
Showing 28 changed files with 119 additions and 82 deletions.
2 changes: 1 addition & 1 deletion shared/tools/pdf2bgf
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ elif [ ! -r $4 ]; then
else
python ${SLPS}/topics/extraction/bnf2bgf/pdf2lll.py $1 intermediate.lll $3 $4
python ${SLPS}/topics/extraction/bnf2bgf/lll2bgf.py intermediate.lll $2
rm -f intermediate.lll
#rm -f intermediate.lll
fi
3 changes: 1 addition & 2 deletions topics/extraction/bnf2bgf/pdf2lll.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def readTerminalsList(f):
except IndexError,e:
print 'index error with',kw,len(kw)
punctuators.reverse()
print 'Punctuators:',punctuators
#print 'Punctuators:',punctuators

knownPostfixes = ('+','*','?')

Expand Down Expand Up @@ -202,7 +202,6 @@ def massageGrammarRule(context,nt):
print 'L-Splitting',tokens[j],'into',ts
tokens[j] = ts
else:
print 'NOT L-splitting',tokens[j],'into',ts
ts = splitTrailing(tokens[j],knownTerminals)
if ts.find(' ')>-1 and (ts.split()[0] in grammar.keys() or ts.split()[-1] in ignored):
print 'T-Splitting',tokens[j],'into',ts
Expand Down
3 changes: 3 additions & 0 deletions topics/grammars/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ build:
cd c && make build
cd cpp && make build
cd csharp && make build
cd java && make build

clean:
cd c && make clean
cd cpp && make clean
cd csharp && make clean
cd java && make clean

test:
cd c && make test
cd cpp && make test
cd csharp && make test
cd java && make test
14 changes: 14 additions & 0 deletions topics/grammars/java/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
build:
cd jls1 && make build
cd jls2 && make build
cd jls3 && make build

clean:
cd jls1 && make clean
cd jls2 && make clean
cd jls3 && make clean

test:
cd jls1 && make test
cd jls2 && make test
cd jls3 && make test
32 changes: 32 additions & 0 deletions topics/grammars/java/jls1/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
all:
make build
make test

build:
make impl
make read

debug:
python ../../../../shared/python/getpre.py syntax.kw impl.html parse.html
python ../../../extraction/bnf2bgf/html2bgf.py parse.html impl1.bgf -v
python ../../../../shared/python/getpre.py collect.kw read.html parse.html
python ../../../extraction/bnf2bgf/html2bgf.py parse.html read1.bgf -v

impl:
@echo "Extracting impl1" > /dev/stderr
python ../../../../shared/python/getpre.py syntax.kw impl.html parse.html
python ../../../extraction/bnf2bgf/html2bgf.py parse.html impl1.bgf

read:
@echo "Extracting read1" > /dev/stderr
python ../../../../shared/python/getpre.py collect.kw read.html parse.html
python ../../../extraction/bnf2bgf/html2bgf.py parse.html read1.bgf

test:
../../../../shared/tools/checkxml bgf impl1.bgf
../../../../shared/tools/checkxml bgf read1.bgf
../../../../shared/tools/gdts impl1.bgf extracted-implementable-grammar.bgf
../../../../shared/tools/gdts read1.bgf extracted-readable-grammar.bgf

clean:
rm -f *.bgf parse.html
File renamed without changes.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions topics/grammars/java/jls1/extracted-readable-grammar.bgf

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions topics/grammars/java/jls2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
all:
make build
make test

build:
make impl
make read

debug:
python ../../../extraction/bnf2bgf/html2bgf.py impl.html impl2.bgf -v
python ../../../../shared/python/getpre.py collect.kw read.html parse.html
python ../../../extraction/bnf2bgf/html2bgf.py parse.html read2.bgf -v

impl:
@echo "Extracting impl2" > /dev/stderr
python ../../../extraction/bnf2bgf/html2bgf.py impl.html impl2.bgf

read:
@echo "Extracting read2" > /dev/stderr
python ../../../../shared/python/getpre.py collect.kw read.html parse.html
python ../../../extraction/bnf2bgf/html2bgf.py parse.html read2.bgf

test:
../../../../shared/tools/checkxml bgf impl2.bgf
../../../../shared/tools/checkxml bgf read2.bgf
../../../../shared/tools/gdts impl2.bgf extracted-implementable-grammar.bgf
../../../../shared/tools/gdts read2.bgf extracted-readable-grammar.bgf

clean:
rm -f *.bgf parse.html
File renamed without changes.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions topics/grammars/java/jls2/extracted-readable-grammar.bgf

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions topics/grammars/java/jls3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
all:
make build
make test

build:
make impl
make read

debug:
python ../../../extraction/bnf2bgf/html2bgf.py impl.html impl3.bgf -v
python ../../../../shared/python/getpre.py collect.kw read.html parse.html
python ../../../extraction/bnf2bgf/html2bgf.py parse.html read3.bgf -v

impl:
@echo "Extracting impl3" > /dev/stderr
python ../../../extraction/bnf2bgf/html2bgf.py impl.html impl3.bgf

read:
@echo "Extracting read3" > /dev/stderr
python ../../../../shared/python/getpre.py collect.kw read.html parse.html
python ../../../extraction/bnf2bgf/html2bgf.py parse.html read3.bgf

test:
../../../../shared/tools/checkxml bgf impl3.bgf
../../../../shared/tools/checkxml bgf read3.bgf
../../../../shared/tools/gdts impl3.bgf extracted-implementable-grammar.bgf
../../../../shared/tools/gdts read3.bgf extracted-readable-grammar.bgf

clean:
rm -f *.bgf parse.html
File renamed without changes.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions topics/grammars/java/jls3/extracted-readable-grammar.bgf

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
27 changes: 0 additions & 27 deletions topics/java/jls1/Makefile

This file was deleted.

25 changes: 0 additions & 25 deletions topics/java/jls2/Makefile

This file was deleted.

25 changes: 0 additions & 25 deletions topics/java/jls3/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion topics/java/lci/java.lcf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</shortcut>
<shortcut>
<name>java</name>
<expansion>..</expansion>
<expansion>../../grammars/java</expansion>
</shortcut>
<shortcut>
<name>tools</name>
Expand Down
2 changes: 1 addition & 1 deletion topics/java/related/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
build:
xmllint --noout --schema related.xsd related.xml
xsltproc links2html.xslt related.xml | python ../../presentation/ldf2pdf/closemeta.py > related.html
xsltproc links2html.xslt related.xml | python ../../../shared/python/closemeta.py > related.html

clean:
rm -f related.html
Expand Down

0 comments on commit 4a843e3

Please sign in to comment.