I admit that I do not really know how to divide the rules, although I 
believe I could deduce it from the context.  I guess that Marpa would have 
two places/methods to feed the BNF, one for the lexical and one for the 
structural, so I have to read more and more carefully.
Thanks
ZA

On Thursday, December 4, 2014 1:06:48 PM UTC-5, Jeffrey Kegler wrote:
>
> A lot of standards BNF has been converted to Marpa, but doing it fully 
> automatically is problematic, because standards BNF was written on the 
> assumption that there is no practical way to parse directly from BNF, and 
> the standards writers feel free to cut a corner or two.
>
> They do this in particular with the lexing/parsing boundary.  As a 
> practical matter, parsers almost always need a lexical layer and a 
> structural layer, and in Marpa's SLIF, these have two different sets of 
> rules, one using '::=", and the other using a tilde ('~').  To translate 
> the standards BNF into Marpa's SLIF, you'll have to divide the rules into 
> lexical (L0) and structural (G1).
>
> I am pretty sure there are (or at least have been) large Marpa-powered SQL 
> subsets running out there, running in production environments, because of 
> questions that have come in.  But those are proprietary.   And I am not 
> aware of any open-source full SQL parser in Marpa.
>
> Guessing, converting the SQL BNF to Marpa is quite possible, but might 
> take some time and effort, particularly if you're not already familar with 
> BNF and the lexical/structural distinction in traditional parsing.
>
> On Thu, Dec 4, 2014 at 9:37 AM, Zeev Atlas <[email protected] <javascript:>
> > wrote:
>
>> Hi all
>> I am new to Marpa, so I may be trying to chew too much, but my question 
>> is of general nature.
>> I am interested ultimately in parsing SQL (not running it, just parsing 
>> into structures that I could than analyze.)  So I wrote a simple program 
>> that strip the SQL 2003 BNF file (http://savage.net.au/SQL/sql-2003-2.bnf) 
>> from irrelevant data and try to feed it to Marpa as is.
>>
>> In the BNF I have clauses like this:
>> <percent> ::= %
>> which I already figured out I need to change to something like
>> <percent> ::= '%'
>>
>> My issue is the infamous clauses:
>>
>> <space> ::= 
>> or worse
>> <quote> ::= '
>>
>> Could somebody tell me please how should I deal with those
>> note that 
>> <space> ::= ' ' and <quote> ::= ''' or <quote> ::= '''' do not work
>>
>> BTW, if anybody already did a full featured (not specific dialect) SQL 
>> parser (SQL::Statement is a relatively incomplete subset) or knows about 
>> such one, please let me know.  Also, I am looking for dialect specific full 
>> BNF files if available
>>
>> Thanks all 
>> ZA
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "marpa parser" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"marpa parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to