Hi! thanks for the reply but now there is another problem. It works now and it exports to json but it looks like this:

["start",["seq","(",[["seqstr",["tagstr",["OZN","SBARQ "],["_alternati +on_1_of_production_1_of_rule_tagstr",["seq","(",[["seqstr",["tagstr", +["OZN","WHADVP "],["_alternation_1_of_production_1_of_rule_tagstr",[" +seq","(",[["seqstr",["tagstr",["OZN","WRB "],["_alternation_1_of_prod +uction_1_of_rule_tagstr",["rijec","Where"]]]]],")"]]]]],")"]]]],["seq +str",["seq","(",[["seqstr",["tagstr",["OZN","SQ "],["_alternation_1_o +f_production_1_of_rule_tagstr",["seq","(",[["seqstr",["tagstr",["OZN" +,"VBZ "],["_alternation_1_of_production_1_of_rule_tagstr",["rijec","i +s"]]]]],")"]]]],["seqstr",["seq","(",[["seqstr",["tagstr",["OZN","NP +"],["_alternation_1_of_production_1_of_rule_tagstr",["seq","(",[["seq +str",["tagstr",["OZN","NNP "],["_alternation_1_of_production_1_of_rul +e_tagstr",["rijec","Inoco"]]]]],")"]]]]],")"]],["seqstr",["seq","(",[ +["seqstr",["tagstr",["OZN","VP "],["_alternation_1_of_production_1_of +_rule_tagstr",["seq","(",[["seqstr",["tagstr",["OZN","VBN "],["_alter +nation_1_of_production_1_of_rule_tagstr",["rijec","based"]]]]],")"]]] +]],")"]]],")"]],["seqstr",["seq","(",[["seqstr",["tagstr",["OZN",". " +],["_alternation_1_of_production_1_of_rule_tagstr",["rijec","?"]]]]], +")"]]],")"]]

It should actually look like this example bellow, I mean with curly brackets (not square) and colons instead of comma:

{"firstName": "John", "lastName" : "Smith", "age" : 25, "address" : {"streetAdr ” : "21 2nd Street", "city" : "New York", "state" : "NY", ” zip" : "10021"}, "phoneNumber": [{"type" : "home", "number": "212 555 - 1234"}, {"type" : "fax", "number ” : "646 555 - 4567"}] }

I tried using <autotree> directive and it won't even export to json (shows message:"encountered object 'start=HASH(0x89d0d08)', but neither allow_blessed nor convert_blessed settings are enabled at gramatika.txt line 31.") Is there another way to get desired shape? Thanks!


In reply to Re^4: converting context free grammar to BNF by nido203
in thread converting context free grammar to BNF by nido203

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.