Adding first cut of code to render alternations

Still need to implement lines to the individual parts
This commit is contained in:
Jeff Avallone
2014-11-30 17:54:12 -05:00
parent ed2c26c39e
commit f8cded8eac
5 changed files with 44 additions and 12 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
grammar JavascriptRegexp
root <- ( ( "/" regexp "/" fl:[igm]* ) / regexp ""? ) <Root>
regexp <- match ( "|" match )* <Regexp>
match <- anchor_start? ( ( subexp / charset / terminal ) repeat? )* anchor_end?
regexp <- match alternates:( "|" match )* <Regexp>
match <- anchor_start? ( ( subexp / charset / terminal ) repeat? )* anchor_end? <Match>
anchor_start <- "^"
anchor_end <- "$"
repeat <- ( repeat_any / repeat_required / repeat_optional / repeat_spec ) repeat_greedy?