ion7-grammar / from.ebnf

module

from.ebnf

local Grammar = require "ion7.grammar"
local g = Grammar.from_ebnf([[
    Date     ::= Year "-" Month "-" Day
    Year     ::= Digit Digit Digit Digit
    Month    ::= Digit Digit
    Day      ::= Digit Digit
    Digit    ::= [0-9]
]])
print(g:to_gbnf())

Functions

from_ebnf

Parse an EBNF string into a Builder.

from_ebnf(source, root)
sourcestringW3C-style EBNF rulelist.
rootstring?Root rule name (default: first defined rule).
→ Builder