Skip to content

Commit

Permalink
co-evolution of the Grammar Zoo
Browse files Browse the repository at this point in the history
  • Loading branch information
grammarware committed Oct 5, 2012
1 parent 96a8212 commit eff7fdc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions shared/python/BGF3.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def parse(self,exprelem):
self.wrapped = Plus()
elif expr.tag == 'star':
self.wrapped = Star()
elif expr.tag == 'seplistplus':
self.wrapped = SepListPlus()
elif expr.tag == 'sepliststar':
self.wrapped = SepListStar()
else:
print("Don't know how to parse",expr.tag)
return
Expand Down
4 changes: 2 additions & 2 deletions topics/export/hypertext/bgf2fancy.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
<xsl:text>, see </xsl:text>
<xsl:choose>
<xsl:when test="substring-after($zoo,'_dev/')='tank.xml'">
<a href="http://slps.sourceforge.net/tank/">Grammar Tank</a>
<a href="http://grammarware.github.com/tank/">Grammar Tank</a>
</xsl:when>
<xsl:otherwise>
<a href="http://slps.sourceforge.net/zoo/">Grammar Zoo</a>
<a href="http://grammarware.github.com/zoo/">Grammar Zoo</a>
</xsl:otherwise>
</xsl:choose>
<xsl:text> for details. </xsl:text>
Expand Down
12 changes: 6 additions & 6 deletions topics/mutation/horizontal/hor.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/local/bin/python
#!/Library/Frameworks/Python.framework/Versions/3.1/bin/python3
# -*- coding: utf-8 -*-
import os,sys
sys.path.append(os.getcwd().split('projects')[0]+'projects/slps/shared/python')
import BGF
import BGF3

if __name__ == "__main__":
if len(sys.argv) != 3:
print 'This tool generates an XBGF script to horizontalize all vertical nonterminals present in the grammar.'
print 'Usage:'
print ' '+sys.argv[0]+' <bgf-input> <xbgf-output'
print('This tool generates an XBGF script to horizontalize all vertical nonterminals present in the grammar.')
print('Usage:')
print(' '+sys.argv[0]+' <bgf-input> <xbgf-output')
sys.exit(1)
bgf = BGF.Grammar()
bgf = BGF3.Grammar()
bgf.parse(sys.argv[1])
single = []
multiple = []
Expand Down

0 comments on commit eff7fdc

Please sign in to comment.