Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@251 ab42f6e0-554d-0410-b580-99e487e6eeb2
- Loading branch information
1 parent
7530814
commit a50a7e5
Showing
4 changed files
with
88 additions
and
18 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,10 +1,13 @@ | ||
build: | ||
|
||
test: | ||
python xpathpre.py ../../java/jls1/syntax.html >jls1.html | ||
python html2bgf.py jls1.html jls1.bgf | ||
python html2bgf.py ../../java/jls2/syntax.html jls2.bgf | ||
python html2bgf.py ../../java/jls3/syntax.html jls3.bgf | ||
../../../shared/tools/checkxml bgf jls1.bgf | ||
../../../shared/tools/checkxml bgf jls2.bgf | ||
../../../shared/tools/checkxml bgf jls3.bgf | ||
|
||
clean: | ||
rm -f *.bgf | ||
rm -f *.bgf jls1.html |
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,8 @@ | ||
This extractor tries to squeeze a BGF from the hypertext documentation. | ||
In order to do so, is applies a number of heuristics and fixes the most | ||
cmmonly encountered problems in manually created language specifications. | ||
|
||
It works equally well with Java Language Standard 2 and 3, but requires | ||
an additional action for Java Language Standard 1. This action virtually | ||
equals running some sort of //pre XPath query, but the HTML was too dirty | ||
and non-well-formed to use the real xpath utility. |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/python | ||
import sys | ||
|
||
f = open(sys.argv[1],'r') | ||
grammar = False | ||
print '<pre>' | ||
for chunk in ''.join(f.readlines()).split('<pre>'): | ||
if chunk.find('19.2')>0: | ||
grammar = True | ||
elif grammar: | ||
print chunk.split('</pre>')[0].replace('<br>','').replace(' ',' ') | ||
print '</pre>' | ||
f.close() |