Skip to content

Commit

Permalink
change rep to plus and eps to empty
Browse files Browse the repository at this point in the history
  • Loading branch information
connolly committed Nov 15, 2006
1 parent 6a1002c commit e1d8f90
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions grammar/ebnf2bnf.n3
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ rdfs:seeAlso <ebnf>, <ebnf.n3>, <ebnf.rdf>.

@prefix g: <http://www.w3.org/2000/10/swap/grammar/ebnf#>.

g:eps g:seq ().
g:empty g:seq ().

{ ?A g:opt ?B } => { ?A g:alt ( g:eps ?B ) }.
{ ?A g:opt ?B } => { ?A g:alt ( g:empty ?B ) }.

{ ?A g:rep ?B } => { ?A g:seq ( ?B [ g:star ?B] ) }.
{ ?A g:plus ?B } => { ?A g:seq ( ?B [ g:star ?B] ) }.

{ ?A g:star ?B } => { ?A g:alt ( g:eps [ g:seq (?B ?A) ] ) }.
{ ?A g:star ?B } => { ?A g:alt ( g:empty [ g:seq (?B ?A) ] ) }.


# find all the non-terminals
Expand All @@ -26,7 +26,7 @@ g:eps g:seq ().
g:alt rdfs:domain g:Production.
{ ?S [ rdfs:domain ?C] [] } => { ?S a ?C }.

# eps is not a production
# empty is not a production
{ ?S g:seq [ rdf:rest []] } => { ?S a g:Production }.

{ ?L g:start ?A }
Expand Down Expand Up @@ -61,7 +61,7 @@ re:seq rdfs:domain re:Regex.
re:matches rdfs:domain re:Regex.
re:diff rdfs:domain re:Regex.
re:opt rdfs:domain re:Regex.
re:rep rdfs:domain re:Regex.
re:plus rdfs:domain re:Regex.
re:star rdfs:domain re:Regex.

{ [ g:alt [ list:member ?T ]] g:nonTerminal ?L.
Expand Down

0 comments on commit e1d8f90

Please sign in to comment.