Talk:Parse EBNF: Difference between revisions

(→‎Output form: For the Ruby implementation, I intend to give error messages about syntax errors.)
 
(10 intermediate revisions by 5 users not shown)
Line 1:
== Initial comments ==
 
I guess I started this as a draft task because I haven't implemented it myself yet. <br>
There is no reason to keep it a draft too long if we get a few fresh implementations here. [[User:Tinku99|Tinku99]] 05:28, 12 June 2010 (UTC)tinku99
Line 32 ⟶ 34:
 
The given calculator grammar uses the identifiers <code>PLUS</code>, <code>MINUS</code>, <code>MULT</code>, <code>DIV</code>, and <code>NUMBER</code> without defining them. Don't they need to be defined? —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 20:54, 12 May 2011 (UTC)
 
: +1 on that. --[[User:Paddy3118|Paddy3118]] 04:55, 13 May 2011 (UTC)
 
== PicoLisp grammar is PicoLisp not EBNF ==
PicoLisp seems to parse PicoLisp rather than EBNF. This makes for a shorter program, but, if allowed, then the task description should state something like ''"parse an EBNF-like input grammer expressed as code for your programming language"'' to be fair. --[[User:Paddy3118|Paddy3118]] 05:05, 13 May 2011 (UTC)
: Well, but that's trivial. A one-line to convert the text form:<lang PicoLisp>(for E EBNF
(use (@S @E)
(unless (and (match '(@S : @E ;) (str E)) (not (cdr @S)))
(quit "Invalid EBNF" E) )
(put (car @S) 'ebnf @E) ) )</lang>--[[User:Abu|Abu]] 07:20, 17 May 2011 (UTC)
 
== ANTLR parser EBNF or ISO standard EBNF? ==
There is a [http://www.cl.cam.ac.uk/~mgk25/iso-14977.pdf difference]. --[[User:Paddy3118|Paddy3118]] 05:43, 13 May 2011 (UTC)
 
: Oh, in that case: let's go for ISO EBNF (though perhaps without the rules on exceptions; they're non-trivial to implement and the standard actually says that no grammar may be written that ''requires'' them, making them a shorthand form only). –[[User:Dkf|Donal Fellows]] 09:47, 13 May 2011 (UTC)
 
== Rewrite?==
How about defining an EBNF-like language here and have the task be to:
# Parse a ''given'' language definition for a simple calculator that goes right down to terminals.
# Parse a given expression including numbers with all digits and traversing all edges in the language graph.
# Parse a modified language definition where NUMBERS do not include 6.
# Print and show that the earlier expression fails to parse.
--[[User:Paddy3118|Paddy3118]] 05:43, 13 May 2011 (UTC)
 
==Rewrite!==
I've '''been bold''' and changed the task. Tell me what you think. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 22:50, 22 May 2011 (UTC)
 
==Making this a full task==
Why this task is still not a full task, why it's a draft? Let's make it just a regular task, we seem to have already some implementations. [[User:Avmich|Avmich]] 18:21, 19 January 2012 (UTC)
: There's been a lot of disagreement over what this task was supposed to be; there's no hurry to promote, especially when there is no consensus. (It's not like people solve these things for a full-time job either.) –[[User:Dkf|Donal Fellows]] 21:54, 19 January 2012 (UTC)
:: I think right now the task is clear enough - you get a string with grammar and an input string of the grammar's language, and you should check if the correspondence holds.
:: Promoting would add attention and may be someone would add a solution or two. [[User:Avmich|Avmich]] 23:36, 19 January 2012 (UTC)
::: It's definitely clearer than it was but it still needs work. The description is a bit thin and some of the questions asked here aren't really answered. Also with the clarification, it's harder to tell which examples are correct. Which EBNF to use (or if it even matters) if you declare which. The end result is if someone is just skimming along through tasks that might interest them then they have to do more work to understand this task over others. It's a disincentive. I think fixing the incorrect examples would do more than just removing draft. Right now it will look confused if promoted. I'd also suggest copying out the test input to the main page as there are only two. The tests page is still valuable for "more information". --[[User:Dgamey|Dgamey]] 03:06, 20 January 2012 (UTC)
Anonymous user