[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [odata] Extension of APG for case sensitive strings
Best regards, -- Ken On Fri, 9 Nov 2012, Stefan Drees wrote:
Hi Ken, Am 09.11.12 06:00, schrieb kenb:In ODATA-117 it was pointed out that string are case insensitive in ABNF. I extended APG so that single-quoted strings are case sensitive. I also added an option for generating a grammar in standard ABNF so that one can develop a grammar using case sensitive strings and then generate a grammar that is compatible with the ABNF standard. The code is attached ....thanks a lot.!I played with it using the current svn version of our ABNF construction rules (stored in check_eapg.txt):$> java -jar eapg.jar /abnf=out_abnf.txt /eabnf=out_eabnf.txt /in=check_eapg.txt /dwA diff shows the translations from lovely strings like in the production for skiptoken:; svn-source: skiptoken = %x24.73.6b.69.70.74.6f.6b.65.6e "=" ; $skiptoken1*( unreserved / pct-encoded / other-delims / ":" / "@" / "$" / "=" ) ; everything except "&"; out_abnf.txtskiptoken = %x24.73.6B.69.70.74.6F.6B.65.6E "=" 1*(unreserved / pct-encoded / other-delims / ":" / "@" / "$" / "="); out_eabnf.txtskiptoken = '$skiptoken' "=" 1*(unreserved / pct-encoded / other-delims / ":" / "@" / "$" / "=")The apparent transformations look ok to me.Are the structural changes it performs when looking at the abnf-output also ok?Sample production for singleNavigation: ; odata-abnf-construction-rules-v1.0-wd01.txt input singleNavigation = [ "/" qualifiedEntityTypeName ] ( links "/" navigationProperty/ "/" ( entityColNavigationProperty [ collectionNavigation ]/ entityNavigationProperty [ singleNavigation ] / complexColProperty [ collectionPath ] / complexProperty [ complexPath ] / primitiveColProperty [ collectionPath ] / primitiveProperty [ singlePath ] / streamProperty ) / boundOperation / "" ; for casting after key access ) ; portion in out_abnf.txt i.e. eapg.jar output (reformatted for comparability singleNavigation = [ "/" qualifiedEntityTypeName ] ((links "/" navigationProperty)/ ("/" ((entityColNavigationProperty [ collectionNavigation ])/(entityNavigationProperty [singleNavigation]) /(complexColProperty [collectionPath]) /(complexProperty [complexPath]) / (primitiveColProperty [collectionPath]) / (primitiveProperty [singlePath]) / streamProperty) ) / boundOperation / "" ) ; abnf output (original formating):singleNavigation = ["/" qualifiedEntityTypeName] ((links "/" navigationProperty) / ("/" ((entityColNavigationProperty [collectionNavigation]) / (entityNavigationProperty [singleNavigation]) / (complexColProperty [collectionPath]) / (complexProperty [complexPath]) / (primitiveColProperty [collectionPath]) / (primitiveProperty [singlePath]) / streamProperty)) / boundOperation / "")Note eg. the extra parentheses grouping links "/" navigationProperty atsingleNavigation = ["/" qualifiedEntityTypeName] ((links "/" navigationProperty) / ...in the output while (space normalizing) the respective input start gives:singleNavigation = ["/" qualifiedEntityTypeName] ( links "/" navigationProperty / ...but probably I am to xBNF ignorant to see the equivalence or necessity of these parentheses. In that case please ignore or if you are willing give me a hint ;-)If I feed in the eabnf output of the first run:$> java -jar eapg.jar /abnf=out2fromeabnf_abnf.txt /eabnf=out2fromeabnf_eabnf.txt /in=out_eabnf.txt /dw$> diff -p -U 1 out2fromeabnf_abnf.txt out_abnf.txt and $> diff -p -U 1 out2fromeabnf_eabnf.txt out_eabnf.txt both show the roundtripping works (no differences found).All the best and thanks again for this both IMO good and interesting contribution.Stefan.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]