Hi,
I would like to add support for the remaining keywords (or most of them, at least) to the TextMate bundle posted under "Editor Support".
However, in order to do it properly, it would be nice to know the context of each of the keywords.
Is there an official Cobra grammar available anywhere?
I apologize if it is already easily located — I just can't seem to find it!
Forums
Official Cobra grammar
9 posts
• Page 1 of 1
Re: Official Cobra grammar
Theres no formal grammar document.
This page Keywords is the best keyword reference we have outside the source code.
It has all the keywords in alpha order and a link to the code file.
If you follow that page then the KeywordSpecs 'View Online' link to the keywords file/class you can look for the
rawSpecs property - List ( about a page or so down) which gives a table of the keywords and some indication of their use and what they're for though not the full grammatical context...
If thats insufficient then the only other recourse is to walk through the CobraParser.cobra source following the recursive descent code.
( that will be 100% correct by definition)
Perhaps slightly less onerous is to look at the wiki doc (From 'wiki:LanguageTopics' under 'Program Structure') and pick the keywords from the doc/grammar descriptions for each construct/statement there ....
Its possible the doc there is not 100% complete/correct though and you might find it difficult to pick the keywords out easily rapidly for your purposes.
This page Keywords is the best keyword reference we have outside the source code.
It has all the keywords in alpha order and a link to the code file.
If you follow that page then the KeywordSpecs 'View Online' link to the keywords file/class you can look for the
rawSpecs property - List ( about a page or so down) which gives a table of the keywords and some indication of their use and what they're for though not the full grammatical context...
If thats insufficient then the only other recourse is to walk through the CobraParser.cobra source following the recursive descent code.
( that will be 100% correct by definition)
Perhaps slightly less onerous is to look at the wiki doc (From 'wiki:LanguageTopics' under 'Program Structure') and pick the keywords from the doc/grammar descriptions for each construct/statement there ....
Its possible the doc there is not 100% complete/correct though and you might find it difficult to pick the keywords out easily rapidly for your purposes.
- hopscc
- Posts: 632
- Location: New Plymouth, Taranaki, New Zealand
Re: Official Cobra grammar
Thank you. I must say that I am a bit surprised that there is no formal grammar, but I guess I will manage without it.
While looking at the CobraParser source, I found a property called validIsNames, in which the keyword readonly is listed. (line 830 in CobraParser.cobra)
A bit surprised, as readonly is not specified as a keyword in any of the other resources you specify, I tried to compile it — it works.
Is this keyword planned for removal later, or is it just a mistake that it isn't mentioned elsewhere?
While looking at the CobraParser source, I found a property called validIsNames, in which the keyword readonly is listed. (line 830 in CobraParser.cobra)
A bit surprised, as readonly is not specified as a keyword in any of the other resources you specify, I tried to compile it — it works.
Is this keyword planned for removal later, or is it just a mistake that it isn't mentioned elsewhere?
- didrik
- Posts: 2
Re: Official Cobra grammar
Its probably that it has been added since the doc on isnames/access modifiers was done
or the code run that emitted the keywords list was run
readonly support is relatively recent in comparison to some of the other items....
or the code run that emitted the keywords list was run
readonly support is relatively recent in comparison to some of the other items....
- hopscc
- Posts: 632
- Location: New Plymouth, Taranaki, New Zealand
Re: Official Cobra grammar
Actually that omission is definitely a doc lag/issue and
its probably a bug that its not listed in the keywords table with the rest of the isNames modifiers
I'll open a ticket and a patch for it - Thanx - well spotted.
its probably a bug that its not listed in the keywords table with the rest of the isNames modifiers
I'll open a ticket and a patch for it - Thanx - well spotted.
- hopscc
- Posts: 632
- Location: New Plymouth, Taranaki, New Zealand
Re: Official Cobra grammar
So noted on ticket:313.
- hopscc
- Posts: 632
- Location: New Plymouth, Taranaki, New Zealand
Re: Official Cobra grammar
Man, I'm finishing up tooltips in the MD/XS addin and am trying to include the grammar in the tooltip for keywords and I am really wishing we had the grammar all in one place right about now
- nerdzero
- Posts: 286
- Location: Chicago, IL
Re: Official Cobra grammar
Sorry, I'm still on "partial types" and then "parser recovery" after that.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: Official Cobra grammar
Heh, yeah for sure those are higher priority. This doesn't even have to be done by you. I mean, the info is available, just not in one place...but I'm lazy.
- nerdzero
- Posts: 286
- Location: Chicago, IL
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 40 guests